diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-10-22 22:00:44 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-10-22 22:00:44 +0100 |
commit | 1962aabdf5d5aa69e52afdeead360ccb4c0c9a49 (patch) | |
tree | e8b1d0bb96f5df698207986a683297a4767f2934 /src/inst.h | |
parent | 789016a3439781eca20f3fca47e62dd8f2d2ea7b (diff) | |
download | ovm-1962aabdf5d5aa69e52afdeead360ccb4c0c9a49.tar.gz ovm-1962aabdf5d5aa69e52afdeead360ccb4c0c9a49.tar.bz2 ovm-1962aabdf5d5aa69e52afdeead360ccb4c0c9a49.zip |
Added OP_PLUS_*
Takes two operands from the stack then pushes their sum.
Diffstat (limited to 'src/inst.h')
-rw-r--r-- | src/inst.h | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -28,14 +28,14 @@ typedef enum OP_PUSH_HWORD, OP_PUSH_WORD, - OP_PUSH_REGISTER_BYTE, - OP_PUSH_REGISTER_HWORD, - OP_PUSH_REGISTER_WORD, - OP_POP_BYTE, OP_POP_HWORD, OP_POP_WORD, + OP_PUSH_REGISTER_BYTE, + OP_PUSH_REGISTER_HWORD, + OP_PUSH_REGISTER_WORD, + OP_MOV_BYTE, OP_MOV_HWORD, OP_MOV_WORD, @@ -66,6 +66,10 @@ typedef enum OP_EQ_WORD, // Mathematical operations + OP_PLUS_BYTE, + OP_PLUS_HWORD, + OP_PLUS_WORD, + // Program control flow OP_JUMP_ABS, OP_JUMP_STACK, @@ -129,6 +133,8 @@ inst_t *insts_read_bytecode_file(FILE *, size_t *); #define INST_XOR(TYPE) ((inst_t){.opcode = OP_XOR_##TYPE}) #define INST_EQ(TYPE) ((inst_t){.opcode = OP_EQ_##TYPE}) +#define INST_PLUS(TYPE) ((inst_t){.opcode = OP_PLUS_##TYPE}) + #define INST_JUMP_ABS(OP) \ ((inst_t){.opcode = OP_JUMP_ABS, .operand = DWORD(OP)}) #define INST_JUMP_STACK ((inst_t){.opcode = OP_JUMP_STACK}) |