如果指向堆栈中下一个位置的指针在RamSP/中出现,我如何指示hack中的计算机打开该位置?我试过了
@0
D=M
@D但是它没有打开存储在Ram中的地址,我如何让它访问存储在ram中的Ram地址谢谢
发布于 2016-08-23 18:43:30
您可以使用A/M寄存器间接访问ram位置。
@SP // loads the A register with the value SP (SP predefined to 0)
A=M // loads the A register with the contents of MEM[0] (the stack pointer)
D=M // loads D with the contents of MEM[Stack]@D将用符号位置D的内容加载A寄存器,这将由汇编程序自动分配。@D (地址)和D(寄存器)不是一回事,因此,使用@D不是一个好主意。
https://stackoverflow.com/questions/39098236
复制相似问题