x86: print interrupt number of INT instruction in positive form. bug reported by @pancake

test2
Nguyen Anh Quynh 10 years ago
parent 8bb1f04bb8
commit 1271684973
  1. 7
      arch/X86/X86ATTInstPrinter.c
  2. 7
      arch/X86/X86IntelInstPrinter.c

@ -530,6 +530,13 @@ static void printOperand(MCInst *MI, unsigned OpNo, SStream *O)
SStream_concat(O, "$-%"PRIu64, -imm);
}
break;
case X86_INS_INT:
// do not print number in negative form
if (imm >= 0 && imm <= HEX_THRESHOLD)
SStream_concat(O, "$%u", imm);
else
SStream_concat(O, "$0x%x", imm & 0xff);
break;
case X86_INS_RET:
// RET imm16
if (imm >= 0 && imm <= HEX_THRESHOLD)

@ -616,6 +616,13 @@ static void printOperand(MCInst *MI, unsigned OpNo, SStream *O)
break;
case X86_INS_INT:
// do not print number in negative form
if (imm >= 0 && imm <= HEX_THRESHOLD)
SStream_concat(O, "%u", imm);
else
SStream_concat(O, "0x%x", imm & 0xff);
break;
case X86_INS_AND:
case X86_INS_OR:
case X86_INS_XOR:

Loading…
Cancel
Save