Update/add instructions in parser

* StoreImm just uses a u64 instead of u32 - we'll figure out the layout
  later
* Jmp implementation added (can't believe I forgot this)
* Add Inst AST item, whose immediates don't have to be a u64 right away

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-01-28 13:51:25 -05:00
parent 7e6c621c2b
commit f98a53654e
6 changed files with 63 additions and 29 deletions

View File

@@ -190,6 +190,10 @@ impl Vm {
self.remove_flags(Flags::COMPARE);
}
}
Inst::Jmp(r1) => {
let w1 = self.get_reg(r1);
self.set_reg(IP, w1);
}
Inst::Jz(r1) => {
if !self.flags().contains(Flags::COMPARE) {
let w1 = self.get_reg(r1);