Rizin
unix-like reverse engineering framework and cli tools
h8300_disas.c File Reference
#include <rz_types.h>
#include <rz_util.h>
#include "h8300_disas.h"

Go to the source code of this file.

Functions

static int decode_opcode_4bit (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_opcode (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_eepmov (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_ldc (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_r162r16 (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_andc (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_adds (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_bsr (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_imm162r16 (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_disp162r16 (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_pop (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_indinc162r16 (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_ind162r16 (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_imm2r8 (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_imm2ind16 (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_imm2abs8 (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_r2r8 (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_rzind16 (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_rzabs8 (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_subs (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_daa (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_r82r16 (const ut8 *bytes, struct h8300_cmd *cmd)
 
int decode_jmp_abs16 (const ut8 *bytes, struct h8300_cmd *cmd)
 
int decode_jmp_abs8 (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_jmp_ind (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_abs162r16 (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_r82ind16 (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_r82dispr16 (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_r82rdec16 (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_r82abs16 (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_nop (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_abs2r_short (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_rzimm_short (const ut8 *bytes, struct h8300_cmd *cmd)
 
static int decode_imm2r_short (const ut8 *bytes, struct h8300_cmd *cmd)
 
int h8300_decode_command (const ut8 *instr, struct h8300_cmd *cmd)
 

Variables

static const char * commands_4bit []
 
static const char * commands []
 
static const char * commands_9bit []
 

Function Documentation

◆ decode_abs162r16()

static int decode_abs162r16 ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 610 of file h8300_disas.c.

610  {
611  int ret = 4;
612  ut16 abs;
613 
614  if (decode_opcode(bytes, cmd)) {
615  return -1;
616  }
617 
618  abs = rz_read_at_be16(bytes, 2);
619  if (bytes[1] & 0x80) {
620  snprintf(cmd->operands, H8300_INSTR_MAXLEN,
621  "r%u,@0x%x:16", bytes[1] & 0x7, abs);
622  } else {
623  snprintf(cmd->operands, H8300_INSTR_MAXLEN, "@0x%x:16,r%u",
624  abs, bytes[1] & 0x7);
625  }
626 
627  return ret;
628 }
static ut8 bytes[32]
Definition: asm_arc.c:23
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 cmd
Definition: sflib.h:79
uint16_t ut16
static int decode_opcode(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:143
#define H8300_INSTR_MAXLEN
Definition: h8300_disas.h:111
snprintf
Definition: kernel.h:364
static ut16 rz_read_at_be16(const void *src, size_t offset)
Definition: rz_endian.h:55

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, rz_read_at_be16(), and snprintf.

Referenced by h8300_decode_command().

◆ decode_abs2r_short()

static int decode_abs2r_short ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 737 of file h8300_disas.c.

737  {
738  int ret = 2;
739 
740  if (decode_opcode_4bit(bytes, cmd)) {
741  return -1;
742  }
743 
744  snprintf(cmd->operands, H8300_INSTR_MAXLEN,
745  "@0x%x:8,r%u%c",
746  bytes[1], bytes[0] & 0x7,
747  bytes[0] & 0x8 ? 'l' : 'h');
748 
749  return ret;
750 }
static int decode_opcode_4bit(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:130

References bytes, cmd, decode_opcode_4bit(), H8300_INSTR_MAXLEN, and snprintf.

Referenced by h8300_decode_command().

◆ decode_adds()

static int decode_adds ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 284 of file h8300_disas.c.

284  {
285  int ret = 2;
286  unsigned reg, val;
287 
288  if (decode_opcode(bytes, cmd)) {
289  return -1;
290  }
291 
292  reg = bytes[1] & 0x7;
293 
294  if (bytes[1] & 0x80) {
295  val = 2;
296  } else {
297  val = 1;
298  }
299 
300  snprintf(cmd->operands, H8300_INSTR_MAXLEN, "#%u,r%u", val, reg);
301 
302  return ret;
303 }
ut16 val
Definition: armass64_const.h:6
#define reg(n)

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, reg, snprintf, and val.

Referenced by h8300_decode_command().

◆ decode_andc()

static int decode_andc ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 272 of file h8300_disas.c.

272  {
273  int ret = 2;
274 
275  if (decode_opcode(bytes, cmd)) {
276  return -1;
277  }
278 
279  snprintf(cmd->operands, H8300_INSTR_MAXLEN, "#0x%x:8,ccr", bytes[1]);
280 
281  return ret;
282 }

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, and snprintf.

Referenced by h8300_decode_command().

◆ decode_bsr()

static int decode_bsr ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 305 of file h8300_disas.c.

305  {
306  int ret = 2;
307 
308  if (decode_opcode(bytes, cmd)) {
309  return -1;
310  }
311 
312  snprintf(cmd->operands, H8300_INSTR_MAXLEN, ".%d",
313  (st8)bytes[1]);
314 
315  return ret;
316 }
#define st8
Definition: rz_types_base.h:16

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, snprintf, and st8.

Referenced by h8300_decode_command().

◆ decode_daa()

static int decode_daa ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 523 of file h8300_disas.c.

523  {
524  int ret = 2;
525 
526  if (bytes[0] == 0x17 && bytes[1] >> 4 == 0) {
527  strncpy(cmd->instr, "not", H8300_INSTR_MAXLEN - 1);
528  cmd->instr[H8300_INSTR_MAXLEN - 1] = '\0';
529  } else if (bytes[0] == 0x12 && bytes[1] >> 4 == 0) {
530  strncpy(cmd->instr, "rotxl", H8300_INSTR_MAXLEN - 1);
531  cmd->instr[H8300_INSTR_MAXLEN - 1] = '\0';
532  } else if (bytes[0] == 0x13 && bytes[1] >> 4 == 0) {
533  strncpy(cmd->instr, "rotxr", H8300_INSTR_MAXLEN - 1);
534  cmd->instr[H8300_INSTR_MAXLEN - 1] = '\0';
535  } else if (bytes[0] == 0x10 && bytes[1] >> 4 == 0) {
536  strncpy(cmd->instr, "shll", H8300_INSTR_MAXLEN - 1);
537  } else if (bytes[0] == 0x11 && bytes[1] >> 4 == 0) {
538  strncpy(cmd->instr, "shlr", H8300_INSTR_MAXLEN - 1);
539  } else if (decode_opcode(bytes, cmd)) {
540  return -1;
541  }
542 
543  snprintf(cmd->operands, H8300_INSTR_MAXLEN, "r%u%c",
544  (bytes[1]) & 0x7,
545  bytes[1] & 0x8 ? 'l' : 'h');
546 
547  return ret;
548 }

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, and snprintf.

Referenced by h8300_decode_command().

◆ decode_disp162r16()

static int decode_disp162r16 ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 335 of file h8300_disas.c.

335  {
336  int ret = 4;
337  ut16 disp;
338 
339  if (decode_opcode(bytes, cmd)) {
340  return -1;
341  }
342 
343  disp = rz_read_at_be16(bytes, 2);
344 
345  if (bytes[1] & 0x80) {
346  snprintf(cmd->operands, H8300_INSTR_MAXLEN,
347  "r%u,@(0x%x:16,r%u)",
348  bytes[1] & 0x7, disp,
349  (bytes[1] >> 4) & 0x7);
350  } else {
351  snprintf(cmd->operands, H8300_INSTR_MAXLEN,
352  "@(0x%x:16,r%u),r%u", disp,
353  (bytes[1] >> 4) & 0x7, bytes[1] & 0x7);
354  }
355 
356  return ret;
357 }

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, rz_read_at_be16(), and snprintf.

Referenced by h8300_decode_command().

◆ decode_eepmov()

static int decode_eepmov ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 216 of file h8300_disas.c.

216  {
217  int ret = 4;
218 
219  if (decode_opcode(bytes, cmd)) {
220  return -1;
221  }
222  cmd->operands[0] = '\0';
223 
224  switch (bytes[0]) {
225  case H8300_RTS:
226  case H8300_RTE:
227  ret = 2;
228  break;
229  }
230 
231  return ret;
232 }
@ H8300_RTS
Definition: h8300_disas.h:73
@ H8300_RTE
Definition: h8300_disas.h:75

References bytes, cmd, decode_opcode(), H8300_RTE, and H8300_RTS.

Referenced by h8300_decode_command().

◆ decode_imm162r16()

static int decode_imm162r16 ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 319 of file h8300_disas.c.

319  {
320  int ret = 4;
321  ut16 imm;
322 
323  if (decode_opcode(bytes, cmd)) {
324  return -1;
325  }
326 
327  imm = rz_read_at_be16(bytes, 2);
328  snprintf(cmd->operands, H8300_INSTR_MAXLEN, "#0x%x:16,r%u",
329  imm, bytes[1] & 0x7);
330 
331  return ret;
332 }
#define imm

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, imm, rz_read_at_be16(), and snprintf.

Referenced by h8300_decode_command().

◆ decode_imm2abs8()

static int decode_imm2abs8 ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 448 of file h8300_disas.c.

448  {
449  int ret = 4;
450 
451  if (decode_opcode(bytes, cmd)) {
452  return -1;
453  }
454 
455  snprintf(cmd->operands, H8300_INSTR_MAXLEN, "#0x%x:3,@0x%x:8",
456  (bytes[3] >> 4) & 0x7, bytes[1]);
457 
458  return ret;
459 }

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, and snprintf.

Referenced by h8300_decode_command().

◆ decode_imm2ind16()

static int decode_imm2ind16 ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 434 of file h8300_disas.c.

434  {
435  int ret = 4;
436 
437  if (decode_opcode(bytes, cmd)) {
438  return -1;
439  }
440 
441  snprintf(cmd->operands, H8300_INSTR_MAXLEN, "#0x%x:3,@r%u",
442  (bytes[3] >> 4) & 0x7, bytes[1] >> 4);
443 
444  return ret;
445 }

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, and snprintf.

Referenced by h8300_decode_command().

◆ decode_imm2r8()

static int decode_imm2r8 ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 419 of file h8300_disas.c.

419  {
420  int ret = 2;
421 
422  if (decode_opcode(bytes, cmd)) {
423  return -1;
424  }
425 
426  snprintf(cmd->operands, H8300_INSTR_MAXLEN, "#0x%x:3,r%u%c",
427  (bytes[1] >> 4) & 0x7, bytes[1] & 0x7,
428  bytes[1] & 0x8 ? 'l' : 'h');
429 
430  return ret;
431 }

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, and snprintf.

Referenced by h8300_decode_command().

◆ decode_imm2r_short()

static int decode_imm2r_short ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 766 of file h8300_disas.c.

766  {
767  int ret = 2;
768 
769  if (decode_opcode_4bit(bytes, cmd)) {
770  return -1;
771  }
772 
773  snprintf(cmd->operands, H8300_INSTR_MAXLEN, "#0x%x:8,r%u%c",
774  bytes[1], bytes[0] & 0x7, bytes[0] & 0x8 ? 'l' : 'h');
775 
776  return ret;
777 }

References bytes, cmd, decode_opcode_4bit(), H8300_INSTR_MAXLEN, and snprintf.

Referenced by h8300_decode_command().

◆ decode_ind162r16()

static int decode_ind162r16 ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 398 of file h8300_disas.c.

398  {
399  int ret = 2;
400 
401  if (decode_opcode(bytes, cmd)) {
402  return -1;
403  }
404 
405  if (bytes[1] & 0x80) {
406  snprintf(cmd->operands, H8300_INSTR_MAXLEN, "r%u,@r%u",
407  bytes[1] & 0x7,
408  (bytes[1] >> 4) & 0x7);
409  } else {
410  snprintf(cmd->operands, H8300_INSTR_MAXLEN, "@r%u,r%u",
411  (bytes[1] >> 4) & 0x7,
412  bytes[1] & 0x7);
413  }
414 
415  return ret;
416 }

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, and snprintf.

Referenced by h8300_decode_command().

◆ decode_indinc162r16()

static int decode_indinc162r16 ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 374 of file h8300_disas.c.

374  {
375  int ret = 2;
376  ut8 tmp = bytes[1] >> 4;
377 
378  if (bytes[0] == 0x6D && (tmp == 7 || tmp == 0xF)) {
379  return decode_pop(bytes, cmd);
380  }
381 
382  if (decode_opcode(bytes, cmd)) {
383  return -1;
384  }
385 
386  if (bytes[1] & 0x80) {
387  snprintf(cmd->operands, H8300_INSTR_MAXLEN, "r%u,@-r%u",
388  bytes[1] & 0x7, (bytes[1] >> 4) & 0x7);
389  } else {
390  snprintf(cmd->operands, H8300_INSTR_MAXLEN, "@r%u+,r%u",
391  (bytes[1] >> 4) & 0x7, bytes[1] & 0x7);
392  }
393 
394  return ret;
395 }
static int decode_pop(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:359
uint8_t ut8
Definition: lh5801.h:11

References bytes, cmd, decode_opcode(), decode_pop(), H8300_INSTR_MAXLEN, snprintf, and autogen_x86imm::tmp.

Referenced by h8300_decode_command().

◆ decode_jmp_abs16()

int decode_jmp_abs16 ( const ut8 bytes,
struct h8300_cmd cmd 
)

Definition at line 567 of file h8300_disas.c.

567  {
568  int ret = 4;
569  ut16 abs;
570 
571  if (decode_opcode(bytes, cmd)) {
572  return -1;
573  }
574 
575  abs = rz_read_at_be16(bytes, 2);
576  snprintf(cmd->operands, H8300_INSTR_MAXLEN, "@0x%x:16", abs);
577 
578  return ret;
579 }

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, rz_read_at_be16(), and snprintf.

Referenced by h8300_decode_command().

◆ decode_jmp_abs8()

int decode_jmp_abs8 ( const ut8 bytes,
struct h8300_cmd cmd 
)

Definition at line 582 of file h8300_disas.c.

582  {
583  int ret = 2;
584 
585  if (decode_opcode(bytes, cmd)) {
586  return -1;
587  }
588 
589  snprintf(cmd->operands, H8300_INSTR_MAXLEN,
590  "@@0x%x:8", bytes[1]);
591 
592  return ret;
593 }

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, and snprintf.

Referenced by h8300_decode_command().

◆ decode_jmp_ind()

static int decode_jmp_ind ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 596 of file h8300_disas.c.

596  {
597  int ret = 2;
598 
599  if (decode_opcode(bytes, cmd)) {
600  return -1;
601  }
602 
603  snprintf(cmd->operands, H8300_INSTR_MAXLEN,
604  "@r%u", (bytes[1] >> 4) & 0x7);
605 
606  return ret;
607 }

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, and snprintf.

Referenced by h8300_decode_command().

◆ decode_ldc()

static int decode_ldc ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 234 of file h8300_disas.c.

234  {
235  int ret = 2;
236 
237  if (decode_opcode(bytes, cmd)) {
238  return -1;
239  }
240 
241  if (bytes[0] == H8300_LDC_2 || bytes[0] == H8300_XORC ||
242  bytes[0] == H8300_ORC) {
243  snprintf(cmd->operands, H8300_INSTR_MAXLEN,
244  "#0x%x:8,ccr", bytes[1]);
245  } else if (bytes[0] == H8300_LDC) {
246  snprintf(cmd->operands, H8300_INSTR_MAXLEN,
247  "r%u%c,ccr", bytes[1] & 0x7,
248  bytes[1] & 0x8 ? 'l' : 'h');
249  } else if (bytes[0] == H8300_STC) {
250  snprintf(cmd->operands, H8300_INSTR_MAXLEN,
251  "ccr,r%u%c", bytes[1] & 0x7,
252  bytes[1] & 0x8 ? 'l' : 'h');
253  }
254 
255  return ret;
256 }
@ H8300_ORC
Definition: h8300_disas.h:27
@ H8300_LDC_2
Definition: h8300_disas.h:30
@ H8300_LDC
Definition: h8300_disas.h:26
@ H8300_XORC
Definition: h8300_disas.h:28
@ H8300_STC
Definition: h8300_disas.h:25

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, H8300_LDC, H8300_LDC_2, H8300_ORC, H8300_STC, H8300_XORC, and snprintf.

Referenced by h8300_decode_command().

◆ decode_nop()

static int decode_nop ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 725 of file h8300_disas.c.

725  {
726  int ret = 2;
727 
728  if (decode_opcode(bytes, cmd)) {
729  return -1;
730  }
731 
732  cmd->operands[0] = '\0';
733 
734  return ret;
735 }

References bytes, cmd, and decode_opcode().

Referenced by h8300_decode_command().

◆ decode_opcode()

static int decode_opcode ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 143 of file h8300_disas.c.

143  {
144  ut16 ext_opcode;
145 
146  ext_opcode = (rz_read_be16(bytes)) >> 7;
147 
148  switch (ext_opcode) {
149  case H8300_BOR:
150  case H8300_BIOR:
151  case H8300_BXOR:
152  case H8300_BIXOR:
153  case H8300_BAND:
154  case H8300_BIAND:
155  case H8300_BLD:
156  case H8300_BILD:
157  case H8300_BST:
158  case H8300_BIST:
159  if (ext_opcode >= sizeof(commands_9bit) / sizeof(void *) ||
160  !commands_9bit[ext_opcode]) {
161  break;
162  }
163  strncpy(cmd->instr, commands_9bit[ext_opcode], H8300_INSTR_MAXLEN - 1);
164  cmd->instr[H8300_INSTR_MAXLEN - 1] = '\0';
165  return 0;
166  }
167 
168  switch (bytes[0]) {
171  case H8300_BCLR_R2IND16:
172  case H8300_BCLR_R2ABS8:
173  switch (bytes[2]) {
174  case 0x74:
175  strncpy(cmd->instr, bytes[3] & 0x80 ? "bior" : "bor",
176  H8300_INSTR_MAXLEN - 1);
177  return 0;
178  case 0x76:
179  strncpy(cmd->instr, bytes[3] & 0x80 ? "biand" : "band",
180  H8300_INSTR_MAXLEN - 1);
181  return 0;
182  case 0x77:
183  strncpy(cmd->instr, bytes[3] & 0x80 ? "bild" : "bld",
184  H8300_INSTR_MAXLEN - 1);
185  return 0;
186  case 0x67:
187  strncpy(cmd->instr, bytes[3] & 0x80 ? "bist" : "bst",
188  H8300_INSTR_MAXLEN - 1);
189  return 0;
190  case 0x75:
191  strncpy(cmd->instr, bytes[3] & 0x80 ? "bixor" : "bxor",
192  H8300_INSTR_MAXLEN - 1);
193  return 0;
194  case 0x60:
195  case 0x70:
196  strncpy(cmd->instr, "bset", H8300_INSTR_MAXLEN - 1);
197  return 0;
198  case 0x61:
199  case 0x71:
200  strncpy(cmd->instr, "bnot", H8300_INSTR_MAXLEN - 1);
201  return 0;
202  }
203  break;
204  }
205 
206  if (bytes[0] >= sizeof(commands) / sizeof(void *) || !commands[bytes[0]]) {
207  return -1;
208  }
209 
210  strncpy(cmd->instr, commands[bytes[0]], H8300_INSTR_MAXLEN - 1);
211  cmd->instr[H8300_INSTR_MAXLEN - 1] = '\0';
212 
213  return 0;
214 }
static const char * commands[]
Definition: h8300_disas.c:21
static const char * commands_9bit[]
Definition: h8300_disas.c:117
@ H8300_BST
Definition: h8300_disas.h:114
@ H8300_BIXOR
Definition: h8300_disas.h:119
@ H8300_BAND
Definition: h8300_disas.h:120
@ H8300_BIAND
Definition: h8300_disas.h:121
@ H8300_BILD
Definition: h8300_disas.h:123
@ H8300_BLD
Definition: h8300_disas.h:122
@ H8300_BIST
Definition: h8300_disas.h:115
@ H8300_BOR
Definition: h8300_disas.h:116
@ H8300_BXOR
Definition: h8300_disas.h:118
@ H8300_BIOR
Definition: h8300_disas.h:117
@ H8300_BIAND_IMM2IND16
Definition: h8300_disas.h:105
@ H8300_BCLR_R2IND16
Definition: h8300_disas.h:106
@ H8300_BIAND_IMM2ABS8
Definition: h8300_disas.h:107
@ H8300_BCLR_R2ABS8
Definition: h8300_disas.h:108
static ut16 rz_read_be16(const void *src)
Definition: rz_endian.h:50

References bytes, cmd, commands, commands_9bit, H8300_BAND, H8300_BCLR_R2ABS8, H8300_BCLR_R2IND16, H8300_BIAND, H8300_BIAND_IMM2ABS8, H8300_BIAND_IMM2IND16, H8300_BILD, H8300_BIOR, H8300_BIST, H8300_BIXOR, H8300_BLD, H8300_BOR, H8300_BST, H8300_BXOR, H8300_INSTR_MAXLEN, and rz_read_be16().

Referenced by decode_abs162r16(), decode_adds(), decode_andc(), decode_bsr(), decode_daa(), decode_disp162r16(), decode_eepmov(), decode_imm162r16(), decode_imm2abs8(), decode_imm2ind16(), decode_imm2r8(), decode_ind162r16(), decode_indinc162r16(), decode_jmp_abs16(), decode_jmp_abs8(), decode_jmp_ind(), decode_ldc(), decode_nop(), decode_r162r16(), decode_r2r8(), decode_r82abs16(), decode_r82dispr16(), decode_r82ind16(), decode_r82r16(), decode_r82rdec16(), decode_rzabs8(), decode_rzind16(), and decode_subs().

◆ decode_opcode_4bit()

static int decode_opcode_4bit ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 130 of file h8300_disas.c.

130  {
131  ut8 opcode = bytes[0] >> 4;
132 
133  if (opcode >= sizeof(commands_4bit) / sizeof(void *) || !commands_4bit[opcode]) {
134  return -1;
135  }
136 
137  strncpy(cmd->instr, commands_4bit[opcode], H8300_INSTR_MAXLEN - 1);
138  cmd->instr[H8300_INSTR_MAXLEN - 1] = '\0';
139 
140  return 0;
141 }
static const char * commands_4bit[]
Definition: h8300_disas.c:8

References bytes, cmd, commands_4bit, and H8300_INSTR_MAXLEN.

Referenced by decode_abs2r_short(), decode_imm2r_short(), and decode_rzimm_short().

◆ decode_pop()

static int decode_pop ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 359 of file h8300_disas.c.

359  {
360  int ret = 2;
361  ut8 tmp = bytes[1] >> 4;
362 
363  strncpy(cmd->instr, tmp == 0x7 ? "pop" : "push",
364  H8300_INSTR_MAXLEN - 1);
365  cmd->instr[H8300_INSTR_MAXLEN - 1] = '\0';
366 
367  snprintf(cmd->operands, H8300_INSTR_MAXLEN,
368  "r%u", bytes[1] & 0x7);
369 
370  return ret;
371 }

References bytes, cmd, H8300_INSTR_MAXLEN, snprintf, and autogen_x86imm::tmp.

Referenced by decode_indinc162r16().

◆ decode_r162r16()

static int decode_r162r16 ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 258 of file h8300_disas.c.

258  {
259  int ret = 2;
260 
261  if (decode_opcode(bytes, cmd)) {
262  return -1;
263  }
264 
265  snprintf(cmd->operands, H8300_INSTR_MAXLEN, "r%u,r%u",
266  bytes[1] >> 4,
267  bytes[1] & 0x7);
268 
269  return ret;
270 }

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, and snprintf.

Referenced by h8300_decode_command().

◆ decode_r2r8()

static int decode_r2r8 ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 462 of file h8300_disas.c.

462  {
463  int ret = 2;
464 
465  if (decode_opcode(bytes, cmd)) {
466  return -1;
467  }
468 
469  snprintf(cmd->operands, H8300_INSTR_MAXLEN, "r%u%c,r%u%c",
470  (bytes[1] >> 4) & 0x7,
471  bytes[1] & 0x80 ? 'l' : 'h',
472  bytes[1] & 0x7, bytes[1] & 0x8 ? 'l' : 'h');
473 
474  return ret;
475 }

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, and snprintf.

Referenced by h8300_decode_command().

◆ decode_r82abs16()

static int decode_r82abs16 ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 699 of file h8300_disas.c.

699  {
700  int ret = 4;
701  ut16 abs;
702 
703  if (bytes[0] == 0x6A && bytes[1] >> 4 == 4) {
704  strncpy(cmd->instr, "movfpe", H8300_INSTR_MAXLEN);
705  } else if (bytes[0] == 0x6A && bytes[1] >> 4 == 0xC) {
706  strncpy(cmd->instr, "movtpe", H8300_INSTR_MAXLEN);
707  } else if (decode_opcode(bytes, cmd)) {
708  return -1;
709  }
710 
711  abs = rz_read_at_be16(bytes, 2);
712 
713  if (bytes[1] & 0x80) {
714  snprintf(cmd->operands, H8300_INSTR_MAXLEN, "r%u%c,@0x%x:16",
715  bytes[1] & 0x7, bytes[1] & 0x8 ? 'l' : 'h', abs);
716  } else {
717  snprintf(cmd->operands, H8300_INSTR_MAXLEN, "@0x%x:16,r%u%c",
718  abs, bytes[1] & 0x7,
719  bytes[1] & 0x8 ? 'l' : 'h');
720  }
721 
722  return ret;
723 }

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, rz_read_at_be16(), and snprintf.

Referenced by h8300_decode_command().

◆ decode_r82dispr16()

static int decode_r82dispr16 ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 652 of file h8300_disas.c.

652  {
653  int ret = 4;
654  ut16 disp;
655 
656  if (decode_opcode(bytes, cmd)) {
657  return -1;
658  }
659 
660  disp = rz_read_at_be16(bytes, 2);
661  if (bytes[1] & 0x80) {
662  snprintf(cmd->operands, H8300_INSTR_MAXLEN,
663  "r%u%c,@(0x%x:16,r%u)",
664  bytes[1] & 0x7, bytes[1] & 0x8 ? 'l' : 'h',
665  disp, (bytes[1] >> 4) & 0x7);
666  } else {
667  snprintf(cmd->operands, H8300_INSTR_MAXLEN,
668  "@(0x%x:16,r%u),r%u%c",
669  disp, (bytes[1] >> 4) & 0x7,
670  bytes[1] & 0x7, bytes[1] & 0x8 ? 'l' : 'h');
671  }
672  return ret;
673 }

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, rz_read_at_be16(), and snprintf.

Referenced by h8300_decode_command().

◆ decode_r82ind16()

static int decode_r82ind16 ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 631 of file h8300_disas.c.

631  {
632  int ret = 2;
633 
634  if (decode_opcode(bytes, cmd)) {
635  return -1;
636  }
637 
638  if (bytes[1] & 0x80) {
639  snprintf(cmd->operands, H8300_INSTR_MAXLEN, "r%u%c,@r%u",
640  bytes[1] & 0x7, bytes[1] & 0x8 ? 'l' : 'h',
641  (bytes[1] >> 4) & 0x7);
642  } else {
643  snprintf(cmd->operands, H8300_INSTR_MAXLEN, "@r%u,r%u%c",
644  (bytes[1] >> 4) & 0x7,
645  bytes[1] & 0x7, bytes[1] & 0x8 ? 'l' : 'h');
646  }
647 
648  return ret;
649 }

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, and snprintf.

Referenced by h8300_decode_command().

◆ decode_r82r16()

static int decode_r82r16 ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 551 of file h8300_disas.c.

551  {
552  int ret = 2;
553 
554  if (decode_opcode(bytes, cmd)) {
555  return -1;
556  }
557 
558  snprintf(cmd->operands, H8300_INSTR_MAXLEN, "r%u%c,r%u",
559  (bytes[1] >> 4) & 0x7,
560  bytes[1] & 0x80 ? 'l' : 'h',
561  bytes[1] & 0x7);
562 
563  return ret;
564 }

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, and snprintf.

Referenced by h8300_decode_command().

◆ decode_r82rdec16()

static int decode_r82rdec16 ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 676 of file h8300_disas.c.

676  {
677  int ret = 2;
678 
679  if (decode_opcode(bytes, cmd)) {
680  return -1;
681  }
682 
683  if (bytes[1] & 0x80) {
684  snprintf(cmd->operands, H8300_INSTR_MAXLEN,
685  "r%u%c,@-r%u",
686  bytes[1] & 0x7, bytes[1] & 0x8 ? 'l' : 'h',
687  (bytes[1] >> 4) & 0x7);
688  } else {
689  snprintf(cmd->operands, H8300_INSTR_MAXLEN,
690  "@r%u+,r%u%c",
691  (bytes[1] >> 4) & 0x7,
692  bytes[1] & 0x7, bytes[1] & 0x8 ? 'l' : 'h');
693  }
694 
695  return ret;
696 }

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, and snprintf.

Referenced by h8300_decode_command().

◆ decode_rzabs8()

static int decode_rzabs8 ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 494 of file h8300_disas.c.

494  {
495  int ret = 4;
496 
497  if (decode_opcode(bytes, cmd)) {
498  return -1;
499  }
500 
501  snprintf(cmd->operands, H8300_INSTR_MAXLEN, "r%u%c,@0x%x:8",
502  (bytes[3] >> 4) & 0x7,
503  bytes[3] & 0x80 ? 'l' : 'h',
504  bytes[1]);
505 
506  return ret;
507 }

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, and snprintf.

Referenced by h8300_decode_command().

◆ decode_rzimm_short()

static int decode_rzimm_short ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 752 of file h8300_disas.c.

752  {
753  int ret = 2;
754 
755  if (decode_opcode_4bit(bytes, cmd)) {
756  return -1;
757  }
758 
759  snprintf(cmd->operands, H8300_INSTR_MAXLEN,
760  "r%u%c,@0x%x:8",
761  bytes[0] & 0x7, bytes[0] & 0x8 ? 'l' : 'h',
762  bytes[1]);
763  return ret;
764 }

References bytes, cmd, decode_opcode_4bit(), H8300_INSTR_MAXLEN, and snprintf.

Referenced by h8300_decode_command().

◆ decode_rzind16()

static int decode_rzind16 ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 478 of file h8300_disas.c.

478  {
479  int ret = 4;
480 
481  if (decode_opcode(bytes, cmd)) {
482  return -1;
483  }
484 
485  snprintf(cmd->operands, H8300_INSTR_MAXLEN, "r%u%c,@r%u",
486  (bytes[3] >> 4) & 0x7,
487  bytes[3] & 0x80 ? 'l' : 'h',
488  bytes[1] >> 4);
489 
490  return ret;
491 }

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, and snprintf.

Referenced by h8300_decode_command().

◆ decode_subs()

static int decode_subs ( const ut8 bytes,
struct h8300_cmd cmd 
)
static

Definition at line 509 of file h8300_disas.c.

509  {
510  int ret = 2;
511 
512  if (decode_opcode(bytes, cmd)) {
513  return -1;
514  }
515 
516  snprintf(cmd->operands, H8300_INSTR_MAXLEN, "#%u,r%u",
517  bytes[1] & 0x80 ? 2 : 1, bytes[1] & 0x7);
518 
519  return ret;
520 }

References bytes, cmd, decode_opcode(), H8300_INSTR_MAXLEN, and snprintf.

Referenced by h8300_decode_command().

◆ h8300_decode_command()

int h8300_decode_command ( const ut8 instr,
struct h8300_cmd cmd 
)

Definition at line 779 of file h8300_disas.c.

779  {
780  int ret = 0;
781 
782  switch (instr[0] >> 4) {
783  case H8300_MOV_4BIT_3:
784  ret = decode_rzimm_short(instr, cmd);
785  break;
786  case H8300_MOV_4BIT_2:
787  ret = decode_abs2r_short(instr, cmd);
788  break;
789  case H8300_AND_4BIT:
790  case H8300_ADDX_4BIT:
791  case H8300_ADD_4BIT:
792  case H8300_CMP_4BIT:
793  case H8300_MOV_4BIT:
794  case H8300_OR_4BIT:
795  case H8300_SUBX_4BIT:
796  case H8300_XOR_4BIT:
797  ret = decode_imm2r_short(instr, cmd);
798  break;
799  }
800 
801  if (ret) {
802  {
803  return ret;
804  }
805  }
806 
807  switch (instr[0]) {
808  case H8300_ANDC:
809  ret = decode_andc(instr, cmd);
810  break;
811  case H8300_SUBS:
812  ret = decode_subs(instr, cmd);
813  break;
814  case H8300_ADDW_DIRECT:
815  case H8300_CMP_2:
816  ret = decode_r162r16(instr, cmd);
817  break;
818  case H8300_ADDS:
819  ret = decode_adds(instr, cmd);
820  break;
821  case H8300_BAND_BIAND:
822  case H8300_BCLR_IMM2R8:
823  case H8300_BST_BIST:
824  case H8300_BTST:
825  case H8300_BILD_IMM2R8:
826  case H8300_BOR_BIOR:
827  case H8300_BXOR_BIXOR:
828  case H8300_BNOT_2:
829  case H8300_BSET_2:
830  ret = decode_imm2r8(instr, cmd);
831  break;
832  case H8300_AND:
833  case H8300_ADDB_DIRECT:
834  case H8300_BCLR_R2R8:
835  case H8300_SUB_1:
836  case H8300_SUBX:
837  case H8300_ADDX:
838  case H8300_XOR:
839  case H8300_BNOT_1:
840  case H8300_BSET_1:
841  case H8300_CMP_1:
842  case H8300_MOV_1:
843  case H8300_BTST_R2R8:
844  ret = decode_r2r8(instr, cmd);
845  break;
846  case H8300_BCLR_R2IND16:
847  switch (instr[2]) {
848  case 0x60:
849  case 0x61:
850  case 0x62:
851  ret = decode_rzind16(instr, cmd);
852  break;
853  case 0x70:
854  case 0x71:
855  case 0x72:
856  case 0x67:
857  case 0x75:
858  ret = decode_imm2ind16(instr, cmd);
859  break;
860  default:
861  ret = -1;
862  }
863  break;
864  case H8300_BCLR_R2ABS8:
865  switch (instr[2]) {
866  case 0x60:
867  case 0x61:
868  case 0x62:
869  ret = decode_rzabs8(instr, cmd);
870  break;
871  case 0x67:
872  case 0x70:
873  case 0x71:
874  case 0x72:
875  ret = decode_imm2abs8(instr, cmd);
876  break;
877  default:
878  ret = -1;
879  }
880  break;
882  ret = decode_imm2ind16(instr, cmd);
883  break;
885  ret = decode_imm2abs8(instr, cmd);
886  break;
887  case H8300_BSR:
888  ret = decode_bsr(instr, cmd);
889  break;
890  case H8300_NOP:
891  ret = decode_nop(instr, cmd);
892  break;
893  case H8300_DAA:
894  case H8300_DAS:
895  case H8300_DEC:
896  case H8300_INC:
897  case H8300_NOT_NEG:
898  case H8300_ROTL:
899  case H8300_ROTR:
900  case H8300_SHL:
901  case H8300_SHR:
902  ret = decode_daa(instr, cmd);
903  break;
904  case H8300_DIVXU:
905  case H8300_MULXU:
906  ret = decode_r82r16(instr, cmd);
907  break;
908  case H8300_EEPMOV:
909  case H8300_RTS:
910  case H8300_RTE:
911  case H8300_SLEEP:
912  ret = decode_eepmov(instr, cmd);
913  break;
914  case H8300_JMP_1:
915  case H8300_JSR_1:
916  ret = decode_jmp_ind(instr, cmd);
917  break;
918  case H8300_JMP_2:
919  case H8300_JSR_2:
920  ret = decode_jmp_abs16(instr, cmd);
921  break;
922  case H8300_JMP_3:
923  case H8300_JSR_3:
924  case H8300_BRA:
925  case H8300_BRN:
926  case H8300_BHI:
927  case H8300_BLS:
928  case H8300_BCC:
929  case H8300_BCS:
930  case H8300_BNE:
931  case H8300_BEQ:
932  case H8300_BVC:
933  case H8300_BVS:
934  case H8300_BPL:
935  case H8300_BMI:
936  case H8300_BGE:
937  case H8300_BLT:
938  case H8300_BGT:
939  case H8300_BLE:
940  ret = decode_jmp_abs8(instr, cmd);
941  break;
942  case H8300_ORC:
943  case H8300_LDC:
944  case H8300_LDC_2:
945  case H8300_STC:
946  case H8300_XORC:
947  ret = decode_ldc(instr, cmd);
948  break;
949  case H8300_OR:
950  ret = decode_r2r8(instr, cmd);
951  break;
952  case H8300_MOV_2:
953  case H8300_SUBW:
954  ret = decode_r162r16(instr, cmd);
955  break;
956  case H8300_MOV_IMM162R16:
957  ret = decode_imm162r16(instr, cmd);
958  break;
959  case H8300_MOV_IND162R16:
960  ret = decode_ind162r16(instr, cmd);
961  break;
963  ret = decode_disp162r16(instr, cmd);
964  break;
966  ret = decode_indinc162r16(instr, cmd);
967  break;
968  case H8300_MOV_ABS162R16:
969  ret = decode_abs162r16(instr, cmd);
970  break;
971  case H8300_MOV_R82IND16:
972  ret = decode_r82ind16(instr, cmd);
973  break;
975  ret = decode_r82dispr16(instr, cmd);
976  break;
977  case H8300_MOV_R82RDEC16:
978  ret = decode_r82rdec16(instr, cmd);
979  break;
980  case H8300_MOV_R82ABS16:
981  ret = decode_r82abs16(instr, cmd);
982  break;
983  default:
984  return -1;
985  }
986 
987  return ret;
988 }
static int decode_abs162r16(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:610
static int decode_r82abs16(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:699
static int decode_indinc162r16(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:374
static int decode_daa(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:523
static int decode_subs(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:509
int decode_jmp_abs16(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:567
static int decode_imm162r16(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:319
static int decode_nop(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:725
static int decode_imm2r8(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:419
static int decode_bsr(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:305
static int decode_imm2r_short(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:766
static int decode_eepmov(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:216
static int decode_jmp_ind(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:596
static int decode_r82r16(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:551
static int decode_imm2abs8(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:448
static int decode_andc(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:272
static int decode_disp162r16(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:335
static int decode_r82rdec16(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:676
int decode_jmp_abs8(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:582
static int decode_rzind16(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:478
static int decode_abs2r_short(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:737
static int decode_r82dispr16(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:652
static int decode_r82ind16(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:631
static int decode_r162r16(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:258
static int decode_rzimm_short(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:752
static int decode_r2r8(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:462
static int decode_imm2ind16(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:434
static int decode_ind162r16(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:398
static int decode_rzabs8(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:494
static int decode_ldc(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:234
static int decode_adds(const ut8 *bytes, struct h8300_cmd *cmd)
Definition: h8300_disas.c:284
@ H8300_MOV_4BIT_2
Definition: h8300_disas.h:10
@ H8300_ADDX_4BIT
Definition: h8300_disas.h:13
@ H8300_ADD_4BIT
Definition: h8300_disas.h:12
@ H8300_OR_4BIT
Definition: h8300_disas.h:16
@ H8300_AND_4BIT
Definition: h8300_disas.h:18
@ H8300_MOV_4BIT_3
Definition: h8300_disas.h:11
@ H8300_CMP_4BIT
Definition: h8300_disas.h:14
@ H8300_XOR_4BIT
Definition: h8300_disas.h:17
@ H8300_SUBX_4BIT
Definition: h8300_disas.h:15
@ H8300_MOV_4BIT
Definition: h8300_disas.h:19
@ H8300_BGE
Definition: h8300_disas.h:67
@ H8300_SUB_1
Definition: h8300_disas.h:47
@ H8300_SLEEP
Definition: h8300_disas.h:24
@ H8300_SUBS
Definition: h8300_disas.h:50
@ H8300_BCC
Definition: h8300_disas.h:59
@ H8300_MOV_IMM162R16
Definition: h8300_disas.h:103
@ H8300_BOR_BIOR
Definition: h8300_disas.h:99
@ H8300_SUBX
Definition: h8300_disas.h:53
@ H8300_DAS
Definition: h8300_disas.h:54
@ H8300_SUBW
Definition: h8300_disas.h:48
@ H8300_ADDX
Definition: h8300_disas.h:37
@ H8300_BSET_1
Definition: h8300_disas.h:82
@ H8300_SHR
Definition: h8300_disas.h:40
@ H8300_BSR
Definition: h8300_disas.h:74
@ H8300_MOV_R82IND16
Definition: h8300_disas.h:87
@ H8300_EEPMOV
Definition: h8300_disas.h:104
@ H8300_BNOT_1
Definition: h8300_disas.h:83
@ H8300_BRA
Definition: h8300_disas.h:55
@ H8300_ROTR
Definition: h8300_disas.h:42
@ H8300_NOT_NEG
Definition: h8300_disas.h:46
@ H8300_BNE
Definition: h8300_disas.h:61
@ H8300_CMP_2
Definition: h8300_disas.h:52
@ H8300_JMP_2
Definition: h8300_disas.h:77
@ H8300_MOV_1
Definition: h8300_disas.h:35
@ H8300_BMI
Definition: h8300_disas.h:66
@ H8300_ADDB_DIRECT
Definition: h8300_disas.h:31
@ H8300_MOV_INDINC162R16
Definition: h8300_disas.h:92
@ H8300_BLT
Definition: h8300_disas.h:68
@ H8300_BHI
Definition: h8300_disas.h:57
@ H8300_BLS
Definition: h8300_disas.h:58
@ H8300_BVC
Definition: h8300_disas.h:63
@ H8300_MOV_R82DISPR16
Definition: h8300_disas.h:93
@ H8300_BPL
Definition: h8300_disas.h:65
@ H8300_MOV_ABS162R16
Definition: h8300_disas.h:90
@ H8300_DEC
Definition: h8300_disas.h:49
@ H8300_NOP
Definition: h8300_disas.h:23
@ H8300_ROTL
Definition: h8300_disas.h:41
@ H8300_CMP_1
Definition: h8300_disas.h:51
@ H8300_MOV_2
Definition: h8300_disas.h:36
@ H8300_MOV_IND162R16
Definition: h8300_disas.h:88
@ H8300_BSET_2
Definition: h8300_disas.h:95
@ H8300_INC
Definition: h8300_disas.h:33
@ H8300_XOR
Definition: h8300_disas.h:44
@ H8300_MOV_R82ABS16
Definition: h8300_disas.h:89
@ H8300_OR
Definition: h8300_disas.h:43
@ H8300_DIVXU
Definition: h8300_disas.h:72
@ H8300_MOV_R82RDEC16
Definition: h8300_disas.h:91
@ H8300_ADDW_DIRECT
Definition: h8300_disas.h:32
@ H8300_BNOT_2
Definition: h8300_disas.h:96
@ H8300_BCS
Definition: h8300_disas.h:60
@ H8300_BCLR_R2R8
Definition: h8300_disas.h:84
@ H8300_BGT
Definition: h8300_disas.h:69
@ H8300_BAND_BIAND
Definition: h8300_disas.h:101
@ H8300_JSR_2
Definition: h8300_disas.h:80
@ H8300_BILD_IMM2R8
Definition: h8300_disas.h:102
@ H8300_JMP_3
Definition: h8300_disas.h:78
@ H8300_ANDC
Definition: h8300_disas.h:29
@ H8300_BST_BIST
Definition: h8300_disas.h:86
@ H8300_ADDS
Definition: h8300_disas.h:34
@ H8300_JSR_1
Definition: h8300_disas.h:79
@ H8300_MULXU
Definition: h8300_disas.h:71
@ H8300_JMP_1
Definition: h8300_disas.h:76
@ H8300_MOV_DISP162R16
Definition: h8300_disas.h:94
@ H8300_BLE
Definition: h8300_disas.h:70
@ H8300_BVS
Definition: h8300_disas.h:64
@ H8300_SHL
Definition: h8300_disas.h:39
@ H8300_BRN
Definition: h8300_disas.h:56
@ H8300_BTST_R2R8
Definition: h8300_disas.h:85
@ H8300_BEQ
Definition: h8300_disas.h:62
@ H8300_DAA
Definition: h8300_disas.h:38
@ H8300_BXOR_BIXOR
Definition: h8300_disas.h:100
@ H8300_BTST
Definition: h8300_disas.h:98
@ H8300_JSR_3
Definition: h8300_disas.h:81
@ H8300_BCLR_IMM2R8
Definition: h8300_disas.h:97
@ H8300_AND
Definition: h8300_disas.h:45

References cmd, decode_abs162r16(), decode_abs2r_short(), decode_adds(), decode_andc(), decode_bsr(), decode_daa(), decode_disp162r16(), decode_eepmov(), decode_imm162r16(), decode_imm2abs8(), decode_imm2ind16(), decode_imm2r8(), decode_imm2r_short(), decode_ind162r16(), decode_indinc162r16(), decode_jmp_abs16(), decode_jmp_abs8(), decode_jmp_ind(), decode_ldc(), decode_nop(), decode_r162r16(), decode_r2r8(), decode_r82abs16(), decode_r82dispr16(), decode_r82ind16(), decode_r82r16(), decode_r82rdec16(), decode_rzabs8(), decode_rzimm_short(), decode_rzind16(), decode_subs(), H8300_ADD_4BIT, H8300_ADDB_DIRECT, H8300_ADDS, H8300_ADDW_DIRECT, H8300_ADDX, H8300_ADDX_4BIT, H8300_AND, H8300_AND_4BIT, H8300_ANDC, H8300_BAND_BIAND, H8300_BCC, H8300_BCLR_IMM2R8, H8300_BCLR_R2ABS8, H8300_BCLR_R2IND16, H8300_BCLR_R2R8, H8300_BCS, H8300_BEQ, H8300_BGE, H8300_BGT, H8300_BHI, H8300_BIAND_IMM2ABS8, H8300_BIAND_IMM2IND16, H8300_BILD_IMM2R8, H8300_BLE, H8300_BLS, H8300_BLT, H8300_BMI, H8300_BNE, H8300_BNOT_1, H8300_BNOT_2, H8300_BOR_BIOR, H8300_BPL, H8300_BRA, H8300_BRN, H8300_BSET_1, H8300_BSET_2, H8300_BSR, H8300_BST_BIST, H8300_BTST, H8300_BTST_R2R8, H8300_BVC, H8300_BVS, H8300_BXOR_BIXOR, H8300_CMP_1, H8300_CMP_2, H8300_CMP_4BIT, H8300_DAA, H8300_DAS, H8300_DEC, H8300_DIVXU, H8300_EEPMOV, H8300_INC, H8300_JMP_1, H8300_JMP_2, H8300_JMP_3, H8300_JSR_1, H8300_JSR_2, H8300_JSR_3, H8300_LDC, H8300_LDC_2, H8300_MOV_1, H8300_MOV_2, H8300_MOV_4BIT, H8300_MOV_4BIT_2, H8300_MOV_4BIT_3, H8300_MOV_ABS162R16, H8300_MOV_DISP162R16, H8300_MOV_IMM162R16, H8300_MOV_IND162R16, H8300_MOV_INDINC162R16, H8300_MOV_R82ABS16, H8300_MOV_R82DISPR16, H8300_MOV_R82IND16, H8300_MOV_R82RDEC16, H8300_MULXU, H8300_NOP, H8300_NOT_NEG, H8300_OR, H8300_OR_4BIT, H8300_ORC, H8300_ROTL, H8300_ROTR, H8300_RTE, H8300_RTS, H8300_SHL, H8300_SHR, H8300_SLEEP, H8300_STC, H8300_SUB_1, H8300_SUBS, H8300_SUBW, H8300_SUBX, H8300_SUBX_4BIT, H8300_XOR, H8300_XOR_4BIT, and H8300_XORC.

Referenced by disassemble(), and h8300_op().

Variable Documentation

◆ commands

const char* commands[]
static

Definition at line 21 of file h8300_disas.c.

Referenced by decode_opcode(), and mach0_info_new().

◆ commands_4bit

const char* commands_4bit[]
static
Initial value:
= {
[H8300_MOV_4BIT_2] = "mov.b",
[H8300_MOV_4BIT_3] = "mov.b",
[H8300_ADD_4BIT] = "add.b",
[H8300_ADDX_4BIT] = "addx",
[H8300_CMP_4BIT] = "cmp.b",
[H8300_SUBX_4BIT] = "subx",
[H8300_OR_4BIT] = "or",
[H8300_XOR_4BIT] = "xor",
[H8300_AND_4BIT] = "and",
[H8300_MOV_4BIT] = "mov.b"
}

Definition at line 8 of file h8300_disas.c.

Referenced by decode_opcode_4bit().

◆ commands_9bit

const char* commands_9bit[]
static
Initial value:
= {
[H8300_BST] = "bst",
[H8300_BIST] = "bist",
[H8300_BOR] = "bor",
[H8300_BIOR] = "bior",
[H8300_BXOR] = "bxor",
[H8300_BIXOR] = "bixor",
[H8300_BAND] = "band",
[H8300_BIAND] = "biand",
[H8300_BLD] = "bld",
[H8300_BILD] = "bild",
}

Definition at line 117 of file h8300_disas.c.

Referenced by decode_opcode().