Applies a binary text operation using `parse` to decode the instruction and `op` to compute the result.
(
&mut self,
instr: u32,
constants: &[ConstantDatum],
heap: &Heap,
parse: fn(u32) -> (Register, Register, Register),
op: F,
)
| 577 | /// Applies a binary text operation using `parse` to decode the instruction and `op` to |
| 578 | /// compute the result. |
| 579 | fn do_binary_text_op<F>( |
| 580 | &mut self, |
| 581 | instr: u32, |
| 582 | constants: &[ConstantDatum], |
| 583 | heap: &Heap, |
| 584 | parse: fn(u32) -> (Register, Register, Register), |
| 585 | op: F, |
| 586 | ) where |
| 587 | F: Fn(&str, &str) -> bool, |
| 588 | { |
| 589 | let (dest, src1, src2) = parse(instr); |
| 590 | let lhs = self.deref_string(src1, constants, heap); |
| 591 | let rhs = self.deref_string(src2, constants, heap); |
| 592 | self.set_reg(dest, if op(lhs, rhs) { 1 } else { 0 }); |
| 593 | self.pc += 1; |
| 594 | } |
| 595 | |
| 596 | /// Implements the `AddDouble` opcode. |
| 597 | pub(super) fn do_add_double(&mut self, instr: u32) { |
no test coverage detected