diff options
-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)}) |