diff options
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -45,6 +45,7 @@ int runvm(State *S) { if (S->do_trace) { printf("\t[%lu + %lu] : ",th->fp, th->sp); for (int i = 0; i < th->sp; i++) { + printf("(%d) ",i); print_val(th->stack[th->fp + i]); printf(" ; "); } @@ -124,6 +125,12 @@ int runvm(State *S) { PUSH(th->stack[th->fp + lidx]); break; } + case OP_SETLOCAL: { + uint8_t lidx = RBYTE(); + Val v = PEEK(); + th->stack[th->fp + lidx] = v; + break; + } #define BINARY_OP(opcode, OP, RET_TYPE) \ case opcode: { \ |