Add jmpif_not instruction

This commit is contained in:
Andrew Morris
2023-07-03 09:33:47 +10:00
parent adce30305f
commit d217f60967
9 changed files with 66 additions and 38 deletions

View File

@@ -412,6 +412,15 @@ impl StackFrameTrait for BytecodeStackFrame {
}
}
JmpIfNot => {
let cond = self.decoder.decode_val(&mut self.registers);
let dst = self.decoder.decode_pos();
if !cond.is_truthy() {
self.decoder.pos = dst;
}
}
UnaryPlus => self.apply_unary_op(operations::op_unary_plus),
UnaryMinus => self.apply_unary_op(operations::op_unary_minus),