Go to the documentation of this file.
35 "Register Direct - Data",
36 "Register Direct - Address",
38 "Register Indirect - Address",
39 "Register Indirect - Address with Postincrement",
40 "Register Indirect - Address with Predecrement",
41 "Register Indirect - Address with Displacement",
43 "Address Register Indirect With Index - 8-bit displacement",
44 "Address Register Indirect With Index - Base displacement",
46 "Memory indirect - Postindex",
47 "Memory indirect - Preindex",
49 "Program Counter Indirect - with Displacement",
51 "Program Counter Indirect with Index - with 8-Bit Displacement",
52 "Program Counter Indirect with Index - with Base Displacement",
54 "Program Counter Memory Indirect - Postindexed",
55 "Program Counter Memory Indirect - Preindexed",
57 "Absolute Data Addressing - Short",
58 "Absolute Data Addressing - Long",
66 for (
i = 0;
i <
detail->regs_read_count; ++
i)
70 printf(
"\treading from reg: %s\n", reg_name);
73 for (
i = 0;
i <
detail->regs_write_count; ++
i)
77 printf(
"\twriting to reg: %s\n", reg_name);
88 if (ins->detail == NULL)
100 for (
i = 0;
i <
m68k->op_count;
i++) {
103 switch((
int)
op->type) {
110 printf(
"\t\toperands[%u].type: IMM = 0x%x\n",
i, (
int)
op->imm);
113 printf(
"\t\toperands[%u].type: MEM\n",
i);
115 printf(
"\t\t\toperands[%u].mem.base: REG = %s\n",
118 printf(
"\t\t\toperands[%u].mem.index: REG = %s\n",
120 printf(
"\t\t\toperands[%u].mem.index: size = %c\n",
121 i,
op->mem.index_size ?
'l' :
'w');
123 if (
op->mem.disp != 0)
124 printf(
"\t\t\toperands[%u].mem.disp: 0x%x\n",
i,
op->mem.disp);
125 if (
op->mem.scale != 0)
126 printf(
"\t\t\toperands[%u].mem.scale: %d\n",
i,
op->mem.scale);
131 printf(
"\t\toperands[%u].type: FP_SINGLE\n",
i);
132 printf(
"\t\t\toperands[%u].simm: %f\n",
i,
op->simm);
135 printf(
"\t\toperands[%u].type: FP_DOUBLE\n",
i);
136 printf(
"\t\t\toperands[%u].dimm: %lf\n",
i,
op->dimm);
139 printf(
"\t\toperands[%u].type: REG_BITS = $%x\n",
i,
op->register_bits);
149 #define M68K_CODE "\xf0\x10\xf0\x00\x48\xaf\xff\xff\x7f\xff\x11\xb0\x01\x37\x7f\xff\xff\xff\x12\x34\x56\x78\x01\x33\x10\x10\x10\x10\x32\x32\x32\x32\x4C\x00\x54\x04\x48\xe7\xe0\x30\x4C\xDF\x0C\x07\xd4\x40\x87\x5a\x4e\x71\x02\xb4\xc0\xde\xc0\xde\x5c\x00\x1d\x80\x71\x12\x01\x23\xf2\x3c\x44\x22\x40\x49\x0e\x56\x54\xc5\xf2\x3c\x44\x00\x44\x7a\x00\x00\xf2\x00\x0a\x28\x4E\xB9\x00\x00\x00\x12\x4E\x75"
168 printf(
"Failed on cs_open() with error returned: %u\n",
err);
178 printf(
"****************\n");
183 for (j = 0; j <
count; j++) {
184 assert(address == insn[j].address &&
"this means the size of the previous instruction was incorrect");
185 address += insn[j].size;
186 printf(
"0x%" PRIx64
":\t%s\t%s\n", insn[j].address, insn[j].mnemonic, insn[j].op_str);
189 printf(
"0x%" PRIx64
":\n", insn[j-1].address + insn[j-1].
size);
194 printf(
"****************\n");
197 printf(
"ERROR: Failed to disasm given code!\n");
@ M68K_OP_REG_BITS
Register bits move.
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_close(csh *handle)
@ CS_ARCH_M68K
68K architecture
CAPSTONE_EXPORT size_t CAPSTONE_API cs_disasm(csh ud, const uint8_t *buffer, size_t size, uint64_t offset, size_t count, cs_insn **insn)
_Use_decl_annotations_ int __cdecl printf(const char *_Format,...)
static void print_read_write_regs(cs_detail *detail)
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_open(cs_arch arch, cs_mode mode, csh *handle)
cs_arch
Architecture type.
@ M68K_OP_FP_DOUBLE
double precision Floating-Point operand
@ M68K_OP_FP_SINGLE
single precision Floating-Point operand
@ CS_OPT_DETAIL
Break down instruction structure into details.
static void print_insn_detail(cs_insn *ins)
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_option(csh ud, cs_opt_type type, size_t value)
The M68K instruction and it's operands.
const CAPSTONE_EXPORT char *CAPSTONE_API cs_reg_name(csh ud, unsigned int reg)
unsigned __int64 uint64_t
@ CS_OPT_ON
Turn ON an option (CS_OPT_DETAIL, CS_OPT_SKIPDATA).
@ CS_MODE_M68K_040
M68K 68040 mode.
@ CS_MODE_BIG_ENDIAN
big-endian mode
@ M68K_OP_IMM
= CS_OP_IMM (Immediate operand).
const char * s_addressing_modes[]
@ M68K_OP_REG
= CS_OP_REG (Register operand).
static void print_string_hex(const char *comment, unsigned char *str, size_t len)
CAPSTONE_EXPORT void CAPSTONE_API cs_free(cs_insn *insn, size_t count)
struct platform platforms[]
@ M68K_OP_MEM
= CS_OP_MEM (Memory operand).
grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:31