12 #include "../../cs_priv.h"
13 #include "../../utils.h"
15 #include "../../MCInst.h"
16 #include "../../MCInstrDesc.h"
17 #include "../../MCRegisterInfo.h"
22 #ifdef CAPSTONE_HAS_M680X
26 #define DECL_SPEC __cdecl
40 typedef enum insn_hdlr_id {
85 typedef enum e_access_mode {
106 typedef enum e_access {
114 typedef struct inst_page1 {
116 unsigned handler_id1 : 6;
117 unsigned handler_id2 : 6;
121 typedef struct inst_pageX {
124 unsigned handler_id1 : 6;
125 unsigned handler_id2 : 6;
128 typedef struct insn_props {
130 unsigned access_mode : 5;
133 bool cc_modified : 1;
134 bool update_reg_access : 1;
157 if (address -
info->offset >=
info->size)
161 *
byte =
info->code[address -
info->offset];
169 if (address -
info->offset >=
info->size)
183 if (address + 1 -
info->offset >=
info->size)
196 if (address + 3 -
info->offset >=
info->size)
212 static int binary_search(
const inst_pageX *
const inst_pageX_table,
213 int table_size,
uint8_t opcode)
216 int last = table_size - 1;
217 int middle = (first + last) / 2;
219 while (first <= last) {
220 if (inst_pageX_table[middle].opcode < opcode) {
223 else if (inst_pageX_table[middle].opcode == opcode) {
229 middle = (first + last) / 2;
242 uint8_t insn_prefix = (
id >> 8) & 0xff;
249 if (
cpu->pageX_table_size[
i] == 0 ||
253 if (
cpu->pageX_prefix[
i] == insn_prefix) {
255 cpu->pageX_table_size[
i],
id & 0xff);
256 insn->id = (index >= 0) ?
257 cpu->inst_pageX_table[
i][index].insn :
263 if (insn_prefix != 0)
266 insn->id =
cpu->inst_page1_table[
id].insn;
273 if (
cpu->overlay_table_size[
i] == 0 ||
274 (
cpu->inst_overlay_table[
i] ==
NULL))
278 cpu->overlay_table_size[
i],
280 insn->id =
cpu->inst_overlay_table[
i][index].insn;
365 if (
op->idx.inc_dec) {
380 static const e_access g_access_mode_to_access[4][15] = {
383 MODIFY, MODIFY, MODIFY, MODIFY, WRITE,
READ, MODIFY,
387 WRITE, MODIFY, WRITE, MODIFY, MODIFY,
READ, UNCHANGED,
391 WRITE, MODIFY,
READ,
READ, MODIFY, UNCHANGED, UNCHANGED,
394 UNCHANGED,
READ, WRITE, WRITE, MODIFY, MODIFY,
READ,
READ,
395 WRITE, MODIFY,
READ,
READ, MODIFY, UNCHANGED, UNCHANGED,
399 static e_access get_access(
int operator_index, e_access_mode access_mode)
401 int idx = (operator_index > 3) ? 3 : operator_index;
403 return g_access_mode_to_access[
idx][access_mode];
407 e_access_mode access_mode)
417 e_access
access = get_access(
i, access_mode);
423 e_access_mode access_mode)
430 (access_mode == uuuu))
446 typedef struct insn_to_changed_regs {
448 e_access_mode access_mode;
450 } insn_to_changed_regs;
455 #define EOL M680X_REG_INVALID
456 static const insn_to_changed_regs changed_regs[] = {
590 if (
info->insn == changed_regs[
i].insn) {
591 e_access_mode access_mode = changed_regs[
i].access_mode;
593 for (j = 0; changed_regs[
i].regs[j] !=
EOL; ++j) {
606 access = get_access(j, access_mode);
615 typedef struct insn_desc {
636 switch (post_byte & 0x9F) {
665 if ((post_byte & 0x60) != 0 ||
690 if (!(post_byte & 0x20))
693 switch (post_byte & 0xe7) {
727 return info->
cpu->tfr_reg_valid[reg_nibble];
736 return !(post_byte & 0x08);
742 return reg_nibble <= 4;
757 if ((post_byte >= 0xc0) ||
758 ((post_byte & 0x07) == 2) || ((post_byte & 0x07) == 3))
779 if ((post_byte & 0xc0) == 0xc0)
790 insn_desc *insn_description)
797 for (
i = 0;
i < 2;
i++) {
799 bool is_subset =
false;
801 switch (insn_description->hid[
i]) {
841 sz = get_indexed09_post_byte_size(
info, address +
size);
854 sz = get_indexed12_post_byte_size(
info,
855 address +
size, is_subset);
864 sz = get_indexed12_post_byte_size(
info,
865 address +
size,
false);
869 address +
size + 1)))
876 sz = get_indexed12_post_byte_size(
info,
877 address +
size,
false);
890 retval = is_tfm_reg_valid(
info, (ir >> 4) & 0x0F) &&
891 is_tfm_reg_valid(
info, ir & 0x0F);
898 retval = is_tfr09_reg_valid(
info, (ir >> 4) & 0x0F) &&
899 is_tfr09_reg_valid(
info, ir & 0x0F);
906 retval = is_exg_tfr12_post_byte_valid(
info, ir);
911 sz = get_bitmv_post_byte_size(
info, address +
size);
919 sz = get_loop_post_byte_size(
info, address +
size);
927 CS_ASSERT(0 &&
"Unexpected instruction handler id");
936 insn_description->insn_size +=
size;
944 insn_desc *insn_description)
946 const inst_pageX *inst_table =
NULL;
958 insn_description->opcode = ir;
962 if (
cpu->pageX_table_size[
i] == 0 ||
966 if ((
cpu->pageX_prefix[
i] == ir)) {
969 inst_table =
cpu->inst_pageX_table[
i];
970 table_size =
cpu->pageX_table_size[
i];
975 insn_description->opcode =
976 (insn_description->opcode << 8) | ir;
981 insn_description->hid[0] =
982 inst_table[index].handler_id1;
983 insn_description->hid[1] =
984 inst_table[index].handler_id2;
985 insn_description->insn = inst_table[index].insn;
992 insn_description->insn =
cpu->inst_page1_table[ir].insn;
993 insn_description->hid[0] =
994 cpu->inst_page1_table[ir].handler_id1;
995 insn_description->hid[1] =
996 cpu->inst_page1_table[ir].handler_id2;
1002 if (
cpu->overlay_table_size[
i] == 0 ||
1003 (
cpu->inst_overlay_table[
i] ==
NULL))
1006 inst_table =
cpu->inst_overlay_table[
i];
1007 table_size =
cpu->overlay_table_size[
i];
1011 insn_description->hid[0] =
1012 inst_table[index].handler_id1;
1013 insn_description->hid[1] =
1014 inst_table[index].handler_id2;
1015 insn_description->insn = inst_table[index].insn;
1021 insn_description->insn_size = address - base_address;
1025 is_sufficient_code_size(
info, address, insn_description);
1075 op->size = default_size;
1078 static const m680x_reg reg_s_reg_ids[] = {
1083 static const m680x_reg reg_u_reg_ids[] = {
1099 reg_to_reg_ids = ®_u_reg_ids[0];
1103 reg_to_reg_ids = ®_s_reg_ids[0];
1107 CS_ASSERT(0 &&
"Unexpected operand0 register");
1118 for (bit_index = 0; bit_index < 8; ++bit_index) {
1120 add_reg_operand(
info, reg_to_reg_ids[bit_index]);
1124 static const m680x_reg g_tfr_exg_reg_ids[] = {
1139 add_reg_operand(
info, g_tfr_exg_reg_ids[
regs >> 4]);
1140 add_reg_operand(
info, g_tfr_exg_reg_ids[
regs & 0x0f]);
1142 if ((
regs & 0x0f) == 0x05) {
1151 static const m680x_reg g_tfr_exg12_reg0_ids[] = {
1155 static const m680x_reg g_tfr_exg12_reg1_ids[] = {
1170 add_reg_operand(
info, g_tfr_exg12_reg0_ids[(
regs >> 4) & 0x07]);
1171 add_reg_operand(
info, g_tfr_exg12_reg1_ids[
regs & 0x07]);
1182 op->rel.address = address;
1189 read_byte_sign_extended(
info, &
offset, (*address)++);
1214 static const m680x_reg g_rr5_to_reg_ids[] = {
1226 set_operand_size(
info,
op, 1);
1227 op->idx.base_reg = base_reg;
1229 op->idx.inc_dec = inc_dec;
1231 if (inc_dec && post_inc_dec)
1236 op->idx.offset_addr = 0;
1239 op->idx.offset_bits = offset_bits;
1276 set_operand_size(
info,
op, 1);
1277 op->idx.base_reg = g_rr5_to_reg_ids[(post_byte >> 5) & 0x03];
1280 if (!(post_byte & 0x80)) {
1282 if ((post_byte & 0x10) == 0x10)
1283 op->idx.offset = post_byte | 0xfff0;
1285 op->idx.offset = post_byte & 0x0f;
1287 op->idx.offset_addr =
op->idx.offset + *address;
1291 if ((post_byte & 0x10) == 0x10)
1295 switch (post_byte & 0x1f) {
1297 op->idx.inc_dec = 1;
1303 op->idx.inc_dec = 2;
1308 op->idx.inc_dec = -1;
1313 op->idx.inc_dec = -2;
1333 read_byte_sign_extended(
info, &soffset, (*address)++);
1334 op->idx.offset_addr =
offset + *address;
1335 op->idx.offset = soffset;
1341 read_byte_sign_extended(
info, &soffset, (*address)++);
1342 op->idx.offset = soffset;
1351 op->idx.offset_addr =
offset + *address;
1371 op->ext.indirect =
true;
1412 set_operand_size(
info,
op, 1);
1415 if (!(post_byte & 0x20)) {
1417 op->idx.base_reg = g_idx12_to_reg_ids[(post_byte >> 6) & 0x03];
1419 if ((post_byte & 0x10) == 0x10)
1420 op->idx.offset = post_byte | 0xfff0;
1422 op->idx.offset = post_byte & 0x0f;
1424 op->idx.offset_addr =
op->idx.offset + *address;
1428 if ((post_byte & 0xe0) == 0xe0)
1430 g_idx12_to_reg_ids[(post_byte >> 3) & 0x03];
1432 switch (post_byte & 0xe7) {
1436 op->idx.offset = offset8;
1438 if (post_byte & 0x01)
1439 op->idx.offset |= 0xff00;
1444 op->idx.offset_addr =
op->idx.offset + *address;
1458 op->idx.offset_addr =
op->idx.offset + *address;
1465 op->idx.offset_reg =
1466 g_or12_to_reg_ids[post_byte & 0x03];
1477 g_idx12_to_reg_ids[(post_byte >> 6) & 0x03];
1478 op->idx.inc_dec = post_byte & 0x0f;
1480 if (
op->idx.inc_dec & 0x08)
1481 op->idx.inc_dec |= 0xf0;
1483 if (
op->idx.inc_dec >= 0)
1486 if (post_byte & 0x10)
1510 set_operand_size(
info,
op, 1);
1520 set_operand_size(
info,
op, 1);
1533 set_operand_size(
info,
op, 1);
1537 read_byte_sign_extended(
info, &sword, *address);
1547 read_sdword(
info, &
op->imm, *address);
1552 CS_ASSERT(0 &&
"Unexpected immediate byte size");
1555 *address +=
op->size;
1578 op->const_val = (post_byte >> 3) & 0x07;
1583 op->const_val = post_byte & 0x07;
1585 direct_hdlr(MI,
info, address);
1591 static const uint8_t inc_dec_r0[] = {
1594 static const uint8_t inc_dec_r1[] = {
1602 add_indexed_operand(
info, g_tfr_exg_reg_ids[
regs >> 4],
true,
1604 add_indexed_operand(
info, g_tfr_exg_reg_ids[
regs & 0x0f],
true,
1617 op->const_val = (MI->
Opcode & 0x0e) >> 1;
1630 op->const_val = (MI->
Opcode & 0x0e) >> 1;
1631 direct_hdlr(MI,
info, address);
1632 relative8_hdlr(MI,
info, address);
1655 immediate_hdlr(MI,
info, address);
1656 relative8_hdlr(MI,
info, address);
1701 indexed12_hdlr(MI,
info, address);
1719 set_operand_size(
info,
op, 1);
1728 indexed12_hdlr(MI,
info, address);
1732 set_operand_size(
info, op0, 1);
1739 static const m680x_reg index_to_reg_id[] = {
1743 static const m680x_insn index_to_insn_id[] = {
1754 info->insn = index_to_insn_id[(post_byte >> 5) & 0x07];
1757 illegal_hdlr(MI,
info, address);
1762 add_reg_operand(
info, index_to_reg_id[post_byte & 0x07]);
1768 op->rel.offset = (post_byte & 0x10) ? 0xff00 | rel : rel;
1770 op->rel.address = *address +
op->rel.offset;
1818 insn_desc insn_description;
1819 e_access_mode access_mode;
1825 memset(&insn_description, 0,
sizeof(insn_description));
1826 memset(m680x, 0,
sizeof(*m680x));
1827 info->insn_size = 1;
1832 if (insn_description.opcode > 0xff)
1837 info->insn = insn_description.insn;
1841 reg = g_insn_props[
info->insn].reg0;
1852 reg = g_insn_props[
info->insn].reg1;
1865 (g_insn_handler[insn_description.hid[0]])(MI,
info,
1867 (g_insn_handler[insn_description.hid[1]])(MI,
info,
1870 add_insn_group(
detail, g_insn_props[
info->insn].group);
1872 if (g_insn_props[
info->insn].cc_modified &&
1873 (
info->
cpu->insn_cc_not_modified[0] !=
info->insn) &&
1874 (
info->
cpu->insn_cc_not_modified[1] !=
info->insn))
1877 access_mode = g_insn_props[
info->insn].access_mode;
1881 if ((
info->
cpu->insn_cc_not_modified[0] ==
info->insn) ||
1882 (
info->
cpu->insn_cc_not_modified[1] ==
info->insn))
1886 add_operators_access(MI,
info, access_mode);
1888 if (g_insn_props[
info->insn].update_reg_access)
1889 set_changed_regs_read_write_counts(MI,
info);
1891 info->insn_size = insn_description.insn_size;
1893 return info->insn_size;
1899 address = base_address;
1900 illegal_hdlr(MI,
info, &address);
1907 static const uint8_t g_m6800_reg_byte_size[22] = {
1909 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 0, 0
1912 static const uint8_t g_m6805_reg_byte_size[22] = {
1914 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 2, 0, 0
1917 static const uint8_t g_m6808_reg_byte_size[22] = {
1919 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 1, 1, 0, 2, 0, 0, 0, 2, 0, 0
1922 static const uint8_t g_m6801_reg_byte_size[22] = {
1924 0, 1, 1, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 0, 0
1927 static const uint8_t g_m6811_reg_byte_size[22] = {
1929 0, 1, 1, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 2, 0, 0
1932 static const uint8_t g_cpu12_reg_byte_size[22] = {
1934 0, 1, 1, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 2, 2, 2
1937 static const uint8_t g_m6809_reg_byte_size[22] = {
1939 0, 1, 1, 0, 0, 0, 2, 0, 1, 1, 0, 0, 0, 2, 2, 2, 2, 0, 0, 2, 0, 0
1942 static const uint8_t g_hd6309_reg_byte_size[22] = {
1944 0, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 0, 0, 2, 2, 2, 2, 2, 4, 2, 0, 0
1949 static const bool m6809_tfr_reg_valid[16] = {
1950 true,
true,
true,
true,
true,
true,
false,
false,
1951 true,
true,
true,
true,
false,
false,
false,
false,
1960 { 0x00, 0x00, 0x00 },
1969 &g_m6800_inst_page1_table[0],
1970 { &g_m6801_inst_overlay_table[0], &g_hd6301_inst_overlay_table[0] },
1972 ARR_SIZE(g_m6801_inst_overlay_table),
1973 ARR_SIZE(g_hd6301_inst_overlay_table)
1975 { 0x00, 0x00, 0x00 },
1978 &g_m6801_reg_byte_size[0],
1984 &g_m6809_inst_page1_table[0],
1985 { &g_hd6309_inst_overlay_table[0],
NULL },
1986 {
ARR_SIZE(g_hd6309_inst_overlay_table), 0 },
1987 { 0x10, 0x11, 0x00 },
1988 { &g_hd6309_inst_page2_table[0], &g_hd6309_inst_page3_table[0],
NULL },
1990 ARR_SIZE(g_hd6309_inst_page2_table),
1991 ARR_SIZE(g_hd6309_inst_page3_table),
1994 &g_hd6309_reg_byte_size[0],
2000 &g_m6800_inst_page1_table[0],
2003 { 0x00, 0x00, 0x00 },
2006 &g_m6800_reg_byte_size[0],
2012 &g_m6800_inst_page1_table[0],
2013 { &g_m6801_inst_overlay_table[0],
NULL },
2014 {
ARR_SIZE(g_m6801_inst_overlay_table), 0 },
2015 { 0x00, 0x00, 0x00 },
2018 &g_m6801_reg_byte_size[0],
2024 &g_m6805_inst_page1_table[0],
2027 { 0x00, 0x00, 0x00 },
2030 &g_m6805_reg_byte_size[0],
2036 &g_m6805_inst_page1_table[0],
2037 { &g_m6808_inst_overlay_table[0],
NULL },
2038 {
ARR_SIZE(g_m6808_inst_overlay_table), 0 },
2039 { 0x9E, 0x00, 0x00 },
2040 { &g_m6808_inst_page2_table[0],
NULL,
NULL },
2041 {
ARR_SIZE(g_m6808_inst_page2_table), 0, 0 },
2042 &g_m6808_reg_byte_size[0],
2048 &g_m6809_inst_page1_table[0],
2051 { 0x10, 0x11, 0x00 },
2053 &g_m6809_inst_page2_table[0],
2054 &g_m6809_inst_page3_table[0],
2058 ARR_SIZE(g_m6809_inst_page2_table),
2059 ARR_SIZE(g_m6809_inst_page3_table),
2062 &g_m6809_reg_byte_size[0],
2063 &m6809_tfr_reg_valid[0],
2068 &g_m6800_inst_page1_table[0],
2070 &g_m6801_inst_overlay_table[0],
2071 &g_m6811_inst_overlay_table[0]
2074 ARR_SIZE(g_m6801_inst_overlay_table),
2075 ARR_SIZE(g_m6811_inst_overlay_table)
2077 { 0x18, 0x1A, 0xCD },
2079 &g_m6811_inst_page2_table[0],
2080 &g_m6811_inst_page3_table[0],
2081 &g_m6811_inst_page4_table[0]
2084 ARR_SIZE(g_m6811_inst_page2_table),
2085 ARR_SIZE(g_m6811_inst_page3_table),
2088 &g_m6811_reg_byte_size[0],
2094 &g_cpu12_inst_page1_table[0],
2097 { 0x18, 0x00, 0x00 },
2098 { &g_cpu12_inst_page2_table[0],
NULL,
NULL },
2099 {
ARR_SIZE(g_cpu12_inst_page2_table), 0, 0 },
2100 &g_cpu12_reg_byte_size[0],
2106 &g_m6805_inst_page1_table[0],
2108 &g_m6808_inst_overlay_table[0],
2109 &g_hcs08_inst_overlay_table[0]
2112 ARR_SIZE(g_m6808_inst_overlay_table),
2113 ARR_SIZE(g_hcs08_inst_overlay_table)
2115 { 0x9E, 0x00, 0x00 },
2116 { &g_hcs08_inst_page2_table[0],
NULL,
NULL },
2117 {
ARR_SIZE(g_hcs08_inst_page2_table), 0, 0 },
2118 &g_m6808_reg_byte_size[0],
2133 info->size = code_len;
2134 info->offset = address;
2145 unsigned int insn_size = 0;
2185 insn_size = m680x_disassemble(MI,
info, (
uint16_t)address);
2187 if (insn_size == 0) {
2193 if (insn_size > code_len) {
2259 if (HANDLER_ID_ENDING !=
ARR_SIZE(g_insn_handler)) {
2265 if (ACCESS_MODE_ENDING !=
MATRIX_SIZE(g_access_mode_to_access)) {
2275 #ifndef CAPSTONE_DIET
2277 cs_regs regs_read,
uint8_t *regs_read_count,
2278 cs_regs regs_write,
uint8_t *regs_write_count)
2280 if (insn->detail ==
NULL) {
2281 *regs_read_count = 0;
2282 *regs_write_count = 0;
2285 *regs_read_count = insn->detail->regs_read_count;
2286 *regs_write_count = insn->detail->regs_write_count;
2288 memcpy(regs_read, insn->detail->regs_read,
2289 *regs_read_count *
sizeof(insn->detail->regs_read[0]));
2290 memcpy(regs_write, insn->detail->regs_write,
2292 sizeof(insn->detail->regs_write[0]));
cs_err M680X_disassembler_init(cs_struct *ud)
bool M680X_getInstruction(csh ud, const uint8_t *code, size_t code_len, MCInst *instr, uint16_t *size, uint64_t address, void *info)
void M680X_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id)
void M680X_reg_access(const cs_insn *insn, cs_regs regs_read, uint8_t *regs_read_count, cs_regs regs_write, uint8_t *regs_write_count)
static int exists_reg_list(uint16_t *regs, uint8_t count, m68k_reg reg)
static void build_regs_read_write_counts(m68k_info *info)
static void update_am_reg_list(m68k_info *info, cs_m68k_op *op, int write)
static void add_reg_to_rw_list(m68k_info *info, m68k_reg reg, int write)
void MCInst_clear(MCInst *inst)
void MCInst_setOpcode(MCInst *inst, unsigned Op)
static ut32 reg_bits(arm_reg reg)
static mcore_handle handle
RzBinInfo * info(RzBinFile *bf)
@ CS_MODE_M680X_6811
M680X Motorola/Freescale/NXP 68HC11 mode.
@ CS_MODE_M680X_6805
M680X Motorola/Freescale 6805 mode.
@ CS_MODE_M680X_HCS08
M680X Freescale/NXP HCS08 mode.
@ CS_MODE_M680X_6309
M680X Hitachi 6309 mode.
@ CS_MODE_M680X_CPU12
used on M68HC12/HCS12
@ CS_MODE_M680X_6301
M680X Hitachi 6301,6303 mode.
@ CS_MODE_M680X_6801
M680X Motorola 6801,6803 mode.
@ CS_MODE_M680X_6800
M680X Motorola 6800,6802 mode.
@ CS_MODE_M680X_6808
M680X Motorola/Freescale/NXP 68HC08 mode.
@ CS_MODE_M680X_6809
M680X Motorola 6809 mode.
@ CS_AC_INVALID
Uninitialized/invalid access type.
@ CS_AC_READ
Operand read from memory or register.
@ CS_AC_WRITE
Operand write to memory or register.
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
static ut8 read_byte(ParseStatus *b)
static ut32 read_word(ParseStatus *b)
#define offsetof(type, member)
return memset(p, 0, total)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
static static fork const void static count static fd const char static mode const char static pathname const char static path const char static dev const char static group static getpid static getuid void void static data static pause access
#define M680X_IDX_INDIRECT
m680x_insn
M680X instruction IDs.
@ M680X_INS_PULB
M6800/1/2/3.
@ M680X_INS_PSHB
M6800/1/2/3.
@ M680X_INS_WAI
M6800/1/2/3.
@ M680X_INS_PSHX
M6800/1/2/3.
@ M680X_INS_PULA
M6800/1/2/3.
@ M680X_INS_PSHA
M6800/1/2/3.
@ M680X_INS_PULX
M6800/1/2/3.
#define M680X_IDX_NO_COMMA
#define M680X_FIRST_OP_IN_MNEM
m680x_reg
M680X registers and special registers.
@ M680X_REG_DP
M6809/M6309.
@ M680X_REG_B
M6800/1/2/3/9, HD6301/9.
@ M680X_REG_ENDING
<– mark the end of the list of registers
@ M680X_REG_CC
M6800/1/2/3/9, M6301/9.
@ M680X_REG_X
M6800/1/2/3/9, M6301/9.
@ M680X_REG_S
M6809/M6309.
@ M680X_REG_A
M6800/1/2/3/9, HD6301/9.
@ M680X_REG_PC
M6800/1/2/3/9, M6301/9.
@ M680X_REG_Y
M6809/M6309.
@ M680X_REG_D
M6801/3/9, HD6301/9.
@ M680X_REG_U
M6809/M6309.
#define M680X_IDX_POST_INC_DEC
@ M680X_OP_EXTENDED
= Extended addressing operand.
@ M680X_OP_INDEXED
= Indexed addressing operand.
@ M680X_OP_CONSTANT
Used e.g. for a bit index or page number.
@ M680X_OP_IMMEDIATE
= Immediate operand.
@ M680X_OP_REGISTER
= Register operand.
@ M680X_OP_RELATIVE
= Relative addressing operand.
@ M680X_OP_DIRECT
= Direct addressing operand.
#define M680X_OFFSET_BITS_5
#define M680X_SECOND_OP_IN_MNEM
#define M680X_OFFSET_BITS_9
#define M680X_OFFSET_NONE
m680x_group_type
Group of M680X instructions.
@ M680X_GRP_BRAREL
= CS_GRP_BRANCH_RELATIVE
@ M680X_GRP_RET
= CS_GRP_RET
@ M680X_GRP_JUMP
= CS_GRP_INVALID
#define M680X_OFFSET_BITS_16
#define M680X_OFFSET_BITS_8
static int binary_search(unsigned int *A, int key, int imin, int imax)
m680x_reg reg
register value for REG operand
m680x_op_ext ext
Extended address.
int32_t imm
immediate value for IMM operand
The M680X instruction and it's operands.
uint8_t flags
See: M680X instruction flags.
cs_m680x_op operands[M680X_OPERAND_COUNT]
operands for this insn.
uint8_t op_count
number of operands for the instruction or 0
uint16_t address
The absolute address.
insn_item_t * decode_insn(tms320_dasm_t *dasm)
if(dbg->bits==RZ_SYS_BITS_64)