mima-tools/examples/jmp_to_address_in_acc.mimasm
Joscha 5e9c50d618 Allow digits in label names
Also, only allow a-zA-Z as the first character of label names.
2019-11-10 14:32:55 +00:00

28 lines
482 B
Text

IAR = technique-1
; This file demonstrates a few techniques for jumping to an address
; stored in the ACC.
; A few variables
jump-instruction: JMP 0
tmp: LIT 0
; Jumping by setting the RA and then returning
100:
technique-1:
LDC technique-2
STRA
RET
; Jumping by writing a JMP instruction to a memory location and then
; jumping to that (aka. almost self-modifying code)
200:
technique-2:
LDC end
OR jump-instruction
STV tmp
JMP tmp
300:
end:
HALT