Created
June 30, 2018 04:43
-
-
Save the6p4c/041771809b4fae1f0ac4945d8d24ef6d to your computer and use it in GitHub Desktop.
Revisions
-
the6p4c created this gist
Jun 30, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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]