Skip to content

Instantly share code, notes, and snippets.

@the6p4c
Created June 30, 2018 04:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save the6p4c/041771809b4fae1f0ac4945d8d24ef6d to your computer and use it in GitHub Desktop.
Save the6p4c/041771809b4fae1f0ac4945d8d24ef6d to your computer and use it in GitHub Desktop.
LAI x (01XX)
load accumulator immediate
acc = x
LAM x (02XX)
load accumulator memory
acc = mem[x]
LAI x (0300)
load accumulator memory indirect
acc = mem[mem[0]]
SAM x (04XX)
store accumulator memory
mem[x] = acc
SAI x (0500)
store accumulator memory indirect
mem[mem[0]] = acc
SAO (0600)
store accumulator output
output = acc
JMP (11XX)
jump
ip = x
JZ (12XX)
jump if accumulator zero
ip = acc == 0 ? x : ip + 1
JNZ (13XX)
jump if accumulator not zero
ip = acc != 0 ? x : ip + 1
ADDI x (21XX)
add immediate
acc += x
ADDM x (22XX)
add memory
acc += mem[x]
SUBI x (23XX)
subtract immediate
acc -= x
SUBM x (24XX)
subtract memory
acc -= mem[x]
MODI x (25XX)
modulo immediate
acc %= x
MODM x (26XX)
modulo memory
acc %= mem[x]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment