diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-11-02 20:35:47 +0000 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-11-02 20:35:47 +0000 |
commit | 99b0ebdfa6e05b202e4ce900f95aef12f2214f69 (patch) | |
tree | d8c10cde979dfb1bc1ccf06cf6cb4b580f5f7a9f | |
parent | 4990d93a1c333c032e5ee0f1fc4aa3a02a7d41fc (diff) | |
download | ovm-99b0ebdfa6e05b202e4ce900f95aef12f2214f69.tar.gz ovm-99b0ebdfa6e05b202e4ce900f95aef12f2214f69.tar.bz2 ovm-99b0ebdfa6e05b202e4ce900f95aef12f2214f69.zip |
Small fixes
-rw-r--r-- | lib/base.h | 2 | ||||
-rw-r--r-- | lib/inst.h | 5 |
2 files changed, 4 insertions, 3 deletions
@@ -77,7 +77,7 @@ typedef enum #define SWORD_SIZE sizeof(s_word) // Macros to extract the nth byte or nth hword from a word -#define WORD_NTH_BYTE(WORD, N) (((WORD) >> ((N)*8)) & 0xff) +#define WORD_NTH_BYTE(WORD, N) (((WORD) >> ((N)*8)) & 0xFF) #define WORD_NTH_HWORD(WORD, N) (((WORD) >> ((N)*2)) & 0xFFFFFFFF) // Assume array contains 4 bytes. @@ -229,8 +229,9 @@ inst_t *insts_read_bytecode_file(FILE *, size_t *); #define INST_JUMP_ABS(OP) \ ((inst_t){.opcode = OP_JUMP_ABS, .operand = DWORD(OP)}) -#define INST_JUMP_STACK ((inst_t){.opcode = OP_JUMP_STACK}) -#define INST_JUMP_REGISTER ((inst_t){.opcode = OP_JUMP_REGISTER}) +#define INST_JUMP_STACK ((inst_t){.opcode = OP_JUMP_STACK}) +#define INST_JUMP_REGISTER(OP) \ + ((inst_t){.opcode = OP_JUMP_REGISTER, .operand = DWORD(OP)}) #define INST_JUMP_IF(TYPE, OP) \ ((inst_t){.opcode = OP_JUMP_IF_##TYPE, .operand = DWORD(OP)}) |