6
#include <capstone/capstone.h>
9
void print_insn_detail_sparc(csh handle, cs_insn *ins)
15
if (ins->detail == NULL)
18
sparc = &(ins->detail->sparc);
20
printf("\top_count: %u\n", sparc->op_count);
22
for (i = 0; i < sparc->op_count; i++) {
23
cs_sparc_op *op = &(sparc->operands[i]);
24
switch((int)op->type) {
28
printf("\t\toperands[%u].type: REG = %s\n", i, cs_reg_name(handle, op->reg));
31
printf("\t\toperands[%u].type: IMM = 0x%" PRIx64 "\n", i, op->imm);
34
printf("\t\toperands[%u].type: MEM\n", i);
35
if (op->mem.base != X86_REG_INVALID)
36
printf("\t\t\toperands[%u].mem.base: REG = %s\n",
37
i, cs_reg_name(handle, op->mem.base));
38
if (op->mem.index != X86_REG_INVALID)
39
printf("\t\t\toperands[%u].mem.index: REG = %s\n",
40
i, cs_reg_name(handle, op->mem.index));
41
if (op->mem.disp != 0)
42
printf("\t\t\toperands[%u].mem.disp: 0x%x\n", i, op->mem.disp);
49
printf("\tCode condition: %u\n", sparc->cc);
52
printf("\tHint code: %u\n", sparc->hint);