twitu wrote
This clarified one of my doubts.
So to put it simply, in case of an M operation, say for example:
@R0
M=M+1
The value of memory location R0 is taken incremented and put back without affecting the D register. This happens by multiplexing the output of the RAM directly into in ALU and storing it back.
Yes, that is correct.
You can explicitly load the result into D at the same time.
@R0
MD=M+1
This is the equivalent of C++ "preincrement"
D = ++R0
With one additional instruction you can do "postincrement"
@R0 // D = R0++
MD=M+1
D=D-1
--Mark