diff options
author | ubq323 <ubq323@ubq323.website> | 2024-06-20 18:43:01 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2024-06-20 18:45:35 +0100 |
commit | 9a7d1b1d41f4b3bb3387e7bbe77105d0089803d0 (patch) | |
tree | 984e8648448ee75fe2bed9f9616ba295fc1b81f7 /dis.c | |
parent | 600eaef90f9f0507635fec4cf98f7fa1d1779bd1 (diff) |
globals are now variable
Diffstat (limited to 'dis.c')
-rw-r--r-- | dis.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -30,7 +30,16 @@ void disasm_chunk(Chunk *ch) { println_val(k); break; } + case OP_SETGLOBAL: { + uint8_t ix = ch->bc.d[ip++]; + printf("setglobal #%d\t; ",ix); + Val k = ch->consts.d[ix]; + printf("%-4s : ",typename_str(k)); + println_val(k); + break; + } SIMPLE_INSTR(OP_PRINT, "print") + SIMPLE_INSTR(OP_DROP, "drop") SIMPLE_INSTR(OP_ADD, "add") SIMPLE_INSTR(OP_SUB, "sub") SIMPLE_INSTR(OP_MUL, "mul") |