diff --git a/opcodes.c b/opcodes.c index 014f272..5de463a 100644 --- a/opcodes.c +++ b/opcodes.c @@ -22,9 +22,9 @@ static int adr_abs(const uint8_t* operand, char* str, int max) { return snprintf(str, max, "$%04X", *(uint16_t*)operand); } -static inline int adr_abs_reg(char reg, const uint8_t* operand, +static inline int adr_abs_reg(char reg, const uint8_t* op, char* str, int max) { - return snprintf(str, max, "$%04X,%c", *operand, reg); + return snprintf(str, max, "$%04X,%c", *(uint16_t*)op, reg); } static int adr_abs_x(const uint8_t* operand, char* str, int max) {