Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有人可以解释一下操作码0x08在 LR35902 处理器上的作用。助记符是LD (a16),SP。
0x08
LD (a16),SP
我很困惑,因为堆栈指针是一个 16 位的值,但(a16)它是一个只能存储 8 位的地址(我认为!)。我可以猜到前 8 位被放入(a16),下一个被放置在旁边,但我想确认一下。
(a16)
是的,该操作码将 SP 值放在地址 (a16) 上。这是它的样子:
void MemoryWrite(uint16_t addr, uint8_t value); MemoryWrite(a16, SP & 0xFF); MemoryWrite(a16 + 1, (SP & 0xFF00) >> 8);
因为它是一个 little-endian 处理器,所以您将最低有效字节放在首位。