Add call/ret/push/pop instructions

* Call/ret/push/pop are implemented and appear to be working
* Call/ret/push/pop is specified in the 0x2000 block, replacing the
  mov instruction
* Mov instruction is now specified in the 0x3000 block

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-02-26 10:14:48 -05:00
parent bd34cdad63
commit 7a6c2d80ab
8 changed files with 206 additions and 7 deletions

View File

@@ -95,6 +95,10 @@ Inst -> Inst:
| 'JMP' Value { Inst::Jmp($2) }
| 'JZ' Value { Inst::Jz($2) }
| 'JNZ' Value { Inst::Jnz($2) }
| 'CALL' Value { Inst::Call($2) }
| 'RET' { Inst::Ret }
| 'PUSH' Value { Inst::Push($2) }
| 'POP' Value { Inst::Pop($2) }
| 'MOV' Value 'COMMA' Value { Inst::Mov($2, $4) }
| 'HALT' { Inst::Halt }
| 'NOP' { Inst::Nop }