Added instructions for MALLOC_STACK and SUB

MALLOC_STACK is a stack based version of MALLOC, SUB does subtraction.
This commit is contained in:
2023-11-01 22:55:41 +00:00
parent b6e359f5eb
commit 46e5abbac9
2 changed files with 26 additions and 4 deletions

View File

@@ -49,6 +49,10 @@ typedef enum
OP_MALLOC_HWORD,
OP_MALLOC_WORD,
OP_MALLOC_STACK_BYTE,
OP_MALLOC_STACK_HWORD,
OP_MALLOC_STACK_WORD,
OP_MSET_BYTE,
OP_MSET_HWORD,
OP_MSET_WORD,
@@ -122,6 +126,10 @@ typedef enum
OP_PLUS_HWORD,
OP_PLUS_WORD,
OP_SUB_BYTE,
OP_SUB_HWORD,
OP_SUB_WORD,
OP_MULT_BYTE,
OP_MULT_HWORD,
OP_MULT_WORD,
@@ -196,6 +204,7 @@ inst_t *insts_read_bytecode_file(FILE *, size_t *);
#define INST_MALLOC(TYPE, OP) \
((inst_t){.opcode = OP_MALLOC_##TYPE, .operand = DWORD(OP)})
#define INST_MALLOC_STACK(TYPE) ((inst_t){.opcode = OP_MALLOC_STACK_##TYPE})
#define INST_MSET(TYPE, OP) \
((inst_t){.opcode = OP_MSET_##TYPE, .operand = DWORD(OP)})
#define INST_MSET_STACK(TYPE) ((inst_t){.opcode = OP_MSET_STACK_##TYPE})
@@ -215,6 +224,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_SUB(TYPE) ((inst_t){.opcode = OP_SUB_##TYPE})
#define INST_MULT(TYPE) ((inst_t){.opcode = OP_MULT_##TYPE})
#define INST_JUMP_ABS(OP) \