Fix register bitshift priority

This commit is contained in:
2023-06-01 16:02:08 +09:00
parent 36b7ffc830
commit 8107b06da4
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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);
+1 -1
View File
@@ -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},