Commit c648b20
Axel Kern
CPU Emulator: Fix wrong jump target
Bugfix: The A Register was wrongly updated before deriving the jump target. The jump target should be based on the value in A before executing the jump instruction.
Example:
@1234
A=0;JMP // should jump to 1234, not to 0
The corrected behavior is in line with the Hardware Simulator.
See here:
http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/Subtle-different-behaviors-between-the-CPU-emulator-and-the-proposed-CPU-design-td4034781.html1 parent 6c3eb2a commit c648b20
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
165 | 164 | | |
| 165 | + | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| |||
0 commit comments