OIC: move macro


In the OIC ``assembler'' below, I will use symbolic names for branch destinations instead of explicit memory locations, and ``next'' is always the next instruction.
# ``move 0,1'' instruction:  moves contents of location 0 to location 1
# memory location 2 is ``scratch'' memory, input is x, in location 0
	subz 1,1,next	# mem[1] = mem[1]-mem[1] = 0
	subz 2,2,next	# mem[2] = mem[2]-mem[2] = 0
	subz 2,0,next	# mem[2] = mem[2]-mem[0] = -x
	subz 1,2,next	# mem[1] = mem[1]-mem[2] = x

[ CSE 80 | ACS home | CSE home | CSE calendar | bsy's home page ]
picture of bsy

bsy@cse.ucsd.edu, last updated Wed Oct 16 22:37:34 PDT 1996.

email bsy