Skip to content

Commit 0995477

Browse files
authored
Merge pull request #14 from comwrg/master
fix JNZ comment
2 parents 64ac65b + 784300f commit 0995477

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

xc-tutor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ int eval() {
12061206
else if (op == PUSH) {*--sp = ax;} // push the value of ax onto the stack
12071207
else if (op == JMP) {pc = (int *)*pc;} // jump to the address
12081208
else if (op == JZ) {pc = ax ? pc + 1 : (int *)*pc;} // jump if ax is zero
1209-
else if (op == JNZ) {pc = ax ? (int *)*pc : pc + 1;} // jump if ax is zero
1209+
else if (op == JNZ) {pc = ax ? (int *)*pc : pc + 1;} // jump if ax is not zero
12101210
else if (op == CALL) {*--sp = (int)(pc+1); pc = (int *)*pc;} // call subroutine
12111211
//else if (op == RET) {pc = (int *)*sp++;} // return from subroutine;
12121212
else if (op == ENT) {*--sp = (int)bp; bp = sp; sp = sp - *pc++;} // make new stack frame

xc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,7 @@ int eval() {
12361236
else if (op == PUSH) {*--sp = ax;} // push the value of ax onto the stack
12371237
else if (op == JMP) {pc = (int *)*pc;} // jump to the address
12381238
else if (op == JZ) {pc = ax ? pc + 1 : (int *)*pc;} // jump if ax is zero
1239-
else if (op == JNZ) {pc = ax ? (int *)*pc : pc + 1;} // jump if ax is zero
1239+
else if (op == JNZ) {pc = ax ? (int *)*pc : pc + 1;} // jump if ax is not zero
12401240
else if (op == CALL) {*--sp = (int)(pc+1); pc = (int *)*pc;} // call subroutine
12411241
//else if (op == RET) {pc = (int *)*sp++;} // return from subroutine;
12421242
else if (op == ENT) {*--sp = (int)bp; bp = sp; sp = sp - *pc++;} // make new stack frame

0 commit comments

Comments
 (0)