Rizin
unix-like reverse engineering framework and cli tools
M68KInstPrinter.c
Go to the documentation of this file.
1 /* Capstone Disassembly Engine */
2 /* M68K Backend by Daniel Collin <daniel@collin.com> 2015-2016 */
3 
4 #ifdef _MSC_VER
5 // Disable security warnings for strcat & sprintf
6 #ifndef _CRT_SECURE_NO_WARNINGS
7 #define _CRT_SECURE_NO_WARNINGS
8 #endif
9 
10 //Banned API Usage : strcat / sprintf is a Banned API as listed in dontuse.h for
11 //security purposes.
12 #pragma warning(disable:28719)
13 #endif
14 
15 #include <stdio.h> // DEBUG
16 #include <stdlib.h>
17 #include <string.h>
18 
19 #include "M68KInstPrinter.h"
20 
21 #include "M68KDisassembler.h"
22 
23 #include "../../cs_priv.h"
24 #include "../../utils.h"
25 
26 #include "../../MCInst.h"
27 #include "../../MCInstrDesc.h"
28 #include "../../MCRegisterInfo.h"
29 
30 #ifndef CAPSTONE_DIET
31 static const char* s_spacing = " ";
32 
33 static const char* s_reg_names[] = {
34  "invalid",
35  "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7",
36  "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7",
37  "fp0", "fp1", "fp2", "fp3", "fp4", "fp5", "fp6", "fp7",
38  "pc",
39  "sr", "ccr", "sfc", "dfc", "usp", "vbr", "cacr",
40  "caar", "msp", "isp", "tc", "itt0", "itt1", "dtt0",
41  "dtt1", "mmusr", "urp", "srp",
42 
43  "fpcr", "fpsr", "fpiar",
44 };
45 
46 static const char* s_instruction_names[] = {
47  "invalid",
48  "abcd", "add", "adda", "addi", "addq", "addx", "and", "andi", "asl", "asr", "bhs", "blo", "bhi", "bls", "bcc", "bcs", "bne", "beq", "bvc",
49  "bvs", "bpl", "bmi", "bge", "blt", "bgt", "ble", "bra", "bsr", "bchg", "bclr", "bset", "btst", "bfchg", "bfclr", "bfexts", "bfextu", "bfffo", "bfins",
50  "bfset", "bftst", "bkpt", "callm", "cas", "cas2", "chk", "chk2", "clr", "cmp", "cmpa", "cmpi", "cmpm", "cmp2", "cinvl", "cinvp", "cinva", "cpushl", "cpushp",
51  "cpusha", "dbt", "dbf", "dbhi", "dbls", "dbcc", "dbcs", "dbne", "dbeq", "dbvc", "dbvs", "dbpl", "dbmi", "dbge", "dblt", "dbgt", "dble", "dbra",
52  "divs", "divsl", "divu", "divul", "eor", "eori", "exg", "ext", "extb", "fabs", "fsabs", "fdabs", "facos", "fadd", "fsadd", "fdadd", "fasin",
53  "fatan", "fatanh", "fbf", "fbeq", "fbogt", "fboge", "fbolt", "fbole", "fbogl", "fbor", "fbun", "fbueq", "fbugt", "fbuge", "fbult", "fbule", "fbne", "fbt",
54  "fbsf", "fbseq", "fbgt", "fbge", "fblt", "fble", "fbgl", "fbgle", "fbngle", "fbngl", "fbnle", "fbnlt", "fbnge", "fbngt", "fbsne", "fbst", "fcmp", "fcos",
55  "fcosh", "fdbf", "fdbeq", "fdbogt", "fdboge", "fdbolt", "fdbole", "fdbogl", "fdbor", "fdbun", "fdbueq", "fdbugt", "fdbuge", "fdbult", "fdbule", "fdbne",
56  "fdbt", "fdbsf", "fdbseq", "fdbgt", "fdbge", "fdblt", "fdble", "fdbgl", "fdbgle", "fdbngle", "fdbngl", "fdbnle", "fdbnlt", "fdbnge", "fdbngt", "fdbsne",
57  "fdbst", "fdiv", "fsdiv", "fddiv", "fetox", "fetoxm1", "fgetexp", "fgetman", "fint", "fintrz", "flog10", "flog2", "flogn", "flognp1", "fmod", "fmove",
58  "fsmove", "fdmove", "fmovecr", "fmovem", "fmul", "fsmul", "fdmul", "fneg", "fsneg", "fdneg", "fnop", "frem", "frestore", "fsave", "fscale", "fsgldiv",
59  "fsglmul", "fsin", "fsincos", "fsinh", "fsqrt", "fssqrt", "fdsqrt", "fsf", "fseq", "fsogt", "fsoge", "fsolt", "fsole", "fsogl", "fsor", "fsun", "fsueq",
60  "fsugt", "fsuge", "fsult", "fsule", "fsne", "fst", "fssf", "fsseq", "fsgt", "fsge", "fslt", "fsle", "fsgl", "fsgle", "fsngle",
61  "fsngl", "fsnle", "fsnlt", "fsnge", "fsngt", "fssne", "fsst", "fsub", "fssub", "fdsub", "ftan", "ftanh", "ftentox", "ftrapf", "ftrapeq", "ftrapogt",
62  "ftrapoge", "ftrapolt", "ftrapole", "ftrapogl", "ftrapor", "ftrapun", "ftrapueq", "ftrapugt", "ftrapuge", "ftrapult", "ftrapule", "ftrapne", "ftrapt",
63  "ftrapsf", "ftrapseq", "ftrapgt", "ftrapge", "ftraplt", "ftraple", "ftrapgl", "ftrapgle", "ftrapngle", "ftrapngl", "ftrapnle", "ftrapnlt", "ftrapnge",
64  "ftrapngt", "ftrapsne", "ftrapst", "ftst", "ftwotox", "halt", "illegal", "jmp", "jsr", "lea", "link", "lpstop", "lsl", "lsr", "move", "movea", "movec",
65  "movem", "movep", "moveq", "moves", "move16", "muls", "mulu", "nbcd", "neg", "negx", "nop", "not", "or", "ori", "pack", "pea", "pflush", "pflusha",
66  "pflushan", "pflushn", "ploadr", "ploadw", "plpar", "plpaw", "pmove", "pmovefd", "ptestr", "ptestw", "pulse", "rems", "remu", "reset", "rol", "ror",
67  "roxl", "roxr", "rtd", "rte", "rtm", "rtr", "rts", "sbcd", "st", "sf", "shi", "sls", "scc", "shs", "scs", "slo", "sne", "seq", "svc", "svs", "spl", "smi",
68  "sge", "slt", "sgt", "sle", "stop", "sub", "suba", "subi", "subq", "subx", "swap", "tas", "trap", "trapv", "trapt", "trapf", "traphi", "trapls",
69  "trapcc", "traphs", "trapcs", "traplo", "trapne", "trapeq", "trapvc", "trapvs", "trappl", "trapmi", "trapge", "traplt", "trapgt", "traple", "tst", "unlk", "unpk",
70 };
71 #endif
72 
73 
74 #ifndef CAPSTONE_DIET
75 static const char* getRegName(m68k_reg reg)
76 {
77  return s_reg_names[(int)reg];
78 }
79 
80 static void printRegbitsRange(char* buffer, uint32_t data, const char* prefix)
81 {
82  unsigned int first = 0;
83  unsigned int run_length = 0;
84  int i;
85 
86  for (i = 0; i < 8; ++i) {
87  if (data & (1 << i)) {
88  first = i;
89  run_length = 0;
90 
91  while (i < 7 && (data & (1 << (i + 1)))) {
92  i++;
93  run_length++;
94  }
95 
96  if (buffer[0] != 0)
97  strcat(buffer, "/");
98 
99  sprintf(buffer + strlen(buffer), "%s%d", prefix, first);
100  if (run_length > 0)
101  sprintf(buffer + strlen(buffer), "-%s%d", prefix, first + run_length);
102  }
103  }
104 }
105 
106 static void registerBits(SStream* O, const cs_m68k_op* op)
107 {
108  char buffer[128];
109  unsigned int data = op->register_bits;
110 
111  buffer[0] = 0;
112 
113  if (!data) {
114  SStream_concat(O, "%s", "#$0");
115  return;
116  }
117 
118  printRegbitsRange(buffer, data & 0xff, "d");
119  printRegbitsRange(buffer, (data >> 8) & 0xff, "a");
120  printRegbitsRange(buffer, (data >> 16) & 0xff, "fp");
121 
122  SStream_concat(O, "%s", buffer);
123 }
124 
125 static void registerPair(SStream* O, const cs_m68k_op* op)
126 {
127  SStream_concat(O, "%s:%s", s_reg_names[op->reg_pair.reg_0],
128  s_reg_names[op->reg_pair.reg_1]);
129 }
130 
131 static void printAddressingMode(SStream* O, unsigned int pc, const cs_m68k* inst, const cs_m68k_op* op)
132 {
133  switch (op->address_mode) {
134  case M68K_AM_NONE:
135  switch (op->type) {
136  case M68K_OP_REG_BITS:
137  registerBits(O, op);
138  break;
139  case M68K_OP_REG_PAIR:
140  registerPair(O, op);
141  break;
142  case M68K_OP_REG:
143  SStream_concat(O, "%s", s_reg_names[op->reg]);
144  break;
145  default:
146  break;
147  }
148  break;
149 
150  case M68K_AM_REG_DIRECT_DATA: SStream_concat(O, "d%d", (op->reg - M68K_REG_D0)); break;
151  case M68K_AM_REG_DIRECT_ADDR: SStream_concat(O, "a%d", (op->reg - M68K_REG_A0)); break;
152  case M68K_AM_REGI_ADDR: SStream_concat(O, "(a%d)", (op->reg - M68K_REG_A0)); break;
153  case M68K_AM_REGI_ADDR_POST_INC: SStream_concat(O, "(a%d)+", (op->reg - M68K_REG_A0)); break;
154  case M68K_AM_REGI_ADDR_PRE_DEC: SStream_concat(O, "-(a%d)", (op->reg - M68K_REG_A0)); break;
155  case M68K_AM_REGI_ADDR_DISP: SStream_concat(O, "%s$%x(a%d)", op->mem.disp < 0 ? "-" : "", abs(op->mem.disp), (op->mem.base_reg - M68K_REG_A0)); break;
156  case M68K_AM_PCI_DISP: SStream_concat(O, "$%x(pc)", pc + 2 + op->mem.disp); break;
157  case M68K_AM_ABSOLUTE_DATA_SHORT: SStream_concat(O, "$%x.w", op->imm); break;
158  case M68K_AM_ABSOLUTE_DATA_LONG: SStream_concat(O, "$%x.l", op->imm); break;
159  case M68K_AM_IMMEDIATE:
160  if (inst->op_size.type == M68K_SIZE_TYPE_FPU) {
161 #if defined(_KERNEL_MODE)
162  // Issue #681: Windows kernel does not support formatting float point
163  SStream_concat(O, "#<float_point_unsupported>");
164  break;
165 #else
167  SStream_concat(O, "#%f", op->simm);
168  else if (inst->op_size.fpu_size == M68K_FPU_SIZE_DOUBLE)
169  SStream_concat(O, "#%f", op->dimm);
170  else
171  SStream_concat(O, "#<unsupported>");
172  break;
173 #endif
174  }
175  SStream_concat(O, "#$%x", op->imm);
176  break;
178  SStream_concat(O, "$%x(pc,%s%s.%c)", pc + 2 + op->mem.disp, s_spacing, getRegName(op->mem.index_reg), op->mem.index_size ? 'l' : 'w');
179  break;
181  SStream_concat(O, "%s$%x(%s,%s%s.%c)", op->mem.disp < 0 ? "-" : "", abs(op->mem.disp), getRegName(op->mem.base_reg), s_spacing, getRegName(op->mem.index_reg), op->mem.index_size ? 'l' : 'w');
182  break;
185 
186  if (op->address_mode == M68K_AM_PCI_INDEX_BASE_DISP) {
187  SStream_concat(O, "$%x", pc + 2 + op->mem.in_disp);
188  } else {
189  if (op->mem.in_disp > 0)
190  SStream_concat(O, "$%x", op->mem.in_disp);
191  }
192 
193  SStream_concat(O, "(");
194 
195  if (op->address_mode == M68K_AM_PCI_INDEX_BASE_DISP) {
196  SStream_concat(O, "pc,%s.%c", getRegName(op->mem.index_reg), op->mem.index_size ? 'l' : 'w');
197  } else {
198  if (op->mem.base_reg != M68K_REG_INVALID)
199  SStream_concat(O, "a%d,%s", op->mem.base_reg - M68K_REG_A0, s_spacing);
200  SStream_concat(O, "%s.%c", getRegName(op->mem.index_reg), op->mem.index_size ? 'l' : 'w');
201  }
202 
203  if (op->mem.scale > 0)
204  SStream_concat(O, "%s*%s%d)", s_spacing, s_spacing, op->mem.scale);
205  else
206  SStream_concat(O, ")");
207  break;
208  // It's ok to just use PCMI here as is as we set base_reg to PC in the disassembler. While this is not strictly correct it makes the code
209  // easier and that is what actually happens when the code is executed anyway.
210 
215  SStream_concat(O, "([");
216 
217  if (op->address_mode == M68K_AM_PC_MEMI_POST_INDEX || op->address_mode == M68K_AM_PC_MEMI_PRE_INDEX) {
218  SStream_concat(O, "$%x", pc + 2 + op->mem.in_disp);
219  } else {
220  if (op->mem.in_disp > 0)
221  SStream_concat(O, "$%x", op->mem.in_disp);
222  }
223 
224  if (op->mem.base_reg != M68K_REG_INVALID) {
225  if (op->mem.in_disp > 0)
226  SStream_concat(O, ",%s%s", s_spacing, getRegName(op->mem.base_reg));
227  else
228  SStream_concat(O, "%s", getRegName(op->mem.base_reg));
229  }
230 
231  if (op->address_mode == M68K_AM_MEMI_POST_INDEX || op->address_mode == M68K_AM_PC_MEMI_POST_INDEX)
232  SStream_concat(O, "]");
233 
234  if (op->mem.index_reg != M68K_REG_INVALID)
235  SStream_concat(O, ",%s%s.%c", s_spacing, getRegName(op->mem.index_reg), op->mem.index_size ? 'l' : 'w');
236 
237  if (op->mem.scale > 0)
238  SStream_concat(O, "%s*%s%d", s_spacing, s_spacing, op->mem.scale);
239 
240  if (op->address_mode == M68K_AM_MEMI_PRE_INDEX || op->address_mode == M68K_AM_PC_MEMI_PRE_INDEX)
241  SStream_concat(O, "]");
242 
243  if (op->mem.out_disp > 0)
244  SStream_concat(O, ",%s$%x", s_spacing, op->mem.out_disp);
245 
246  SStream_concat(O, ")");
247  break;
249  SStream_concat(O, "$%x", pc + 2 + op->br_disp.disp);
250  default:
251  break;
252  }
253 
254  if (op->mem.bitfield)
255  SStream_concat(O, "{%d:%d}", op->mem.offset, op->mem.width);
256 }
257 #endif
258 
259 #define m68k_sizeof_array(array) (int)(sizeof(array)/sizeof(array[0]))
260 #define m68k_min(a, b) (a < b) ? a : b
261 
262 void M68K_printInst(MCInst* MI, SStream* O, void* PrinterInfo)
263 {
264 #ifndef CAPSTONE_DIET
265  m68k_info *info = (m68k_info *)PrinterInfo;
266  cs_m68k *ext = &info->extension;
267  cs_detail *detail = NULL;
268  int i = 0;
269 
270  detail = MI->flat_insn->detail;
271  if (detail) {
272  int regs_read_count = m68k_min(m68k_sizeof_array(detail->regs_read), info->regs_read_count);
273  int regs_write_count = m68k_min(m68k_sizeof_array(detail->regs_write), info->regs_write_count);
274  int groups_count = m68k_min(m68k_sizeof_array(detail->groups), info->groups_count);
275 
276  memcpy(&detail->m68k, ext, sizeof(cs_m68k));
277 
278  memcpy(&detail->regs_read, &info->regs_read, regs_read_count * sizeof(uint16_t));
279  detail->regs_read_count = regs_read_count;
280 
281  memcpy(&detail->regs_write, &info->regs_write, regs_write_count * sizeof(uint16_t));
282  detail->regs_write_count = regs_write_count;
283 
284  memcpy(&detail->groups, &info->groups, groups_count);
285  detail->groups_count = groups_count;
286  }
287 
288  if (MI->Opcode == M68K_INS_INVALID) {
289  if (ext->op_count)
290  SStream_concat(O, "dc.w $%x", ext->operands[0].imm);
291  else
292  SStream_concat(O, "dc.w $<unknown>");
293  return;
294  }
295 
297 
298  switch (ext->op_size.type) {
300  break;
301 
302  case M68K_SIZE_TYPE_CPU :
303  switch (ext->op_size.cpu_size) {
304  case M68K_CPU_SIZE_BYTE: SStream_concat0(O, ".b"); break;
305  case M68K_CPU_SIZE_WORD: SStream_concat0(O, ".w"); break;
306  case M68K_CPU_SIZE_LONG: SStream_concat0(O, ".l"); break;
307  case M68K_CPU_SIZE_NONE: break;
308  }
309  break;
310 
311  case M68K_SIZE_TYPE_FPU :
312  switch (ext->op_size.fpu_size) {
313  case M68K_FPU_SIZE_SINGLE: SStream_concat0(O, ".s"); break;
314  case M68K_FPU_SIZE_DOUBLE: SStream_concat0(O, ".d"); break;
315  case M68K_FPU_SIZE_EXTENDED: SStream_concat0(O, ".x"); break;
316  case M68K_FPU_SIZE_NONE: break;
317  }
318  break;
319  }
320 
321  SStream_concat0(O, " ");
322 
323  // this one is a bit spacial so we do special things
324 
325  if (MI->Opcode == M68K_INS_CAS2) {
326  int reg_value_0, reg_value_1;
327  printAddressingMode(O, info->pc, ext, &ext->operands[0]); SStream_concat0(O, ",");
328  printAddressingMode(O, info->pc, ext, &ext->operands[1]); SStream_concat0(O, ",");
329  reg_value_0 = ext->operands[2].register_bits >> 4;
330  reg_value_1 = ext->operands[2].register_bits & 0xf;
331  SStream_concat(O, "(%s):(%s)", s_reg_names[M68K_REG_D0 + reg_value_0], s_reg_names[M68K_REG_D0 + reg_value_1]);
332  return;
333  }
334 
335  for (i = 0; i < ext->op_count; ++i) {
336  printAddressingMode(O, info->pc, ext, &ext->operands[i]);
337  if ((i + 1) != ext->op_count)
338  SStream_concat(O, ",%s", s_spacing);
339  }
340 #endif
341 }
342 
343 const char* M68K_reg_name(csh handle, unsigned int reg)
344 {
345 #ifdef CAPSTONE_DIET
346  return NULL;
347 #else
348  if (reg >= ARR_SIZE(s_reg_names)) {
349  return NULL;
350  }
351  return s_reg_names[(int)reg];
352 #endif
353 }
354 
355 void M68K_get_insn_id(cs_struct* h, cs_insn* insn, unsigned int id)
356 {
357  insn->id = id; // These id's matches for 68k
358 }
359 
360 const char* M68K_insn_name(csh handle, unsigned int id)
361 {
362 #ifdef CAPSTONE_DIET
363  return NULL;
364 #else
365  return s_instruction_names[id];
366 #endif
367 }
368 
369 #ifndef CAPSTONE_DIET
371  { M68K_GRP_INVALID , NULL },
372  { M68K_GRP_JUMP, "jump" },
373  { M68K_GRP_RET , "ret" },
374  { M68K_GRP_IRET, "iret" },
375  { M68K_GRP_BRANCH_RELATIVE, "branch_relative" },
376 };
377 #endif
378 
379 const char *M68K_group_name(csh handle, unsigned int id)
380 {
381 #ifndef CAPSTONE_DIET
383 #else
384  return NULL;
385 #endif
386 }
387 
static const char * s_instruction_names[]
const char * M68K_reg_name(csh handle, unsigned int reg)
static name_map group_name_maps[]
#define m68k_min(a, b)
static const char * s_reg_names[]
static void registerPair(SStream *O, const cs_m68k_op *op)
const char * M68K_group_name(csh handle, unsigned int id)
static const char * s_spacing
const char * M68K_insn_name(csh handle, unsigned int id)
static void registerBits(SStream *O, const cs_m68k_op *op)
#define m68k_sizeof_array(array)
void M68K_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id)
static void printAddressingMode(SStream *O, unsigned int pc, const cs_m68k *inst, const cs_m68k_op *op)
void M68K_printInst(MCInst *MI, SStream *O, void *PrinterInfo)
static void printRegbitsRange(char *buffer, uint32_t data, const char *prefix)
static const char * getRegName(m68k_reg reg)
void SStream_concat(SStream *ss, const char *fmt,...)
Definition: SStream.c:45
void SStream_concat0(SStream *ss, const char *s)
Definition: SStream.c:31
lzma_index ** i
Definition: index.h:629
static const char ext[]
Definition: apprentice.c:1981
static mcore_handle handle
Definition: asm_mcore.c:8
RzBinInfo * info(RzBinFile *bf)
Definition: bin_ne.c:86
size_t csh
Definition: capstone.h:71
#define NULL
Definition: cris-opc.c:27
unsigned short prefix[65536]
Definition: gun.c:163
sprintf
Definition: kernel.h:365
#define reg(n)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
@ M68K_CPU_SIZE_LONG
4 bytes in size
Definition: m68k.h:181
@ M68K_CPU_SIZE_WORD
2 bytes in size
Definition: m68k.h:180
@ M68K_CPU_SIZE_BYTE
1 byte in size
Definition: m68k.h:179
@ M68K_CPU_SIZE_NONE
unsized or unspecified
Definition: m68k.h:178
@ M68K_AM_NONE
No address mode.
Definition: m68k.h:80
@ M68K_AM_MEMI_POST_INDEX
Memory indirect - Postindex.
Definition: m68k.h:93
@ M68K_AM_PC_MEMI_PRE_INDEX
Program Counter Memory Indirect - Preindexed.
Definition: m68k.h:102
@ M68K_AM_REG_DIRECT_ADDR
Register Direct - Address.
Definition: m68k.h:83
@ M68K_AM_REGI_ADDR
Register Indirect - Address.
Definition: m68k.h:85
@ M68K_AM_IMMEDIATE
Immediate value.
Definition: m68k.h:106
@ M68K_AM_REGI_ADDR_POST_INC
Register Indirect - Address with Postincrement.
Definition: m68k.h:86
@ M68K_AM_ABSOLUTE_DATA_SHORT
Absolute Data Addressing - Short.
Definition: m68k.h:104
@ M68K_AM_AREGI_INDEX_8_BIT_DISP
Address Register Indirect With Index- 8-bit displacement.
Definition: m68k.h:90
@ M68K_AM_PCI_INDEX_BASE_DISP
Program Counter Indirect with Index - with Base Displacement.
Definition: m68k.h:99
@ M68K_AM_PCI_DISP
Program Counter Indirect - with Displacement.
Definition: m68k.h:96
@ M68K_AM_REGI_ADDR_PRE_DEC
Register Indirect - Address with Predecrement.
Definition: m68k.h:87
@ M68K_AM_MEMI_PRE_INDEX
Memory indirect - Preindex.
Definition: m68k.h:94
@ M68K_AM_ABSOLUTE_DATA_LONG
Absolute Data Addressing - Long.
Definition: m68k.h:105
@ M68K_AM_PC_MEMI_POST_INDEX
Program Counter Memory Indirect - Postindexed.
Definition: m68k.h:101
@ M68K_AM_REG_DIRECT_DATA
Register Direct - Data.
Definition: m68k.h:82
@ M68K_AM_AREGI_INDEX_BASE_DISP
Address Register Indirect With Index- Base displacement.
Definition: m68k.h:91
@ M68K_AM_BRANCH_DISPLACEMENT
Address as displacement from (PC+2) used by branches.
Definition: m68k.h:108
@ M68K_AM_PCI_INDEX_8_BIT_DISP
Program Counter Indirect with Index - with 8-Bit Displacement.
Definition: m68k.h:98
@ M68K_AM_REGI_ADDR_DISP
Register Indirect - Address with Displacement.
Definition: m68k.h:88
@ M68K_SIZE_TYPE_INVALID
Definition: m68k.h:194
@ M68K_SIZE_TYPE_CPU
Definition: m68k.h:196
@ M68K_SIZE_TYPE_FPU
Definition: m68k.h:197
@ M68K_GRP_RET
= CS_GRP_RET
Definition: m68k.h:602
@ M68K_GRP_INVALID
CS_GRUP_INVALID.
Definition: m68k.h:600
@ M68K_GRP_IRET
= CS_GRP_IRET
Definition: m68k.h:603
@ M68K_GRP_JUMP
= CS_GRP_JUMP
Definition: m68k.h:601
@ M68K_GRP_BRANCH_RELATIVE
= CS_GRP_BRANCH_RELATIVE
Definition: m68k.h:604
@ M68K_OP_REG_PAIR
Register pair in the same op (upper 4 bits for first reg, lower for second)
Definition: m68k.h:120
@ M68K_OP_REG_BITS
Register bits move.
Definition: m68k.h:119
@ M68K_OP_REG
= CS_OP_REG (Register operand).
Definition: m68k.h:114
@ M68K_FPU_SIZE_SINGLE
4 byte in size (single float)
Definition: m68k.h:187
@ M68K_FPU_SIZE_NONE
unsized like fsave/frestore
Definition: m68k.h:186
@ M68K_FPU_SIZE_DOUBLE
8 byte in size (double)
Definition: m68k.h:188
@ M68K_FPU_SIZE_EXTENDED
12 byte in size (extended real format)
Definition: m68k.h:189
@ M68K_INS_INVALID
Definition: m68k.h:219
@ M68K_INS_CAS2
Definition: m68k.h:264
m68k_reg
M68K registers and special registers.
Definition: m68k.h:20
@ M68K_REG_D0
Definition: m68k.h:23
@ M68K_REG_INVALID
Definition: m68k.h:21
@ M68K_REG_A0
Definition: m68k.h:32
#define ARR_SIZE(a)
Definition: ocaml.c:13
int id
Definition: op.c:540
#define O
Definition: rcond.c:14
static int
Definition: sfsocketcall.h:114
unsigned short uint16_t
Definition: sftypes.h:30
unsigned int uint32_t
Definition: sftypes.h:29
#define h(i)
Definition: sha256.c:48
Definition: MCInst.h:88
cs_insn * flat_insn
Definition: MCInst.h:95
unsigned Opcode
Definition: MCInst.h:93
Definition: SStream.h:9
Definition: buffer.h:15
Instruction operand.
Definition: m68k.h:160
The M68K instruction and it's operands.
Definition: m68k.h:210
m68k_op_size op_size
size of data operand works on in bytes (.b, .w, .l, etc)
Definition: m68k.h:213
m68k_size_type type
Definition: m68k.h:202
m68k_fpu_size fpu_size
Definition: m68k.h:205
Definition: utils.h:36
const char * id2name(const name_map *map, int max, const unsigned int id)
Definition: utils.c:56
Definition: dis.c:32