diff options
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -57,7 +57,10 @@ int runvm(State *S) { int status = 1; - disasm_chunk(ch); + if (S->do_disasm) { + disasm_chunk(ch); + puts("---"); + } #define RBYTE() (ch->bc.d[th->ip++]) #define RSHORT() (th->ip += 2, (uint16_t)( ch->bc.d[th->ip-2] | ch->bc.d[th->ip-1] << 8 )) @@ -66,13 +69,11 @@ int runvm(State *S) { #define POP() (th->stack[--th->sp]) #define PEEK() (th->stack[th->sp-1]) - puts("---"); while (1) { uint8_t instr = RBYTE(); switch (instr) { case OP_RET: status = 0; - printf("done!\n"); goto done; break; case OP_LOADK: { |