Hey all, for some reason I'm really stumbling with dereferencing in project 8. I'd prefer to figure it out on my own, so any hints would be appreciated. I fully understand dereferencing in C, eg, but the only example I can think of in nand2tetris is the code @SP, AM = M-1. I have played around with the VMUEmulator and the only way I can seem to mimic it is to load the address into a temp register, and then execute "A=M""A=M" (yes, 2 times!). I'm sure that's not the correct approach.
I grepped my code and didn't see anywhere I wrote that sequence, but I did write lots of D=*p and *p=D sequences. (Stack operations probably use something like A=M, M=MopD so my simple grep didn't find them.)
If you are talking about handling "pop that n" type instructions, I also used one of the R13-15 temp registers to hold the destination address.