x86: print immediate of IN/OUT instructions in positive form. this fixes issue #554

This commit is contained in:
Nguyen Anh Quynh 2015-11-27 21:28:05 +07:00
parent ed88b001f8
commit 7fc5bc3b4b
2 changed files with 5 additions and 0 deletions

View File

@ -644,6 +644,8 @@ static void printOperand(MCInst *MI, unsigned OpNo, SStream *O)
SStream_concat(O, "$0x%"PRIx64, imm);
break;
case X86_INS_IN:
case X86_INS_OUT:
case X86_INS_INT:
// do not print number in negative form
imm = imm & 0xff;

View File

@ -829,6 +829,7 @@ static void printOperand(MCInst *MI, unsigned OpNo, SStream *O)
if (opsize == 1) // print 1 byte immediate in positive form
imm = imm & 0xff;
// printf(">>> id = %u\n", MI->flat_insn->id);
switch(MI->flat_insn->id) {
default:
printImm(MI->csh->syntax, O, imm, false);
@ -839,6 +840,8 @@ static void printOperand(MCInst *MI, unsigned OpNo, SStream *O)
printImm(MI->csh->syntax, O, imm, true);
break;
case X86_INS_IN:
case X86_INS_OUT:
case X86_INS_INT:
// do not print number in negative form
imm = imm & 0xff;