aboutsummaryrefslogtreecommitdiff
path: root/lib/inst.h
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2023-11-01 22:55:41 +0000
committerAryadev Chavali <aryadev@aryadevchavali.com>2023-11-01 22:55:41 +0000
commit46e5abbac9d8e4d9257e59cd0f8b73f509e4a512 (patch)
treec3591a87b1fb221205662c5e44b10137fa2c26df /lib/inst.h
parentb6e359f5ebf914ecbe2b4c68d7d800e32005a7cd (diff)
downloadovm-46e5abbac9d8e4d9257e59cd0f8b73f509e4a512.tar.gz
ovm-46e5abbac9d8e4d9257e59cd0f8b73f509e4a512.tar.bz2
ovm-46e5abbac9d8e4d9257e59cd0f8b73f509e4a512.zip
Added instructions for MALLOC_STACK and SUB
MALLOC_STACK is a stack based version of MALLOC, SUB does subtraction.
Diffstat (limited to 'lib/inst.h')
-rw-r--r--lib/inst.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/inst.h b/lib/inst.h
index 5671b47..10f8dc7 100644
--- a/lib/inst.h
+++ b/lib/inst.h
@@ -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) \