ret EQ 0 # Address where result is placed. arg EQ 1 # Address where number to be halved is placed. LI 15 ST arg LM arg # Load number to be halved, RL 7 # and rotate it right once. ST ret # Store result. BN neg # Go to neg if top bit is 1 (1's bit before rotation). done LI 0 # Stop computer. BZ 0 neg LI 1 # Set AC to 0x80. RL 7 AD ret # Add 0x80 to ret. ST ret LI 0 # Stop computer. BZ 0