Add a special case for "test" which needs an immediate even though everything else with it's opcode doesn't.
Also made some spacing consistent. --HG-- extra : convert_revision : 72a317f29c11705782e19840bef24354214d3143
This commit is contained in:
parent
97c4258383
commit
4bb1c5ba0c
1 changed files with 13 additions and 3 deletions
|
@ -311,6 +311,16 @@ namespace X86ISA
|
|||
else
|
||||
displacementSize = 0;
|
||||
}
|
||||
|
||||
// The "test" instruction in group 3 needs an immediate, even though
|
||||
// the other instructions with the same actual opcode don't.
|
||||
if (emi.opcode.num == 1 && (modRM.reg & 0x6) == 0) {
|
||||
if (emi.opcode.op == 0xF6)
|
||||
immediateSize = 1;
|
||||
else if (emi.opcode.op == 0xF7)
|
||||
immediateSize = (emi.opSize == 8) ? 4 : emi.opSize;
|
||||
}
|
||||
|
||||
//If there's an SIB, get that next.
|
||||
//There is no SIB in 16 bit mode.
|
||||
if (modRM.rm == 4 && modRM.mod != 3) {
|
||||
|
|
Loading…
Reference in a new issue