aboutsummaryrefslogtreecommitdiff
path: root/lib/inst.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/inst.h')
-rw-r--r--lib/inst.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/inst.h b/lib/inst.h
index e36d1c3..29cbd55 100644
--- a/lib/inst.h
+++ b/lib/inst.h
@@ -44,6 +44,18 @@ typedef enum
OP_DUP_HWORD,
OP_DUP_WORD,
+ // Dealing with the heap
+ OP_MALLOC_BYTE,
+ OP_MALLOC_HWORD,
+ OP_MALLOC_WORD,
+ OP_MSET_BYTE,
+ OP_MSET_HWORD,
+ OP_MSET_WORD,
+ OP_MGET_BYTE,
+ OP_MGET_HWORD,
+ OP_MGET_WORD,
+ OP_MDELETE,
+
// Boolean operations
OP_NOT_BYTE,
OP_NOT_HWORD,
@@ -170,6 +182,14 @@ inst_t *insts_read_bytecode_file(FILE *, size_t *);
#define INST_DUP(TYPE, OP) \
((inst_t){.opcode = OP_DUP_##TYPE, .operand = DWORD(OP)})
+#define INST_MALLOC(TYPE, OP) \
+ ((inst_t){.opcode = OP_MALLOC_##TYPE, .operand = DWORD(OP)})
+#define INST_MSET(TYPE, OP) \
+ ((inst_t){.opcode = OP_MSET_##TYPE, .operand = DWORD(OP)})
+#define INST_MGET(TYPE, OP) \
+ ((inst_t){.opcode = OP_MGET_##TYPE, .operand = DWORD(OP)})
+#define INST_MDELETE ((inst_t){.opcode = OP_MDELETE})
+
#define INST_NOT(TYPE) ((inst_t){.opcode = OP_NOT_##TYPE})
#define INST_OR(TYPE) ((inst_t){.opcode = OP_OR_##TYPE})
#define INST_AND(TYPE) ((inst_t){.opcode = OP_AND_##TYPE})