Introduced a new mathematical operator MULT

Thankfully multiplication, like addition, is the same under 2s
complement as it is for unsigned numbers.  So I just need to implement
those versions to be fine.
This commit is contained in:
2023-11-01 18:08:11 +00:00
parent c244e7c4a4
commit 4be04d2518
2 changed files with 17 additions and 4 deletions

View File

@@ -98,6 +98,10 @@ typedef enum
OP_PLUS_HWORD,
OP_PLUS_WORD,
OP_MULT_BYTE,
OP_MULT_HWORD,
OP_MULT_WORD,
// Simple I/O
OP_PRINT_BYTE,
OP_PRINT_CHAR,
@@ -176,6 +180,7 @@ inst_t *insts_read_bytecode_file(FILE *, size_t *);
#define INST_GT(TYPE) ((inst_t){.opcode = OP_GT_##TYPE})
#define INST_GTE(TYPE) ((inst_t){.opcode = OP_GTE_##TYPE})
#define INST_PLUS(TYPE) ((inst_t){.opcode = OP_PLUS_##TYPE})
#define INST_MULT(TYPE) ((inst_t){.opcode = OP_MULT_##TYPE})
#define INST_JUMP_ABS(OP) \
((inst_t){.opcode = OP_JUMP_ABS, .operand = DWORD(OP)})