Skip to content

Instantly share code, notes, and snippets.

@the6p4c
Created June 30, 2018 04:43
Show Gist options
  • Select an option

  • Save the6p4c/041771809b4fae1f0ac4945d8d24ef6d to your computer and use it in GitHub Desktop.

Select an option

Save the6p4c/041771809b4fae1f0ac4945d8d24ef6d to your computer and use it in GitHub Desktop.

Revisions

  1. the6p4c created this gist Jun 30, 2018.
    45 changes: 45 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@
    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]