summaryrefslogtreecommitdiff
path: root/dis.c
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-06-20 18:43:01 +0100
committerubq323 <ubq323@ubq323.website>2024-06-20 18:45:35 +0100
commit9a7d1b1d41f4b3bb3387e7bbe77105d0089803d0 (patch)
tree984e8648448ee75fe2bed9f9616ba295fc1b81f7 /dis.c
parent600eaef90f9f0507635fec4cf98f7fa1d1779bd1 (diff)
globals are now variable
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")