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

Method print_ins_detail

bindings/java/TestSystemz.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 Systemz.OpInfo operands = (Systemz.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 Systemz.Operand i = (Systemz.Operand) operands.op[c];
43 if (i.type == SYSZ_OP_REG)
44 System.out.printf("\t\toperands[%d].type: REG = %s\n", c, ins.regName(i.value.reg));
45 if (i.type == SYSZ_OP_ACREG)
46 System.out.printf("\t\toperands[%d].type: ACREG = %s\n", c, i.value.reg);
47 if (i.type == SYSZ_OP_IMM)
48 System.out.printf("\t\toperands[%d].type: IMM = 0x%x\n", c, i.value.imm);
49 if (i.type == SYSZ_OP_MEM) {
50 System.out.printf("\t\toperands[%d].type: MEM\n", c);
51 if (i.value.mem.base != SYSZ_REG_INVALID)
52 System.out.printf("\t\t\toperands[%d].mem.base: REG = %s\n", c, ins.regName(i.value.mem.base));
53 if (i.value.mem.index != SYSZ_REG_INVALID)
54 System.out.printf("\t\t\toperands[%d].mem.index: REG = %s\n", c, ins.regName(i.value.mem.index));
55 if (i.value.mem.length != 0)
56 System.out.printf("\t\t\toperands[%d].mem.length: 0x%x\n", c, i.value.mem.disp);
57 if (i.value.mem.disp != 0)
58 System.out.printf("\t\t\toperands[%d].mem.disp: 0x%x\n", c, i.value.mem.disp);
59 }
60 }
61 }
62
63 if (operands.cc != 0)
64 System.out.printf("\tConditional code: %d\n", operands.cc);
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