12 void Computer::executeLD(
const InstructionWord& instruction, Register5* reg) {
13 int address = getIndexedAddress(instruction,
true);
14 copyToRegister5(instruction,
memory[address], reg);
18 void Computer::executeLDi(
const InstructionWord& instruction) {
19 int address = getIndexedAddress(instruction,
true);
20 int registerIndex = instruction.operation() - Instructions::LD1 + 1;
21 auto& rIi =
rI(registerIndex);
22 copyToRegister2(instruction,
memory[address], &rIi);
26 void Computer::executeLDN(
const InstructionWord& instruction, Register5* reg) {
27 executeLD(instruction, reg);
28 reg->negative = !reg->negative;
32 void Computer::executeLDiN(
const InstructionWord& instruction) {
33 int address = getIndexedAddress(instruction,
true);
34 int registerIndex = instruction.operation() - Instructions::LD1N + 1;
35 auto& rIi =
rI(registerIndex);
36 copyToRegister2(instruction,
memory[address], &rIi);
37 rIi.negative = 1 - rIi.negative;