From 9a7d1b1d41f4b3bb3387e7bbe77105d0089803d0 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Thu, 20 Jun 2024 18:43:01 +0100 Subject: globals are now variable --- dis.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'dis.c') 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") -- cgit v1.2.3