|
|
|
@ -91,7 +91,7 @@ void XCore_insn_extract(MCInst *MI, const char *code) |
|
|
|
|
// base register
|
|
|
|
|
if (MI->csh->detail) { |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].type = XCORE_OP_MEM; |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].mem.base = id; |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].mem.base = (uint8_t)id; |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].mem.index = XCORE_REG_INVALID; |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].mem.disp = 0; |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].mem.direct = 1; |
|
|
|
@ -109,7 +109,7 @@ void XCore_insn_extract(MCInst *MI, const char *code) |
|
|
|
|
if (id) { |
|
|
|
|
// index register
|
|
|
|
|
if (MI->csh->detail) { |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].mem.index = id; |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].mem.index = (uint8_t)id; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// a number means disp
|
|
|
|
@ -160,7 +160,7 @@ static void set_mem_access(MCInst *MI, bool status, int reg) |
|
|
|
|
if (reg != 0xffff && reg != -0xffff) { |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].type = XCORE_OP_MEM; |
|
|
|
|
if (reg) { |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].mem.base = reg; |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].mem.base = (uint8_t)reg; |
|
|
|
|
} else { |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].mem.base = XCORE_REG_INVALID; |
|
|
|
|
} |
|
|
|
@ -171,7 +171,7 @@ static void set_mem_access(MCInst *MI, bool status, int reg) |
|
|
|
|
// the last op should be the memory base
|
|
|
|
|
MI->flat_insn->detail->xcore.op_count--; |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].type = XCORE_OP_MEM; |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].mem.base = MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].reg; |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].mem.base = (uint8_t)MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].reg; |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].mem.index = XCORE_REG_INVALID; |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].mem.disp = 0; |
|
|
|
|
if (reg > 0) |
|
|
|
@ -181,7 +181,7 @@ static void set_mem_access(MCInst *MI, bool status, int reg) |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (reg) { |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].mem.index = reg; |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].mem.index = (uint8_t)reg; |
|
|
|
|
// done, create the next operand slot
|
|
|
|
|
MI->flat_insn->detail->xcore.op_count++; |
|
|
|
|
} |
|
|
|
@ -199,9 +199,9 @@ static void _printOperand(MCInst *MI, MCOperand *MO, SStream *O) |
|
|
|
|
if (MI->csh->detail) { |
|
|
|
|
if (MI->csh->doing_mem) { |
|
|
|
|
if (MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].mem.base == ARM_REG_INVALID) |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].mem.base = reg; |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].mem.base = (uint8_t)reg; |
|
|
|
|
else |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].mem.index = reg; |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].mem.index = (uint8_t)reg; |
|
|
|
|
} else { |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].type = XCORE_OP_REG; |
|
|
|
|
MI->flat_insn->detail->xcore.operands[MI->flat_insn->detail->xcore.op_count].reg = reg; |
|
|
|
|