| 1 | /* Capstone Disassembler Engine */cxx . . $ `<file>/cstool/cstool_systemz.c`/ |
| 2 | /* By Nguyen Anh Quynh <[email protected]>, 2013-2014 */ |
| 3 | |
| 4 | #include <stdio.h> |
| 5 | |
| 6 | #include <capstone/capstone.h>cxx . . $ `<file>/include/capstone/capstone.h`/ |
| 7 | #include "cstool.h"cxx . . $ `<file>/cstool/cstool.h`/ |
| 8 | |
| 9 | void print_insn_detail_syszcxx . . $ print_insn_detail_sysz(2888c3e5b0984e8d).(cshcxx . . $ csh# handle, cs_insncxx . . $ cs_insn# *ins) |
| 10 | { |
| 11 | cs_syszcxx . . $ cs_sysz# *sysz; |
| 12 | int i; |
| 13 | |
| 14 | // detail can be NULL on "data" instruction if SKIPDATA option is turned ON |
| 15 | if (ins->detailcxx . . $ cs_insn#detail. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!) |
| 16 | return; |
| 17 | |
| 18 | sysz = &(ins->detailcxx . . $ cs_insn#detail.->syszcxx . . $ cs_detail#$anonymous_type_0#sysz.); |
| 19 | if (sysz->op_countcxx . . $ cs_sysz#op_count.) |
| 20 | printfcxx . . $ printf(581fddd72a8db8fc).("\top_count: %u\n", sysz->op_countcxx . . $ cs_sysz#op_count.); |
| 21 | |
| 22 | for (i = 0; i < sysz->op_countcxx . . $ cs_sysz#op_count.; i++) { |
| 23 | cs_sysz_opcxx . . $ cs_sysz_op# *op = &(sysz->operandscxx . . $ cs_sysz#operands.[i]); |
| 24 | switch((int)op->typecxx . . $ cs_sysz_op#type.) { |
| 25 | default: |
| 26 | break; |
| 27 | case SYSZ_OP_REGcxx . . $ SYSZ_OP_REG.: |
| 28 | printfcxx . . $ printf(581fddd72a8db8fc).("\t\toperands[%u].type: REG = %s\n", i, cs_reg_namecxx . . $ cs_reg_name(efd1348d9ae5172e).(handle, op->regcxx . . $ cs_sysz_op#$anonymous_type_0#reg.)); |
| 29 | break; |
| 30 | case SYSZ_OP_ACREGcxx . . $ SYSZ_OP_ACREG.: |
| 31 | printfcxx . . $ printf(581fddd72a8db8fc).("\t\toperands[%u].type: ACREG = %u\n", i, op->regcxx . . $ cs_sysz_op#$anonymous_type_0#reg.); |
| 32 | break; |
| 33 | case SYSZ_OP_IMMcxx . . $ SYSZ_OP_IMM.: |
| 34 | printfcxx . . $ printf(581fddd72a8db8fc).("\t\toperands[%u].type: IMM = 0x%" PRIx64cxx . . $ `<external>/15933738808807975373/inttypes.h:126:10`! "\n", i, op->immcxx . . $ cs_sysz_op#$anonymous_type_0#imm.); |
| 35 | break; |
| 36 | case SYSZ_OP_MEMcxx . . $ SYSZ_OP_MEM.: |
| 37 | printfcxx . . $ printf(581fddd72a8db8fc).("\t\toperands[%u].type: MEM\n", i); |
| 38 | if (op->memcxx . . $ cs_sysz_op#$anonymous_type_0#mem..basecxx . . $ sysz_op_mem#base. != SYSZ_REG_INVALIDcxx . . $ SYSZ_REG_INVALID.) |
| 39 | printfcxx . . $ printf(581fddd72a8db8fc).("\t\t\toperands[%u].mem.base: REG = %s\n", |
| 40 | i, cs_reg_namecxx . . $ cs_reg_name(efd1348d9ae5172e).(handle, op->memcxx . . $ cs_sysz_op#$anonymous_type_0#mem..basecxx . . $ sysz_op_mem#base.)); |
| 41 | if (op->memcxx . . $ cs_sysz_op#$anonymous_type_0#mem..indexcxx . . $ sysz_op_mem#index. != SYSZ_REG_INVALIDcxx . . $ SYSZ_REG_INVALID.) |
| 42 | printfcxx . . $ printf(581fddd72a8db8fc).("\t\t\toperands[%u].mem.index: REG = %s\n", |
| 43 | i, cs_reg_namecxx . . $ cs_reg_name(efd1348d9ae5172e).(handle, op->memcxx . . $ cs_sysz_op#$anonymous_type_0#mem..indexcxx . . $ sysz_op_mem#index.)); |
| 44 | if (op->memcxx . . $ cs_sysz_op#$anonymous_type_0#mem..lengthcxx . . $ sysz_op_mem#length. != 0) |
| 45 | printfcxx . . $ printf(581fddd72a8db8fc).("\t\t\toperands[%u].mem.length: 0x%" PRIx64cxx . . $ `<external>/15933738808807975373/inttypes.h:126:10`! "\n", i, op->memcxx . . $ cs_sysz_op#$anonymous_type_0#mem..lengthcxx . . $ sysz_op_mem#length.); |
| 46 | if (op->memcxx . . $ cs_sysz_op#$anonymous_type_0#mem..dispcxx . . $ sysz_op_mem#disp. != 0) |
| 47 | printfcxx . . $ printf(581fddd72a8db8fc).("\t\t\toperands[%u].mem.disp: 0x%" PRIx64cxx . . $ `<external>/15933738808807975373/inttypes.h:126:10`! "\n", i, op->memcxx . . $ cs_sysz_op#$anonymous_type_0#mem..dispcxx . . $ sysz_op_mem#disp.); |
| 48 | |
| 49 | break; |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | if (sysz->cccxx . . $ cs_sysz#cc. != 0) |
| 54 | printfcxx . . $ printf(581fddd72a8db8fc).("\tCode condition: %u\n", sysz->cccxx . . $ cs_sysz#cc.); |
| 55 | } |