MCPcopy Create free account
hub / github.com/capstone-engine/capstone / print_ins_detail

Method print_ins_detail

bindings/java/TestPpc.java:34–66  ·  view source on GitHub ↗
(Capstone.CsInsn ins)

Source from the content-addressed store, hash-verified

32 }
33
34 public static void print_ins_detail(Capstone.CsInsn ins) {
35 System.out.printf("0x%x:\t%s\t%s\n", ins.address, ins.mnemonic, ins.opStr);
36
37 Ppc.OpInfo operands = (Ppc.OpInfo) ins.operands;
38
39 if (operands.op.length != 0) {
40 System.out.printf("\top_count: %d\n", operands.op.length);
41 for (int c=0; c<operands.op.length; c++) {
42 Ppc.Operand i = (Ppc.Operand) operands.op[c];
43 if (i.type == PPC_OP_REG)
44 System.out.printf("\t\toperands[%d].type: REG = %s\n", c, ins.regName(i.value.reg));
45 if (i.type == PPC_OP_IMM)
46 System.out.printf("\t\toperands[%d].type: IMM = 0x%x\n", c, i.value.imm);
47 if (i.type == PPC_OP_MEM) {
48 System.out.printf("\t\toperands[%d].type: MEM\n", c);
49 if (i.value.mem.base != PPC_REG_INVALID)
50 System.out.printf("\t\t\toperands[%d].mem.base: REG = %s\n", c, ins.regName(i.value.mem.base));
51 if (i.value.mem.disp != 0)
52 System.out.printf("\t\t\toperands[%d].mem.disp: 0x%x\n", c, i.value.mem.disp);
53 }
54 }
55 }
56
57 if (operands.bc != 0)
58 System.out.printf("\tBranch code: %d\n", operands.bc);
59
60 if (operands.bh != 0)
61 System.out.printf("\tBranch hint: %d\n", operands.bh);
62
63 if (operands.updateCr0)
64 System.out.printf("\tUpdate-CR0: True\n");
65
66 }
67
68 public static void main(String argv[]) {
69

Callers 1

mainMethod · 0.95

Calls 1

regNameMethod · 0.80

Tested by

no test coverage detected