update debug

This commit is contained in:
Elias Bennour 2023-12-09 22:57:26 +01:00
parent 44f70a1777
commit 829735eb8c

1
njvm.c
View File

@ -106,6 +106,7 @@ void execute(struct program program) {
*stack.current = fp + 2; *stack.current = fp + 2;
fp = pop(stack); fp = pop(stack);
if (debug == 1) printStack(stack, fp); if (debug == 1) printStack(stack, fp);
break;
case POPL: case POPL:
if (debug == 1) printf("popl: %i\n", SIGN_EXTEND(IMMEDIATE(program.program[i]))); if (debug == 1) printf("popl: %i\n", SIGN_EXTEND(IMMEDIATE(program.program[i])));
stack.stack[fp + SIGN_EXTEND(IMMEDIATE(program.program[i]))] = pop(stack); stack.stack[fp + SIGN_EXTEND(IMMEDIATE(program.program[i]))] = pop(stack);