arm: print immediate in positive form for AND/ORR/EOR/BIC instructions

This commit is contained in:
Nguyen Anh Quynh 2014-11-11 12:50:43 +08:00
parent d82b28a75f
commit 278e7270d9
1 changed files with 25 additions and 9 deletions

View File

@ -632,7 +632,10 @@ static void printOperand(MCInst *MI, unsigned OpNo, SStream *O)
} else {
SStream_concat(O, "#0x%x", imm);
}
} else if (imm >= 0) {
} else {
switch(MI->flat_insn->id) {
default:
if (imm >= 0) {
if (imm > HEX_THRESHOLD)
SStream_concat(O, "#0x%x", imm);
else
@ -643,6 +646,19 @@ static void printOperand(MCInst *MI, unsigned OpNo, SStream *O)
else
SStream_concat(O, "#-%u", -imm);
}
break;
case ARM_INS_AND:
case ARM_INS_ORR:
case ARM_INS_EOR:
case ARM_INS_BIC:
// 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);
break;
}
}
if (MI->csh->detail) {
if (MI->csh->doing_mem)