I've recently started to learn about SUBLEQ One Instruction Set Computers and am currently trying to write a simple assembler for a SUBLEQ emulator i wrote. So far I've implemented DB, MOV, INC and DEC, but I am struggling a bit with the MOV instruction, when it has pointers as arguments.
For example: MOV 20, 21
to move data from address 21 to address 20 in SUBLEQ looks like this (assuming address 100 is zero and the program starts at address zero):
sble 20 20 3
sble 21 100 6
sble 100 20 9
The content at the target address is zeroed and the content at the source address is added to the destination by subtracting it two times.
Now to my problem: If one argument is a pointer, for example MOV 20, [21]
so that the contents of address 21 are pointing to the real data I want to to copy to address 20, how can that be represented using SUBLEQ?