41 #include "../../cs_priv.h"
42 #include "../../utils.h"
44 #include "../../MCInst.h"
45 #include "../../MCInstrDesc.h"
46 #include "../../MCRegisterInfo.h"
55 #define BIT_0(A) ((A) & 0x00000001)
56 #define BIT_1(A) ((A) & 0x00000002)
57 #define BIT_2(A) ((A) & 0x00000004)
58 #define BIT_3(A) ((A) & 0x00000008)
59 #define BIT_4(A) ((A) & 0x00000010)
60 #define BIT_5(A) ((A) & 0x00000020)
61 #define BIT_6(A) ((A) & 0x00000040)
62 #define BIT_7(A) ((A) & 0x00000080)
63 #define BIT_8(A) ((A) & 0x00000100)
64 #define BIT_9(A) ((A) & 0x00000200)
65 #define BIT_A(A) ((A) & 0x00000400)
66 #define BIT_B(A) ((A) & 0x00000800)
67 #define BIT_C(A) ((A) & 0x00001000)
68 #define BIT_D(A) ((A) & 0x00002000)
69 #define BIT_E(A) ((A) & 0x00004000)
70 #define BIT_F(A) ((A) & 0x00008000)
71 #define BIT_10(A) ((A) & 0x00010000)
72 #define BIT_11(A) ((A) & 0x00020000)
73 #define BIT_12(A) ((A) & 0x00040000)
74 #define BIT_13(A) ((A) & 0x00080000)
75 #define BIT_14(A) ((A) & 0x00100000)
76 #define BIT_15(A) ((A) & 0x00200000)
77 #define BIT_16(A) ((A) & 0x00400000)
78 #define BIT_17(A) ((A) & 0x00800000)
79 #define BIT_18(A) ((A) & 0x01000000)
80 #define BIT_19(A) ((A) & 0x02000000)
81 #define BIT_1A(A) ((A) & 0x04000000)
82 #define BIT_1B(A) ((A) & 0x08000000)
83 #define BIT_1C(A) ((A) & 0x10000000)
84 #define BIT_1D(A) ((A) & 0x20000000)
85 #define BIT_1E(A) ((A) & 0x40000000)
86 #define BIT_1F(A) ((A) & 0x80000000)
95 #define M68000_ONLY TYPE_68000
97 #define M68010_ONLY TYPE_68010
98 #define M68010_LESS (TYPE_68000 | TYPE_68010)
99 #define M68010_PLUS (TYPE_68010 | TYPE_68020 | TYPE_68030 | TYPE_68040)
101 #define M68020_ONLY TYPE_68020
102 #define M68020_LESS (TYPE_68010 | TYPE_68020)
103 #define M68020_PLUS (TYPE_68020 | TYPE_68030 | TYPE_68040)
105 #define M68030_ONLY TYPE_68030
106 #define M68030_LESS (TYPE_68010 | TYPE_68020 | TYPE_68030)
107 #define M68030_PLUS (TYPE_68030 | TYPE_68040)
109 #define M68040_PLUS TYPE_68040
122 #define EXT_8BIT_DISPLACEMENT(A) ((A)&0xff)
123 #define EXT_FULL(A) BIT_8(A)
124 #define EXT_EFFECTIVE_ZERO(A) (((A)&0xe4) == 0xc4 || ((A)&0xe2) == 0xc0)
125 #define EXT_BASE_REGISTER_PRESENT(A) (!BIT_7(A))
126 #define EXT_INDEX_REGISTER_PRESENT(A) (!BIT_6(A))
127 #define EXT_INDEX_REGISTER(A) (((A)>>12)&7)
128 #define EXT_INDEX_PRE_POST(A) (EXT_INDEX_PRESENT(A) && (A)&3)
129 #define EXT_INDEX_PRE(A) (EXT_INDEX_PRESENT(A) && ((A)&7) < 4 && ((A)&7) != 0)
130 #define EXT_INDEX_POST(A) (EXT_INDEX_PRESENT(A) && ((A)&7) > 4)
131 #define EXT_INDEX_SCALE(A) (((A)>>9)&3)
132 #define EXT_INDEX_LONG(A) BIT_B(A)
133 #define EXT_INDEX_AR(A) BIT_F(A)
134 #define EXT_BASE_DISPLACEMENT_PRESENT(A) (((A)&0x30) > 0x10)
135 #define EXT_BASE_DISPLACEMENT_WORD(A) (((A)&0x30) == 0x20)
136 #define EXT_BASE_DISPLACEMENT_LONG(A) (((A)&0x30) == 0x30)
137 #define EXT_OUTER_DISPLACEMENT_PRESENT(A) (((A)&3) > 1 && ((A)&0x47) < 0x44)
138 #define EXT_OUTER_DISPLACEMENT_WORD(A) (((A)&3) == 2 && ((A)&0x47) < 0x44)
139 #define EXT_OUTER_DISPLACEMENT_LONG(A) (((A)&3) == 3 && ((A)&0x47) < 0x44)
141 #define IS_BITSET(val,b) ((val) & (1 << (b)))
142 #define BITFIELD_MASK(sb,eb) (((1 << ((sb) + 1))-1) & (~((1 << (eb))-1)))
143 #define BITFIELD(val,sb,eb) ((BITFIELD_MASK(sb,eb) & (val)) >> (eb))
151 return (
v0 << 8) |
v1;
160 return (
v0 << 24) | (
v1 << 16) | (v2 << 8) | v3;
173 return (
v0 << 56) | (
v1 << 48) | (v2 << 40) | (v3 << 32) | (v4 << 24) | (v5 << 16) | (
v6 << 8) |
v7;
198 return 0xaaaaaaaaaaaaaaaaLL;
231 32, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
232 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
267 #define LIMIT_CPU_TYPES(info, ALLOWED_CPU_TYPES) \
269 if (!(info->type & ALLOWED_CPU_TYPES)) { \
270 d68000_invalid(info); \
286 #define get_ea_mode_str_8(instruction) get_ea_mode_str(instruction, 0)
287 #define get_ea_mode_str_16(instruction) get_ea_mode_str(instruction, 1)
288 #define get_ea_mode_str_32(instruction) get_ea_mode_str(instruction, 2)
290 #define get_imm_str_s8() get_imm_str_s(0)
291 #define get_imm_str_s16() get_imm_str_s(1)
292 #define get_imm_str_s32() get_imm_str_s(2)
294 #define get_imm_str_u8() get_imm_str_u(0)
295 #define get_imm_str_u16() get_imm_str_u(1)
296 #define get_imm_str_u32() get_imm_str_u(2)
355 preindex = (extension & 7) > 0 && (extension & 7) < 4;
356 postindex = (extension & 7) > 4;
360 }
else if (postindex) {
386 op->mem.disp = (
int8_t)(extension & 0xff);
402 case 0x00:
case 0x01:
case 0x02:
case 0x03:
case 0x04:
case 0x05:
case 0x06:
case 0x07:
409 case 0x08:
case 0x09:
case 0x0a:
case 0x0b:
case 0x0c:
case 0x0d:
case 0x0e:
case 0x0f:
416 case 0x10:
case 0x11:
case 0x12:
case 0x13:
case 0x14:
case 0x15:
case 0x16:
case 0x17:
422 case 0x18:
case 0x19:
case 0x1a:
case 0x1b:
case 0x1c:
case 0x1d:
case 0x1e:
case 0x1f:
428 case 0x20:
case 0x21:
case 0x22:
case 0x23:
case 0x24:
case 0x25:
case 0x26:
case 0x27:
434 case 0x28:
case 0x29:
case 0x2a:
case 0x2b:
case 0x2c:
case 0x2d:
case 0x2e:
case 0x2f:
441 case 0x30:
case 0x31:
case 0x32:
case 0x33:
case 0x34:
case 0x35:
case 0x36:
case 0x37:
515 op0 = &
ext->operands[0];
516 op1 = &
ext->operands[1];
540 op0 = &
ext->operands[0];
541 op1 = &
ext->operands[1];
561 op0 = &
ext->operands[0];
562 op1 = &
ext->operands[1];
563 op2 = &
ext->operands[2];
585 op0 = &
ext->operands[0];
586 op1 = &
ext->operands[1];
601 op0 = &
ext->operands[0];
602 op1 = &
ext->operands[1];
617 op0 = &
ext->operands[0];
618 op1 = &
ext->operands[1];
634 op0 = &
ext->operands[0];
635 op1 = &
ext->operands[1];
651 op0 = &
ext->operands[0];
652 op1 = &
ext->operands[1];
653 op2 = &
ext->operands[2];
681 op0 = &
ext->operands[0];
682 op1 = &
ext->operands[1];
696 op0 = &
ext->operands[0];
697 op1 = &
ext->operands[1];
709 op0 = &
ext->operands[0];
710 op1 = &
ext->operands[1];
725 op0 = &
ext->operands[0];
726 op1 = &
ext->operands[1];
741 op = &
ext->operands[0];
745 op->br_disp.disp = displacement;
746 op->br_disp.disp_size =
size;
757 op = &
ext->operands[0];
782 op0 = &
ext->operands[0];
783 op1 = &
ext->operands[1];
810 op0 = &
ext->operands[0];
811 op1 = &
ext->operands[1];
812 op2 = &
ext->operands[2];
832 op_ea = &
ext->operands[0];
833 op1 = &
ext->operands[1];
835 if (
BIT_B(extension))
836 offset = (extension >> 6) & 7;
838 offset = (extension >> 6) & 31;
840 if (
BIT_5(extension))
841 width = extension & 7;
863 op = &
ext->operands[0];
874 for (
v >>= 1;
v;
v >>= 1) {
888 for (
v >>= 1;
v;
v >>= 1) {
904 op0 = &
ext->operands[0];
905 op1 = &
ext->operands[1];
922 op0 = &
ext->operands[0];
923 op1 = &
ext->operands[1];
938 op = &
ext->operands[0];
970 op0 = &
ext->operands[0];
971 op1 = &
ext->operands[1];
972 op2 = &
ext->operands[2];
986 reg_0 = (extension >> 28) & 7;
987 reg_1 = (extension >> 12) & 7;
1003 if (
BIT_B(extension))
1008 op0 = &
ext->operands[0];
1009 op1 = &
ext->operands[1];
1023 for (
i = 0;
i < 2; ++
i) {
1025 const int d = data[
i];
1026 const int m = modes[
i];
1031 op->address_mode =
m;
1034 op->address_mode =
m;
1046 op0 = &
ext->operands[0];
1047 op1 = &
ext->operands[1];
1063 switch ((
info->ir >> 3) & 3) {
1083 op0 = &
ext->operands[0];
1084 op1 = &
ext->operands[1];
1088 op0->
imm = (
info->ir >> 6) & 3;
1101 op0 = &
ext->operands[0];
1102 op1 = &
ext->operands[1];
1118 op0 = &
ext->operands[0];
1119 op1 = &
ext->operands[1];
1136 op0 = &
ext->operands[0];
1137 op1 = &
ext->operands[1];
1139 if (
BIT_B(extension)) {
1530 temp =
ext->operands[0];
1531 ext->operands[0] =
ext->operands[1];
1532 ext->operands[1] = temp;
1777 op->br_disp.disp = displacement;
1778 op->br_disp.disp_size =
size;
1788 info->inst->Opcode += (
info->ir & 0x2f);
1791 op0 = &
ext->operands[0];
1809 info->inst->Opcode += (
info->ir & 0x2f);
1812 op0 = &
ext->operands[0];
1833 info->inst->Opcode += (ext1 & 0x2f);
1836 op0 = &
ext->operands[0];
1837 op1 = &
ext->operands[1];
1852 int regsel = (extension >> 10) & 0x7;
1853 int dir = (extension >> 13) & 0x1;
1858 op_ea = &
ext->operands[1];
1870 else if (regsel & 2)
1872 else if (regsel & 1)
1880 int dir = (extension >> 13) & 0x1;
1881 int mode = (extension >> 11) & 0x3;
1882 uint32_t reglist = extension & 0xff;
1885 op_reglist = &
ext->operands[0];
1886 op_ea = &
ext->operands[1];
1922 bool supports_single_op;
1924 int rm,
src,
dst, opmode;
1929 supports_single_op =
true;
1933 rm = (next >> 14) & 0x1;
1934 src = (next >> 10) & 0x7;
1935 dst = (next >> 7) & 0x7;
1936 opmode = next & 0x3f;
1945 op0 = &
ext->operands[0];
1946 op1 = &
ext->operands[1];
1950 op0->
imm = next & 0x3f;
1959 switch ((next >> 13) & 0x7) {
1975 if ((next >> 6) & 1)
2026 if ((next >> 6) & 1) {
2027 if ((next >> 2) & 1)
2028 info->inst->Opcode += 2;
2030 info->inst->Opcode += 1;
2037 ext->op_size.cpu_size = 0;
2040 if ((opmode == 0x00) && ((next >> 13) & 0x1) != 0) {
2041 op0 = &
ext->operands[1];
2042 op1 = &
ext->operands[0];
2044 op0 = &
ext->operands[0];
2045 op1 = &
ext->operands[1];
2048 if (rm == 0 && supports_single_op &&
src ==
dst) {
2139 info->inst->Opcode += (extension1 & 0x2f);
2156 info->inst->Opcode += (extension1 & 0x2f);
2158 op0 = &
ext->operands[0];
2162 op0->
imm = extension2;
2179 info->inst->Opcode += (extension1 & 0x2f);
2181 op0 = &
ext->operands[0];
2185 op0->
imm = extension2;
2227 if (
BIT_B((extension)))
2232 op0 = &
ext->operands[0];
2233 op1 = &
ext->operands[1];
2237 reg_0 = extension & 7;
2238 reg_1 = (extension >> 12) & 7;
2245 if ((reg_0 == reg_1) || !
BIT_A(extension)) {
2302 op0 = &
ext->operands[0];
2303 op1 = &
ext->operands[1];
2318 op0 = &
ext->operands[0];
2319 op1 = &
ext->operands[1];
2475 op0 = &
ext->operands[0];
2476 op1 = &
ext->operands[1];
2494 op0 = &
ext->operands[0];
2495 op1 = &
ext->operands[1];
2509 op0 = &
ext->operands[0];
2510 op1 = &
ext->operands[1];
2524 op0 = &
ext->operands[0];
2525 op1 = &
ext->operands[1];
2539 op0 = &
ext->operands[0];
2540 op1 = &
ext->operands[1];
2555 op0 = &
ext->operands[0];
2556 op1 = &
ext->operands[1];
2581 op0 = &
ext->operands[0];
2582 op1 = &
ext->operands[1];
2584 switch (extension & 0xfff) {
2688 op0 = &
ext->operands[0];
2689 op1 = &
ext->operands[1];
2772 if (
BIT_B((extension)))
2777 op0 = &
ext->operands[0];
2778 op1 = &
ext->operands[1];
2782 reg_0 = extension & 7;
2783 reg_1 = (extension >> 12) & 7;
2790 if (!
BIT_A(extension)) {
3093 op = &
ext->operands[0];
3258 info->extension.op_count = 0;
3364 op = &
ext->operands[0];
3390 if ( (
i->word2_mask && ((word_check &
i->word2_mask) !=
i->word2_match)) ||
3422 info->regs_write_count++;
3430 info->regs_read_count++;
3436 switch (
op->address_mode) {
3474 for (
i = 0;
i < 8; ++
i) {
3475 if (
bits & (1 <<
i)) {
3491 switch ((
int)
op->type) {
3515 if (!
info->extension.op_count)
3518 if (
info->extension.op_count == 1) {
3525 for (
i = 1;
i <
info->extension.op_count; ++
i)
3536 info->address_mask = 0xffffffff;
3541 info->address_mask = 0x00ffffff;
3545 info->address_mask = 0x00ffffff;
3549 info->address_mask = 0x00ffffff;
3553 info->address_mask = 0xffffffff;
3557 info->address_mask = 0xffffffff;
3561 info->address_mask = 0xffffffff;
3564 info->address_mask = 0;
3622 info->groups_count = 0;
3623 info->regs_read_count = 0;
3624 info->regs_write_count = 0;
3626 info->code_len = code_len;
3627 info->baseAddress = address;
3656 if (
s > (
int)code_len)
static void d68020_cmpi_pcdi_32(m68k_info *info)
static uint32_t g_5bit_data_table[32]
static void d68000_cmpi_8(m68k_info *info)
#define EXT_INDEX_REGISTER_PRESENT(A)
static void d68020_bfclr(m68k_info *info)
static void d68000_lsl_ea(m68k_info *info)
static void update_bits_range(m68k_info *info, m68k_reg reg_start, uint8_t bits, int write)
static void d68000_rts(m68k_info *info)
static void d68000_asr_r_32(m68k_info *info)
static int exists_reg_list(uint16_t *regs, uint8_t count, m68k_reg reg)
static void build_dbcc(m68k_info *info, int size, int displacement)
static void d68020_bfset(m68k_info *info)
static void d68000_bchg_s(m68k_info *info)
static void d68020_cas_8(m68k_info *info)
static void d68000_lsl_s_8(m68k_info *info)
static void d68000_subi_32(m68k_info *info)
static void d68000_btst_r(m68k_info *info)
static void d68000_roxl_r_16(m68k_info *info)
static void d68000_sub_re_32(m68k_info *info)
static void get_ea_mode_op(m68k_info *info, cs_m68k_op *op, uint32_t instruction, uint32_t size)
static void d68000_or_re_16(m68k_info *info)
static uint8_t reverse_bits_8(uint32_t v)
static void d68000_roxl_s_32(m68k_info *info)
static void d68000_addi_8(m68k_info *info)
static void d68000_movem_er_16(m68k_info *info)
static void d68000_ror_ea(m68k_info *info)
static void build_imm_special_reg(m68k_info *info, int opcode, int imm, int size, m68k_reg reg)
static void d68000_bset_s(m68k_info *info)
static void d68020_chk_32(m68k_info *info)
static void update_op_reg_list(m68k_info *info, cs_m68k_op *op, int write)
static void d68000_roxl_s_16(m68k_info *info)
static void d68040_move16_al_pi(m68k_info *info)
static void d68020_tst_i_16(m68k_info *info)
static void d68000_subi_16(m68k_info *info)
static void d68000_bra_16(m68k_info *info)
static void d68000_rol_r_8(m68k_info *info)
static void d68000_and_re_8(m68k_info *info)
static void make_cpbcc_operand(cs_m68k_op *op, int size, int displacement)
static void build_relative_branch(m68k_info *info, int opcode, int size, int displacement)
static void d68000_move_16(m68k_info *info)
static void d68000_subx_mm_16(m68k_info *info)
static void d68000_adda_32(m68k_info *info)
static void d68000_ror_r_8(m68k_info *info)
static void d68000_asr_ea(m68k_info *info)
static void d68020_cmpi_pcix_32(m68k_info *info)
static void d68000_eori_to_ccr(m68k_info *info)
static void d68000_add_re_16(m68k_info *info)
static void d68000_andi_32(m68k_info *info)
static void d68000_roxr_ea(m68k_info *info)
static void d68020_rtm(m68k_info *info)
static void d68000_ext_16(m68k_info *info)
static void d68000_roxr_s_8(m68k_info *info)
static void d68000_rol_s_8(m68k_info *info)
static void d68000_asl_r_16(m68k_info *info)
static void d68000_rol_r_32(m68k_info *info)
static void d68000_bset_r(m68k_info *info)
static void d68000_abcd_mm(m68k_info *info)
static void build_re_1(m68k_info *info, int opcode, uint8_t size)
static void d68000_lsl_r_8(m68k_info *info)
static void build_illegal(m68k_info *info, int data)
static void d68020_trapcc_16(m68k_info *info)
static void d68010_rtd(m68k_info *info)
static void build_ea_a(m68k_info *info, int opcode, uint8_t size)
static void d68020_tst_pcdi_32(m68k_info *info)
static void d68020_chk2_cmp2_16(m68k_info *info)
static void d68000_clr_16(m68k_info *info)
static void build_chk2_cmp2(m68k_info *info, int size)
static void d68000_addx_rr_8(m68k_info *info)
static void build_trap(m68k_info *info, int size, int immediate)
static void d68000_move_to_sr(m68k_info *info)
static void d68000_sub_er_32(m68k_info *info)
static void d68020_cpdbcc(m68k_info *info)
static void build_regs_read_write_counts(m68k_info *info)
static void d68000_cmpm_16(m68k_info *info)
static void build_movep_re(m68k_info *info, int size)
static void build_movep_er(m68k_info *info, int size)
static void d68000_sbcd_mm(m68k_info *info)
static void d68000_ext_32(m68k_info *info)
static void d68000_rtr(m68k_info *info)
static void d68000_move_fr_usp(m68k_info *info)
static void d68000_tst_8(m68k_info *info)
static void d68000_bsr_16(m68k_info *info)
static void build_r(m68k_info *info, int opcode, uint8_t size)
static unsigned int peek_imm_8(const m68k_info *info)
static void d68000_or_re_8(m68k_info *info)
static void build_movem_re(m68k_info *info, int opcode, int size)
static void m68k_setup_internals(m68k_info *info, MCInst *inst, unsigned int pc, unsigned int cpu_type)
bool M68K_getInstruction(csh ud, const uint8_t *code, size_t code_len, MCInst *instr, uint16_t *size, uint64_t address, void *inst_info)
static void d68000_ror_r_16(m68k_info *info)
static void d68000_illegal(m68k_info *info)
static void d68020_tst_i_8(m68k_info *info)
static void d68000_roxr_s_32(m68k_info *info)
static void d68000_movem_pd_32(m68k_info *info)
#define EXT_BASE_DISPLACEMENT_LONG(A)
static void d68000_roxr_s_16(m68k_info *info)
static void d68000_stop(m68k_info *info)
static void d68020_cas_32(m68k_info *info)
static void d68000_andi_to_ccr(m68k_info *info)
static void d68010_move_fr_ccr(m68k_info *info)
static void d68010_movec(m68k_info *info)
static void d68020_cpsave(m68k_info *info)
static void d68000_roxl_r_8(m68k_info *info)
static void d68000_eor_8(m68k_info *info)
static void d68000_lsr_s_32(m68k_info *info)
static void d68020_bcc_32(m68k_info *info)
static void d68000_lsr_r_8(m68k_info *info)
static void d68020_trapcc_0(m68k_info *info)
static void d68000_ror_r_32(m68k_info *info)
static void d68000_roxr_r_16(m68k_info *info)
static void d68000_asr_s_32(m68k_info *info)
static void d68000_move_to_usp(m68k_info *info)
static void d68000_cmpa_32(m68k_info *info)
static void d68000_eori_16(m68k_info *info)
static void d68000_or_er_8(m68k_info *info)
static void d68000_sub_er_16(m68k_info *info)
static void d68000_cmp_32(m68k_info *info)
static void build_d_d_ea(m68k_info *info, int opcode, int size)
static void fmove_fpcr(m68k_info *info, uint32_t extension)
static void d68000_abcd_rr(m68k_info *info)
static void d68000_moveq(m68k_info *info)
static void set_insn_group(m68k_info *info, m68k_group_type group)
static void d68000_divu(m68k_info *info)
static void d68000_bsr_8(m68k_info *info)
static void build_3bit_ea(m68k_info *info, int opcode, int size)
#define EXT_8BIT_DISPLACEMENT(A)
static void build_re_gen_1(m68k_info *info, bool isDreg, int opcode, uint8_t size)
static void d68000_addx_rr_32(m68k_info *info)
static void build_cas2(m68k_info *info, int size)
static void d68020_cptrapcc_0(m68k_info *info)
static void d68000_add_er_8(m68k_info *info)
static void d68000_or_er_32(m68k_info *info)
static void d68010_moves_32(m68k_info *info)
static void d68000_mulu(m68k_info *info)
static void d68020_chk2_cmp2_8(m68k_info *info)
static void d68000_eori_8(m68k_info *info)
static void d68000_eori_32(m68k_info *info)
static void get_with_index_address_mode(m68k_info *info, cs_m68k_op *op, uint32_t instruction, uint32_t size, bool is_pc)
static void d68000_add_re_8(m68k_info *info)
static void d68000_lsr_s_16(m68k_info *info)
static void d68000_addq_8(m68k_info *info)
static uint16_t reverse_bits(uint32_t v)
static void d68020_extb_32(m68k_info *info)
static void d68000_lsr_ea(m68k_info *info)
static void d68000_cmpa_16(m68k_info *info)
static void d68000_lsl_s_32(m68k_info *info)
static void build_bitfield_ins(m68k_info *info, int opcode, int has_d_arg)
static void d68000_dbcc(m68k_info *info)
static void d68000_rte(m68k_info *info)
static void d68000_scc(m68k_info *info)
static void d68000_invalid(m68k_info *info)
static void d68000_negx_32(m68k_info *info)
static void d68020_link_32(m68k_info *info)
static void d68000_suba_16(m68k_info *info)
static void d68000_nop(m68k_info *info)
static void d68000_bclr_r(m68k_info *info)
static void d68000_asr_s_8(m68k_info *info)
static void d68020_cpbcc_32(m68k_info *info)
static unsigned int m68k_disassemble(m68k_info *info, uint64_t pc)
static void d68000_ror_s_8(m68k_info *info)
#define EXT_INDEX_LONG(A)
static void d68040_move16_pi_pi(m68k_info *info)
static void d68000_jsr(m68k_info *info)
static void d68000_rol_s_16(m68k_info *info)
static void d68020_bra_32(m68k_info *info)
static void d68000_exg_aa(m68k_info *info)
static void d68000_andi_to_sr(m68k_info *info)
static void d68000_subq_16(m68k_info *info)
static void d68000_negx_8(m68k_info *info)
static m68k_insn s_trap_lut[]
static int make_int_16(int value)
static void d68020_chk2_cmp2_32(m68k_info *info)
static void d68020_cas2_32(m68k_info *info)
static void d68020_tst_a_32(m68k_info *info)
static void update_reg_list_regbits(m68k_info *info, cs_m68k_op *op, int write)
static void d68020_callm(m68k_info *info)
static void d68000_ori_to_sr(m68k_info *info)
static void d68000_clr_32(m68k_info *info)
static void d68010_moves_8(m68k_info *info)
static void d68020_tst_i_32(m68k_info *info)
static void d68000_neg_32(m68k_info *info)
static void d68000_adda_16(m68k_info *info)
static void d68000_lsr_s_8(m68k_info *info)
static void d68000_ror_s_16(m68k_info *info)
static void build_dbxx(m68k_info *info, int opcode, int size, int displacement)
static void d68000_exg_da(m68k_info *info)
static void d68000_link_16(m68k_info *info)
static void d68000_cmpi_32(m68k_info *info)
static void d68020_bsr_32(m68k_info *info)
static void d68000_bclr_s(m68k_info *info)
static void d68000_chk_16(m68k_info *info)
static int instruction_is_valid(m68k_info *info, const unsigned int word_check)
static void d68000_tst_32(m68k_info *info)
static void d68010_moves_16(m68k_info *info)
static void d68000_ori_8(m68k_info *info)
static void d68000_bra_8(m68k_info *info)
static void d68000_movem_er_32(m68k_info *info)
static void d68000_eor_32(m68k_info *info)
static void d68000_or_re_32(m68k_info *info)
static void d68000_tas(m68k_info *info)
static void build_3bit_d(m68k_info *info, int opcode, int size)
static void d68020_tst_pcix_16(m68k_info *info)
static void build_moves(m68k_info *info, int size)
static cs_m68k * build_init_op(m68k_info *info, int opcode, int count, int size)
static void d68000_asl_ea(m68k_info *info)
static void d68020_trapcc_32(m68k_info *info)
static void d68020_mull(m68k_info *info)
static void d68000_bcc_16(m68k_info *info)
static void d68000_cmpi_16(m68k_info *info)
static void d68020_bfins(m68k_info *info)
static void d68000_lsr_r_16(m68k_info *info)
static void build_bcc(m68k_info *info, int size, int displacement)
static void fmovem(m68k_info *info, uint32_t extension)
static void d68000_addi_16(m68k_info *info)
static void d68020_divl(m68k_info *info)
static void build_ea_ea(m68k_info *info, int opcode, int size)
static void d68020_bftst(m68k_info *info)
static void d68000_subi_8(m68k_info *info)
static void d68020_cprestore(m68k_info *info)
static void d68000_addi_32(m68k_info *info)
static void d68000_neg_8(m68k_info *info)
static void d68000_asl_s_32(m68k_info *info)
static unsigned long long read_imm_64(m68k_info *info)
static void d68000_subx_rr_8(m68k_info *info)
static void d68000_addx_rr_16(m68k_info *info)
static void d68000_add_er_16(m68k_info *info)
static void d68020_tst_a_16(m68k_info *info)
static m68k_insn s_dbcc_lut[]
static void d68000_ori_32(m68k_info *info)
static void d68020_pack_rr(m68k_info *info)
static unsigned int read_imm_8(m68k_info *info)
static void d68020_cmpi_pcdi_16(m68k_info *info)
static unsigned int m68k_read_safe_32(const m68k_info *info, const uint64_t address)
#define EXT_OUTER_DISPLACEMENT_PRESENT(A)
static unsigned int read_imm_32(m68k_info *info)
static void d68000_movep_er_16(m68k_info *info)
static void d68000_1010(m68k_info *info)
static void d68000_reset(m68k_info *info)
static void d68000_cmp_8(m68k_info *info)
static void d68000_not_8(m68k_info *info)
static void d68000_add_re_32(m68k_info *info)
static void d68020_cpscc(m68k_info *info)
static void d68040_move16_pi_al(m68k_info *info)
static void d68000_and_re_32(m68k_info *info)
static void update_am_reg_list(m68k_info *info, cs_m68k_op *op, int write)
static void d68000_bchg_r(m68k_info *info)
static void d68020_bfchg(m68k_info *info)
static void d68000_lsl_r_32(m68k_info *info)
static void d68000_andi_16(m68k_info *info)
static void add_reg_to_rw_list(m68k_info *info, m68k_reg reg, int write)
#define EXT_BASE_REGISTER_PRESENT(A)
static void d68000_and_er_16(m68k_info *info)
static int make_int_8(int value)
static unsigned long long peek_imm_64(const m68k_info *info)
static void d68020_cptrapcc_16(m68k_info *info)
static void d68000_roxl_ea(m68k_info *info)
static void d68000_not_32(m68k_info *info)
static void d68000_eori_to_sr(m68k_info *info)
static void d68000_roxr_r_32(m68k_info *info)
static void d68000_cmpm_8(m68k_info *info)
static void d68000_asl_s_8(m68k_info *info)
static void d68000_negx_16(m68k_info *info)
static unsigned int read_imm_16(m68k_info *info)
static void d68000_lsl_r_16(m68k_info *info)
static void d68020_bfextu(m68k_info *info)
static void build_mm(m68k_info *info, int opcode, uint8_t size, int imm)
static void d68000_bcc_8(m68k_info *info)
static void d68000_addq_32(m68k_info *info)
static unsigned int m68k_read_safe_16(const m68k_info *info, const uint64_t address)
static void d68010_bkpt(m68k_info *info)
static void d68000_subx_rr_32(m68k_info *info)
static void build_pi_pi(m68k_info *info, int opcode, int size)
#define BITFIELD(val, sb, eb)
static void d68000_unlk(m68k_info *info)
static void d68000_lsr_r_32(m68k_info *info)
static void d68000_pea(m68k_info *info)
static void d68000_nbcd(m68k_info *info)
static void d68000_roxl_r_32(m68k_info *info)
static void d68000_movem_re_16(m68k_info *info)
static void d68020_bfexts(m68k_info *info)
static void build_d(m68k_info *info, int opcode, int size)
static void build_ea(m68k_info *info, int opcode, uint8_t size)
static void d68000_rol_r_16(m68k_info *info)
static void d68000_addx_mm_16(m68k_info *info)
static void d68000_ror_s_32(m68k_info *info)
static void d68040_move16_al_ai(m68k_info *info)
static void build_rr(m68k_info *info, int opcode, uint8_t size, int imm)
static void d68000_dbra(m68k_info *info)
static void d68000_movem_re_32(m68k_info *info)
static void d68000_andi_8(m68k_info *info)
static void d68040_cinv(m68k_info *info)
static void d68000_swap(m68k_info *info)
static void d68000_clr_8(m68k_info *info)
static instruction_struct g_instruction_table[0x10000]
static void d68000_1111(m68k_info *info)
static void d68000_muls(m68k_info *info)
static void build_imm_ea(m68k_info *info, int opcode, uint8_t size, int imm)
static void d68000_addx_mm_32(m68k_info *info)
static void d68000_movep_re_16(m68k_info *info)
#define EXT_BASE_DISPLACEMENT_PRESENT(A)
static void d68000_move_8(m68k_info *info)
static void d68000_subx_mm_32(m68k_info *info)
static void d68000_add_er_32(m68k_info *info)
static void d68000_asl_s_16(m68k_info *info)
static void d68020_cmpi_pcdi_8(m68k_info *info)
#define EXT_INDEX_REGISTER(A)
static void d68000_rol_s_32(m68k_info *info)
static void d68000_roxr_r_8(m68k_info *info)
static void d68000_rol_ea(m68k_info *info)
static void d68000_lsl_s_16(m68k_info *info)
static void build_invalid(m68k_info *info, int data)
static void d68020_tst_pcdi_16(m68k_info *info)
static void d68000_sbcd_rr(m68k_info *info)
static void d68000_subx_mm_8(m68k_info *info)
static void d68000_jmp(m68k_info *info)
static void d68000_and_er_32(m68k_info *info)
static void d68000_suba_32(m68k_info *info)
static void d68000_asl_r_8(m68k_info *info)
#define EXT_INDEX_SCALE(A)
static void d68000_and_er_8(m68k_info *info)
#define LIMIT_CPU_TYPES(info, ALLOWED_CPU_TYPES)
static void d68040_move16_ai_al(m68k_info *info)
static void d68020_cmpi_pcix_8(m68k_info *info)
static void d68000_asl_r_32(m68k_info *info)
static void d68000_movem_pd_16(m68k_info *info)
static void build_er_1(m68k_info *info, int opcode, uint8_t size)
static void d68020_cpgen(m68k_info *info)
static void d68000_subq_32(m68k_info *info)
static void d68000_btst_s(m68k_info *info)
static uint32_t g_3bit_qdata_table[8]
static void d68000_exg_dd(m68k_info *info)
static unsigned int m68k_read_disassembler_32(const m68k_info *info, const uint64_t addr)
static void d68000_cmp_16(m68k_info *info)
static void d68000_addx_mm_8(m68k_info *info)
static void d68000_sub_er_8(m68k_info *info)
static void d68000_addq_16(m68k_info *info)
static m68k_insn s_scc_lut[]
static void d68000_asr_s_16(m68k_info *info)
static void d68020_tst_pcix_8(m68k_info *info)
static void d68000_asr_r_16(m68k_info *info)
static void build_imm(m68k_info *info, int opcode, int data)
static void d68020_cas_16(m68k_info *info)
static uint64_t m68k_read_disassembler_64(const m68k_info *info, const uint64_t addr)
static void d68000_movea_16(m68k_info *info)
static void d68000_asr_r_8(m68k_info *info)
static void d68000_move_32(m68k_info *info)
static void build_movem_er(m68k_info *info, int opcode, int size)
static void d68000_move_to_ccr(m68k_info *info)
static void d68000_or_er_16(m68k_info *info)
static unsigned int peek_imm_16(const m68k_info *info)
static void d68000_movea_32(m68k_info *info)
static void d68000_trapv(m68k_info *info)
static void d68020_bfffo(m68k_info *info)
static void d68000_subq_8(m68k_info *info)
static void d68020_pack_mm(m68k_info *info)
static void d68000_not_16(m68k_info *info)
static void build_cpush_cinv(m68k_info *info, int op_offset)
static void d68000_and_re_16(m68k_info *info)
static void d68000_ori_16(m68k_info *info)
static void d68020_unpk_mm(m68k_info *info)
static void d68020_unpk_rr(m68k_info *info)
static void build_er_gen_1(m68k_info *info, bool isDreg, int opcode, uint8_t size)
static void d68000_eor_16(m68k_info *info)
static void d68020_cas2_16(m68k_info *info)
static m68k_insn s_branch_lut[]
static void d68020_cpbcc_16(m68k_info *info)
static void build_link(m68k_info *info, int disp, int size)
static void d68000_move_fr_sr(m68k_info *info)
static void d68000_neg_16(m68k_info *info)
static void d68000_tst_16(m68k_info *info)
static void d68000_movep_re_32(m68k_info *info)
static void d68000_divs(m68k_info *info)
static void d68020_cptrapcc_32(m68k_info *info)
static void d68000_trap(m68k_info *info)
static unsigned int m68k_read_disassembler_16(const m68k_info *info, const uint64_t addr)
static void d68000_ori_to_ccr(m68k_info *info)
static void d68040_cpush(m68k_info *info)
static void d68020_tst_pcix_32(m68k_info *info)
static void d68000_sub_re_16(m68k_info *info)
static uint64_t m68k_read_safe_64(const m68k_info *info, const uint64_t address)
static void d68000_movep_er_32(m68k_info *info)
#define EXT_OUTER_DISPLACEMENT_LONG(A)
static void d68000_lea(m68k_info *info)
static void d68000_subx_rr_16(m68k_info *info)
static void d68020_tst_pcdi_8(m68k_info *info)
static unsigned int peek_imm_32(const m68k_info *info)
static void build_absolute_jump_with_immediate(m68k_info *info, int opcode, int size, int immediate)
static void d68000_sub_re_8(m68k_info *info)
static void d68020_cmpi_pcix_16(m68k_info *info)
static void build_move16(m68k_info *info, int data[2], int modes[2])
static void d68000_roxl_s_8(m68k_info *info)
static void d68000_cmpm_32(m68k_info *info)
void M68K_printInst(MCInst *MI, SStream *O, void *PrinterInfo)
void MCInst_setOpcode(MCInst *inst, unsigned Op)
void SStream_Init(SStream *ss)
static mcore_handle handle
RzBinInfo * info(RzBinFile *bf)
int bits(struct state *s, int need)
@ CS_MODE_M68K_040
M68K 68040 mode.
@ CS_MODE_M68K_060
M68K 68060 mode.
@ CS_MODE_M68K_010
M68K 68010 mode.
@ CS_MODE_M68K_020
M68K 68020 mode.
@ CS_MODE_M68K_030
M68K 68030 mode.
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
#define offsetof(type, member)
return memset(p, 0, total)
#define M68K_OPERAND_COUNT
@ M68K_CPU_SIZE_LONG
4 bytes in size
@ M68K_CPU_SIZE_WORD
2 bytes in size
@ M68K_CPU_SIZE_BYTE
1 byte in size
@ M68K_AM_NONE
No address mode.
@ M68K_AM_MEMI_POST_INDEX
Memory indirect - Postindex.
@ M68K_AM_PC_MEMI_PRE_INDEX
Program Counter Memory Indirect - Preindexed.
@ M68K_AM_REG_DIRECT_ADDR
Register Direct - Address.
@ M68K_AM_REGI_ADDR
Register Indirect - Address.
@ M68K_AM_IMMEDIATE
Immediate value.
@ M68K_AM_REGI_ADDR_POST_INC
Register Indirect - Address with Postincrement.
@ M68K_AM_ABSOLUTE_DATA_SHORT
Absolute Data Addressing - Short.
@ M68K_AM_AREGI_INDEX_8_BIT_DISP
Address Register Indirect With Index- 8-bit displacement.
@ M68K_AM_PCI_INDEX_BASE_DISP
Program Counter Indirect with Index - with Base Displacement.
@ M68K_AM_PCI_DISP
Program Counter Indirect - with Displacement.
@ M68K_AM_REGI_ADDR_PRE_DEC
Register Indirect - Address with Predecrement.
@ M68K_AM_MEMI_PRE_INDEX
Memory indirect - Preindex.
@ M68K_AM_ABSOLUTE_DATA_LONG
Absolute Data Addressing - Long.
@ M68K_AM_PC_MEMI_POST_INDEX
Program Counter Memory Indirect - Postindexed.
@ M68K_AM_REG_DIRECT_DATA
Register Direct - Data.
@ M68K_AM_AREGI_INDEX_BASE_DISP
Address Register Indirect With Index- Base displacement.
@ M68K_AM_BRANCH_DISPLACEMENT
Address as displacement from (PC+2) used by branches.
@ M68K_AM_PCI_INDEX_8_BIT_DISP
Program Counter Indirect with Index - with 8-Bit Displacement.
@ M68K_AM_REGI_ADDR_DISP
Register Indirect - Address with Displacement.
m68k_group_type
Group of M68K instructions.
@ M68K_GRP_RET
= CS_GRP_RET
@ M68K_GRP_IRET
= CS_GRP_IRET
@ M68K_GRP_JUMP
= CS_GRP_JUMP
@ M68K_GRP_BRANCH_RELATIVE
= CS_GRP_BRANCH_RELATIVE
@ M68K_OP_REG_PAIR
Register pair in the same op (upper 4 bits for first reg, lower for second)
@ M68K_OP_BR_DISP
Branch displacement.
@ 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_BITS
Register bits move.
@ M68K_OP_REG
= CS_OP_REG (Register operand).
@ M68K_OP_MEM
= CS_OP_MEM (Memory operand).
@ M68K_FPU_SIZE_SINGLE
4 byte in size (single float)
@ M68K_FPU_SIZE_DOUBLE
8 byte in size (double)
@ M68K_FPU_SIZE_EXTENDED
12 byte in size (extended real format)
m68k_insn
M68K instruction.
m68k_reg
M68K registers and special registers.
@ M68K_OP_BR_DISP_SIZE_LONG
signed 32-bit displacement
@ M68K_OP_BR_DISP_SIZE_WORD
signed 16-bit displacement
static void special(struct parse *, int)
m68k_op_br_disp br_disp
data when operand is a branch displacement
uint32_t register_bits
register bits for movem etc. (always in d0-d7, a0-a7, fp0 - fp7 order)
m68k_op_mem mem
data when operand is targeting memory
m68k_reg reg
register value for REG operand
m68k_address_mode address_mode
M68K addressing mode for this op.
uint64_t imm
immediate value for IMM operand
cs_m68k_op_reg_pair reg_pair
register pair in one operand
The M68K instruction and it's operands.
void(* instruction)(m68k_info *info)
int32_t disp
displacement value
uint8_t disp_size
Size from m68k_op_br_disp_size type above.
uint8_t width
used for bf* instructions
uint8_t offset
used for bf* instructions
uint8_t bitfield
set to true if the two values below should be used
int16_t disp
displacement value
m68k_reg base_reg
base register (or M68K_REG_INVALID if irrelevant)
if(dbg->bits==RZ_SYS_BITS_64)