Go to the documentation of this file.
10 #define ARR_SIZE(a) (sizeof(a)/sizeof(a[0]))
43 "UNCHANGED",
"READ",
"WRITE",
"READ | WRITE",
50 if (
detail->regs_read_count > 0) {
51 printf(
"\tRegisters read:");
53 for (
i = 0;
i <
detail->regs_read_count; ++
i)
60 if (
detail->regs_write_count > 0) {
61 printf(
"\tRegisters modified:");
63 for (
i = 0;
i <
detail->regs_write_count; ++
i)
73 cs_detail *
detail = insn->detail;
90 switch ((
int)
op->type) {
97 if ((
i == 0 && (m680x->
flags &
99 ((
i == 1 && (m680x->
flags &
101 comment =
" (in mnemonic)";
103 printf(
"\t\toperands[%u].type: REGISTER = %s%s\n",
i,
108 printf(
"\t\toperands[%u].type: CONSTANT = %u\n",
i,
113 printf(
"\t\toperands[%u].type: IMMEDIATE = #%d\n",
i,
118 printf(
"\t\toperands[%u].type: DIRECT = 0x%02X\n",
i,
123 printf(
"\t\toperands[%u].type: EXTENDED %s = 0x%04X\n",
124 i,
op->ext.indirect ?
"INDIRECT" :
"",
129 printf(
"\t\toperands[%u].type: RELATIVE = 0x%04X\n",
i,
134 printf(
"\t\toperands[%u].type: INDEXED%s\n",
i,
139 printf(
"\t\t\tbase register: %s\n",
143 printf(
"\t\t\toffset register: %s\n",
146 if ((
op->idx.offset_bits != 0) &&
149 printf(
"\t\t\toffset: %d\n",
op->idx.offset);
152 printf(
"\t\t\toffset address: 0x%X\n",
153 op->idx.offset_addr);
155 printf(
"\t\t\toffset bits: %u\n",
156 op->idx.offset_bits);
159 if (
op->idx.inc_dec) {
160 const char *post_pre =
op->idx.
flags &
162 const char *inc_dec = (
op->idx.inc_dec > 0) ?
163 "increment" :
"decrement";
165 printf(
"\t\t\t%s %s: %d\n", post_pre, inc_dec,
166 abs(
op->idx.inc_dec));
173 printf(
"\t\t\tsize: %u\n",
op->size);
182 if (
detail->groups_count) {
197 "\x01\x09\x36\x64\x7f\x74\x10\x00\x90\x10\xA4\x10\xb6\x10\x00\x39"
200 "\x04\x05\x3c\x3d\x38\x93\x10\xec\x10\xed\x10\x39"
203 "\x04\x7f\x00\x17\x22\x28\x00\x2e\x00\x40\x42\x5a\x70\x8e\x97\x9c" \
204 "\xa0\x15\xad\x00\xc3\x10\x00\xda\x12\x34\xe5\x7f\xfe"
207 "\x31\x22\x00\x35\x22\x45\x10\x00\x4b\x00\x51\x10\x52\x5e\x22\x62" \
208 "\x65\x12\x34\x72\x84\x85\x86\x87\x8a\x8b\x8c\x94\x95\xa7\x10\xaf\x10" \
209 "\x9e\x60\x7f\x9e\x6b\x7f\x00\x9e\xd6\x10\x00\x9e\xe6\x7f"
212 "\x32\x10\x00\x9e\xae\x9e\xce\x7f\x9e\xbe\x10\x00\x9e\xfe\x7f" \
213 "\x3e\x10\x00\x9e\xf3\x7f\x96\x10\x00\x9e\xff\x7f\x82"
216 "\x02\x03\x12\x7f\x10\x00\x13\x99\x08\x00\x14\x7f\x02\x15\x7f\x01" \
217 "\x1e\x7f\x20\x00\x8f\xcf" \
218 "\x18\x08\x18\x30\x18\x3c\x18\x67\x18\x8c\x10\x00\x18\x8f" \
219 "\x18\xce\x10\x00\x18\xff\x10\x00" \
220 "\x1a\xa3\x7f\x1a\xac\x1a\xee\x7f\x1a\xef\x7f\xcd\xac\x7f"
223 "\x00\x04\x01\x00\x0c\x00\x80\x0e\x00\x80\x00\x11\x1e\x10\x00\x80\x00" \
224 "\x3b\x4a\x10\x00\x04\x4b\x01\x04\x4f\x7f\x80\x00\x8f\x10\x00\xb7\x52" \
225 "\xb7\xb1\xa6\x67\xa6\xfe\xa6\xf7\x18\x02\xe2\x30\x39\xe2\x10\x00" \
226 "\x18\x0c\x30\x39\x10\x00\x18\x11\x18\x12\x10\x00\x18\x19\x00\x18\x1e\x00" \
227 "\x18\x3e\x18\x3f\x00"
229 #define HD6301_CODE \
230 "\x6b\x10\x00\x71\x10\x00\x72\x10\x10\x39"
233 "\x06\x10\x19\x1a\x55\x1e\x01\x23\xe9\x31\x06\x34\x55\xa6\x81" \
234 "\xa7\x89\x7f\xff\xa6\x9d\x10\x00\xa7\x91\xa6\x9f\x10\x00" \
235 "\x11\xac\x99\x10\x00\x39" \
237 "\xA6\x07\xA6\x27\xA6\x47\xA6\x67\xA6\x0F\xA6\x10" \
238 "\xA6\x80\xA6\x81\xA6\x82\xA6\x83\xA6\x84\xA6\x85\xA6\x86" \
239 "\xA6\x88\x7F\xA6\x88\x80\xA6\x89\x7F\xFF\xA6\x89\x80\x00" \
240 "\xA6\x8B\xA6\x8C\x10\xA6\x8D\x10\x00" \
242 "\xA6\x91\xA6\x93\xA6\x94\xA6\x95\xA6\x96" \
243 "\xA6\x98\x7F\xA6\x98\x80\xA6\x99\x7F\xFF\xA6\x99\x80\x00" \
244 "\xA6\x9B\xA6\x9C\x10\xA6\x9D\x10\x00\xA6\x9F\x10\x00"
247 #define HD6309_CODE \
248 "\x01\x10\x10\x62\x10\x10\x7b\x10\x10\x00\xcd\x49\x96\x02\xd2" \
249 "\x10\x30\x23\x10\x38\x10\x3b\x10\x53\x10\x5d" \
250 "\x11\x30\x43\x10\x11\x37\x25\x10\x11\x38\x12\x11\x39\x23\x11\x3b\x34" \
251 "\x11\x8e\x10\x00\x11\xaf\x10\x11\xab\x10\x11\xf6\x80\x00"
331 const char *nine_spaces =
" ";
341 printf(
"Failed on cs_open() with error returned: %u\n",
356 printf(
"********************\n");
362 for (j = 0; j <
count; j++) {
369 printf(
"%s", insn[j].mnemonic);
370 slen = (
int)strlen(insn[j].mnemonic);
371 printf(
"%.*s", 1 + (5 - slen), nine_spaces);
372 printf(
"%s\n", insn[j].op_str);
382 printf(
"********************\n");
386 printf(
"ERROR: Failed to disasm given code!\n");
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_close(csh *handle)
@ CS_MODE_M680X_6800
M680X Motorola 6800,6802 mode.
@ M680X_OP_CONSTANT
Used e.g. for a bit index or page number.
@ M680X_OP_EXTENDED
= Extended addressing operand.
@ M680X_OP_DIRECT
= Direct addressing operand.
@ M680X_OP_IMMEDIATE
= Immediate operand.
@ CS_MODE_M680X_6805
M680X Motorola/Freescale 6805 mode.
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)
@ CS_MODE_M680X_CPU12
used on M68HC12/HCS12
_Use_decl_annotations_ int __cdecl printf(const char *_Format,...)
@ CS_MODE_M680X_6801
M680X Motorola 6801,6803 mode.
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_open(cs_arch arch, cs_mode mode, csh *handle)
cs_arch
Architecture type.
@ CS_OPT_DETAIL
Break down instruction structure into details.
#define M680X_FIRST_OP_IN_MNEM
static void print_read_write_regs(csh handle, cs_detail *detail)
uint8_t op_count
number of operands for the instruction or 0
@ CS_ARCH_M680X
680X architecture
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_option(csh ud, cs_opt_type type, size_t value)
static const char * s_access[]
@ CS_MODE_M680X_6808
M680X Motorola/Freescale/NXP 68HC08 mode.
static void print_string_hex(const char *comment, unsigned char *str, size_t len)
#define M680X_IDX_POST_INC_DEC
static bool consistency_checks()
const CAPSTONE_EXPORT char *CAPSTONE_API cs_reg_name(csh ud, unsigned int reg)
unsigned __int64 uint64_t
@ M680X_REG_PC
M6800/1/2/3/9, M6301/9.
@ CS_OPT_ON
Turn ON an option (CS_OPT_DETAIL, CS_OPT_SKIPDATA).
uint8_t flags
See: M680X instruction flags.
The M680X instruction and it's operands.
@ CS_MODE_M680X_6809
M680X Motorola 6809 mode.
static void print_string_hex_short(unsigned char *str, size_t len)
#define M680X_IDX_INDIRECT
@ CS_AC_INVALID
Uninitialized/invalid access type.
@ CS_MODE_M680X_6309
M680X Hitachi 6309 mode.
cs_m680x_op operands[M680X_OPERAND_COUNT]
operands for this insn.
@ CS_MODE_M680X_HCS08
M680X Freescale/NXP HCS08 mode.
#define M680X_SECOND_OP_IN_MNEM
static void print_insn_detail(csh handle, cs_insn *insn)
@ M680X_OP_RELATIVE
= Relative addressing operand.
@ M680X_OP_INDEXED
= Indexed addressing operand.
CAPSTONE_EXPORT void CAPSTONE_API cs_free(cs_insn *insn, size_t count)
@ M680X_OP_REGISTER
= Register operand.
@ CS_MODE_M680X_6301
M680X Hitachi 6301,6303 mode.
struct platform platforms[]
@ CS_MODE_M680X_6811
M680X Motorola/Freescale/NXP 68HC11 mode.
grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:28