15 void Computer::executeJMP(
const InstructionWord& instruction) {
16 int32_t address = getIndexedAddress(instruction,
true);
17 rJ.
set(_lineOffset + 1);
18 _lineOffset = address - 1;
22 void Computer::executeJSJ(
const InstructionWord& instruction) {
23 int32_t address = getIndexedAddress(instruction,
true);
24 _lineOffset = address - 1;
33 void Computer::executeJOV(
const InstructionWord& instruction) {
35 this->executeJMP(instruction);
46 void Computer::executeJNOV(
const InstructionWord& instruction) {
50 this->executeJMP(instruction);
58 void Computer::executeJL(
const InstructionWord& instruction) {
60 this->executeJMP(instruction);
68 void Computer::executeJE(
const InstructionWord& instruction) {
69 if (
comparison == ComparisonIndicator::EQUAL) {
70 this->executeJMP(instruction);
78 void Computer::executeJG(
const InstructionWord& instruction) {
79 if (
comparison == ComparisonIndicator::GREATER) {
80 this->executeJMP(instruction);
88 void Computer::executeJGE(
const InstructionWord& instruction) {
90 this->executeJMP(instruction);
97 void Computer::executeJNE(
const InstructionWord& instruction) {
98 if (
comparison != ComparisonIndicator::EQUAL) {
99 int32_t address = getIndexedAddress(instruction,
true);
100 rJ.
set(_lineOffset + 1);
101 _lineOffset = address - 1;
109 void Computer::executeJLE(
const InstructionWord& instruction) {
110 if (
comparison != ComparisonIndicator::GREATER) {
111 this->executeJMP(instruction);
116 void Computer::executeJN(
const InstructionWord& instruction, Register5* reg) {
117 if (reg->value() < 0) {
118 this->executeJMP(instruction);
123 void Computer::executeJZ(
const InstructionWord& instruction, Register5* reg) {
124 if (reg->value() == 0) {
125 this->executeJMP(instruction);
130 void Computer::executeJP(
const InstructionWord& instruction, Register5* reg) {
131 if (reg->value() > 0) {
132 this->executeJMP(instruction);
137 void Computer::executeJNN(
const InstructionWord& instruction, Register5* reg) {
138 if (reg->value() >= 0) {
139 this->executeJMP(instruction);
144 void Computer::executeJNZ(
const InstructionWord& instruction, Register5* reg) {
145 if (reg->value() != 0) {
146 this->executeJMP(instruction);
151 void Computer::executeJNP(
const InstructionWord& instruction, Register5* reg) {
152 if (reg->value() <= 0) {
153 this->executeJMP(instruction);
158 void Computer::executeJiN(
const InstructionWord& instruction) {
159 int registerIndex = instruction.operation() - Instructions::J1N + 1;
160 auto rIi =
rI(registerIndex);
161 if (rIi.value() < 0) {
162 this->executeJMP(instruction);
167 void Computer::executeJiZ(
const InstructionWord& instruction) {
168 int registerIndex = instruction.operation() - Instructions::J1N + 1;
169 auto& rIi =
rI(registerIndex);
170 if (rIi.value() == 0) {
171 this->executeJMP(instruction);
176 void Computer::executeJiP(
const InstructionWord& instruction) {
177 int registerIndex = instruction.operation() - Instructions::J1N + 1;
178 auto& rIi =
rI(registerIndex);
179 if (rIi.value() > 0) {
180 this->executeJMP(instruction);
185 void Computer::executeJiNN(
const InstructionWord& instruction) {
186 int registerIndex = instruction.operation() - Instructions::J1N + 1;
187 auto& rIi =
rI(registerIndex);
188 if (rIi.value() >= 0) {
189 this->executeJMP(instruction);
194 void Computer::executeJiNZ(
const InstructionWord& instruction) {
195 int registerIndex = instruction.operation() - Instructions::J1N + 1;
196 auto& rIi =
rI(registerIndex);
197 if (rIi.value() != 0) {
198 this->executeJMP(instruction);
203 void Computer::executeJiNP(
const InstructionWord& instruction) {
204 int registerIndex = instruction.operation() - Instructions::J1N + 1;
205 auto& rIi =
rI(registerIndex);
206 if (rIi.value() <= 0) {
207 this->executeJMP(instruction);