Administrator
|
This is referring to an instruction like
M;JNE
This would read RAM[A] and if it was non-zero, jump to ROM address A.
This does not cause any particular problem with the hardware, it is just extremely unlikely to be what you want to do. It would only occur in "trick" code. For instance, I saw a student's Fill program that kept a counter in R0 and used something like
@R0
M=M-1;JEQ
to decrement the counter and restart the program. Using a normal RAM variable this would have been something like
@n
MD=M-1
@RESTART
D;JEQ
There is another instruction that looks like it is reading an address from RAM and jumping to the address that was read (jumping via a code pointer).
@code_ptr
A=M;JMP
But by the strict definition of the instructions, this loads the PC with the current value of A, and simultaneously loads A with the new value read from RAM[A]. (The CPUEmulator does it differently!)
Any instruction that modifies A should also not be used with a jump option.
--Mark
|