mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 04:33:05 +00:00
[x86] Fix 16-bit disassembly of JCXZ/JECXZ
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199653 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fc19ac9654
commit
a3fb0f9773
@ -987,6 +987,25 @@ static int getID(struct InternalInstruction* insn, const void *miiArg) {
|
|||||||
if (getIDWithAttrMask(&instructionID, insn, attrMask))
|
if (getIDWithAttrMask(&instructionID, insn, attrMask))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* JCXZ/JECXZ need special handling for 16-bit mode because the meaning
|
||||||
|
* of the AdSize prefix is inverted w.r.t. 32-bit mode.
|
||||||
|
*/
|
||||||
|
if (insn->mode == MODE_16BIT && insn->opcode == 0xE3) {
|
||||||
|
const struct InstructionSpecifier *spec;
|
||||||
|
spec = specifierForUID(instructionID);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check for Ii8PCRel instructions. We could alternatively do a
|
||||||
|
* string-compare on the names, but this is probably cheaper.
|
||||||
|
*/
|
||||||
|
if (x86OperandSets[spec->operands][0].type == TYPE_REL8) {
|
||||||
|
attrMask ^= ATTR_ADSIZE;
|
||||||
|
if (getIDWithAttrMask(&instructionID, insn, attrMask))
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* The following clauses compensate for limitations of the tables. */
|
/* The following clauses compensate for limitations of the tables. */
|
||||||
|
|
||||||
if ((insn->mode == MODE_16BIT || insn->prefixPresent[0x66]) &&
|
if ((insn->mode == MODE_16BIT || insn->prefixPresent[0x66]) &&
|
||||||
|
@ -297,10 +297,10 @@
|
|||||||
# CHECK: lcalll $2, $4660
|
# CHECK: lcalll $2, $4660
|
||||||
0x66 0x9a 0x34 0x12 0x00 0x00 0x02 0x00
|
0x66 0x9a 0x34 0x12 0x00 0x00 0x02 0x00
|
||||||
|
|
||||||
# CHECKX: jcxz
|
# CHECK: jcxz
|
||||||
0xe3 0x00
|
0xe3 0x00
|
||||||
|
|
||||||
# CHECKX: jecxz
|
# CHECK: jecxz
|
||||||
0x67 0xe3 0x00
|
0x67 0xe3 0x00
|
||||||
|
|
||||||
# CHECK: iretw
|
# CHECK: iretw
|
||||||
|
Loading…
Reference in New Issue
Block a user