10 #include <capstone/capstone.h>
17 "Register Direct - Data",
18 "Register Direct - Address",
20 "Register Indirect - Address",
21 "Register Indirect - Address with Postincrement",
22 "Register Indirect - Address with Predecrement",
23 "Register Indirect - Address with Displacement",
25 "Address Register Indirect With Index - 8-bit displacement",
26 "Address Register Indirect With Index - Base displacement",
28 "Memory indirect - Postindex",
29 "Memory indirect - Preindex",
31 "Program Counter Indirect - with Displacement",
33 "Program Counter Indirect with Index - with 8-Bit Displacement",
34 "Program Counter Indirect with Index - with Base Displacement",
36 "Program Counter Memory Indirect - Postindexed",
37 "Program Counter Memory Indirect - Preindexed",
39 "Absolute Data Addressing - Short",
40 "Absolute Data Addressing - Long",
48 for (
i = 0;
i <
detail->regs_read_count; ++
i) {
51 printf(
"\treading from reg: %s\n", reg_name);
54 for (
i = 0;
i <
detail->regs_write_count; ++
i) {
57 printf(
"\twriting to reg: %s\n", reg_name);
68 if (ins->detail ==
NULL)
80 for (
i = 0;
i <
m68k->op_count;
i++) {
83 switch((
int)
op->type) {
90 printf(
"\t\toperands[%u].type: IMM = 0x%x\n",
i, (
int)
op->imm);
93 printf(
"\t\toperands[%u].type: MEM\n",
i);
95 printf(
"\t\t\toperands[%u].mem.base: REG = %s\n",
98 printf(
"\t\t\toperands[%u].mem.index: REG = %s\n",
100 printf(
"\t\t\toperands[%u].mem.index: size = %c\n",
101 i,
op->mem.index_size ?
'l' :
'w');
103 if (
op->mem.disp != 0)
104 printf(
"\t\t\toperands[%u].mem.disp: 0x%x\n",
i,
op->mem.disp);
105 if (
op->mem.scale != 0)
106 printf(
"\t\t\toperands[%u].mem.scale: %d\n",
i,
op->mem.scale);
111 printf(
"\t\toperands[%u].type: FP_SINGLE\n",
i);
112 printf(
"\t\t\toperands[%u].simm: %f\n",
i,
op->simm);
115 printf(
"\t\toperands[%u].type: FP_DOUBLE\n",
i);
116 printf(
"\t\t\toperands[%u].dimm: %lf\n",
i,
op->dimm);
static mcore_handle handle
CAPSTONE_EXPORT const char *CAPSTONE_API cs_reg_name(csh ud, unsigned int reg)
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
@ M68K_OP_IMM
= CS_OP_IMM (Immediate operand).
@ M68K_OP_FP_SINGLE
single precision Floating-Point operand
@ M68K_OP_FP_DOUBLE
double precision Floating-Point operand
@ M68K_OP_REG
= CS_OP_REG (Register operand).
@ M68K_OP_MEM
= CS_OP_MEM (Memory operand).
The M68K instruction and it's operands.