From 3b136ffdebf135cc0d285573edd7bdfefb99bb00 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Fri, 22 Oct 2021 12:37:37 +0200 Subject: Add unary arithmetic operations for numbers --- src/bytecode/debug.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/bytecode/debug.h') diff --git a/src/bytecode/debug.h b/src/bytecode/debug.h index c891b77..05f9d8e 100644 --- a/src/bytecode/debug.h +++ b/src/bytecode/debug.h @@ -36,10 +36,6 @@ disassemble_instruction(Chunk *chunk, size_t offset) { } u8 instruction = chunk->code[offset]; switch (instruction) { - case OP_RETURN: { - printf("OP_RETURN\n"); - return offset + 1; - } break; case OP_CONSTANT: { u8 constant = chunk->code[offset + 1]; printf("%-16s %4d (", "OP_CONSTANT", constant); @@ -47,6 +43,12 @@ disassemble_instruction(Chunk *chunk, size_t offset) { printf(")\n"); return offset + 2; } break; + case OP_SUM: { printf("OP_SUM\n"); return offset + 1; } break; + case OP_SUB: { printf("OP_SUB\n"); return offset + 1; } break; + case OP_MUL: { printf("OP_MUL\n"); return offset + 1; } break; + case OP_DIV: { printf("OP_DIV\n"); return offset + 1; } break; + case OP_MOD: { printf("OP_MOD\n"); return offset + 1; } break; + case OP_RETURN: { printf("OP_RETURN\n"); return offset + 1; } break; default: { printf("Unknown OP: %d\n", instruction); return offset + 1; -- cgit v1.2.1