aboutsummaryrefslogtreecommitdiff
path: root/src/inst.h
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2023-10-16 01:18:34 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2023-10-16 01:20:06 +0100
commita4c9b85c79714792403220ef4ffbdb6bc20fcec1 (patch)
tree505614f909831fee273cbe6e0055db8374749779 /src/inst.h
parent6038363d2facd5c8a79d9c4920ca5b3cf70bef95 (diff)
downloadovm-a4c9b85c79714792403220ef4ffbdb6bc20fcec1.tar.gz
ovm-a4c9b85c79714792403220ef4ffbdb6bc20fcec1.tar.bz2
ovm-a4c9b85c79714792403220ef4ffbdb6bc20fcec1.zip
MOV and PUSH_*_REGISTER should only need bytes for their operand
We won't have more than 255 registers, so a byte is all that's necessary.
Diffstat (limited to 'src/inst.h')
-rw-r--r--src/inst.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/inst.h b/src/inst.h
index 7fed8e1..da58434 100644
--- a/src/inst.h
+++ b/src/inst.h
@@ -76,11 +76,11 @@ inst_t inst_read_bytecode(darr_t *);
#define INST_FPUSH(FLOAT) \
((inst_t){.opcode = OP_PUSH_FLOAT, .operand = DFLOAT(FLOAT)})
-#define INST_BMOV(REG) ((inst_t){.opcode = OP_MOV_BYTE, .operand = DWORD(REG)})
+#define INST_BMOV(REG) ((inst_t){.opcode = OP_MOV_BYTE, .operand = DBYTE(REG)})
-#define INST_WMOV(REG) ((inst_t){.opcode = OP_MOV_WORD, .operand = DWORD(REG)})
+#define INST_WMOV(REG) ((inst_t){.opcode = OP_MOV_WORD, .operand = DBYTE(REG)})
-#define INST_FMOV(REG) ((inst_t){.opcode = OP_MOV_FLOAT, .operand = DWORD(REG)})
+#define INST_FMOV(REG) ((inst_t){.opcode = OP_MOV_FLOAT, .operand = DBYTE(REG)})
#define INST_BPOP ((inst_t){.opcode = OP_POP_BYTE})
@@ -89,12 +89,12 @@ inst_t inst_read_bytecode(darr_t *);
#define INST_FPOP ((inst_t){.opcode = OP_POP_FLOAT})
#define INST_BPUSH_REG(REG) \
- ((inst_t){.opcode = OP_PUSH_BYTE_REGISTER, .operand = DWORD(REG)})
+ ((inst_t){.opcode = OP_PUSH_BYTE_REGISTER, .operand = DBYTE(REG)})
#define INST_WPUSH_REG(REG) \
- ((inst_t){.opcode = OP_PUSH_WORD_REGISTER, .operand = DWORD(REG)})
+ ((inst_t){.opcode = OP_PUSH_WORD_REGISTER, .operand = DBYTE(REG)})
#define INST_FPUSH_REG(REG) \
- ((inst_t){.opcode = OP_PUSH_FLOAT_REGISTER, .operand = DWORD(REG)})
+ ((inst_t){.opcode = OP_PUSH_FLOAT_REGISTER, .operand = DBYTE(REG)})
#endif