mirror of
https://github.com/capstone-engine/capstone.git
synced 2024-11-27 23:40:25 +00:00
arm: add IMM operand for printPostIdxImm8s4Operand(). issue #861
This commit is contained in:
parent
eebd47d78a
commit
695e60be9d
@ -1266,10 +1266,19 @@ static void printPostIdxImm8s4Operand(MCInst *MI, unsigned OpNum, SStream *O)
|
||||
{
|
||||
MCOperand *MO = MCInst_getOperand(MI, OpNum);
|
||||
unsigned Imm = (unsigned int)MCOperand_getImm(MO);
|
||||
if (((Imm & 0xff) << 2) > HEX_THRESHOLD)
|
||||
|
||||
if (((Imm & 0xff) << 2) > HEX_THRESHOLD) {
|
||||
SStream_concat(O, "#%s0x%x", ((Imm & 256) ? "" : "-"), ((Imm & 0xff) << 2));
|
||||
else
|
||||
} else {
|
||||
SStream_concat(O, "#%s%u", ((Imm & 256) ? "" : "-"), ((Imm & 0xff) << 2));
|
||||
}
|
||||
|
||||
if (MI->csh->detail) {
|
||||
int v = (Imm & 256) ? ((Imm & 0xff) << 2) : -((Imm & 0xff) << 2);
|
||||
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].type = ARM_OP_IMM;
|
||||
MI->flat_insn->detail->arm.operands[MI->flat_insn->detail->arm.op_count].imm = v;
|
||||
MI->flat_insn->detail->arm.op_count++;
|
||||
}
|
||||
}
|
||||
|
||||
static void printAddrMode5Operand(MCInst *MI, unsigned OpNum, SStream *O,
|
||||
|
Loading…
Reference in New Issue
Block a user