diff --git a/src/dasm.c b/src/dasm.c index 7747c58..0c728e1 100644 --- a/src/dasm.c +++ b/src/dasm.c @@ -68,10 +68,10 @@ void print_instruction(unsigned addr, instruction_t inst, unsigned raw) printf("%04x", addr + inst.size - ((raw & 0xFF << 8) + (raw & 0xFF00 >> 8))); break; case REG8: - printf("%s", registers8[operand & 0b111000 >> 3]); + printf("%s", registers8[(operand & 0b111000) >> 3]); break; case REG16: - printf("%s", registers16[operand & 0b111000 >> 3]); + printf("%s", registers16[(operand & 0b111000) >> 3]); break; case R_M8: print_rm_operand(inst, raw, operand, false); diff --git a/src/instructions.c b/src/instructions.c index 200269b..89b2e76 100644 --- a/src/instructions.c +++ b/src/instructions.c @@ -122,7 +122,7 @@ const instruction_t instructions[] = { {.opcode = 0x86, .extended = -1, .name = "xchg", .mode = {R_M8, REG8, END}, .size = 2}, {.opcode = 0x87, .extended = -1, .name = "xchg", .mode = {R_M16, REG16, END}, .size = 3}, {.opcode = 0x88, .extended = -1, .name = "mov", .mode = {R_M8, REG8, END}, .size = 2}, - {.opcode = 0x89, .extended = -1, .name = "mov", .mode = {R_M16, REG16, END}, .size = 3}, + {.opcode = 0x89, .extended = -1, .name = "mov", .mode = {R_M16, REG16, END}, .size = 2}, {.opcode = 0x8A, .extended = -1, .name = "mov", .mode = {REG8, R_M8, END}, .size = 2}, {.opcode = 0x8B, .extended = -1, .name = "mov", .mode = {REG16, R_M16, END}, .size = 3}, // {.opcode = 0x8C, .extended = -1, .name = "mov", .mode = {R_M16, sreg, END}, .size = 3},