Coverage Report

Created: 2026-08-31 06:58

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/capstonenext/arch/M68K/M68KDisassembler.h
Line
Count
Source
1
/* Capstone Disassembly Engine */
2
/* M68K Backend by Daniel Collin <daniel@collin.com> 2015-2016 */
3
4
#ifndef CS_M68KDISASSEMBLER_H
5
#define CS_M68KDISASSEMBLER_H
6
7
#include "../../MCInst.h"
8
9
/* ======================================================================== */
10
/* ============================ GENERAL DEFINES =========================== */
11
/* ======================================================================== */
12
13
/* Bit Isolation Functions */
14
3.74k
#define BIT_0(A) ((A) & 0x00000001)
15
#define BIT_1(A) ((A) & 0x00000002)
16
#define BIT_2(A) ((A) & 0x00000004)
17
0
#define BIT_3(A) ((A) & 0x00000008)
18
#define BIT_4(A) ((A) & 0x00000010)
19
2.23k
#define BIT_5(A) ((A) & 0x00000020)
20
12.4k
#define BIT_6(A) ((A) & 0x00000040)
21
12.4k
#define BIT_7(A) ((A) & 0x00000080)
22
29.2k
#define BIT_8(A) ((A) & 0x00000100)
23
#define BIT_9(A) ((A) & 0x00000200)
24
1.30k
#define BIT_A(A) ((A) & 0x00000400)
25
28.0k
#define BIT_B(A) ((A) & 0x00000800)
26
#define BIT_C(A) ((A) & 0x00001000)
27
#define BIT_D(A) ((A) & 0x00002000)
28
#define BIT_E(A) ((A) & 0x00004000)
29
30.0k
#define BIT_F(A) ((A) & 0x00008000)
30
#define BIT_10(A) ((A) & 0x00010000)
31
#define BIT_11(A) ((A) & 0x00020000)
32
#define BIT_12(A) ((A) & 0x00040000)
33
#define BIT_13(A) ((A) & 0x00080000)
34
#define BIT_14(A) ((A) & 0x00100000)
35
#define BIT_15(A) ((A) & 0x00200000)
36
#define BIT_16(A) ((A) & 0x00400000)
37
#define BIT_17(A) ((A) & 0x00800000)
38
#define BIT_18(A) ((A) & 0x01000000)
39
#define BIT_19(A) ((A) & 0x02000000)
40
#define BIT_1A(A) ((A) & 0x04000000)
41
#define BIT_1B(A) ((A) & 0x08000000)
42
#define BIT_1C(A) ((A) & 0x10000000)
43
#define BIT_1D(A) ((A) & 0x20000000)
44
#define BIT_1E(A) ((A) & 0x40000000)
45
1.25k
#define BIT_1F(A) ((A) & 0x80000000)
46
47
/* These are the M68K feature masks understood by this disassembler. */
48
#define M68000_ONLY CS_MODE_M68K_000
49
50
#define M68010_ONLY CS_MODE_M68K_010
51
400k
#define M68010_LESS (CS_MODE_M68K_000 | CS_MODE_M68K_010)
52
#define M68010_PLUS \
53
  (CS_MODE_M68K_010 | CS_MODE_M68K_020 | CS_MODE_M68K_030 | \
54
   CS_MODE_M68K_040 | CS_MODE_M68K_060)
55
56
#define M68020_ONLY CS_MODE_M68K_020
57
#define M68020_LESS (CS_MODE_M68K_010 | CS_MODE_M68K_020)
58
#define M68020_PLUS \
59
  (CS_MODE_M68K_020 | CS_MODE_M68K_030 | CS_MODE_M68K_040 | \
60
   CS_MODE_M68K_060)
61
62
#define M68030_ONLY CS_MODE_M68K_030
63
#define M68030_LESS (CS_MODE_M68K_010 | CS_MODE_M68K_020 | CS_MODE_M68K_030)
64
#define M68030_PLUS (CS_MODE_M68K_030 | CS_MODE_M68K_040 | CS_MODE_M68K_060)
65
66
580
#define M68040_PLUS (CS_MODE_M68K_040 | CS_MODE_M68K_060)
67
68
typedef uint32_t m68k_feature_mask;
69
70
/* Extension word formats */
71
#define EXT_8BIT_DISPLACEMENT(A) ((A) & 0xff)
72
29.2k
#define EXT_FULL(A) BIT_8(A)
73
#define EXT_EFFECTIVE_ZERO(A) (((A) & 0xe4) == 0xc4 || ((A) & 0xe2) == 0xc0)
74
12.4k
#define EXT_BASE_REGISTER_PRESENT(A) (!BIT_7(A))
75
12.4k
#define EXT_INDEX_REGISTER_PRESENT(A) (!BIT_6(A))
76
23.8k
#define EXT_INDEX_REGISTER(A) (((A) >> 12) & 7)
77
#define EXT_INDEX_PRE_POST(A) (EXT_INDEX_REGISTER_PRESENT(A) && (A) & 3)
78
#define EXT_INDEX_PRE(A) \
79
  (EXT_INDEX_REGISTER_PRESENT(A) && ((A) & 7) < 4 && ((A) & 7) != 0)
80
#define EXT_INDEX_POST(A) (EXT_INDEX_REGISTER_PRESENT(A) && ((A) & 7) > 4)
81
38.6k
#define EXT_INDEX_SCALE(A) (((A) >> 9) & 3)
82
23.8k
#define EXT_INDEX_LONG(A) BIT_B(A)
83
23.8k
#define EXT_INDEX_AR(A) BIT_F(A)
84
37.2k
#define EXT_BASE_DISPLACEMENT_PRESENT(A) (((A) & 0x30) > 0x10)
85
#define EXT_BASE_DISPLACEMENT_WORD(A) (((A) & 0x30) == 0x20)
86
14.1k
#define EXT_BASE_DISPLACEMENT_LONG(A) (((A) & 0x30) == 0x30)
87
/* Outer displacement is present when I/IS[1:0] (bits 1-0) is 2 (word) or 3 (long).
88
 * This applies regardless of the IS bit (bit 6): when index is suppressed,
89
 * I/IS values 5-7 mirror 1-3 (just indirect instead of postindexed).
90
 * The old check ((A) & 0x47) < 0x44 incorrectly excluded IS=1 cases
91
 * (I/IS=6,7) which DO have outer displacements per the M68K spec.
92
 */
93
37.2k
#define EXT_OUTER_DISPLACEMENT_PRESENT(A) (((A) & 3) > 1)
94
#define EXT_OUTER_DISPLACEMENT_WORD(A) (((A) & 3) == 2)
95
9.87k
#define EXT_OUTER_DISPLACEMENT_LONG(A) (((A) & 3) == 3)
96
97
#define IS_BITSET(val, b) ((val) & (1 << (b)))
98
25.4k
#define BITFIELD_MASK(sb, eb) (((1 << ((sb) + 1)) - 1) & (~((1 << (eb)) - 1)))
99
25.4k
#define BITFIELD(val, sb, eb) ((BITFIELD_MASK(sb, eb) & (val)) >> (eb))
100
101
/* Bitfield offset/width encoding.
102
 * Public decode macros (M68K_BF_*) live in <capstone/m68k.h>.
103
 * Internal aliases kept for brevity within arch code. */
104
#define M68K_BITFIELD_REG_FLAG M68K_BF_REG_FLAG
105
#define M68K_BITFIELD_IS_REG(v) M68K_BF_IS_REG(v)
106
#define M68K_BITFIELD_REG_NUM(v) M68K_BF_REG_NUM(v)
107
2.20k
#define M68K_BITFIELD_ENCODE_REG(regnum) (((regnum) & 7) | M68K_BF_REG_FLAG)
108
109
/* ── Coprocessor ID (CpID) ───────────────────────────────────────────
110
 * Bits 11:9 of the F-line instruction word select the coprocessor.   */
111
33.1k
#define M68K_CPID(info) (((info)->ir >> 9) & 7)
112
113
25.9k
#define M68K_CPID_MMU 0 /* PMMU (68030/68851)                     */
114
19.6k
#define M68K_CPID_FPU 1 /* FPU  (68881/68882/internal)            */
115
2.82k
#define M68K_CPID_CACHE 2 /* Cache ops -- cinvl/cpushl on 68040+    */
116
117
/* ── IR bit-field helpers ────────────────────────────────────────────
118
 * Extract commonly-used fields from the first instruction word.      */
119
120
/* Coprocessor conditional predicate field (bits 5:0).
121
 *
122
 * Reference: Motorola MC68881/MC68882 Floating-Point Coprocessor User's
123
 * Manual, first edition (1987), sections 4.7.2-4.7.3, Tables 4-20 and
124
 * 4-22, pages 4-129 through 4-134. A reference copy is available at:
125
 * https://www.bitsavers.org/components/motorola/68000/68020/MC68881_MC68882_Floating-Point_Coprocessor_Users_Manual_1ed_1987.pdf
126
 */
127
4.33k
#define M68K_COPROCESSOR_CONDITION_MASK 0x3f
128
129
static inline uint32_t m68k_coprocessor_condition(uint32_t word)
130
4.33k
{
131
4.33k
  return word & M68K_COPROCESSOR_CONDITION_MASK;
132
4.33k
}
Unexecuted instantiation: M68KModule.c:m68k_coprocessor_condition
M68KDisassembler.c:m68k_coprocessor_condition
Line
Count
Source
130
4.33k
{
131
4.33k
  return word & M68K_COPROCESSOR_CONDITION_MASK;
132
4.33k
}
Unexecuted instantiation: M68KInstPrinter.c:m68k_coprocessor_condition
133
134
/* 4-bit condition selector used by Bcc/DBcc/Scc/TRAPcc. */
135
24.2k
#define M68K_IR_CONDITION_NIBBLE(info) (((info)->ir >> 8) & 0xf)
136
0
#define M68K_CONDITION_FALSE 1
137
138
/* cinv/cpush: select cpush(1) vs cinv(0) -- bit 5 of IR. */
139
136
#define M68K_IR_IS_CPUSH(info) (((info)->ir >> 5) & 1)
140
141
/* cinv/cpush: cache scope -- bits 4:3 of IR (0=invalid,1=line,2=page,3=all). */
142
2.57k
#define M68K_IR_CACHE_SCOPE(info) (((info)->ir >> 3) & 3)
143
144
/* cinv/cpush: cache selector -- bits 7:6 of IR (DC/IC/BC). */
145
2.26k
#define M68K_IR_CACHE_SEL(info) (((info)->ir >> 6) & 3)
146
147
/* ── FPU extension-word bit-field helpers ────────────────────────────
148
 * The FPU command word is the 16-bit extension following the F-line. */
149
150
/* R/M bit (bit 14): 1 = effective-address operand, 0 = FP-register operand. */
151
9.11k
#define M68K_FEXT_RM(ext) (((ext) >> 14) & 1)
152
153
/* Type / command class (bits 15:13). */
154
18.2k
#define M68K_FEXT_TYPE(ext) (((ext) >> 13) & 7)
155
18.2k
#define M68K_FEXT_TYPE_GENERAL_MAX 0x1
156
18.2k
#define M68K_FEXT_TYPE_FMOVE_TO_EA 0x3
157
292
#define M68K_FEXT_TYPE_FPCR_FROM_EA 0x4
158
795
#define M68K_FEXT_TYPE_FPCR_TO_EA 0x5
159
1.21k
#define M68K_FEXT_TYPE_FMOVEM_FROM_EA 0x6
160
2.74k
#define M68K_FEXT_TYPE_FMOVEM_TO_EA 0x7
161
162
/* Source/format specifier (bits 12:10). */
163
9.11k
#define M68K_FEXT_SRC(ext) (((ext) >> 10) & 7)
164
165
/* Destination FP register (bits 9:7). */
166
9.35k
#define M68K_FEXT_DST(ext) (((ext) >> 7) & 7)
167
168
/* Opmode (bits 5:0) -- FPU operation selector. */
169
9.35k
#define M68K_FEXT_OPMODE(ext) ((ext) & 0x3f)
170
171
/* Single/double precision flag (bit 6) -- 68040+ only. */
172
12.3k
#define M68K_FEXT_SD_FLAG(ext) (((ext) >> 6) & 1)
173
174
/* FMOVECR signature: bits 15:10 == 0x17 (010111b). */
175
2.23k
#define M68K_FEXT_IS_FMOVECR(ext) (BITFIELD((ext), 15, 10) == 0x17)
176
177
/* Register-select field for FMOVE to/from FPCR/FPSR/FPIAR (bits 12:10). */
178
795
#define M68K_FEXT_REGSEL(ext) (((ext) >> 10) & 7)
179
180
/* Direction bit for FMOVE FPCR (bit 13): 0 = ea->fpcr, 1 = fpcr->ea. */
181
6.77k
#define M68K_FEXT_DIR(ext) (((ext) >> 13) & 1)
182
183
/* FMOVEM register-list encoding.
184
 *
185
 * Bits 12:11 select static/dynamic and predecrement versus
186
 * postincrement-or-control forms. A static list occupies bits 7:0; a dynamic
187
 * list has the reserved-bit format 0rrr0000, with Dn in bits 6:4.
188
 *
189
 * Reference: Motorola MC68881/MC68882 Floating-Point Coprocessor User's
190
 * Manual, first edition (1987), section 4.7.1.6, Table 4-18, pages 4-126
191
 * through 4-128:
192
 * https://www.bitsavers.org/components/motorola/68000/68020/MC68881_MC68882_Floating-Point_Coprocessor_Users_Manual_1ed_1987.pdf
193
 */
194
typedef enum {
195
  M68K_FMOVEM_MODE_STATIC_PREDECREMENT = 0,
196
  M68K_FMOVEM_MODE_DYNAMIC_PREDECREMENT = 1,
197
  M68K_FMOVEM_MODE_STATIC_POSTINCREMENT_OR_CONTROL = 2,
198
  M68K_FMOVEM_MODE_DYNAMIC_POSTINCREMENT_OR_CONTROL = 3,
199
} m68k_fmovem_mode;
200
201
static inline m68k_fmovem_mode m68k_fmovem_get_mode(uint32_t extension)
202
5.49k
{
203
5.49k
  return (m68k_fmovem_mode)BITFIELD(extension, 12, 11);
204
5.49k
}
Unexecuted instantiation: M68KModule.c:m68k_fmovem_get_mode
M68KDisassembler.c:m68k_fmovem_get_mode
Line
Count
Source
202
5.49k
{
203
5.49k
  return (m68k_fmovem_mode)BITFIELD(extension, 12, 11);
204
5.49k
}
Unexecuted instantiation: M68KInstPrinter.c:m68k_fmovem_get_mode
205
206
static inline uint32_t m68k_fmovem_register_list(uint32_t extension)
207
2.74k
{
208
2.74k
  return BITFIELD(extension, 7, 0);
209
2.74k
}
Unexecuted instantiation: M68KModule.c:m68k_fmovem_register_list
M68KDisassembler.c:m68k_fmovem_register_list
Line
Count
Source
207
2.74k
{
208
2.74k
  return BITFIELD(extension, 7, 0);
209
2.74k
}
Unexecuted instantiation: M68KInstPrinter.c:m68k_fmovem_register_list
210
211
static inline bool
212
m68k_fmovem_dynamic_reserved_bits_are_zero(uint32_t extension)
213
1.05k
{
214
1.05k
  return BITFIELD(extension, 7, 7) == 0 && BITFIELD(extension, 3, 0) == 0;
215
1.05k
}
Unexecuted instantiation: M68KModule.c:m68k_fmovem_dynamic_reserved_bits_are_zero
M68KDisassembler.c:m68k_fmovem_dynamic_reserved_bits_are_zero
Line
Count
Source
213
1.05k
{
214
1.05k
  return BITFIELD(extension, 7, 7) == 0 && BITFIELD(extension, 3, 0) == 0;
215
1.05k
}
Unexecuted instantiation: M68KInstPrinter.c:m68k_fmovem_dynamic_reserved_bits_are_zero
216
217
static inline uint32_t m68k_fmovem_dynamic_register(uint32_t extension)
218
1.03k
{
219
1.03k
  return BITFIELD(extension, 6, 4);
220
1.03k
}
Unexecuted instantiation: M68KModule.c:m68k_fmovem_dynamic_register
M68KDisassembler.c:m68k_fmovem_dynamic_register
Line
Count
Source
218
1.03k
{
219
1.03k
  return BITFIELD(extension, 6, 4);
220
1.03k
}
Unexecuted instantiation: M68KInstPrinter.c:m68k_fmovem_dynamic_register
221
222
/* ── FPU condition-code mask ─────────────────────────────────────────
223
 * The FPU defines predicates 0xxxxx; 1xxxxx encodings are reserved
224
 * aliases that evaluate identically. Use the low five bits to index the
225
 * contiguous FBcc/FDBcc/FScc/FTRAPcc opcode ranges. See the manual
226
 * reference above.                                                   */
227
2.73k
#define M68K_FPU_CONDITION_INDEX_MASK 0x1f
228
229
static inline uint32_t m68k_fpu_condition_index(uint32_t word)
230
2.73k
{
231
2.73k
  return word & M68K_FPU_CONDITION_INDEX_MASK;
232
2.73k
}
Unexecuted instantiation: M68KModule.c:m68k_fpu_condition_index
M68KDisassembler.c:m68k_fpu_condition_index
Line
Count
Source
230
2.73k
{
231
2.73k
  return word & M68K_FPU_CONDITION_INDEX_MASK;
232
2.73k
}
Unexecuted instantiation: M68KInstPrinter.c:m68k_fpu_condition_index
233
234
/* Maximum valid condition codes per coprocessor. */
235
2.55k
#define M68K_PMMU_MAX_COND 16
236
237
/* ── FPU source-format constants (bits 12:10 of ext word) ───────────*/
238
188
#define M68K_FPSRC_LONG 0x00 /* .l  -- 32-bit integer            */
239
819
#define M68K_FPSRC_SINGLE 0x01 /* .s  -- 32-bit IEEE single        */
240
508
#define M68K_FPSRC_EXTENDED 0x02 /* .x  -- 96-bit extended real      */
241
143
#define M68K_FPSRC_PACKED 0x03 /* .p  -- 96-bit packed decimal     */
242
95
#define M68K_FPSRC_WORD 0x04 /* .w  -- 16-bit integer            */
243
364
#define M68K_FPSRC_DOUBLE 0x05 /* .d  -- 64-bit IEEE double        */
244
585
#define M68K_FPSRC_BYTE 0x06 /* .b  -- 8-bit integer             */
245
246
/* FMOVE register-to-memory packed-decimal destination encodings. */
247
3.67k
#define M68K_FPDST_PACKED_STATIC 0x03
248
1.81k
#define M68K_FPDST_PACKED_DYNAMIC 0x07
249
250
/* ── FPU special raw opmodes (before SD-flag masking) ───────────────
251
 * FSSQRT/FDSQRT have raw 7-bit opmodes 0x41/0x45.  After the 6-bit
252
 * truncation (& 0x3f) they become 0x01/0x05 with the SD flag set.   */
253
2.03k
#define M68K_FPOP_FSSQRT_RAW 0x01 /* 0x41 & 0x3f */
254
1.96k
#define M68K_FPOP_FDSQRT_RAW 0x05 /* 0x45 & 0x3f */
255
256
/* ── Feature guard macros ────────────────────────────────────────────
257
 * These reference the `info` parameter available at each call site.
258
 * They early-return from the calling function on guard mismatch.     */
259
260
#define LIMIT_FEATURE(info, FEATURES) \
261
91.6k
  do { \
262
91.6k
    if (!m68k_has_feature(info, FEATURES)) { \
263
48.7k
      d68000_invalid(info); \
264
48.7k
      return; \
265
48.7k
    } \
266
91.6k
  } while (0)
267
268
/* Like LIMIT_FEATURE but also reverses the instruction word consumption,
269
 * so the invalid instruction produces size=0 (not decoded) instead of size=2.
270
 * Use for handlers that replace d68000_invalid in the dispatch table. */
271
#define LIMIT_FEATURE_UNDECODED(info, FEATURES) \
272
5
  do { \
273
5
    if (!m68k_has_feature(info, FEATURES)) { \
274
5
      info->pc -= 2; \
275
5
      d68000_invalid(info); \
276
5
      return; \
277
5
    } \
278
5
  } while (0)
279
280
/* Like LIMIT_FEATURE but also rejects a feature subset.  CPU32 implies 68020
281
 * but lacks some 68020 instructions (CAS, CAS2, CHK.L, PACK, UNPK). */
282
#define LIMIT_FEATURE_EXCLUDING(info, FEATURES, EXCLUDED_FEATURES) \
283
15.2k
  do { \
284
15.2k
    if (!m68k_has_feature(info, FEATURES) || \
285
15.2k
        m68k_has_feature(info, EXCLUDED_FEATURES)) { \
286
5.54k
      d68000_invalid(info); \
287
5.54k
      return; \
288
5.54k
    } \
289
15.2k
  } while (0)
290
291
/* Require CpID == FPU.  Rejects all other coprocessor IDs.
292
 * Used by cpDBcc, cpScc, cpTRAPcc handlers. */
293
#define REQUIRE_CPID_FPU(info) \
294
5.75k
  do { \
295
5.75k
    if (M68K_CPID(info) != M68K_CPID_FPU) { \
296
3.21k
      d68000_invalid(info); \
297
3.21k
      return; \
298
3.21k
    } \
299
5.75k
  } while (0)
300
301
/* ── EA / immediate convenience aliases ─────────────────────────────
302
 * Shorthand wrappers around the sized get_ea_mode_str / get_imm_str
303
 * functions.  These expand at the call site where 'info' is in scope. */
304
305
/* Fake a split interface */
306
#define get_ea_mode_str_8(instruction) get_ea_mode_str(instruction, 0)
307
#define get_ea_mode_str_16(instruction) get_ea_mode_str(instruction, 1)
308
#define get_ea_mode_str_32(instruction) get_ea_mode_str(instruction, 2)
309
310
#define get_imm_str_s8() get_imm_str_s(0)
311
#define get_imm_str_s16() get_imm_str_s(1)
312
#define get_imm_str_s32() get_imm_str_s(2)
313
314
#define get_imm_str_u8() get_imm_str_u(0)
315
#define get_imm_str_u16() get_imm_str_u(1)
316
#define get_imm_str_u32() get_imm_str_u(2)
317
318
/* ── Operand access shorthands ──────────────────────────────────────
319
 * Quick access to the operand array and instruction size via `info`. */
320
#define IOPS(I) (&info->extension.operands[(I)])
321
6.16k
#define ISIZE (info->extension.op_size.cpu_size)
322
323
/* ======================================================================== */
324
/* ============================ INTERNAL TYPES ============================ */
325
/* ======================================================================== */
326
327
/* Private, For internal use only */
328
typedef struct m68k_info {
329
  const uint8_t *code;
330
  size_t code_len;
331
  uint64_t baseAddress;
332
  MCInst *inst;
333
  uint32_t pc; /* program counter */
334
  uint32_t ir; /* instruction register */
335
  m68k_feature_mask features;
336
  uint32_t address_mask; /* Address mask to simulate address lines */
337
  cs_m68k extension;
338
  uint16_t regs_read
339
    [MAX_IMPL_R_REGS]; // list of implicit registers read by this insn
340
  uint8_t regs_read_count; // number of implicit registers read by this insn
341
  uint16_t regs_write
342
    [MAX_IMPL_W_REGS]; // list of implicit registers modified by this insn
343
  uint8_t regs_write_count; // number of implicit registers modified by this insn
344
  uint8_t groups[MAX_NUM_GROUPS];
345
  uint8_t groups_count;
346
} m68k_info;
347
348
static inline bool m68k_has_feature(const m68k_info *info,
349
            m68k_feature_mask features)
350
525k
{
351
525k
  m68k_feature_mask available = info->features;
352
353
525k
  if (available & CS_MODE_M68K_CPU32)
354
0
    available |= CS_MODE_M68K_020;
355
525k
  if (available & CS_MODE_M68K_CF_ISA_A_PLUS)
356
0
    available |= CS_MODE_M68K_CF_ISA_A;
357
525k
  if (available & CS_MODE_M68K_CF_ISA_B)
358
0
    available |= CS_MODE_M68K_CF_ISA_A | CS_MODE_M68K_CF_ISA_A_PLUS;
359
525k
  if (available & CS_MODE_M68K_CF_ISA_C)
360
0
    available |= CS_MODE_M68K_CF_ISA_A;
361
525k
  if (available & CS_MODE_M68K_CF_EMAC)
362
0
    available |= CS_MODE_M68K_CF_MAC;
363
525k
  if (available & CS_MODE_M68K_CF_EMAC_B)
364
0
    available |= CS_MODE_M68K_CF_EMAC | CS_MODE_M68K_CF_MAC;
365
366
525k
  return (available & features) != 0;
367
525k
}
Unexecuted instantiation: M68KModule.c:m68k_has_feature
M68KDisassembler.c:m68k_has_feature
Line
Count
Source
350
525k
{
351
525k
  m68k_feature_mask available = info->features;
352
353
525k
  if (available & CS_MODE_M68K_CPU32)
354
0
    available |= CS_MODE_M68K_020;
355
525k
  if (available & CS_MODE_M68K_CF_ISA_A_PLUS)
356
0
    available |= CS_MODE_M68K_CF_ISA_A;
357
525k
  if (available & CS_MODE_M68K_CF_ISA_B)
358
0
    available |= CS_MODE_M68K_CF_ISA_A | CS_MODE_M68K_CF_ISA_A_PLUS;
359
525k
  if (available & CS_MODE_M68K_CF_ISA_C)
360
0
    available |= CS_MODE_M68K_CF_ISA_A;
361
525k
  if (available & CS_MODE_M68K_CF_EMAC)
362
0
    available |= CS_MODE_M68K_CF_MAC;
363
525k
  if (available & CS_MODE_M68K_CF_EMAC_B)
364
0
    available |= CS_MODE_M68K_CF_EMAC | CS_MODE_M68K_CF_MAC;
365
366
525k
  return (available & features) != 0;
367
525k
}
Unexecuted instantiation: M68KInstPrinter.c:m68k_has_feature
368
369
bool M68K_getInstruction(csh ud, const uint8_t *code, size_t code_len,
370
       MCInst *instr, uint16_t *size, uint64_t address,
371
       void *info);
372
373
#endif