Skip to content

Commit 52d5666

Browse files
authored
Merge pull request #17 from axelkern/Issues/wrong-jump-target
CPU Emulator: Fix wrong jump target
2 parents 6c3eb2a + c648b20 commit 52d5666

File tree

1 file changed

+2
-2
lines changed
  • SimulatorsPackage/src/main/java/Hack/CPUEmulator

1 file changed

+2
-2
lines changed

SimulatorsPackage/src/main/java/Hack/CPUEmulator/CPU.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class CPU
5151
// The time that passed since the program started running.
5252
protected long time;
5353

54-
// An assembler transltor
54+
// An assembler translator
5555
protected HackAssemblerTranslator assemblerTranslator;
5656

5757
/**
@@ -161,8 +161,8 @@ public void executeInstruction() throws ProgramException {
161161
bus.send(rom, PC.get(), A, 0);
162162
else if ((instruction & 0xe000) == 0xe000) {
163163
computeExp(instruction);
164-
setDestination(instruction);
165164
pcChanged = checkJump(instruction);
165+
setDestination(instruction);
166166
}
167167
else if (instruction != HackAssemblerTranslator.NOP)
168168
throw new ProgramException("At line " + PC.get() +

0 commit comments

Comments
 (0)