15 void Computer::executeCMP(
const InstructionWord& instruction, Register5* reg) {
17 int32_t address = getIndexedAddress(instruction,
true);
18 copyToRegister5(instruction, *reg, &a);
19 copyToRegister5(instruction,
memory[address], &b);
20 int32_t aVal = a.value(), bVal = b.value();
23 }
else if (aVal > bVal) {
34 void Computer::executeCMPi(
const InstructionWord& instruction) {
35 int registerIndex = instruction.operation() - Instructions::CMP1 + 1;
36 auto& rIi =
rI(registerIndex);
37 ComputerWord t(rIi.negative, 0, 0, 0, rIi.byte1, rIi.byte2), a, b;
38 int32_t address = getIndexedAddress(instruction,
true);
39 copyToRegister5(instruction, t, &a);
40 copyToRegister5(instruction,
memory[address], &b);
41 int32_t aVal = a.value(), bVal = b.value();
44 }
else if (aVal > bVal) {