mirror of
https://github.com/capstone-engine/capstone.git
synced 2025-03-03 20:07:21 +00:00
x86: fix #456 for AT&T syntax
This commit is contained in:
parent
343a98d8a4
commit
94874ed436
@ -525,6 +525,15 @@ static void printPCRelImm(MCInst *MI, unsigned OpNo, SStream *O)
|
||||
imm = imm & 0xffffffff;
|
||||
}
|
||||
|
||||
if (MI->csh->mode == CS_MODE_16 &&
|
||||
(MI->Opcode != X86_JMP_4 && MI->Opcode != X86_CALLpcrel32))
|
||||
imm = imm & 0xffff;
|
||||
|
||||
// Hack: X86 16bit with opcode X86_JMP_4
|
||||
if (MI->csh->mode == CS_MODE_16 &&
|
||||
(MI->Opcode == X86_JMP_4 && MI->x86_prefix[2] != 0x66))
|
||||
imm = imm & 0xffff;
|
||||
|
||||
// CALL/JMP rel16 is special
|
||||
if (MI->Opcode == X86_CALLpcrel16 || MI->Opcode == X86_JMP_2)
|
||||
imm = imm & 0xffff;
|
||||
@ -532,10 +541,6 @@ static void printPCRelImm(MCInst *MI, unsigned OpNo, SStream *O)
|
||||
if (imm < 0) {
|
||||
SStream_concat(O, "0x%"PRIx64, imm);
|
||||
} else {
|
||||
// handle 16bit segment bound
|
||||
if (MI->csh->mode == CS_MODE_16)
|
||||
imm = imm & 0xffff;
|
||||
|
||||
if (imm > HEX_THRESHOLD)
|
||||
SStream_concat(O, "0x%"PRIx64, imm);
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user