File tree Expand file tree Collapse file tree 3 files changed +3
-4
lines changed
internals/instructions/controlFlow Expand file tree Collapse file tree 3 files changed +3
-4
lines changed Original file line number Diff line number Diff line change 1
1
lit g1 10
2
- lit g2 10
2
+ lit g2 11
3
3
eq g1 g2
4
- jz 10 i4
4
+ jz 10
5
5
str f1 "They are equal"
6
6
call println
7
7
lit f1 0
Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ fun parser(file: List<String>): List<InstructData> {
154
154
// Long
155
155
" jmp" , " jz" , " jnz" -> {
156
156
InstructData (
157
- name = " jmp " , arrayOf(line[1 ].toInt())
157
+ name = instruction , arrayOf(line[1 ].toInt())
158
158
)
159
159
}
160
160
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ import vm
15
15
* @throws GeneralControlFlowException If an error occurs during the jump operation.
16
16
*/
17
17
fun ControlFlow.jnz (targetAddress : Int ): Any = try {
18
-
19
18
if (registers.read(intelNames[IntelRegisters .ZF ]) != 0L ) {
20
19
vm.pc = targetAddress
21
20
} else {
You can’t perform that action at this time.
0 commit comments