diff options
author | iximeow <me@iximeow.net> | 2023-02-12 07:51:10 -0800 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2023-07-04 19:01:38 -0700 |
commit | 6b45d1855419a6976c049f3dc1f710a631bac786 (patch) | |
tree | 1170c8746f9e760d2da5277c0426937ba66001ed /src/long_mode/mod.rs | |
parent | 7b628dea61bd75700846780af8aaeb1bb77c233e (diff) |
more read_E cleanup
Diffstat (limited to 'src/long_mode/mod.rs')
-rw-r--r-- | src/long_mode/mod.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/long_mode/mod.rs b/src/long_mode/mod.rs index bb3eb7c..f593f16 100644 --- a/src/long_mode/mod.rs +++ b/src/long_mode/mod.rs @@ -5250,7 +5250,7 @@ enum OperandCode { ModRM_0x0f00 = OperandCodeBuilder::new().read_modrm().operand_case(OperandCase::ModRM_0x0f00).bits(), ModRM_0x0f01 = OperandCodeBuilder::new().read_modrm().operand_case(OperandCase::ModRM_0x0f01).bits(), - ModRM_0x0f0d = OperandCodeBuilder::new().read_modrm().operand_case(OperandCase::ModRM_0x0f0d).bits(), + ModRM_0x0f0d = OperandCodeBuilder::new().read_E().operand_case(OperandCase::ModRM_0x0f0d).bits(), ModRM_0x0f0f = OperandCodeBuilder::new().read_modrm().operand_case(OperandCase::ModRM_0x0f0f).bits(), // 3dnow ModRM_0x0fae = OperandCodeBuilder::new().read_modrm().operand_case(OperandCase::ModRM_0x0fae).bits(), ModRM_0x0fba = OperandCodeBuilder::new().read_modrm().operand_case(OperandCase::ModRM_0x0fba).bits(), @@ -8180,12 +8180,11 @@ fn read_operands< instruction.regs[0].bank = RegisterBank::X; if mem_oper == OperandSpec::RegMMM { instruction.regs[1].bank = RegisterBank::X; + } else { + instruction.mem_size = 16; } instruction.imm = read_num(words, 1)? as u8 as u64; - if instruction.operands[1] != OperandSpec::RegMMM { - instruction.mem_size = 16; - } instruction.operands[2] = OperandSpec::ImmU8; instruction.operand_count = 3; } @@ -8508,8 +8507,7 @@ fn read_operands< } } OperandCase::ModRM_0x0f0d => { - let modrm = read_modrm(words)?; - let r = (modrm >> 3) & 0b111; + let r = instruction.regs[0].num & 0b111; let bank = bank_from_prefixes_64(SizeCode::vq, instruction.prefixes); @@ -8521,9 +8519,11 @@ fn read_operands< instruction.opcode = Opcode::NOP; } } - instruction.operands[0] = read_E(words, instruction, modrm, bank, sink)?; + instruction.operands[0] = mem_oper; if instruction.operands[0] != OperandSpec::RegMMM { instruction.mem_size = 64; + } else { + instruction.regs[1].bank = bank; } instruction.operand_count = 1; } |