aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2023-10-22 18:02:30 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2023-10-22 18:02:30 +0100
commita8d743e76e8c6991d58354408d63eeb866e4772a (patch)
tree31dc902b90215cfcce13e7265b5397b4a227bcc1
parente6339b10366b037893ee5385463ef4d4873b658d (diff)
downloadovm-a8d743e76e8c6991d58354408d63eeb866e4772a.tar.gz
ovm-a8d743e76e8c6991d58354408d63eeb866e4772a.tar.bz2
ovm-a8d743e76e8c6991d58354408d63eeb866e4772a.zip
Added macros for NOOP and HALT
-rw-r--r--src/inst.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/inst.h b/src/inst.h
index d510118..1073593 100644
--- a/src/inst.h
+++ b/src/inst.h
@@ -94,6 +94,9 @@ inst_t *insts_read_bytecode(darr_t *, size_t *);
void insts_write_bytecode_file(inst_t *, size_t, FILE *);
inst_t *insts_read_bytecode_file(FILE *, size_t *);
+#define INST_NOOP ((inst_t){0})
+#define INST_HALT ((inst_t){.opcode = OP_HALT})
+
#define INST_PUSH(TYPE, OP) \
((inst_t){.opcode = OP_PUSH_##TYPE, .operand = D##TYPE(OP)})