mirror of
https://github.com/capstone-engine/capstone.git
synced 2025-02-13 02:33:34 +00:00
PPC: print 16bit imm as unsigned
This commit is contained in:
parent
e84889433f
commit
c63838c40c
@ -460,18 +460,11 @@ static void printU12ImmOperand(MCInst *MI, unsigned OpNo, SStream *O)
|
||||
static void printS16ImmOperand(MCInst *MI, unsigned OpNo, SStream *O)
|
||||
{
|
||||
if (MCOperand_isImm(MCInst_getOperand(MI, OpNo))) {
|
||||
short Imm = (short)MCOperand_getImm(MCInst_getOperand(MI, OpNo));
|
||||
if (Imm >= 0) {
|
||||
if (Imm > HEX_THRESHOLD)
|
||||
SStream_concat(O, "0x%x", Imm);
|
||||
else
|
||||
SStream_concat(O, "%u", Imm);
|
||||
} else {
|
||||
if (Imm < -HEX_THRESHOLD)
|
||||
SStream_concat(O, "-0x%x", -Imm);
|
||||
else
|
||||
SStream_concat(O, "-%u", -Imm);
|
||||
}
|
||||
unsigned short Imm = (unsigned short)MCOperand_getImm(MCInst_getOperand(MI, OpNo));
|
||||
if (Imm > HEX_THRESHOLD)
|
||||
SStream_concat(O, "0x%x", Imm);
|
||||
else
|
||||
SStream_concat(O, "%u", Imm);
|
||||
|
||||
if (MI->csh->detail) {
|
||||
MI->flat_insn->detail->ppc.operands[MI->flat_insn->detail->ppc.op_count].type = PPC_OP_IMM;
|
||||
|
Loading…
x
Reference in New Issue
Block a user