update debug

This commit is contained in:
Elias Bennour 2023-12-09 23:14:19 +01:00
parent 14025d3b08
commit 742f050b24

6
njvm.c
View File

@ -105,10 +105,8 @@ void execute(struct program program) {
*stack.current = *stack.current + SIGN_EXTEND(IMMEDIATE(program.program[i])); *stack.current = *stack.current + SIGN_EXTEND(IMMEDIATE(program.program[i]));
break; break;
case RSF: case RSF:
if (debug == 1) printf("rsf\n"); if (debug == 1) printf("rsf: %i\n", SIGN_EXTEND(IMMEDIATE(program.program[i])));
if (debug == 1) printf("pop: %i\n", peek(stack, 1)); *stack.current = fp;
*stack.current = fp + 2;
if (debug == 1) printf("pop: %i\n", peek(stack, 1));
fp = pop(stack); fp = pop(stack);
break; break;
case POPL: case POPL: