summaryrefslogtreecommitdiff
path: root/dis.c
diff options
context:
space:
mode:
Diffstat (limited to 'dis.c')
-rw-r--r--dis.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/dis.c b/dis.c
index 16c5b0e..0fb23f8 100644
--- a/dis.c
+++ b/dis.c
@@ -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")