Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-02-09 13:13:26 -05:00
parent 1c16be650a
commit f1ed41f98b
11 changed files with 44 additions and 75 deletions

View File

@@ -12,14 +12,14 @@ impl Vm {
next_ip = cursor.position();
let value = ($mapping)(self.get_reg(r1), self.get_reg(r2));
self.set_reg(r1, value);
}}
}};
}
match op {
ADD => math_inst!(|w1: u64, w2: u64| w1.wrapping_add(w2)),
MUL => math_inst!(|w1: u64, w2: u64| w1.wrapping_mul(w2)),
DIV => math_inst!(|w1: u64, w2: u64| w1.wrapping_div(w2)),
MOD => math_inst!(|w1: u64, w2: u64| w1 % w2),
INEG => { todo!() }
INEG => todo!(),
AND => math_inst!(|w1: u64, w2: u64| w1 & w2),
OR => math_inst!(|w1: u64, w2: u64| w1 | w2),
INV => {