1 /* DO NOT EDIT! -*- buffer-read-only: t -*- vi:set ro: */
2 #line 1 "rl78-decode.opc"
4 /* Copyright (C) 2012-2024 Free Software Foundation, Inc.
5 Contributed by Red Hat.
8 This file is part of the GNU opcodes library.
10 This library is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3, or (at your option)
15 It is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
18 License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
23 MA 02110-1301, USA. */
31 #include "opcode/rl78.h"
37 RL78_Opcode_Decoded
* rl78
;
38 int (* getbyte
)(void *);
43 #define ID(x) rl78->id = RLO_##x, rl78->lineno = __LINE__
44 #define OP(n,t,r,a) (rl78->op[n].type = t, \
45 rl78->op[n].reg = r, \
46 rl78->op[n].addend = a )
47 #define OPX(n,t,r1,r2,a) \
48 (rl78->op[n].type = t, \
49 rl78->op[n].reg = r1, \
50 rl78->op[n].reg2 = r2, \
51 rl78->op[n].addend = a )
53 #define W() rl78->size = RL78_Word
55 #define AU ATTRIBUTE_UNUSED
58 #define GETBYTE() (ld->rl78->n_bytes < (OP_BUF_LEN - 1) ? ld->op [ld->rl78->n_bytes++] = ld->getbyte (ld->ptr): 0)
59 #define B ((unsigned long) GETBYTE())
61 #define SYNTAX(x) rl78->syntax = x
63 #define UNSUPPORTED() \
64 rl78->syntax = "*unknown*"
66 #define RB(x) ((x)+RL78_Reg_X)
67 #define RW(x) ((x)+RL78_Reg_AX)
69 #define Fz rl78->flags = RL78_PSW_Z
70 #define Fza rl78->flags = RL78_PSW_Z | RL78_PSW_AC
71 #define Fzc rl78->flags = RL78_PSW_Z | RL78_PSW_CY
72 #define Fzac rl78->flags = RL78_PSW_Z | RL78_PSW_AC | RL78_PSW_CY
73 #define Fa rl78->flags = RL78_PSW_AC
74 #define Fc rl78->flags = RL78_PSW_CY
75 #define Fac rl78->flags = RL78_PSW_AC | RL78_PSW_CY
77 #define IMMU(bytes) immediate (bytes, 0, ld)
78 #define IMMS(bytes) immediate (bytes, 1, ld)
81 immediate (int bytes
, int sign_extend
, LocalData
* ld
)
89 if (sign_extend
&& (i
& 0x80))
95 if (sign_extend
&& (i
& 0x8000))
102 if (sign_extend
&& (i
& 0x800000))
106 opcodes_error_handler
107 /* xgettext:c-format */
108 (_("internal error: immediate() called with invalid byte count %d"),
115 #define DC(c) OP (0, RL78_Operand_Immediate, 0, c)
116 #define DR(r) OP (0, RL78_Operand_Register, RL78_Reg_##r, 0)
117 #define DRB(r) OP (0, RL78_Operand_Register, RB(r), 0)
118 #define DRW(r) OP (0, RL78_Operand_Register, RW(r), 0)
119 #define DM(r,a) OP (0, RL78_Operand_Indirect, RL78_Reg_##r, a)
120 #define DM2(r1,r2,a) OPX (0, RL78_Operand_Indirect, RL78_Reg_##r1, RL78_Reg_##r2, a)
121 #define DE() rl78->op[0].use_es = 1
122 #define DB(b) set_bit (rl78->op, b)
123 #define DCY() DR(PSW); DB(0)
124 #define DPUSH() OP (0, RL78_Operand_PreDec, RL78_Reg_SP, 0);
126 #define SC(c) OP (1, RL78_Operand_Immediate, 0, c)
127 #define SR(r) OP (1, RL78_Operand_Register, RL78_Reg_##r, 0)
128 #define SRB(r) OP (1, RL78_Operand_Register, RB(r), 0)
129 #define SRW(r) OP (1, RL78_Operand_Register, RW(r), 0)
130 #define SM(r,a) OP (1, RL78_Operand_Indirect, RL78_Reg_##r, a)
131 #define SM2(r1,r2,a) OPX (1, RL78_Operand_Indirect, RL78_Reg_##r1, RL78_Reg_##r2, a)
132 #define SE() rl78->op[1].use_es = 1
133 #define SB(b) set_bit (rl78->op+1, b)
134 #define SCY() SR(PSW); SB(0)
135 #define COND(c) rl78->op[1].condition = RL78_Condition_##c
136 #define SPOP() OP (1, RL78_Operand_PostInc, RL78_Reg_SP, 0);
139 set_bit (RL78_Opcode_Operand
*op
, int bit
)
141 op
->bit_number
= bit
;
143 case RL78_Operand_Register
:
144 op
->type
= RL78_Operand_Bit
;
146 case RL78_Operand_Indirect
:
147 op
->type
= RL78_Operand_BitIndirect
;
168 #define SADDR saddr (IMMU (1))
169 #define SFR sfr (IMMU (1))
172 rl78_decode_opcode (unsigned long pc AU
,
173 RL78_Opcode_Decoded
* rl78
,
174 int (* getbyte
)(void *),
178 LocalData lds
, * ld
= &lds
;
179 unsigned char op_buf
[OP_BUF_LEN
] = {0};
180 unsigned char *op
= op_buf
;
184 lds
.getbyte
= getbyte
;
188 memset (rl78
, 0, sizeof (*rl78
));
192 /* Byte registers, not including A. */
193 /* Word registers, not including AX. */
195 /*----------------------------------------------------------------------*/
199 switch (op
[0] & 0xff)
206 printf ("\033[33m%s\033[0m %02x\n",
207 "/** 0000 0000 nop */",
211 #line 917 "rl78-decode.opc"
214 /*----------------------------------------------------------------------*/
223 /** 0000 0rw1 addw %0, %1 */
224 #line 280 "rl78-decode.opc"
225 int rw AU
= (op
[0] >> 1) & 0x03;
228 printf ("\033[33m%s\033[0m %02x\n",
229 "/** 0000 0rw1 addw %0, %1 */",
231 printf (" rw = 0x%x\n", rw
);
233 SYNTAX("addw %0, %1");
234 #line 280 "rl78-decode.opc"
235 ID(add
); W(); DR(AX
); SRW(rw
); Fzac
;
241 /** 0000 0010 addw %0, %e!1 */
244 printf ("\033[33m%s\033[0m %02x\n",
245 "/** 0000 0010 addw %0, %e!1 */",
248 SYNTAX("addw %0, %e!1");
249 #line 271 "rl78-decode.opc"
250 ID(add
); W(); DR(AX
); SM(None
, IMMU(2)); Fzac
;
256 /** 0000 0100 addw %0, #%1 */
259 printf ("\033[33m%s\033[0m %02x\n",
260 "/** 0000 0100 addw %0, #%1 */",
263 SYNTAX("addw %0, #%1");
264 #line 277 "rl78-decode.opc"
265 ID(add
); W(); DR(AX
); SC(IMMU(2)); Fzac
;
271 /** 0000 0110 addw %0, %1 */
274 printf ("\033[33m%s\033[0m %02x\n",
275 "/** 0000 0110 addw %0, %1 */",
278 SYNTAX("addw %0, %1");
279 #line 283 "rl78-decode.opc"
280 ID(add
); W(); DR(AX
); SM(None
, SADDR
); Fzac
;
286 /** 0000 1000 xch a, x */
289 printf ("\033[33m%s\033[0m %02x\n",
290 "/** 0000 1000 xch a, x */",
294 #line 1240 "rl78-decode.opc"
295 ID(xch
); DR(A
); SR(X
);
297 /*----------------------------------------------------------------------*/
303 /** 0000 1001 mov %0, %e1 */
306 printf ("\033[33m%s\033[0m %02x\n",
307 "/** 0000 1001 mov %0, %e1 */",
310 SYNTAX("mov %0, %e1");
311 #line 684 "rl78-decode.opc"
312 ID(mov
); DR(A
); SM(B
, IMMU(2));
318 /** 0000 1010 add %0, #%1 */
321 printf ("\033[33m%s\033[0m %02x\n",
322 "/** 0000 1010 add %0, #%1 */",
325 SYNTAX("add %0, #%1");
326 #line 234 "rl78-decode.opc"
327 ID(add
); DM(None
, SADDR
); SC(IMMU(1)); Fzac
;
329 /*----------------------------------------------------------------------*/
335 /** 0000 1011 add %0, %1 */
338 printf ("\033[33m%s\033[0m %02x\n",
339 "/** 0000 1011 add %0, %1 */",
342 SYNTAX("add %0, %1");
343 #line 228 "rl78-decode.opc"
344 ID(add
); DR(A
); SM(None
, SADDR
); Fzac
;
350 /** 0000 1100 add %0, #%1 */
353 printf ("\033[33m%s\033[0m %02x\n",
354 "/** 0000 1100 add %0, #%1 */",
357 SYNTAX("add %0, #%1");
358 #line 222 "rl78-decode.opc"
359 ID(add
); DR(A
); SC(IMMU(1)); Fzac
;
365 /** 0000 1101 add %0, %e1 */
368 printf ("\033[33m%s\033[0m %02x\n",
369 "/** 0000 1101 add %0, %e1 */",
372 SYNTAX("add %0, %e1");
373 #line 210 "rl78-decode.opc"
374 ID(add
); DR(A
); SM(HL
, 0); Fzac
;
380 /** 0000 1110 add %0, %ea1 */
383 printf ("\033[33m%s\033[0m %02x\n",
384 "/** 0000 1110 add %0, %ea1 */",
387 SYNTAX("add %0, %ea1");
388 #line 216 "rl78-decode.opc"
389 ID(add
); DR(A
); SM(HL
, IMMU(1)); Fzac
;
395 /** 0000 1111 add %0, %e!1 */
398 printf ("\033[33m%s\033[0m %02x\n",
399 "/** 0000 1111 add %0, %e!1 */",
402 SYNTAX("add %0, %e!1");
403 #line 207 "rl78-decode.opc"
404 ID(add
); DR(A
); SM(None
, IMMU(2)); Fzac
;
410 /** 0001 0000 addw %0, #%1 */
413 printf ("\033[33m%s\033[0m %02x\n",
414 "/** 0001 0000 addw %0, #%1 */",
417 SYNTAX("addw %0, #%1");
418 #line 286 "rl78-decode.opc"
419 ID(add
); W(); DR(SP
); SC(IMMU(1)); Fzac
;
421 /*----------------------------------------------------------------------*/
430 printf ("\033[33m%s\033[0m %02x\n",
431 "/** 0001 0001 es: */",
435 #line 199 "rl78-decode.opc"
441 /*----------------------------------------------------------------------*/
449 /** 0001 0ra0 movw %0, %1 */
450 #line 865 "rl78-decode.opc"
451 int ra AU
= (op
[0] >> 1) & 0x03;
454 printf ("\033[33m%s\033[0m %02x\n",
455 "/** 0001 0ra0 movw %0, %1 */",
457 printf (" ra = 0x%x\n", ra
);
459 SYNTAX("movw %0, %1");
460 #line 865 "rl78-decode.opc"
461 ID(mov
); W(); DRW(ra
); SR(AX
);
469 /** 0001 0ra1 movw %0, %1 */
470 #line 862 "rl78-decode.opc"
471 int ra AU
= (op
[0] >> 1) & 0x03;
474 printf ("\033[33m%s\033[0m %02x\n",
475 "/** 0001 0ra1 movw %0, %1 */",
477 printf (" ra = 0x%x\n", ra
);
479 SYNTAX("movw %0, %1");
480 #line 862 "rl78-decode.opc"
481 ID(mov
); W(); DR(AX
); SRW(ra
);
487 /** 0001 1000 mov %e0, %1 */
490 printf ("\033[33m%s\033[0m %02x\n",
491 "/** 0001 1000 mov %e0, %1 */",
494 SYNTAX("mov %e0, %1");
495 #line 735 "rl78-decode.opc"
496 ID(mov
); DM(B
, IMMU(2)); SR(A
);
502 /** 0001 1001 mov %e0, #%1 */
505 printf ("\033[33m%s\033[0m %02x\n",
506 "/** 0001 1001 mov %e0, #%1 */",
509 SYNTAX("mov %e0, #%1");
510 #line 732 "rl78-decode.opc"
511 ID(mov
); DM(B
, IMMU(2)); SC(IMMU(1));
517 /** 0001 1010 addc %0, #%1 */
520 printf ("\033[33m%s\033[0m %02x\n",
521 "/** 0001 1010 addc %0, #%1 */",
524 SYNTAX("addc %0, #%1");
525 #line 266 "rl78-decode.opc"
526 ID(addc
); DM(None
, SADDR
); SC(IMMU(1)); Fzac
;
528 /*----------------------------------------------------------------------*/
534 /** 0001 1011 addc %0, %1 */
537 printf ("\033[33m%s\033[0m %02x\n",
538 "/** 0001 1011 addc %0, %1 */",
541 SYNTAX("addc %0, %1");
542 #line 263 "rl78-decode.opc"
543 ID(addc
); DR(A
); SM(None
, SADDR
); Fzac
;
549 /** 0001 1100 addc %0, #%1 */
552 printf ("\033[33m%s\033[0m %02x\n",
553 "/** 0001 1100 addc %0, #%1 */",
556 SYNTAX("addc %0, #%1");
557 #line 254 "rl78-decode.opc"
558 ID(addc
); DR(A
); SC(IMMU(1)); Fzac
;
564 /** 0001 1101 addc %0, %e1 */
567 printf ("\033[33m%s\033[0m %02x\n",
568 "/** 0001 1101 addc %0, %e1 */",
571 SYNTAX("addc %0, %e1");
572 #line 242 "rl78-decode.opc"
573 ID(addc
); DR(A
); SM(HL
, 0); Fzac
;
579 /** 0001 1110 addc %0, %ea1 */
582 printf ("\033[33m%s\033[0m %02x\n",
583 "/** 0001 1110 addc %0, %ea1 */",
586 SYNTAX("addc %0, %ea1");
587 #line 251 "rl78-decode.opc"
588 ID(addc
); DR(A
); SM(HL
, IMMU(1)); Fzac
;
594 /** 0001 1111 addc %0, %e!1 */
597 printf ("\033[33m%s\033[0m %02x\n",
598 "/** 0001 1111 addc %0, %e!1 */",
601 SYNTAX("addc %0, %e!1");
602 #line 239 "rl78-decode.opc"
603 ID(addc
); DR(A
); SM(None
, IMMU(2)); Fzac
;
609 /** 0010 0000 subw %0, #%1 */
612 printf ("\033[33m%s\033[0m %02x\n",
613 "/** 0010 0000 subw %0, #%1 */",
616 SYNTAX("subw %0, #%1");
617 #line 1204 "rl78-decode.opc"
618 ID(sub
); W(); DR(SP
); SC(IMMU(1)); Fzac
;
620 /*----------------------------------------------------------------------*/
629 /** 0010 0rw1 subw %0, %1 */
630 #line 1198 "rl78-decode.opc"
631 int rw AU
= (op
[0] >> 1) & 0x03;
634 printf ("\033[33m%s\033[0m %02x\n",
635 "/** 0010 0rw1 subw %0, %1 */",
637 printf (" rw = 0x%x\n", rw
);
639 SYNTAX("subw %0, %1");
640 #line 1198 "rl78-decode.opc"
641 ID(sub
); W(); DR(AX
); SRW(rw
); Fzac
;
647 /** 0010 0010 subw %0, %e!1 */
650 printf ("\033[33m%s\033[0m %02x\n",
651 "/** 0010 0010 subw %0, %e!1 */",
654 SYNTAX("subw %0, %e!1");
655 #line 1189 "rl78-decode.opc"
656 ID(sub
); W(); DR(AX
); SM(None
, IMMU(2)); Fzac
;
662 /** 0010 0100 subw %0, #%1 */
665 printf ("\033[33m%s\033[0m %02x\n",
666 "/** 0010 0100 subw %0, #%1 */",
669 SYNTAX("subw %0, #%1");
670 #line 1195 "rl78-decode.opc"
671 ID(sub
); W(); DR(AX
); SC(IMMU(2)); Fzac
;
677 /** 0010 0110 subw %0, %1 */
680 printf ("\033[33m%s\033[0m %02x\n",
681 "/** 0010 0110 subw %0, %1 */",
684 SYNTAX("subw %0, %1");
685 #line 1201 "rl78-decode.opc"
686 ID(sub
); W(); DR(AX
); SM(None
, SADDR
); Fzac
;
692 /** 0010 1000 mov %e0, %1 */
695 printf ("\033[33m%s\033[0m %02x\n",
696 "/** 0010 1000 mov %e0, %1 */",
699 SYNTAX("mov %e0, %1");
700 #line 747 "rl78-decode.opc"
701 ID(mov
); DM(C
, IMMU(2)); SR(A
);
707 /** 0010 1001 mov %0, %e1 */
710 printf ("\033[33m%s\033[0m %02x\n",
711 "/** 0010 1001 mov %0, %e1 */",
714 SYNTAX("mov %0, %e1");
715 #line 690 "rl78-decode.opc"
716 ID(mov
); DR(A
); SM(C
, IMMU(2));
722 /** 0010 1010 sub %0, #%1 */
725 printf ("\033[33m%s\033[0m %02x\n",
726 "/** 0010 1010 sub %0, #%1 */",
729 SYNTAX("sub %0, #%1");
730 #line 1152 "rl78-decode.opc"
731 ID(sub
); DM(None
, SADDR
); SC(IMMU(1)); Fzac
;
733 /*----------------------------------------------------------------------*/
739 /** 0010 1011 sub %0, %1 */
742 printf ("\033[33m%s\033[0m %02x\n",
743 "/** 0010 1011 sub %0, %1 */",
746 SYNTAX("sub %0, %1");
747 #line 1146 "rl78-decode.opc"
748 ID(sub
); DR(A
); SM(None
, SADDR
); Fzac
;
754 /** 0010 1100 sub %0, #%1 */
757 printf ("\033[33m%s\033[0m %02x\n",
758 "/** 0010 1100 sub %0, #%1 */",
761 SYNTAX("sub %0, #%1");
762 #line 1140 "rl78-decode.opc"
763 ID(sub
); DR(A
); SC(IMMU(1)); Fzac
;
769 /** 0010 1101 sub %0, %e1 */
772 printf ("\033[33m%s\033[0m %02x\n",
773 "/** 0010 1101 sub %0, %e1 */",
776 SYNTAX("sub %0, %e1");
777 #line 1128 "rl78-decode.opc"
778 ID(sub
); DR(A
); SM(HL
, 0); Fzac
;
784 /** 0010 1110 sub %0, %ea1 */
787 printf ("\033[33m%s\033[0m %02x\n",
788 "/** 0010 1110 sub %0, %ea1 */",
791 SYNTAX("sub %0, %ea1");
792 #line 1134 "rl78-decode.opc"
793 ID(sub
); DR(A
); SM(HL
, IMMU(1)); Fzac
;
799 /** 0010 1111 sub %0, %e!1 */
802 printf ("\033[33m%s\033[0m %02x\n",
803 "/** 0010 1111 sub %0, %e!1 */",
806 SYNTAX("sub %0, %e!1");
807 #line 1125 "rl78-decode.opc"
808 ID(sub
); DR(A
); SM(None
, IMMU(2)); Fzac
;
817 /** 0011 0rg0 movw %0, #%1 */
818 #line 859 "rl78-decode.opc"
819 int rg AU
= (op
[0] >> 1) & 0x03;
822 printf ("\033[33m%s\033[0m %02x\n",
823 "/** 0011 0rg0 movw %0, #%1 */",
825 printf (" rg = 0x%x\n", rg
);
827 SYNTAX("movw %0, #%1");
828 #line 859 "rl78-decode.opc"
829 ID(mov
); W(); DRW(rg
); SC(IMMU(2));
835 switch (op
[1] & 0x8f)
839 /** 0011 0001 0bit 0000 btclr %s1, $%a0 */
840 #line 422 "rl78-decode.opc"
841 int bit AU
= (op
[1] >> 4) & 0x07;
844 printf ("\033[33m%s\033[0m %02x %02x\n",
845 "/** 0011 0001 0bit 0000 btclr %s1, $%a0 */",
847 printf (" bit = 0x%x\n", bit
);
849 SYNTAX("btclr %s1, $%a0");
850 #line 422 "rl78-decode.opc"
851 ID(branch_cond_clear
); SM(None
, SADDR
); SB(bit
); DC(pc
+IMMS(1)+4); COND(T
);
853 /*----------------------------------------------------------------------*/
859 /** 0011 0001 0bit 0001 btclr %1, $%a0 */
860 #line 416 "rl78-decode.opc"
861 int bit AU
= (op
[1] >> 4) & 0x07;
864 printf ("\033[33m%s\033[0m %02x %02x\n",
865 "/** 0011 0001 0bit 0001 btclr %1, $%a0 */",
867 printf (" bit = 0x%x\n", bit
);
869 SYNTAX("btclr %1, $%a0");
870 #line 416 "rl78-decode.opc"
871 ID(branch_cond_clear
); DC(pc
+IMMS(1)+3); SR(A
); SB(bit
); COND(T
);
877 /** 0011 0001 0bit 0010 bt %s1, $%a0 */
878 #line 408 "rl78-decode.opc"
879 int bit AU
= (op
[1] >> 4) & 0x07;
882 printf ("\033[33m%s\033[0m %02x %02x\n",
883 "/** 0011 0001 0bit 0010 bt %s1, $%a0 */",
885 printf (" bit = 0x%x\n", bit
);
887 SYNTAX("bt %s1, $%a0");
888 #line 408 "rl78-decode.opc"
889 ID(branch_cond
); SM(None
, SADDR
); SB(bit
); DC(pc
+IMMS(1)+4); COND(T
);
891 /*----------------------------------------------------------------------*/
897 /** 0011 0001 0bit 0011 bt %1, $%a0 */
898 #line 402 "rl78-decode.opc"
899 int bit AU
= (op
[1] >> 4) & 0x07;
902 printf ("\033[33m%s\033[0m %02x %02x\n",
903 "/** 0011 0001 0bit 0011 bt %1, $%a0 */",
905 printf (" bit = 0x%x\n", bit
);
907 SYNTAX("bt %1, $%a0");
908 #line 402 "rl78-decode.opc"
909 ID(branch_cond
); DC(pc
+IMMS(1)+3); SR(A
); SB(bit
); COND(T
);
915 /** 0011 0001 0bit 0100 bf %s1, $%a0 */
916 #line 369 "rl78-decode.opc"
917 int bit AU
= (op
[1] >> 4) & 0x07;
920 printf ("\033[33m%s\033[0m %02x %02x\n",
921 "/** 0011 0001 0bit 0100 bf %s1, $%a0 */",
923 printf (" bit = 0x%x\n", bit
);
925 SYNTAX("bf %s1, $%a0");
926 #line 369 "rl78-decode.opc"
927 ID(branch_cond
); SM(None
, SADDR
); SB(bit
); DC(pc
+IMMS(1)+4); COND(F
);
929 /*----------------------------------------------------------------------*/
935 /** 0011 0001 0bit 0101 bf %1, $%a0 */
936 #line 363 "rl78-decode.opc"
937 int bit AU
= (op
[1] >> 4) & 0x07;
940 printf ("\033[33m%s\033[0m %02x %02x\n",
941 "/** 0011 0001 0bit 0101 bf %1, $%a0 */",
943 printf (" bit = 0x%x\n", bit
);
945 SYNTAX("bf %1, $%a0");
946 #line 363 "rl78-decode.opc"
947 ID(branch_cond
); DC(pc
+IMMS(1)+3); SR(A
); SB(bit
); COND(F
);
953 /** 0011 0001 0cnt 0111 shl %0, %1 */
954 #line 1081 "rl78-decode.opc"
955 int cnt AU
= (op
[1] >> 4) & 0x07;
958 printf ("\033[33m%s\033[0m %02x %02x\n",
959 "/** 0011 0001 0cnt 0111 shl %0, %1 */",
961 printf (" cnt = 0x%x\n", cnt
);
963 SYNTAX("shl %0, %1");
964 #line 1081 "rl78-decode.opc"
965 ID(shl
); DR(C
); SC(cnt
);
971 /** 0011 0001 0cnt 1000 shl %0, %1 */
972 #line 1078 "rl78-decode.opc"
973 int cnt AU
= (op
[1] >> 4) & 0x07;
976 printf ("\033[33m%s\033[0m %02x %02x\n",
977 "/** 0011 0001 0cnt 1000 shl %0, %1 */",
979 printf (" cnt = 0x%x\n", cnt
);
981 SYNTAX("shl %0, %1");
982 #line 1078 "rl78-decode.opc"
983 ID(shl
); DR(B
); SC(cnt
);
989 /** 0011 0001 0cnt 1001 shl %0, %1 */
990 #line 1075 "rl78-decode.opc"
991 int cnt AU
= (op
[1] >> 4) & 0x07;
994 printf ("\033[33m%s\033[0m %02x %02x\n",
995 "/** 0011 0001 0cnt 1001 shl %0, %1 */",
997 printf (" cnt = 0x%x\n", cnt
);
999 SYNTAX("shl %0, %1");
1000 #line 1075 "rl78-decode.opc"
1001 ID(shl
); DR(A
); SC(cnt
);
1007 /** 0011 0001 0cnt 1010 shr %0, %1 */
1008 #line 1092 "rl78-decode.opc"
1009 int cnt AU
= (op
[1] >> 4) & 0x07;
1012 printf ("\033[33m%s\033[0m %02x %02x\n",
1013 "/** 0011 0001 0cnt 1010 shr %0, %1 */",
1015 printf (" cnt = 0x%x\n", cnt
);
1017 SYNTAX("shr %0, %1");
1018 #line 1092 "rl78-decode.opc"
1019 ID(shr
); DR(A
); SC(cnt
);
1025 /** 0011 0001 0cnt 1011 sar %0, %1 */
1026 #line 1039 "rl78-decode.opc"
1027 int cnt AU
= (op
[1] >> 4) & 0x07;
1030 printf ("\033[33m%s\033[0m %02x %02x\n",
1031 "/** 0011 0001 0cnt 1011 sar %0, %1 */",
1033 printf (" cnt = 0x%x\n", cnt
);
1035 SYNTAX("sar %0, %1");
1036 #line 1039 "rl78-decode.opc"
1037 ID(sar
); DR(A
); SC(cnt
);
1044 /** 0011 0001 wcnt 1100 shlw %0, %1 */
1045 #line 1087 "rl78-decode.opc"
1046 int wcnt AU
= (op
[1] >> 4) & 0x0f;
1049 printf ("\033[33m%s\033[0m %02x %02x\n",
1050 "/** 0011 0001 wcnt 1100 shlw %0, %1 */",
1052 printf (" wcnt = 0x%x\n", wcnt
);
1054 SYNTAX("shlw %0, %1");
1055 #line 1087 "rl78-decode.opc"
1056 ID(shl
); W(); DR(BC
); SC(wcnt
);
1058 /*----------------------------------------------------------------------*/
1065 /** 0011 0001 wcnt 1101 shlw %0, %1 */
1066 #line 1084 "rl78-decode.opc"
1067 int wcnt AU
= (op
[1] >> 4) & 0x0f;
1070 printf ("\033[33m%s\033[0m %02x %02x\n",
1071 "/** 0011 0001 wcnt 1101 shlw %0, %1 */",
1073 printf (" wcnt = 0x%x\n", wcnt
);
1075 SYNTAX("shlw %0, %1");
1076 #line 1084 "rl78-decode.opc"
1077 ID(shl
); W(); DR(AX
); SC(wcnt
);
1084 /** 0011 0001 wcnt 1110 shrw %0, %1 */
1085 #line 1095 "rl78-decode.opc"
1086 int wcnt AU
= (op
[1] >> 4) & 0x0f;
1089 printf ("\033[33m%s\033[0m %02x %02x\n",
1090 "/** 0011 0001 wcnt 1110 shrw %0, %1 */",
1092 printf (" wcnt = 0x%x\n", wcnt
);
1094 SYNTAX("shrw %0, %1");
1095 #line 1095 "rl78-decode.opc"
1096 ID(shr
); W(); DR(AX
); SC(wcnt
);
1098 /*----------------------------------------------------------------------*/
1105 /** 0011 0001 wcnt 1111 sarw %0, %1 */
1106 #line 1042 "rl78-decode.opc"
1107 int wcnt AU
= (op
[1] >> 4) & 0x0f;
1110 printf ("\033[33m%s\033[0m %02x %02x\n",
1111 "/** 0011 0001 wcnt 1111 sarw %0, %1 */",
1113 printf (" wcnt = 0x%x\n", wcnt
);
1115 SYNTAX("sarw %0, %1");
1116 #line 1042 "rl78-decode.opc"
1117 ID(sar
); W(); DR(AX
); SC(wcnt
);
1119 /*----------------------------------------------------------------------*/
1125 /** 0011 0001 1bit 0000 btclr %s1, $%a0 */
1126 #line 419 "rl78-decode.opc"
1127 int bit AU
= (op
[1] >> 4) & 0x07;
1130 printf ("\033[33m%s\033[0m %02x %02x\n",
1131 "/** 0011 0001 1bit 0000 btclr %s1, $%a0 */",
1133 printf (" bit = 0x%x\n", bit
);
1135 SYNTAX("btclr %s1, $%a0");
1136 #line 419 "rl78-decode.opc"
1137 ID(branch_cond_clear
); SM(None
, SFR
); SB(bit
); DC(pc
+IMMS(1)+4); COND(T
);
1143 /** 0011 0001 1bit 0001 btclr %e1, $%a0 */
1144 #line 413 "rl78-decode.opc"
1145 int bit AU
= (op
[1] >> 4) & 0x07;
1148 printf ("\033[33m%s\033[0m %02x %02x\n",
1149 "/** 0011 0001 1bit 0001 btclr %e1, $%a0 */",
1151 printf (" bit = 0x%x\n", bit
);
1153 SYNTAX("btclr %e1, $%a0");
1154 #line 413 "rl78-decode.opc"
1155 ID(branch_cond_clear
); DC(pc
+IMMS(1)+3); SM(HL
,0); SB(bit
); COND(T
);
1161 /** 0011 0001 1bit 0010 bt %s1, $%a0 */
1162 #line 405 "rl78-decode.opc"
1163 int bit AU
= (op
[1] >> 4) & 0x07;
1166 printf ("\033[33m%s\033[0m %02x %02x\n",
1167 "/** 0011 0001 1bit 0010 bt %s1, $%a0 */",
1169 printf (" bit = 0x%x\n", bit
);
1171 SYNTAX("bt %s1, $%a0");
1172 #line 405 "rl78-decode.opc"
1173 ID(branch_cond
); SM(None
, SFR
); SB(bit
); DC(pc
+IMMS(1)+4); COND(T
);
1179 /** 0011 0001 1bit 0011 bt %e1, $%a0 */
1180 #line 399 "rl78-decode.opc"
1181 int bit AU
= (op
[1] >> 4) & 0x07;
1184 printf ("\033[33m%s\033[0m %02x %02x\n",
1185 "/** 0011 0001 1bit 0011 bt %e1, $%a0 */",
1187 printf (" bit = 0x%x\n", bit
);
1189 SYNTAX("bt %e1, $%a0");
1190 #line 399 "rl78-decode.opc"
1191 ID(branch_cond
); DC(pc
+IMMS(1)+3); SM(HL
,0); SB(bit
); COND(T
);
1197 /** 0011 0001 1bit 0100 bf %s1, $%a0 */
1198 #line 366 "rl78-decode.opc"
1199 int bit AU
= (op
[1] >> 4) & 0x07;
1202 printf ("\033[33m%s\033[0m %02x %02x\n",
1203 "/** 0011 0001 1bit 0100 bf %s1, $%a0 */",
1205 printf (" bit = 0x%x\n", bit
);
1207 SYNTAX("bf %s1, $%a0");
1208 #line 366 "rl78-decode.opc"
1209 ID(branch_cond
); SM(None
, SFR
); SB(bit
); DC(pc
+IMMS(1)+4); COND(F
);
1215 /** 0011 0001 1bit 0101 bf %e1, $%a0 */
1216 #line 360 "rl78-decode.opc"
1217 int bit AU
= (op
[1] >> 4) & 0x07;
1220 printf ("\033[33m%s\033[0m %02x %02x\n",
1221 "/** 0011 0001 1bit 0101 bf %e1, $%a0 */",
1223 printf (" bit = 0x%x\n", bit
);
1225 SYNTAX("bf %e1, $%a0");
1226 #line 360 "rl78-decode.opc"
1227 ID(branch_cond
); DC(pc
+IMMS(1)+3); SM(HL
,0); SB(bit
); COND(F
);
1231 default: UNSUPPORTED(); break;
1238 /** 0011 0ra1 xchw %0, %1 */
1239 #line 1245 "rl78-decode.opc"
1240 int ra AU
= (op
[0] >> 1) & 0x03;
1243 printf ("\033[33m%s\033[0m %02x\n",
1244 "/** 0011 0ra1 xchw %0, %1 */",
1246 printf (" ra = 0x%x\n", ra
);
1248 SYNTAX("xchw %0, %1");
1249 #line 1245 "rl78-decode.opc"
1250 ID(xch
); W(); DR(AX
); SRW(ra
);
1252 /*----------------------------------------------------------------------*/
1258 /** 0011 1000 mov %e0, #%1 */
1261 printf ("\033[33m%s\033[0m %02x\n",
1262 "/** 0011 1000 mov %e0, #%1 */",
1265 SYNTAX("mov %e0, #%1");
1266 #line 744 "rl78-decode.opc"
1267 ID(mov
); DM(C
, IMMU(2)); SC(IMMU(1));
1273 /** 0011 1001 mov %e0, #%1 */
1276 printf ("\033[33m%s\033[0m %02x\n",
1277 "/** 0011 1001 mov %e0, #%1 */",
1280 SYNTAX("mov %e0, #%1");
1281 #line 738 "rl78-decode.opc"
1282 ID(mov
); DM(BC
, IMMU(2)); SC(IMMU(1));
1288 /** 0011 1010 subc %0, #%1 */
1291 printf ("\033[33m%s\033[0m %02x\n",
1292 "/** 0011 1010 subc %0, #%1 */",
1295 SYNTAX("subc %0, #%1");
1296 #line 1184 "rl78-decode.opc"
1297 ID(subc
); DM(None
, SADDR
); SC(IMMU(1)); Fzac
;
1299 /*----------------------------------------------------------------------*/
1305 /** 0011 1011 subc %0, %1 */
1308 printf ("\033[33m%s\033[0m %02x\n",
1309 "/** 0011 1011 subc %0, %1 */",
1312 SYNTAX("subc %0, %1");
1313 #line 1181 "rl78-decode.opc"
1314 ID(subc
); DR(A
); SM(None
, SADDR
); Fzac
;
1320 /** 0011 1100 subc %0, #%1 */
1323 printf ("\033[33m%s\033[0m %02x\n",
1324 "/** 0011 1100 subc %0, #%1 */",
1327 SYNTAX("subc %0, #%1");
1328 #line 1172 "rl78-decode.opc"
1329 ID(subc
); DR(A
); SC(IMMU(1)); Fzac
;
1335 /** 0011 1101 subc %0, %e1 */
1338 printf ("\033[33m%s\033[0m %02x\n",
1339 "/** 0011 1101 subc %0, %e1 */",
1342 SYNTAX("subc %0, %e1");
1343 #line 1160 "rl78-decode.opc"
1344 ID(subc
); DR(A
); SM(HL
, 0); Fzac
;
1350 /** 0011 1110 subc %0, %ea1 */
1353 printf ("\033[33m%s\033[0m %02x\n",
1354 "/** 0011 1110 subc %0, %ea1 */",
1357 SYNTAX("subc %0, %ea1");
1358 #line 1169 "rl78-decode.opc"
1359 ID(subc
); DR(A
); SM(HL
, IMMU(1)); Fzac
;
1365 /** 0011 1111 subc %0, %e!1 */
1368 printf ("\033[33m%s\033[0m %02x\n",
1369 "/** 0011 1111 subc %0, %e!1 */",
1372 SYNTAX("subc %0, %e!1");
1373 #line 1157 "rl78-decode.opc"
1374 ID(subc
); DR(A
); SM(None
, IMMU(2)); Fzac
;
1380 /** 0100 0000 cmp %e!0, #%1 */
1383 printf ("\033[33m%s\033[0m %02x\n",
1384 "/** 0100 0000 cmp %e!0, #%1 */",
1387 SYNTAX("cmp %e!0, #%1");
1388 #line 486 "rl78-decode.opc"
1389 ID(cmp
); DM(None
, IMMU(2)); SC(IMMU(1)); Fzac
;
1395 /** 0100 0001 mov %0, #%1 */
1398 printf ("\033[33m%s\033[0m %02x\n",
1399 "/** 0100 0001 mov %0, #%1 */",
1402 SYNTAX("mov %0, #%1");
1403 #line 723 "rl78-decode.opc"
1404 ID(mov
); DR(ES
); SC(IMMU(1));
1410 /** 0100 0010 cmpw %0, %e!1 */
1413 printf ("\033[33m%s\033[0m %02x\n",
1414 "/** 0100 0010 cmpw %0, %e!1 */",
1417 SYNTAX("cmpw %0, %e!1");
1418 #line 537 "rl78-decode.opc"
1419 ID(cmp
); W(); DR(AX
); SM(None
, IMMU(2)); Fzac
;
1427 /** 0100 0ra1 cmpw %0, %1 */
1428 #line 546 "rl78-decode.opc"
1429 int ra AU
= (op
[0] >> 1) & 0x03;
1432 printf ("\033[33m%s\033[0m %02x\n",
1433 "/** 0100 0ra1 cmpw %0, %1 */",
1435 printf (" ra = 0x%x\n", ra
);
1437 SYNTAX("cmpw %0, %1");
1438 #line 546 "rl78-decode.opc"
1439 ID(cmp
); W(); DR(AX
); SRW(ra
); Fzac
;
1445 /** 0100 0100 cmpw %0, #%1 */
1448 printf ("\033[33m%s\033[0m %02x\n",
1449 "/** 0100 0100 cmpw %0, #%1 */",
1452 SYNTAX("cmpw %0, #%1");
1453 #line 543 "rl78-decode.opc"
1454 ID(cmp
); W(); DR(AX
); SC(IMMU(2)); Fzac
;
1460 /** 0100 0110 cmpw %0, %1 */
1463 printf ("\033[33m%s\033[0m %02x\n",
1464 "/** 0100 0110 cmpw %0, %1 */",
1467 SYNTAX("cmpw %0, %1");
1468 #line 549 "rl78-decode.opc"
1469 ID(cmp
); W(); DR(AX
); SM(None
, SADDR
); Fzac
;
1471 /*----------------------------------------------------------------------*/
1477 /** 0100 1000 mov %e0, %1 */
1480 printf ("\033[33m%s\033[0m %02x\n",
1481 "/** 0100 1000 mov %e0, %1 */",
1484 SYNTAX("mov %e0, %1");
1485 #line 741 "rl78-decode.opc"
1486 ID(mov
); DM(BC
, IMMU(2)); SR(A
);
1492 /** 0100 1001 mov %0, %e1 */
1495 printf ("\033[33m%s\033[0m %02x\n",
1496 "/** 0100 1001 mov %0, %e1 */",
1499 SYNTAX("mov %0, %e1");
1500 #line 687 "rl78-decode.opc"
1501 ID(mov
); DR(A
); SM(BC
, IMMU(2));
1507 /** 0100 1010 cmp %0, #%1 */
1510 printf ("\033[33m%s\033[0m %02x\n",
1511 "/** 0100 1010 cmp %0, #%1 */",
1514 SYNTAX("cmp %0, #%1");
1515 #line 489 "rl78-decode.opc"
1516 ID(cmp
); DM(None
, SADDR
); SC(IMMU(1)); Fzac
;
1522 /** 0100 1011 cmp %0, %1 */
1525 printf ("\033[33m%s\033[0m %02x\n",
1526 "/** 0100 1011 cmp %0, %1 */",
1529 SYNTAX("cmp %0, %1");
1530 #line 516 "rl78-decode.opc"
1531 ID(cmp
); DR(A
); SM(None
, SADDR
); Fzac
;
1533 /*----------------------------------------------------------------------*/
1539 /** 0100 1100 cmp %0, #%1 */
1542 printf ("\033[33m%s\033[0m %02x\n",
1543 "/** 0100 1100 cmp %0, #%1 */",
1546 SYNTAX("cmp %0, #%1");
1547 #line 507 "rl78-decode.opc"
1548 ID(cmp
); DR(A
); SC(IMMU(1)); Fzac
;
1554 /** 0100 1101 cmp %0, %e1 */
1557 printf ("\033[33m%s\033[0m %02x\n",
1558 "/** 0100 1101 cmp %0, %e1 */",
1561 SYNTAX("cmp %0, %e1");
1562 #line 495 "rl78-decode.opc"
1563 ID(cmp
); DR(A
); SM(HL
, 0); Fzac
;
1569 /** 0100 1110 cmp %0, %ea1 */
1572 printf ("\033[33m%s\033[0m %02x\n",
1573 "/** 0100 1110 cmp %0, %ea1 */",
1576 SYNTAX("cmp %0, %ea1");
1577 #line 504 "rl78-decode.opc"
1578 ID(cmp
); DR(A
); SM(HL
, IMMU(1)); Fzac
;
1584 /** 0100 1111 cmp %0, %e!1 */
1587 printf ("\033[33m%s\033[0m %02x\n",
1588 "/** 0100 1111 cmp %0, %e!1 */",
1591 SYNTAX("cmp %0, %e!1");
1592 #line 492 "rl78-decode.opc"
1593 ID(cmp
); DR(A
); SM(None
, IMMU(2)); Fzac
;
1606 /** 0101 0reg mov %0, #%1 */
1607 #line 675 "rl78-decode.opc"
1608 int reg AU
= op
[0] & 0x07;
1611 printf ("\033[33m%s\033[0m %02x\n",
1612 "/** 0101 0reg mov %0, #%1 */",
1614 printf (" reg = 0x%x\n", reg
);
1616 SYNTAX("mov %0, #%1");
1617 #line 675 "rl78-decode.opc"
1618 ID(mov
); DRB(reg
); SC(IMMU(1));
1624 /** 0101 1000 movw %e0, %1 */
1627 printf ("\033[33m%s\033[0m %02x\n",
1628 "/** 0101 1000 movw %e0, %1 */",
1631 SYNTAX("movw %e0, %1");
1632 #line 877 "rl78-decode.opc"
1633 ID(mov
); W(); DM(B
, IMMU(2)); SR(AX
);
1639 /** 0101 1001 movw %0, %e1 */
1642 printf ("\033[33m%s\033[0m %02x\n",
1643 "/** 0101 1001 movw %0, %e1 */",
1646 SYNTAX("movw %0, %e1");
1647 #line 868 "rl78-decode.opc"
1648 ID(mov
); W(); DR(AX
); SM(B
, IMMU(2));
1654 /** 0101 1010 and %0, #%1 */
1657 printf ("\033[33m%s\033[0m %02x\n",
1658 "/** 0101 1010 and %0, #%1 */",
1661 SYNTAX("and %0, #%1");
1662 #line 318 "rl78-decode.opc"
1663 ID(and); DM(None
, SADDR
); SC(IMMU(1)); Fz
;
1665 /*----------------------------------------------------------------------*/
1671 /** 0101 1011 and %0, %1 */
1674 printf ("\033[33m%s\033[0m %02x\n",
1675 "/** 0101 1011 and %0, %1 */",
1678 SYNTAX("and %0, %1");
1679 #line 315 "rl78-decode.opc"
1680 ID(and); DR(A
); SM(None
, SADDR
); Fz
;
1686 /** 0101 1100 and %0, #%1 */
1689 printf ("\033[33m%s\033[0m %02x\n",
1690 "/** 0101 1100 and %0, #%1 */",
1693 SYNTAX("and %0, #%1");
1694 #line 306 "rl78-decode.opc"
1695 ID(and); DR(A
); SC(IMMU(1)); Fz
;
1701 /** 0101 1101 and %0, %e1 */
1704 printf ("\033[33m%s\033[0m %02x\n",
1705 "/** 0101 1101 and %0, %e1 */",
1708 SYNTAX("and %0, %e1");
1709 #line 294 "rl78-decode.opc"
1710 ID(and); DR(A
); SM(HL
, 0); Fz
;
1716 /** 0101 1110 and %0, %ea1 */
1719 printf ("\033[33m%s\033[0m %02x\n",
1720 "/** 0101 1110 and %0, %ea1 */",
1723 SYNTAX("and %0, %ea1");
1724 #line 300 "rl78-decode.opc"
1725 ID(and); DR(A
); SM(HL
, IMMU(1)); Fz
;
1731 /** 0101 1111 and %0, %e!1 */
1734 printf ("\033[33m%s\033[0m %02x\n",
1735 "/** 0101 1111 and %0, %e!1 */",
1738 SYNTAX("and %0, %e!1");
1739 #line 291 "rl78-decode.opc"
1740 ID(and); DR(A
); SM(None
, IMMU(2)); Fz
;
1752 /** 0110 0rba mov %0, %1 */
1753 #line 678 "rl78-decode.opc"
1754 int rba AU
= op
[0] & 0x07;
1757 printf ("\033[33m%s\033[0m %02x\n",
1758 "/** 0110 0rba mov %0, %1 */",
1760 printf (" rba = 0x%x\n", rba
);
1762 SYNTAX("mov %0, %1");
1763 #line 678 "rl78-decode.opc"
1764 ID(mov
); DR(A
); SRB(rba
);
1770 switch (op
[1] & 0xff)
1781 /** 0110 0001 0000 0reg add %0, %1 */
1782 #line 231 "rl78-decode.opc"
1783 int reg AU
= op
[1] & 0x07;
1786 printf ("\033[33m%s\033[0m %02x %02x\n",
1787 "/** 0110 0001 0000 0reg add %0, %1 */",
1789 printf (" reg = 0x%x\n", reg
);
1791 SYNTAX("add %0, %1");
1792 #line 231 "rl78-decode.opc"
1793 ID(add
); DRB(reg
); SR(A
); Fzac
;
1805 /** 0110 0001 0000 1rba add %0, %1 */
1806 #line 225 "rl78-decode.opc"
1807 int rba AU
= op
[1] & 0x07;
1810 printf ("\033[33m%s\033[0m %02x %02x\n",
1811 "/** 0110 0001 0000 1rba add %0, %1 */",
1813 printf (" rba = 0x%x\n", rba
);
1815 SYNTAX("add %0, %1");
1816 #line 225 "rl78-decode.opc"
1817 ID(add
); DR(A
); SRB(rba
); Fzac
;
1823 /** 0110 0001 0000 1001 addw %0, %ea1 */
1826 printf ("\033[33m%s\033[0m %02x %02x\n",
1827 "/** 0110 0001 0000 1001 addw %0, %ea1 */",
1830 SYNTAX("addw %0, %ea1");
1831 #line 274 "rl78-decode.opc"
1832 ID(add
); W(); DR(AX
); SM(HL
, IMMU(1)); Fzac
;
1845 /** 0110 0001 0001 0reg addc %0, %1 */
1846 #line 260 "rl78-decode.opc"
1847 int reg AU
= op
[1] & 0x07;
1850 printf ("\033[33m%s\033[0m %02x %02x\n",
1851 "/** 0110 0001 0001 0reg addc %0, %1 */",
1853 printf (" reg = 0x%x\n", reg
);
1855 SYNTAX("addc %0, %1");
1856 #line 260 "rl78-decode.opc"
1857 ID(addc
); DRB(reg
); SR(A
); Fzac
;
1869 /** 0110 0001 0001 1rba addc %0, %1 */
1870 #line 257 "rl78-decode.opc"
1871 int rba AU
= op
[1] & 0x07;
1874 printf ("\033[33m%s\033[0m %02x %02x\n",
1875 "/** 0110 0001 0001 1rba addc %0, %1 */",
1877 printf (" rba = 0x%x\n", rba
);
1879 SYNTAX("addc %0, %1");
1880 #line 257 "rl78-decode.opc"
1881 ID(addc
); DR(A
); SRB(rba
); Fzac
;
1894 /** 0110 0001 0010 0reg sub %0, %1 */
1895 #line 1149 "rl78-decode.opc"
1896 int reg AU
= op
[1] & 0x07;
1899 printf ("\033[33m%s\033[0m %02x %02x\n",
1900 "/** 0110 0001 0010 0reg sub %0, %1 */",
1902 printf (" reg = 0x%x\n", reg
);
1904 SYNTAX("sub %0, %1");
1905 #line 1149 "rl78-decode.opc"
1906 ID(sub
); DRB(reg
); SR(A
); Fzac
;
1918 /** 0110 0001 0010 1rba sub %0, %1 */
1919 #line 1143 "rl78-decode.opc"
1920 int rba AU
= op
[1] & 0x07;
1923 printf ("\033[33m%s\033[0m %02x %02x\n",
1924 "/** 0110 0001 0010 1rba sub %0, %1 */",
1926 printf (" rba = 0x%x\n", rba
);
1928 SYNTAX("sub %0, %1");
1929 #line 1143 "rl78-decode.opc"
1930 ID(sub
); DR(A
); SRB(rba
); Fzac
;
1936 /** 0110 0001 0010 1001 subw %0, %ea1 */
1939 printf ("\033[33m%s\033[0m %02x %02x\n",
1940 "/** 0110 0001 0010 1001 subw %0, %ea1 */",
1943 SYNTAX("subw %0, %ea1");
1944 #line 1192 "rl78-decode.opc"
1945 ID(sub
); W(); DR(AX
); SM(HL
, IMMU(1)); Fzac
;
1958 /** 0110 0001 0011 0reg subc %0, %1 */
1959 #line 1178 "rl78-decode.opc"
1960 int reg AU
= op
[1] & 0x07;
1963 printf ("\033[33m%s\033[0m %02x %02x\n",
1964 "/** 0110 0001 0011 0reg subc %0, %1 */",
1966 printf (" reg = 0x%x\n", reg
);
1968 SYNTAX("subc %0, %1");
1969 #line 1178 "rl78-decode.opc"
1970 ID(subc
); DRB(reg
); SR(A
); Fzac
;
1982 /** 0110 0001 0011 1rba subc %0, %1 */
1983 #line 1175 "rl78-decode.opc"
1984 int rba AU
= op
[1] & 0x07;
1987 printf ("\033[33m%s\033[0m %02x %02x\n",
1988 "/** 0110 0001 0011 1rba subc %0, %1 */",
1990 printf (" rba = 0x%x\n", rba
);
1992 SYNTAX("subc %0, %1");
1993 #line 1175 "rl78-decode.opc"
1994 ID(subc
); DR(A
); SRB(rba
); Fzac
;
2007 /** 0110 0001 0100 0reg cmp %0, %1 */
2008 #line 513 "rl78-decode.opc"
2009 int reg AU
= op
[1] & 0x07;
2012 printf ("\033[33m%s\033[0m %02x %02x\n",
2013 "/** 0110 0001 0100 0reg cmp %0, %1 */",
2015 printf (" reg = 0x%x\n", reg
);
2017 SYNTAX("cmp %0, %1");
2018 #line 513 "rl78-decode.opc"
2019 ID(cmp
); DRB(reg
); SR(A
); Fzac
;
2031 /** 0110 0001 0100 1rba cmp %0, %1 */
2032 #line 510 "rl78-decode.opc"
2033 int rba AU
= op
[1] & 0x07;
2036 printf ("\033[33m%s\033[0m %02x %02x\n",
2037 "/** 0110 0001 0100 1rba cmp %0, %1 */",
2039 printf (" rba = 0x%x\n", rba
);
2041 SYNTAX("cmp %0, %1");
2042 #line 510 "rl78-decode.opc"
2043 ID(cmp
); DR(A
); SRB(rba
); Fzac
;
2049 /** 0110 0001 0100 1001 cmpw %0, %ea1 */
2052 printf ("\033[33m%s\033[0m %02x %02x\n",
2053 "/** 0110 0001 0100 1001 cmpw %0, %ea1 */",
2056 SYNTAX("cmpw %0, %ea1");
2057 #line 540 "rl78-decode.opc"
2058 ID(cmp
); W(); DR(AX
); SM(HL
, IMMU(1)); Fzac
;
2071 /** 0110 0001 0101 0reg and %0, %1 */
2072 #line 312 "rl78-decode.opc"
2073 int reg AU
= op
[1] & 0x07;
2076 printf ("\033[33m%s\033[0m %02x %02x\n",
2077 "/** 0110 0001 0101 0reg and %0, %1 */",
2079 printf (" reg = 0x%x\n", reg
);
2081 SYNTAX("and %0, %1");
2082 #line 312 "rl78-decode.opc"
2083 ID(and); DRB(reg
); SR(A
); Fz
;
2095 /** 0110 0001 0101 1rba and %0, %1 */
2096 #line 309 "rl78-decode.opc"
2097 int rba AU
= op
[1] & 0x07;
2100 printf ("\033[33m%s\033[0m %02x %02x\n",
2101 "/** 0110 0001 0101 1rba and %0, %1 */",
2103 printf (" rba = 0x%x\n", rba
);
2105 SYNTAX("and %0, %1");
2106 #line 309 "rl78-decode.opc"
2107 ID(and); DR(A
); SRB(rba
); Fz
;
2113 /** 0110 0001 0101 1001 inc %ea0 */
2116 printf ("\033[33m%s\033[0m %02x %02x\n",
2117 "/** 0110 0001 0101 1001 inc %ea0 */",
2121 #line 590 "rl78-decode.opc"
2122 ID(add
); DM(HL
, IMMU(1)); SC(1); Fza
;
2135 /** 0110 0001 0110 0reg or %0, %1 */
2136 #line 967 "rl78-decode.opc"
2137 int reg AU
= op
[1] & 0x07;
2140 printf ("\033[33m%s\033[0m %02x %02x\n",
2141 "/** 0110 0001 0110 0reg or %0, %1 */",
2143 printf (" reg = 0x%x\n", reg
);
2145 SYNTAX("or %0, %1");
2146 #line 967 "rl78-decode.opc"
2147 ID(or); DRB(reg
); SR(A
); Fz
;
2159 /** 0110 0001 0110 1rba or %0, %1 */
2160 #line 964 "rl78-decode.opc"
2161 int rba AU
= op
[1] & 0x07;
2164 printf ("\033[33m%s\033[0m %02x %02x\n",
2165 "/** 0110 0001 0110 1rba or %0, %1 */",
2167 printf (" rba = 0x%x\n", rba
);
2169 SYNTAX("or %0, %1");
2170 #line 964 "rl78-decode.opc"
2171 ID(or); DR(A
); SRB(rba
); Fz
;
2177 /** 0110 0001 0110 1001 dec %ea0 */
2180 printf ("\033[33m%s\033[0m %02x %02x\n",
2181 "/** 0110 0001 0110 1001 dec %ea0 */",
2185 #line 557 "rl78-decode.opc"
2186 ID(sub
); DM(HL
, IMMU(1)); SC(1); Fza
;
2199 /** 0110 0001 0111 0reg xor %0, %1 */
2200 #line 1271 "rl78-decode.opc"
2201 int reg AU
= op
[1] & 0x07;
2204 printf ("\033[33m%s\033[0m %02x %02x\n",
2205 "/** 0110 0001 0111 0reg xor %0, %1 */",
2207 printf (" reg = 0x%x\n", reg
);
2209 SYNTAX("xor %0, %1");
2210 #line 1271 "rl78-decode.opc"
2211 ID(xor); DRB(reg
); SR(A
); Fz
;
2223 /** 0110 0001 0111 1rba xor %0, %1 */
2224 #line 1268 "rl78-decode.opc"
2225 int rba AU
= op
[1] & 0x07;
2228 printf ("\033[33m%s\033[0m %02x %02x\n",
2229 "/** 0110 0001 0111 1rba xor %0, %1 */",
2231 printf (" rba = 0x%x\n", rba
);
2233 SYNTAX("xor %0, %1");
2234 #line 1268 "rl78-decode.opc"
2235 ID(xor); DR(A
); SRB(rba
); Fz
;
2241 /** 0110 0001 0111 1001 incw %ea0 */
2244 printf ("\033[33m%s\033[0m %02x %02x\n",
2245 "/** 0110 0001 0111 1001 incw %ea0 */",
2248 SYNTAX("incw %ea0");
2249 #line 604 "rl78-decode.opc"
2250 ID(add
); W(); DM(HL
, IMMU(1)); SC(1);
2257 /** 0110 0001 1000 000 add %0, %e1 */
2260 printf ("\033[33m%s\033[0m %02x %02x\n",
2261 "/** 0110 0001 1000 000 add %0, %e1 */",
2264 SYNTAX("add %0, %e1");
2265 #line 213 "rl78-decode.opc"
2266 ID(add
); DR(A
); SM2(HL
, B
, 0); Fzac
;
2272 /** 0110 0001 1000 0010 add %0, %e1 */
2275 printf ("\033[33m%s\033[0m %02x %02x\n",
2276 "/** 0110 0001 1000 0010 add %0, %e1 */",
2279 SYNTAX("add %0, %e1");
2280 #line 219 "rl78-decode.opc"
2281 ID(add
); DR(A
); SM2(HL
, C
, 0); Fzac
;
2318 /** 0110 0001 1nnn 01mm callt [%x0] */
2319 #line 439 "rl78-decode.opc"
2320 int nnn AU
= (op
[1] >> 4) & 0x07;
2321 #line 439 "rl78-decode.opc"
2322 int mm AU
= op
[1] & 0x03;
2325 printf ("\033[33m%s\033[0m %02x %02x\n",
2326 "/** 0110 0001 1nnn 01mm callt [%x0] */",
2328 printf (" nnn = 0x%x,", nnn
);
2329 printf (" mm = 0x%x\n", mm
);
2331 SYNTAX("callt [%x0]");
2332 #line 439 "rl78-decode.opc"
2333 ID(call
); DM(None
, 0x80 + mm
*16 + nnn
*2);
2335 /*----------------------------------------------------------------------*/
2347 /** 0110 0001 1000 1reg xch %0, %1 */
2348 #line 1230 "rl78-decode.opc"
2349 int reg AU
= op
[1] & 0x07;
2352 printf ("\033[33m%s\033[0m %02x %02x\n",
2353 "/** 0110 0001 1000 1reg xch %0, %1 */",
2355 printf (" reg = 0x%x\n", reg
);
2357 SYNTAX("xch %0, %1");
2358 #line 1230 "rl78-decode.opc"
2359 /* Note: DECW uses reg == X, so this must follow DECW */
2360 ID(xch
); DR(A
); SRB(reg
);
2366 /** 0110 0001 1000 1001 decw %ea0 */
2369 printf ("\033[33m%s\033[0m %02x %02x\n",
2370 "/** 0110 0001 1000 1001 decw %ea0 */",
2373 SYNTAX("decw %ea0");
2374 #line 571 "rl78-decode.opc"
2375 ID(sub
); W(); DM(HL
, IMMU(1)); SC(1);
2381 /** 0110 0001 1001 0000 addc %0, %e1 */
2384 printf ("\033[33m%s\033[0m %02x %02x\n",
2385 "/** 0110 0001 1001 0000 addc %0, %e1 */",
2388 SYNTAX("addc %0, %e1");
2389 #line 245 "rl78-decode.opc"
2390 ID(addc
); DR(A
); SM2(HL
, B
, 0); Fzac
;
2396 /** 0110 0001 1001 0010 addc %0, %e1 */
2399 printf ("\033[33m%s\033[0m %02x %02x\n",
2400 "/** 0110 0001 1001 0010 addc %0, %e1 */",
2403 SYNTAX("addc %0, %e1");
2404 #line 248 "rl78-decode.opc"
2405 ID(addc
); DR(A
); SM2(HL
, C
, 0); Fzac
;
2412 /** 0110 0001 1010 000 sub %0, %e1 */
2415 printf ("\033[33m%s\033[0m %02x %02x\n",
2416 "/** 0110 0001 1010 000 sub %0, %e1 */",
2419 SYNTAX("sub %0, %e1");
2420 #line 1131 "rl78-decode.opc"
2421 ID(sub
); DR(A
); SM2(HL
, B
, 0); Fzac
;
2427 /** 0110 0001 1010 0010 sub %0, %e1 */
2430 printf ("\033[33m%s\033[0m %02x %02x\n",
2431 "/** 0110 0001 1010 0010 sub %0, %e1 */",
2434 SYNTAX("sub %0, %e1");
2435 #line 1137 "rl78-decode.opc"
2436 ID(sub
); DR(A
); SM2(HL
, C
, 0); Fzac
;
2442 /** 0110 0001 1010 1000 xch %0, %1 */
2445 printf ("\033[33m%s\033[0m %02x %02x\n",
2446 "/** 0110 0001 1010 1000 xch %0, %1 */",
2449 SYNTAX("xch %0, %1");
2450 #line 1234 "rl78-decode.opc"
2451 ID(xch
); DR(A
); SM(None
, SADDR
);
2457 /** 0110 0001 1010 1001 xch %0, %e1 */
2460 printf ("\033[33m%s\033[0m %02x %02x\n",
2461 "/** 0110 0001 1010 1001 xch %0, %e1 */",
2464 SYNTAX("xch %0, %e1");
2465 #line 1227 "rl78-decode.opc"
2466 ID(xch
); DR(A
); SM2(HL
, C
, 0);
2472 /** 0110 0001 1010 1010 xch %0, %e!1 */
2475 printf ("\033[33m%s\033[0m %02x %02x\n",
2476 "/** 0110 0001 1010 1010 xch %0, %e!1 */",
2479 SYNTAX("xch %0, %e!1");
2480 #line 1209 "rl78-decode.opc"
2481 ID(xch
); DR(A
); SM(None
, IMMU(2));
2487 /** 0110 0001 1010 1011 xch %0, %s1 */
2490 printf ("\033[33m%s\033[0m %02x %02x\n",
2491 "/** 0110 0001 1010 1011 xch %0, %s1 */",
2494 SYNTAX("xch %0, %s1");
2495 #line 1237 "rl78-decode.opc"
2496 ID(xch
); DR(A
); SM(None
, SFR
);
2502 /** 0110 0001 1010 1100 xch %0, %e1 */
2505 printf ("\033[33m%s\033[0m %02x %02x\n",
2506 "/** 0110 0001 1010 1100 xch %0, %e1 */",
2509 SYNTAX("xch %0, %e1");
2510 #line 1218 "rl78-decode.opc"
2511 ID(xch
); DR(A
); SM(HL
, 0);
2517 /** 0110 0001 1010 1101 xch %0, %ea1 */
2520 printf ("\033[33m%s\033[0m %02x %02x\n",
2521 "/** 0110 0001 1010 1101 xch %0, %ea1 */",
2524 SYNTAX("xch %0, %ea1");
2525 #line 1224 "rl78-decode.opc"
2526 ID(xch
); DR(A
); SM(HL
, IMMU(1));
2532 /** 0110 0001 1010 1110 xch %0, %e1 */
2535 printf ("\033[33m%s\033[0m %02x %02x\n",
2536 "/** 0110 0001 1010 1110 xch %0, %e1 */",
2539 SYNTAX("xch %0, %e1");
2540 #line 1212 "rl78-decode.opc"
2541 ID(xch
); DR(A
); SM(DE
, 0);
2547 /** 0110 0001 1010 1111 xch %0, %ea1 */
2550 printf ("\033[33m%s\033[0m %02x %02x\n",
2551 "/** 0110 0001 1010 1111 xch %0, %ea1 */",
2554 SYNTAX("xch %0, %ea1");
2555 #line 1215 "rl78-decode.opc"
2556 ID(xch
); DR(A
); SM(DE
, IMMU(1));
2562 /** 0110 0001 1011 0000 subc %0, %e1 */
2565 printf ("\033[33m%s\033[0m %02x %02x\n",
2566 "/** 0110 0001 1011 0000 subc %0, %e1 */",
2569 SYNTAX("subc %0, %e1");
2570 #line 1163 "rl78-decode.opc"
2571 ID(subc
); DR(A
); SM2(HL
, B
, 0); Fzac
;
2577 /** 0110 0001 1011 0010 subc %0, %e1 */
2580 printf ("\033[33m%s\033[0m %02x %02x\n",
2581 "/** 0110 0001 1011 0010 subc %0, %e1 */",
2584 SYNTAX("subc %0, %e1");
2585 #line 1166 "rl78-decode.opc"
2586 ID(subc
); DR(A
); SM2(HL
, C
, 0); Fzac
;
2592 /** 0110 0001 1011 1000 mov %0, %1 */
2595 printf ("\033[33m%s\033[0m %02x %02x\n",
2596 "/** 0110 0001 1011 1000 mov %0, %1 */",
2599 SYNTAX("mov %0, %1");
2600 #line 729 "rl78-decode.opc"
2601 ID(mov
); DR(ES
); SM(None
, SADDR
);
2607 /** 0110 0001 1011 1001 xch %0, %e1 */
2610 printf ("\033[33m%s\033[0m %02x %02x\n",
2611 "/** 0110 0001 1011 1001 xch %0, %e1 */",
2614 SYNTAX("xch %0, %e1");
2615 #line 1221 "rl78-decode.opc"
2616 ID(xch
); DR(A
); SM2(HL
, B
, 0);
2622 /** 0110 0001 1100 0000 cmp %0, %e1 */
2625 printf ("\033[33m%s\033[0m %02x %02x\n",
2626 "/** 0110 0001 1100 0000 cmp %0, %e1 */",
2629 SYNTAX("cmp %0, %e1");
2630 #line 498 "rl78-decode.opc"
2631 ID(cmp
); DR(A
); SM2(HL
, B
, 0); Fzac
;
2637 /** 0110 0001 1100 0010 cmp %0, %e1 */
2640 printf ("\033[33m%s\033[0m %02x %02x\n",
2641 "/** 0110 0001 1100 0010 cmp %0, %e1 */",
2644 SYNTAX("cmp %0, %e1");
2645 #line 501 "rl78-decode.opc"
2646 ID(cmp
); DR(A
); SM2(HL
, C
, 0); Fzac
;
2652 /** 0110 0001 1100 0011 bh $%a0 */
2655 printf ("\033[33m%s\033[0m %02x %02x\n",
2656 "/** 0110 0001 1100 0011 bh $%a0 */",
2660 #line 346 "rl78-decode.opc"
2661 ID(branch_cond
); DC(pc
+IMMS(1)+3); SR(None
); COND(H
);
2667 /** 0110 0001 1100 1000 sk%c1 */
2670 printf ("\033[33m%s\033[0m %02x %02x\n",
2671 "/** 0110 0001 1100 1000 sk%c1 */",
2675 #line 1100 "rl78-decode.opc"
2682 /** 0110 0001 1100 1001 mov %0, %e1 */
2685 printf ("\033[33m%s\033[0m %02x %02x\n",
2686 "/** 0110 0001 1100 1001 mov %0, %e1 */",
2689 SYNTAX("mov %0, %e1");
2690 #line 666 "rl78-decode.opc"
2691 ID(mov
); DR(A
); SM2(HL
, B
, 0);
2700 /** 0110 0001 11rg 1010 call %0 */
2701 #line 436 "rl78-decode.opc"
2702 int rg AU
= (op
[1] >> 4) & 0x03;
2705 printf ("\033[33m%s\033[0m %02x %02x\n",
2706 "/** 0110 0001 11rg 1010 call %0 */",
2708 printf (" rg = 0x%x\n", rg
);
2711 #line 436 "rl78-decode.opc"
2718 /** 0110 0001 1100 1011 br ax */
2721 printf ("\033[33m%s\033[0m %02x %02x\n",
2722 "/** 0110 0001 1100 1011 br ax */",
2726 #line 386 "rl78-decode.opc"
2729 /*----------------------------------------------------------------------*/
2735 /** 0110 0001 1100 1100 brk */
2738 printf ("\033[33m%s\033[0m %02x %02x\n",
2739 "/** 0110 0001 1100 1100 brk */",
2743 #line 394 "rl78-decode.opc"
2746 /*----------------------------------------------------------------------*/
2752 /** 0110 0001 1100 1101 pop %s0 */
2755 printf ("\033[33m%s\033[0m %02x %02x\n",
2756 "/** 0110 0001 1100 1101 pop %s0 */",
2760 #line 995 "rl78-decode.opc"
2761 ID(mov
); W(); DR(PSW
); SPOP();
2763 /*----------------------------------------------------------------------*/
2769 /** 0110 0001 1100 1110 movs %ea0, %1 */
2772 printf ("\033[33m%s\033[0m %02x %02x\n",
2773 "/** 0110 0001 1100 1110 movs %ea0, %1 */",
2776 SYNTAX("movs %ea0, %1");
2777 #line 817 "rl78-decode.opc"
2778 ID(mov
); DM(HL
, IMMU(1)); SR(X
); Fzc
;
2780 /*----------------------------------------------------------------------*/
2789 /** 0110 0001 11rb 1111 sel rb%1 */
2790 #line 1047 "rl78-decode.opc"
2791 int rb AU
= (op
[1] >> 4) & 0x03;
2794 printf ("\033[33m%s\033[0m %02x %02x\n",
2795 "/** 0110 0001 11rb 1111 sel rb%1 */",
2797 printf (" rb = 0x%x\n", rb
);
2800 #line 1047 "rl78-decode.opc"
2803 /*----------------------------------------------------------------------*/
2809 /** 0110 0001 1101 0000 and %0, %e1 */
2812 printf ("\033[33m%s\033[0m %02x %02x\n",
2813 "/** 0110 0001 1101 0000 and %0, %e1 */",
2816 SYNTAX("and %0, %e1");
2817 #line 297 "rl78-decode.opc"
2818 ID(and); DR(A
); SM2(HL
, B
, 0); Fz
;
2824 /** 0110 0001 1101 0010 and %0, %e1 */
2827 printf ("\033[33m%s\033[0m %02x %02x\n",
2828 "/** 0110 0001 1101 0010 and %0, %e1 */",
2831 SYNTAX("and %0, %e1");
2832 #line 303 "rl78-decode.opc"
2833 ID(and); DR(A
); SM2(HL
, C
, 0); Fz
;
2839 /** 0110 0001 1101 0011 bnh $%a0 */
2842 printf ("\033[33m%s\033[0m %02x %02x\n",
2843 "/** 0110 0001 1101 0011 bnh $%a0 */",
2847 #line 349 "rl78-decode.opc"
2848 ID(branch_cond
); DC(pc
+IMMS(1)+3); SR(None
); COND(NH
);
2854 /** 0110 0001 1101 1000 sk%c1 */
2857 printf ("\033[33m%s\033[0m %02x %02x\n",
2858 "/** 0110 0001 1101 1000 sk%c1 */",
2862 #line 1106 "rl78-decode.opc"
2869 /** 0110 0001 1101 1001 mov %e0, %1 */
2872 printf ("\033[33m%s\033[0m %02x %02x\n",
2873 "/** 0110 0001 1101 1001 mov %e0, %1 */",
2876 SYNTAX("mov %e0, %1");
2877 #line 633 "rl78-decode.opc"
2878 ID(mov
); DM2(HL
, B
, 0); SR(A
);
2884 /** 0110 0001 1101 1011 ror %0, %1 */
2887 printf ("\033[33m%s\033[0m %02x %02x\n",
2888 "/** 0110 0001 1101 1011 ror %0, %1 */",
2891 SYNTAX("ror %0, %1");
2892 #line 1028 "rl78-decode.opc"
2893 ID(ror
); DR(A
); SC(1);
2899 /** 0110 0001 1101 1100 rolc %0, %1 */
2902 printf ("\033[33m%s\033[0m %02x %02x\n",
2903 "/** 0110 0001 1101 1100 rolc %0, %1 */",
2906 SYNTAX("rolc %0, %1");
2907 #line 1022 "rl78-decode.opc"
2908 ID(rolc
); DR(A
); SC(1);
2914 /** 0110 0001 1101 1101 push %s1 */
2917 printf ("\033[33m%s\033[0m %02x %02x\n",
2918 "/** 0110 0001 1101 1101 push %s1 */",
2922 #line 1003 "rl78-decode.opc"
2923 ID(mov
); W(); DPUSH(); SR(PSW
);
2925 /*----------------------------------------------------------------------*/
2931 /** 0110 0001 1101 1110 cmps %0, %ea1 */
2934 printf ("\033[33m%s\033[0m %02x %02x\n",
2935 "/** 0110 0001 1101 1110 cmps %0, %ea1 */",
2938 SYNTAX("cmps %0, %ea1");
2939 #line 532 "rl78-decode.opc"
2940 ID(cmp
); DR(X
); SM(HL
, IMMU(1)); Fzac
;
2942 /*----------------------------------------------------------------------*/
2948 /** 0110 0001 1110 0000 or %0, %e1 */
2951 printf ("\033[33m%s\033[0m %02x %02x\n",
2952 "/** 0110 0001 1110 0000 or %0, %e1 */",
2955 SYNTAX("or %0, %e1");
2956 #line 952 "rl78-decode.opc"
2957 ID(or); DR(A
); SM2(HL
, B
, 0); Fz
;
2963 /** 0110 0001 1110 0010 or %0, %e1 */
2966 printf ("\033[33m%s\033[0m %02x %02x\n",
2967 "/** 0110 0001 1110 0010 or %0, %e1 */",
2970 SYNTAX("or %0, %e1");
2971 #line 958 "rl78-decode.opc"
2972 ID(or); DR(A
); SM2(HL
, C
, 0); Fz
;
2978 /** 0110 0001 1110 0011 sk%c1 */
2981 printf ("\033[33m%s\033[0m %02x %02x\n",
2982 "/** 0110 0001 1110 0011 sk%c1 */",
2986 #line 1103 "rl78-decode.opc"
2993 /** 0110 0001 1110 1000 sk%c1 */
2996 printf ("\033[33m%s\033[0m %02x %02x\n",
2997 "/** 0110 0001 1110 1000 sk%c1 */",
3001 #line 1115 "rl78-decode.opc"
3004 /*----------------------------------------------------------------------*/
3010 /** 0110 0001 1110 1001 mov %0, %e1 */
3013 printf ("\033[33m%s\033[0m %02x %02x\n",
3014 "/** 0110 0001 1110 1001 mov %0, %e1 */",
3017 SYNTAX("mov %0, %e1");
3018 #line 669 "rl78-decode.opc"
3019 ID(mov
); DR(A
); SM2(HL
, C
, 0);
3025 /** 0110 0001 1110 1011 rol %0, %1 */
3028 printf ("\033[33m%s\033[0m %02x %02x\n",
3029 "/** 0110 0001 1110 1011 rol %0, %1 */",
3032 SYNTAX("rol %0, %1");
3033 #line 1019 "rl78-decode.opc"
3034 ID(rol
); DR(A
); SC(1);
3040 /** 0110 0001 1110 1100 retb */
3043 printf ("\033[33m%s\033[0m %02x %02x\n",
3044 "/** 0110 0001 1110 1100 retb */",
3048 #line 1014 "rl78-decode.opc"
3051 /*----------------------------------------------------------------------*/
3057 /** 0110 0001 1110 1101 halt */
3060 printf ("\033[33m%s\033[0m %02x %02x\n",
3061 "/** 0110 0001 1110 1101 halt */",
3065 #line 582 "rl78-decode.opc"
3068 /*----------------------------------------------------------------------*/
3075 /** 0110 0001 111r 1110 rolwc %0, %1 */
3076 #line 1025 "rl78-decode.opc"
3077 int r AU
= (op
[1] >> 4) & 0x01;
3080 printf ("\033[33m%s\033[0m %02x %02x\n",
3081 "/** 0110 0001 111r 1110 rolwc %0, %1 */",
3083 printf (" r = 0x%x\n", r
);
3085 SYNTAX("rolwc %0, %1");
3086 #line 1025 "rl78-decode.opc"
3087 ID(rolc
); W(); DRW(r
); SC(1);
3093 /** 0110 0001 1111 0000 xor %0, %e1 */
3096 printf ("\033[33m%s\033[0m %02x %02x\n",
3097 "/** 0110 0001 1111 0000 xor %0, %e1 */",
3100 SYNTAX("xor %0, %e1");
3101 #line 1256 "rl78-decode.opc"
3102 ID(xor); DR(A
); SM2(HL
, B
, 0); Fz
;
3108 /** 0110 0001 1111 0010 xor %0, %e1 */
3111 printf ("\033[33m%s\033[0m %02x %02x\n",
3112 "/** 0110 0001 1111 0010 xor %0, %e1 */",
3115 SYNTAX("xor %0, %e1");
3116 #line 1262 "rl78-decode.opc"
3117 ID(xor); DR(A
); SM2(HL
, C
, 0); Fz
;
3123 /** 0110 0001 1111 0011 sk%c1 */
3126 printf ("\033[33m%s\033[0m %02x %02x\n",
3127 "/** 0110 0001 1111 0011 sk%c1 */",
3131 #line 1109 "rl78-decode.opc"
3138 /** 0110 0001 1111 1000 sk%c1 */
3141 printf ("\033[33m%s\033[0m %02x %02x\n",
3142 "/** 0110 0001 1111 1000 sk%c1 */",
3146 #line 1112 "rl78-decode.opc"
3153 /** 0110 0001 1111 1001 mov %e0, %1 */
3156 printf ("\033[33m%s\033[0m %02x %02x\n",
3157 "/** 0110 0001 1111 1001 mov %e0, %1 */",
3160 SYNTAX("mov %e0, %1");
3161 #line 642 "rl78-decode.opc"
3162 ID(mov
); DM2(HL
, C
, 0); SR(A
);
3168 /** 0110 0001 1111 1011 rorc %0, %1 */
3171 printf ("\033[33m%s\033[0m %02x %02x\n",
3172 "/** 0110 0001 1111 1011 rorc %0, %1 */",
3175 SYNTAX("rorc %0, %1");
3176 #line 1031 "rl78-decode.opc"
3177 ID(rorc
); DR(A
); SC(1);
3179 /*----------------------------------------------------------------------*/
3181 /* Note that the branch insns need to be listed before the shift
3182 ones, as "shift count of zero" means "branch insn" */
3188 /** 0110 0001 1111 1100 reti */
3191 printf ("\033[33m%s\033[0m %02x %02x\n",
3192 "/** 0110 0001 1111 1100 reti */",
3196 #line 1011 "rl78-decode.opc"
3203 /** 0110 0001 1111 1101 stop */
3206 printf ("\033[33m%s\033[0m %02x %02x\n",
3207 "/** 0110 0001 1111 1101 stop */",
3211 #line 1120 "rl78-decode.opc"
3214 /*----------------------------------------------------------------------*/
3218 default: UNSUPPORTED(); break;
3223 /** 0110 1000 movw %e0, %1 */
3226 printf ("\033[33m%s\033[0m %02x\n",
3227 "/** 0110 1000 movw %e0, %1 */",
3230 SYNTAX("movw %e0, %1");
3231 #line 880 "rl78-decode.opc"
3232 ID(mov
); W(); DM(C
, IMMU(2)); SR(AX
);
3238 /** 0110 1001 movw %0, %e1 */
3241 printf ("\033[33m%s\033[0m %02x\n",
3242 "/** 0110 1001 movw %0, %e1 */",
3245 SYNTAX("movw %0, %e1");
3246 #line 871 "rl78-decode.opc"
3247 ID(mov
); W(); DR(AX
); SM(C
, IMMU(2));
3253 /** 0110 1010 or %0, #%1 */
3256 printf ("\033[33m%s\033[0m %02x\n",
3257 "/** 0110 1010 or %0, #%1 */",
3260 SYNTAX("or %0, #%1");
3261 #line 973 "rl78-decode.opc"
3262 ID(or); DM(None
, SADDR
); SC(IMMU(1)); Fz
;
3264 /*----------------------------------------------------------------------*/
3270 /** 0110 1011 or %0, %1 */
3273 printf ("\033[33m%s\033[0m %02x\n",
3274 "/** 0110 1011 or %0, %1 */",
3277 SYNTAX("or %0, %1");
3278 #line 970 "rl78-decode.opc"
3279 ID(or); DR(A
); SM(None
, SADDR
); Fz
;
3285 /** 0110 1100 or %0, #%1 */
3288 printf ("\033[33m%s\033[0m %02x\n",
3289 "/** 0110 1100 or %0, #%1 */",
3292 SYNTAX("or %0, #%1");
3293 #line 961 "rl78-decode.opc"
3294 ID(or); DR(A
); SC(IMMU(1)); Fz
;
3300 /** 0110 1101 or %0, %e1 */
3303 printf ("\033[33m%s\033[0m %02x\n",
3304 "/** 0110 1101 or %0, %e1 */",
3307 SYNTAX("or %0, %e1");
3308 #line 949 "rl78-decode.opc"
3309 ID(or); DR(A
); SM(HL
, 0); Fz
;
3315 /** 0110 1110 or %0, %ea1 */
3318 printf ("\033[33m%s\033[0m %02x\n",
3319 "/** 0110 1110 or %0, %ea1 */",
3322 SYNTAX("or %0, %ea1");
3323 #line 955 "rl78-decode.opc"
3324 ID(or); DR(A
); SM(HL
, IMMU(1)); Fz
;
3330 /** 0110 1111 or %0, %e!1 */
3333 printf ("\033[33m%s\033[0m %02x\n",
3334 "/** 0110 1111 or %0, %e!1 */",
3337 SYNTAX("or %0, %e!1");
3338 #line 946 "rl78-decode.opc"
3339 ID(or); DR(A
); SM(None
, IMMU(2)); Fz
;
3351 /** 0111 0rba mov %0, %1 */
3352 #line 702 "rl78-decode.opc"
3353 int rba AU
= op
[0] & 0x07;
3356 printf ("\033[33m%s\033[0m %02x\n",
3357 "/** 0111 0rba mov %0, %1 */",
3359 printf (" rba = 0x%x\n", rba
);
3361 SYNTAX("mov %0, %1");
3362 #line 702 "rl78-decode.opc"
3363 ID(mov
); DRB(rba
); SR(A
);
3369 switch (op
[1] & 0xff)
3380 /** 0111 0001 0bit 0000 set1 %e!0 */
3381 #line 1052 "rl78-decode.opc"
3382 int bit AU
= (op
[1] >> 4) & 0x07;
3385 printf ("\033[33m%s\033[0m %02x %02x\n",
3386 "/** 0111 0001 0bit 0000 set1 %e!0 */",
3388 printf (" bit = 0x%x\n", bit
);
3390 SYNTAX("set1 %e!0");
3391 #line 1052 "rl78-decode.opc"
3392 ID(mov
); DM(None
, IMMU(2)); DB(bit
); SC(1);
3405 /** 0111 0001 0bit 0001 mov1 %0, cy */
3406 #line 809 "rl78-decode.opc"
3407 int bit AU
= (op
[1] >> 4) & 0x07;
3410 printf ("\033[33m%s\033[0m %02x %02x\n",
3411 "/** 0111 0001 0bit 0001 mov1 %0, cy */",
3413 printf (" bit = 0x%x\n", bit
);
3415 SYNTAX("mov1 %0, cy");
3416 #line 809 "rl78-decode.opc"
3417 ID(mov
); DM(None
, SADDR
); DB(bit
); SCY();
3430 /** 0111 0001 0bit 0010 set1 %0 */
3431 #line 1070 "rl78-decode.opc"
3432 int bit AU
= (op
[1] >> 4) & 0x07;
3435 printf ("\033[33m%s\033[0m %02x %02x\n",
3436 "/** 0111 0001 0bit 0010 set1 %0 */",
3438 printf (" bit = 0x%x\n", bit
);
3441 #line 1070 "rl78-decode.opc"
3442 ID(mov
); DM(None
, SADDR
); DB(bit
); SC(1);
3444 /*----------------------------------------------------------------------*/
3457 /** 0111 0001 0bit 0011 clr1 %0 */
3458 #line 462 "rl78-decode.opc"
3459 int bit AU
= (op
[1] >> 4) & 0x07;
3462 printf ("\033[33m%s\033[0m %02x %02x\n",
3463 "/** 0111 0001 0bit 0011 clr1 %0 */",
3465 printf (" bit = 0x%x\n", bit
);
3468 #line 462 "rl78-decode.opc"
3469 ID(mov
); DM(None
, SADDR
); DB(bit
); SC(0);
3471 /*----------------------------------------------------------------------*/
3484 /** 0111 0001 0bit 0100 mov1 cy, %1 */
3485 #line 803 "rl78-decode.opc"
3486 int bit AU
= (op
[1] >> 4) & 0x07;
3489 printf ("\033[33m%s\033[0m %02x %02x\n",
3490 "/** 0111 0001 0bit 0100 mov1 cy, %1 */",
3492 printf (" bit = 0x%x\n", bit
);
3494 SYNTAX("mov1 cy, %1");
3495 #line 803 "rl78-decode.opc"
3496 ID(mov
); DCY(); SM(None
, SADDR
); SB(bit
);
3509 /** 0111 0001 0bit 0101 and1 cy, %s1 */
3510 #line 332 "rl78-decode.opc"
3511 int bit AU
= (op
[1] >> 4) & 0x07;
3514 printf ("\033[33m%s\033[0m %02x %02x\n",
3515 "/** 0111 0001 0bit 0101 and1 cy, %s1 */",
3517 printf (" bit = 0x%x\n", bit
);
3519 SYNTAX("and1 cy, %s1");
3520 #line 332 "rl78-decode.opc"
3521 ID(and); DCY(); SM(None
, SADDR
); SB(bit
);
3523 /*----------------------------------------------------------------------*/
3525 /* Note that the branch insns need to be listed before the shift
3526 ones, as "shift count of zero" means "branch insn" */
3539 /** 0111 0001 0bit 0110 or1 cy, %s1 */
3540 #line 987 "rl78-decode.opc"
3541 int bit AU
= (op
[1] >> 4) & 0x07;
3544 printf ("\033[33m%s\033[0m %02x %02x\n",
3545 "/** 0111 0001 0bit 0110 or1 cy, %s1 */",
3547 printf (" bit = 0x%x\n", bit
);
3549 SYNTAX("or1 cy, %s1");
3550 #line 987 "rl78-decode.opc"
3551 ID(or); DCY(); SM(None
, SADDR
); SB(bit
);
3553 /*----------------------------------------------------------------------*/
3566 /** 0111 0001 0bit 0111 xor1 cy, %s1 */
3567 #line 1291 "rl78-decode.opc"
3568 int bit AU
= (op
[1] >> 4) & 0x07;
3571 printf ("\033[33m%s\033[0m %02x %02x\n",
3572 "/** 0111 0001 0bit 0111 xor1 cy, %s1 */",
3574 printf (" bit = 0x%x\n", bit
);
3576 SYNTAX("xor1 cy, %s1");
3577 #line 1291 "rl78-decode.opc"
3578 ID(xor); DCY(); SM(None
, SADDR
); SB(bit
);
3580 /*----------------------------------------------------------------------*/
3593 /** 0111 0001 0bit 1000 clr1 %e!0 */
3594 #line 444 "rl78-decode.opc"
3595 int bit AU
= (op
[1] >> 4) & 0x07;
3598 printf ("\033[33m%s\033[0m %02x %02x\n",
3599 "/** 0111 0001 0bit 1000 clr1 %e!0 */",
3601 printf (" bit = 0x%x\n", bit
);
3603 SYNTAX("clr1 %e!0");
3604 #line 444 "rl78-decode.opc"
3605 ID(mov
); DM(None
, IMMU(2)); DB(bit
); SC(0);
3618 /** 0111 0001 0bit 1001 mov1 %s0, cy */
3619 #line 812 "rl78-decode.opc"
3620 int bit AU
= (op
[1] >> 4) & 0x07;
3623 printf ("\033[33m%s\033[0m %02x %02x\n",
3624 "/** 0111 0001 0bit 1001 mov1 %s0, cy */",
3626 printf (" bit = 0x%x\n", bit
);
3628 SYNTAX("mov1 %s0, cy");
3629 #line 812 "rl78-decode.opc"
3630 ID(mov
); DM(None
, SFR
); DB(bit
); SCY();
3632 /*----------------------------------------------------------------------*/
3645 /** 0111 0001 0bit 1010 set1 %s0 */
3646 #line 1064 "rl78-decode.opc"
3647 int bit AU
= (op
[1] >> 4) & 0x07;
3650 printf ("\033[33m%s\033[0m %02x %02x\n",
3651 "/** 0111 0001 0bit 1010 set1 %s0 */",
3653 printf (" bit = 0x%x\n", bit
);
3656 #line 1064 "rl78-decode.opc"
3658 ID(mov
); DM(None
, op0
); DB(bit
); SC(1);
3659 if (op0
== RL78_SFR_PSW
&& bit
== 7)
3660 rl78
->syntax
= "ei";
3673 /** 0111 0001 0bit 1011 clr1 %s0 */
3674 #line 456 "rl78-decode.opc"
3675 int bit AU
= (op
[1] >> 4) & 0x07;
3678 printf ("\033[33m%s\033[0m %02x %02x\n",
3679 "/** 0111 0001 0bit 1011 clr1 %s0 */",
3681 printf (" bit = 0x%x\n", bit
);
3684 #line 456 "rl78-decode.opc"
3686 ID(mov
); DM(None
, op0
); DB(bit
); SC(0);
3687 if (op0
== RL78_SFR_PSW
&& bit
== 7)
3688 rl78
->syntax
= "di";
3701 /** 0111 0001 0bit 1100 mov1 cy, %s1 */
3702 #line 806 "rl78-decode.opc"
3703 int bit AU
= (op
[1] >> 4) & 0x07;
3706 printf ("\033[33m%s\033[0m %02x %02x\n",
3707 "/** 0111 0001 0bit 1100 mov1 cy, %s1 */",
3709 printf (" bit = 0x%x\n", bit
);
3711 SYNTAX("mov1 cy, %s1");
3712 #line 806 "rl78-decode.opc"
3713 ID(mov
); DCY(); SM(None
, SFR
); SB(bit
);
3726 /** 0111 0001 0bit 1101 and1 cy, %s1 */
3727 #line 329 "rl78-decode.opc"
3728 int bit AU
= (op
[1] >> 4) & 0x07;
3731 printf ("\033[33m%s\033[0m %02x %02x\n",
3732 "/** 0111 0001 0bit 1101 and1 cy, %s1 */",
3734 printf (" bit = 0x%x\n", bit
);
3736 SYNTAX("and1 cy, %s1");
3737 #line 329 "rl78-decode.opc"
3738 ID(and); DCY(); SM(None
, SFR
); SB(bit
);
3751 /** 0111 0001 0bit 1110 or1 cy, %s1 */
3752 #line 984 "rl78-decode.opc"
3753 int bit AU
= (op
[1] >> 4) & 0x07;
3756 printf ("\033[33m%s\033[0m %02x %02x\n",
3757 "/** 0111 0001 0bit 1110 or1 cy, %s1 */",
3759 printf (" bit = 0x%x\n", bit
);
3761 SYNTAX("or1 cy, %s1");
3762 #line 984 "rl78-decode.opc"
3763 ID(or); DCY(); SM(None
, SFR
); SB(bit
);
3776 /** 0111 0001 0bit 1111 xor1 cy, %s1 */
3777 #line 1288 "rl78-decode.opc"
3778 int bit AU
= (op
[1] >> 4) & 0x07;
3781 printf ("\033[33m%s\033[0m %02x %02x\n",
3782 "/** 0111 0001 0bit 1111 xor1 cy, %s1 */",
3784 printf (" bit = 0x%x\n", bit
);
3786 SYNTAX("xor1 cy, %s1");
3787 #line 1288 "rl78-decode.opc"
3788 ID(xor); DCY(); SM(None
, SFR
); SB(bit
);
3794 /** 0111 0001 1000 0000 set1 cy */
3797 printf ("\033[33m%s\033[0m %02x %02x\n",
3798 "/** 0111 0001 1000 0000 set1 cy */",
3802 #line 1061 "rl78-decode.opc"
3803 ID(mov
); DCY(); SC(1);
3816 /** 0111 0001 1bit 0001 mov1 %e0, cy */
3817 #line 791 "rl78-decode.opc"
3818 int bit AU
= (op
[1] >> 4) & 0x07;
3821 printf ("\033[33m%s\033[0m %02x %02x\n",
3822 "/** 0111 0001 1bit 0001 mov1 %e0, cy */",
3824 printf (" bit = 0x%x\n", bit
);
3826 SYNTAX("mov1 %e0, cy");
3827 #line 791 "rl78-decode.opc"
3828 ID(mov
); DM(HL
, 0); DB(bit
); SCY();
3841 /** 0111 0001 1bit 0010 set1 %e0 */
3842 #line 1055 "rl78-decode.opc"
3843 int bit AU
= (op
[1] >> 4) & 0x07;
3846 printf ("\033[33m%s\033[0m %02x %02x\n",
3847 "/** 0111 0001 1bit 0010 set1 %e0 */",
3849 printf (" bit = 0x%x\n", bit
);
3852 #line 1055 "rl78-decode.opc"
3853 ID(mov
); DM(HL
, 0); DB(bit
); SC(1);
3866 /** 0111 0001 1bit 0011 clr1 %e0 */
3867 #line 447 "rl78-decode.opc"
3868 int bit AU
= (op
[1] >> 4) & 0x07;
3871 printf ("\033[33m%s\033[0m %02x %02x\n",
3872 "/** 0111 0001 1bit 0011 clr1 %e0 */",
3874 printf (" bit = 0x%x\n", bit
);
3877 #line 447 "rl78-decode.opc"
3878 ID(mov
); DM(HL
, 0); DB(bit
); SC(0);
3891 /** 0111 0001 1bit 0100 mov1 cy, %e1 */
3892 #line 797 "rl78-decode.opc"
3893 int bit AU
= (op
[1] >> 4) & 0x07;
3896 printf ("\033[33m%s\033[0m %02x %02x\n",
3897 "/** 0111 0001 1bit 0100 mov1 cy, %e1 */",
3899 printf (" bit = 0x%x\n", bit
);
3901 SYNTAX("mov1 cy, %e1");
3902 #line 797 "rl78-decode.opc"
3903 ID(mov
); DCY(); SM(HL
, 0); SB(bit
);
3916 /** 0111 0001 1bit 0101 and1 cy, %e1 */
3917 #line 323 "rl78-decode.opc"
3918 int bit AU
= (op
[1] >> 4) & 0x07;
3921 printf ("\033[33m%s\033[0m %02x %02x\n",
3922 "/** 0111 0001 1bit 0101 and1 cy, %e1 */",
3924 printf (" bit = 0x%x\n", bit
);
3926 SYNTAX("and1 cy, %e1");
3927 #line 323 "rl78-decode.opc"
3928 ID(and); DCY(); SM(HL
, 0); SB(bit
);
3941 /** 0111 0001 1bit 0110 or1 cy, %e1 */
3942 #line 978 "rl78-decode.opc"
3943 int bit AU
= (op
[1] >> 4) & 0x07;
3946 printf ("\033[33m%s\033[0m %02x %02x\n",
3947 "/** 0111 0001 1bit 0110 or1 cy, %e1 */",
3949 printf (" bit = 0x%x\n", bit
);
3951 SYNTAX("or1 cy, %e1");
3952 #line 978 "rl78-decode.opc"
3953 ID(or); DCY(); SM(HL
, 0); SB(bit
);
3966 /** 0111 0001 1bit 0111 xor1 cy, %e1 */
3967 #line 1282 "rl78-decode.opc"
3968 int bit AU
= (op
[1] >> 4) & 0x07;
3971 printf ("\033[33m%s\033[0m %02x %02x\n",
3972 "/** 0111 0001 1bit 0111 xor1 cy, %e1 */",
3974 printf (" bit = 0x%x\n", bit
);
3976 SYNTAX("xor1 cy, %e1");
3977 #line 1282 "rl78-decode.opc"
3978 ID(xor); DCY(); SM(HL
, 0); SB(bit
);
3984 /** 0111 0001 1000 1000 clr1 cy */
3987 printf ("\033[33m%s\033[0m %02x %02x\n",
3988 "/** 0111 0001 1000 1000 clr1 cy */",
3992 #line 453 "rl78-decode.opc"
3993 ID(mov
); DCY(); SC(0);
4006 /** 0111 0001 1bit 1001 mov1 %e0, cy */
4007 #line 794 "rl78-decode.opc"
4008 int bit AU
= (op
[1] >> 4) & 0x07;
4011 printf ("\033[33m%s\033[0m %02x %02x\n",
4012 "/** 0111 0001 1bit 1001 mov1 %e0, cy */",
4014 printf (" bit = 0x%x\n", bit
);
4016 SYNTAX("mov1 %e0, cy");
4017 #line 794 "rl78-decode.opc"
4018 ID(mov
); DR(A
); DB(bit
); SCY();
4031 /** 0111 0001 1bit 1010 set1 %0 */
4032 #line 1058 "rl78-decode.opc"
4033 int bit AU
= (op
[1] >> 4) & 0x07;
4036 printf ("\033[33m%s\033[0m %02x %02x\n",
4037 "/** 0111 0001 1bit 1010 set1 %0 */",
4039 printf (" bit = 0x%x\n", bit
);
4042 #line 1058 "rl78-decode.opc"
4043 ID(mov
); DR(A
); DB(bit
); SC(1);
4056 /** 0111 0001 1bit 1011 clr1 %0 */
4057 #line 450 "rl78-decode.opc"
4058 int bit AU
= (op
[1] >> 4) & 0x07;
4061 printf ("\033[33m%s\033[0m %02x %02x\n",
4062 "/** 0111 0001 1bit 1011 clr1 %0 */",
4064 printf (" bit = 0x%x\n", bit
);
4067 #line 450 "rl78-decode.opc"
4068 ID(mov
); DR(A
); DB(bit
); SC(0);
4081 /** 0111 0001 1bit 1100 mov1 cy, %e1 */
4082 #line 800 "rl78-decode.opc"
4083 int bit AU
= (op
[1] >> 4) & 0x07;
4086 printf ("\033[33m%s\033[0m %02x %02x\n",
4087 "/** 0111 0001 1bit 1100 mov1 cy, %e1 */",
4089 printf (" bit = 0x%x\n", bit
);
4091 SYNTAX("mov1 cy, %e1");
4092 #line 800 "rl78-decode.opc"
4093 ID(mov
); DCY(); SR(A
); SB(bit
);
4106 /** 0111 0001 1bit 1101 and1 cy, %1 */
4107 #line 326 "rl78-decode.opc"
4108 int bit AU
= (op
[1] >> 4) & 0x07;
4111 printf ("\033[33m%s\033[0m %02x %02x\n",
4112 "/** 0111 0001 1bit 1101 and1 cy, %1 */",
4114 printf (" bit = 0x%x\n", bit
);
4116 SYNTAX("and1 cy, %1");
4117 #line 326 "rl78-decode.opc"
4118 ID(and); DCY(); SR(A
); SB(bit
);
4131 /** 0111 0001 1bit 1110 or1 cy, %1 */
4132 #line 981 "rl78-decode.opc"
4133 int bit AU
= (op
[1] >> 4) & 0x07;
4136 printf ("\033[33m%s\033[0m %02x %02x\n",
4137 "/** 0111 0001 1bit 1110 or1 cy, %1 */",
4139 printf (" bit = 0x%x\n", bit
);
4141 SYNTAX("or1 cy, %1");
4142 #line 981 "rl78-decode.opc"
4143 ID(or); DCY(); SR(A
); SB(bit
);
4156 /** 0111 0001 1bit 1111 xor1 cy, %1 */
4157 #line 1285 "rl78-decode.opc"
4158 int bit AU
= (op
[1] >> 4) & 0x07;
4161 printf ("\033[33m%s\033[0m %02x %02x\n",
4162 "/** 0111 0001 1bit 1111 xor1 cy, %1 */",
4164 printf (" bit = 0x%x\n", bit
);
4166 SYNTAX("xor1 cy, %1");
4167 #line 1285 "rl78-decode.opc"
4168 ID(xor); DCY(); SR(A
); SB(bit
);
4174 /** 0111 0001 1100 0000 not1 cy */
4177 printf ("\033[33m%s\033[0m %02x %02x\n",
4178 "/** 0111 0001 1100 0000 not1 cy */",
4182 #line 922 "rl78-decode.opc"
4183 ID(xor); DCY(); SC(1);
4185 /*----------------------------------------------------------------------*/
4189 default: UNSUPPORTED(); break;
4194 /** 0111 1000 movw %e0, %1 */
4197 printf ("\033[33m%s\033[0m %02x\n",
4198 "/** 0111 1000 movw %e0, %1 */",
4201 SYNTAX("movw %e0, %1");
4202 #line 883 "rl78-decode.opc"
4203 ID(mov
); W(); DM(BC
, IMMU(2)); SR(AX
);
4209 /** 0111 1001 movw %0, %e1 */
4212 printf ("\033[33m%s\033[0m %02x\n",
4213 "/** 0111 1001 movw %0, %e1 */",
4216 SYNTAX("movw %0, %e1");
4217 #line 874 "rl78-decode.opc"
4218 ID(mov
); W(); DR(AX
); SM(BC
, IMMU(2));
4224 /** 0111 1010 xor %0, #%1 */
4227 printf ("\033[33m%s\033[0m %02x\n",
4228 "/** 0111 1010 xor %0, #%1 */",
4231 SYNTAX("xor %0, #%1");
4232 #line 1277 "rl78-decode.opc"
4233 ID(xor); DM(None
, SADDR
); SC(IMMU(1)); Fz
;
4235 /*----------------------------------------------------------------------*/
4241 /** 0111 1011 xor %0, %1 */
4244 printf ("\033[33m%s\033[0m %02x\n",
4245 "/** 0111 1011 xor %0, %1 */",
4248 SYNTAX("xor %0, %1");
4249 #line 1274 "rl78-decode.opc"
4250 ID(xor); DR(A
); SM(None
, SADDR
); Fz
;
4256 /** 0111 1100 xor %0, #%1 */
4259 printf ("\033[33m%s\033[0m %02x\n",
4260 "/** 0111 1100 xor %0, #%1 */",
4263 SYNTAX("xor %0, #%1");
4264 #line 1265 "rl78-decode.opc"
4265 ID(xor); DR(A
); SC(IMMU(1)); Fz
;
4271 /** 0111 1101 xor %0, %e1 */
4274 printf ("\033[33m%s\033[0m %02x\n",
4275 "/** 0111 1101 xor %0, %e1 */",
4278 SYNTAX("xor %0, %e1");
4279 #line 1253 "rl78-decode.opc"
4280 ID(xor); DR(A
); SM(HL
, 0); Fz
;
4286 /** 0111 1110 xor %0, %ea1 */
4289 printf ("\033[33m%s\033[0m %02x\n",
4290 "/** 0111 1110 xor %0, %ea1 */",
4293 SYNTAX("xor %0, %ea1");
4294 #line 1259 "rl78-decode.opc"
4295 ID(xor); DR(A
); SM(HL
, IMMU(1)); Fz
;
4301 /** 0111 1111 xor %0, %e!1 */
4304 printf ("\033[33m%s\033[0m %02x\n",
4305 "/** 0111 1111 xor %0, %e!1 */",
4308 SYNTAX("xor %0, %e!1");
4309 #line 1250 "rl78-decode.opc"
4310 ID(xor); DR(A
); SM(None
, IMMU(2)); Fz
;
4323 /** 1000 0reg inc %0 */
4324 #line 593 "rl78-decode.opc"
4325 int reg AU
= op
[0] & 0x07;
4328 printf ("\033[33m%s\033[0m %02x\n",
4329 "/** 1000 0reg inc %0 */",
4331 printf (" reg = 0x%x\n", reg
);
4334 #line 593 "rl78-decode.opc"
4335 ID(add
); DRB(reg
); SC(1); Fza
;
4341 /** 1000 1000 mov %0, %ea1 */
4344 printf ("\033[33m%s\033[0m %02x\n",
4345 "/** 1000 1000 mov %0, %ea1 */",
4348 SYNTAX("mov %0, %ea1");
4349 #line 672 "rl78-decode.opc"
4350 ID(mov
); DR(A
); SM(SP
, IMMU(1));
4356 /** 1000 1001 mov %0, %e1 */
4359 printf ("\033[33m%s\033[0m %02x\n",
4360 "/** 1000 1001 mov %0, %e1 */",
4363 SYNTAX("mov %0, %e1");
4364 #line 654 "rl78-decode.opc"
4365 ID(mov
); DR(A
); SM(DE
, 0);
4371 /** 1000 1010 mov %0, %ea1 */
4374 printf ("\033[33m%s\033[0m %02x\n",
4375 "/** 1000 1010 mov %0, %ea1 */",
4378 SYNTAX("mov %0, %ea1");
4379 #line 657 "rl78-decode.opc"
4380 ID(mov
); DR(A
); SM(DE
, IMMU(1));
4386 /** 1000 1011 mov %0, %e1 */
4389 printf ("\033[33m%s\033[0m %02x\n",
4390 "/** 1000 1011 mov %0, %e1 */",
4393 SYNTAX("mov %0, %e1");
4394 #line 660 "rl78-decode.opc"
4395 ID(mov
); DR(A
); SM(HL
, 0);
4401 /** 1000 1100 mov %0, %ea1 */
4404 printf ("\033[33m%s\033[0m %02x\n",
4405 "/** 1000 1100 mov %0, %ea1 */",
4408 SYNTAX("mov %0, %ea1");
4409 #line 663 "rl78-decode.opc"
4410 ID(mov
); DR(A
); SM(HL
, IMMU(1));
4416 /** 1000 1101 mov %0, %1 */
4419 printf ("\033[33m%s\033[0m %02x\n",
4420 "/** 1000 1101 mov %0, %1 */",
4423 SYNTAX("mov %0, %1");
4424 #line 696 "rl78-decode.opc"
4425 ID(mov
); DR(A
); SM(None
, SADDR
);
4431 /** 1000 1110 mov %0, %s1 */
4434 printf ("\033[33m%s\033[0m %02x\n",
4435 "/** 1000 1110 mov %0, %s1 */",
4438 SYNTAX("mov %0, %s1");
4439 #line 693 "rl78-decode.opc"
4440 ID(mov
); DR(A
); SM(None
, SFR
);
4446 /** 1000 1111 mov %0, %e!1 */
4449 printf ("\033[33m%s\033[0m %02x\n",
4450 "/** 1000 1111 mov %0, %e!1 */",
4453 SYNTAX("mov %0, %e!1");
4454 #line 651 "rl78-decode.opc"
4455 ID(mov
); DR(A
); SM(None
, IMMU(2));
4468 /** 1001 0reg dec %0 */
4469 #line 560 "rl78-decode.opc"
4470 int reg AU
= op
[0] & 0x07;
4473 printf ("\033[33m%s\033[0m %02x\n",
4474 "/** 1001 0reg dec %0 */",
4476 printf (" reg = 0x%x\n", reg
);
4479 #line 560 "rl78-decode.opc"
4480 ID(sub
); DRB(reg
); SC(1); Fza
;
4486 /** 1001 1000 mov %a0, %1 */
4489 printf ("\033[33m%s\033[0m %02x\n",
4490 "/** 1001 1000 mov %a0, %1 */",
4493 SYNTAX("mov %a0, %1");
4494 #line 648 "rl78-decode.opc"
4495 ID(mov
); DM(SP
, IMMU(1)); SR(A
);
4501 /** 1001 1001 mov %e0, %1 */
4504 printf ("\033[33m%s\033[0m %02x\n",
4505 "/** 1001 1001 mov %e0, %1 */",
4508 SYNTAX("mov %e0, %1");
4509 #line 621 "rl78-decode.opc"
4510 ID(mov
); DM(DE
, 0); SR(A
);
4516 /** 1001 1010 mov %ea0, %1 */
4519 printf ("\033[33m%s\033[0m %02x\n",
4520 "/** 1001 1010 mov %ea0, %1 */",
4523 SYNTAX("mov %ea0, %1");
4524 #line 627 "rl78-decode.opc"
4525 ID(mov
); DM(DE
, IMMU(1)); SR(A
);
4531 /** 1001 1011 mov %e0, %1 */
4534 printf ("\033[33m%s\033[0m %02x\n",
4535 "/** 1001 1011 mov %e0, %1 */",
4538 SYNTAX("mov %e0, %1");
4539 #line 630 "rl78-decode.opc"
4540 ID(mov
); DM(HL
, 0); SR(A
);
4546 /** 1001 1100 mov %ea0, %1 */
4549 printf ("\033[33m%s\033[0m %02x\n",
4550 "/** 1001 1100 mov %ea0, %1 */",
4553 SYNTAX("mov %ea0, %1");
4554 #line 639 "rl78-decode.opc"
4555 ID(mov
); DM(HL
, IMMU(1)); SR(A
);
4561 /** 1001 1101 mov %0, %1 */
4564 printf ("\033[33m%s\033[0m %02x\n",
4565 "/** 1001 1101 mov %0, %1 */",
4568 SYNTAX("mov %0, %1");
4569 #line 753 "rl78-decode.opc"
4570 ID(mov
); DM(None
, SADDR
); SR(A
);
4576 /** 1001 1110 mov %s0, %1 */
4579 printf ("\033[33m%s\033[0m %02x\n",
4580 "/** 1001 1110 mov %s0, %1 */",
4583 SYNTAX("mov %s0, %1");
4584 #line 786 "rl78-decode.opc"
4585 ID(mov
); DM(None
, SFR
); SR(A
);
4587 /*----------------------------------------------------------------------*/
4593 /** 1001 1111 mov %e!0, %1 */
4596 printf ("\033[33m%s\033[0m %02x\n",
4597 "/** 1001 1111 mov %e!0, %1 */",
4600 SYNTAX("mov %e!0, %1");
4601 #line 618 "rl78-decode.opc"
4602 ID(mov
); DM(None
, IMMU(2)); SR(A
);
4608 /** 1010 0000 inc %e!0 */
4611 printf ("\033[33m%s\033[0m %02x\n",
4612 "/** 1010 0000 inc %e!0 */",
4616 #line 587 "rl78-decode.opc"
4617 ID(add
); DM(None
, IMMU(2)); SC(1); Fza
;
4626 /** 1010 0rg1 incw %0 */
4627 #line 607 "rl78-decode.opc"
4628 int rg AU
= (op
[0] >> 1) & 0x03;
4631 printf ("\033[33m%s\033[0m %02x\n",
4632 "/** 1010 0rg1 incw %0 */",
4634 printf (" rg = 0x%x\n", rg
);
4637 #line 607 "rl78-decode.opc"
4638 ID(add
); W(); DRW(rg
); SC(1);
4644 /** 1010 0010 incw %e!0 */
4647 printf ("\033[33m%s\033[0m %02x\n",
4648 "/** 1010 0010 incw %e!0 */",
4651 SYNTAX("incw %e!0");
4652 #line 601 "rl78-decode.opc"
4653 ID(add
); W(); DM(None
, IMMU(2)); SC(1);
4659 /** 1010 0100 inc %0 */
4662 printf ("\033[33m%s\033[0m %02x\n",
4663 "/** 1010 0100 inc %0 */",
4667 #line 596 "rl78-decode.opc"
4668 ID(add
); DM(None
, SADDR
); SC(1); Fza
;
4670 /*----------------------------------------------------------------------*/
4676 /** 1010 0110 incw %0 */
4679 printf ("\033[33m%s\033[0m %02x\n",
4680 "/** 1010 0110 incw %0 */",
4684 #line 610 "rl78-decode.opc"
4685 ID(add
); W(); DM(None
, SADDR
); SC(1);
4687 /*----------------------------------------------------------------------*/
4693 /** 1010 1000 movw %0, %a1 */
4696 printf ("\033[33m%s\033[0m %02x\n",
4697 "/** 1010 1000 movw %0, %a1 */",
4700 SYNTAX("movw %0, %a1");
4701 #line 856 "rl78-decode.opc"
4702 ID(mov
); W(); DR(AX
); SM(SP
, IMMU(1));
4708 /** 1010 1001 movw %0, %e1 */
4711 printf ("\033[33m%s\033[0m %02x\n",
4712 "/** 1010 1001 movw %0, %e1 */",
4715 SYNTAX("movw %0, %e1");
4716 #line 844 "rl78-decode.opc"
4717 ID(mov
); W(); DR(AX
); SM(DE
, 0);
4723 /** 1010 1010 movw %0, %ea1 */
4726 printf ("\033[33m%s\033[0m %02x\n",
4727 "/** 1010 1010 movw %0, %ea1 */",
4730 SYNTAX("movw %0, %ea1");
4731 #line 847 "rl78-decode.opc"
4732 ID(mov
); W(); DR(AX
); SM(DE
, IMMU(1));
4738 /** 1010 1011 movw %0, %e1 */
4741 printf ("\033[33m%s\033[0m %02x\n",
4742 "/** 1010 1011 movw %0, %e1 */",
4745 SYNTAX("movw %0, %e1");
4746 #line 850 "rl78-decode.opc"
4747 ID(mov
); W(); DR(AX
); SM(HL
, 0);
4753 /** 1010 1100 movw %0, %ea1 */
4756 printf ("\033[33m%s\033[0m %02x\n",
4757 "/** 1010 1100 movw %0, %ea1 */",
4760 SYNTAX("movw %0, %ea1");
4761 #line 853 "rl78-decode.opc"
4762 ID(mov
); W(); DR(AX
); SM(HL
, IMMU(1));
4768 /** 1010 1101 movw %0, %1 */
4771 printf ("\033[33m%s\033[0m %02x\n",
4772 "/** 1010 1101 movw %0, %1 */",
4775 SYNTAX("movw %0, %1");
4776 #line 886 "rl78-decode.opc"
4777 ID(mov
); W(); DR(AX
); SM(None
, SADDR
);
4783 /** 1010 1110 movw %0, %s1 */
4786 printf ("\033[33m%s\033[0m %02x\n",
4787 "/** 1010 1110 movw %0, %s1 */",
4790 SYNTAX("movw %0, %s1");
4791 #line 889 "rl78-decode.opc"
4792 ID(mov
); W(); DR(AX
); SM(None
, SFR
);
4798 /** 1010 1111 movw %0, %e!1 */
4801 printf ("\033[33m%s\033[0m %02x\n",
4802 "/** 1010 1111 movw %0, %e!1 */",
4805 SYNTAX("movw %0, %e!1");
4806 #line 840 "rl78-decode.opc"
4807 ID(mov
); W(); DR(AX
); SM(None
, IMMU(2));
4814 /** 1011 0000 dec %e!0 */
4817 printf ("\033[33m%s\033[0m %02x\n",
4818 "/** 1011 0000 dec %e!0 */",
4822 #line 554 "rl78-decode.opc"
4823 ID(sub
); DM(None
, IMMU(2)); SC(1); Fza
;
4832 /** 1011 0rg1 decw %0 */
4833 #line 574 "rl78-decode.opc"
4834 int rg AU
= (op
[0] >> 1) & 0x03;
4837 printf ("\033[33m%s\033[0m %02x\n",
4838 "/** 1011 0rg1 decw %0 */",
4840 printf (" rg = 0x%x\n", rg
);
4843 #line 574 "rl78-decode.opc"
4844 ID(sub
); W(); DRW(rg
); SC(1);
4850 /** 1011 0010 decw %e!0 */
4853 printf ("\033[33m%s\033[0m %02x\n",
4854 "/** 1011 0010 decw %e!0 */",
4857 SYNTAX("decw %e!0");
4858 #line 568 "rl78-decode.opc"
4859 ID(sub
); W(); DM(None
, IMMU(2)); SC(1);
4865 /** 1011 0100 dec %0 */
4868 printf ("\033[33m%s\033[0m %02x\n",
4869 "/** 1011 0100 dec %0 */",
4873 #line 563 "rl78-decode.opc"
4874 ID(sub
); DM(None
, SADDR
); SC(1); Fza
;
4876 /*----------------------------------------------------------------------*/
4882 /** 1011 0110 decw %0 */
4885 printf ("\033[33m%s\033[0m %02x\n",
4886 "/** 1011 0110 decw %0 */",
4890 #line 577 "rl78-decode.opc"
4891 ID(sub
); W(); DM(None
, SADDR
); SC(1);
4893 /*----------------------------------------------------------------------*/
4899 /** 1011 1000 movw %a0, %1 */
4902 printf ("\033[33m%s\033[0m %02x\n",
4903 "/** 1011 1000 movw %a0, %1 */",
4906 SYNTAX("movw %a0, %1");
4907 #line 837 "rl78-decode.opc"
4908 ID(mov
); W(); DM(SP
, IMMU(1)); SR(AX
);
4914 /** 1011 1001 movw %e0, %1 */
4917 printf ("\033[33m%s\033[0m %02x\n",
4918 "/** 1011 1001 movw %e0, %1 */",
4921 SYNTAX("movw %e0, %1");
4922 #line 825 "rl78-decode.opc"
4923 ID(mov
); W(); DM(DE
, 0); SR(AX
);
4929 /** 1011 1010 movw %ea0, %1 */
4932 printf ("\033[33m%s\033[0m %02x\n",
4933 "/** 1011 1010 movw %ea0, %1 */",
4936 SYNTAX("movw %ea0, %1");
4937 #line 828 "rl78-decode.opc"
4938 ID(mov
); W(); DM(DE
, IMMU(1)); SR(AX
);
4944 /** 1011 1011 movw %e0, %1 */
4947 printf ("\033[33m%s\033[0m %02x\n",
4948 "/** 1011 1011 movw %e0, %1 */",
4951 SYNTAX("movw %e0, %1");
4952 #line 831 "rl78-decode.opc"
4953 ID(mov
); W(); DM(HL
, 0); SR(AX
);
4959 /** 1011 1100 movw %ea0, %1 */
4962 printf ("\033[33m%s\033[0m %02x\n",
4963 "/** 1011 1100 movw %ea0, %1 */",
4966 SYNTAX("movw %ea0, %1");
4967 #line 834 "rl78-decode.opc"
4968 ID(mov
); W(); DM(HL
, IMMU(1)); SR(AX
);
4974 /** 1011 1101 movw %0, %1 */
4977 printf ("\033[33m%s\033[0m %02x\n",
4978 "/** 1011 1101 movw %0, %1 */",
4981 SYNTAX("movw %0, %1");
4982 #line 901 "rl78-decode.opc"
4983 ID(mov
); W(); DM(None
, SADDR
); SR(AX
);
4989 /** 1011 1110 movw %s0, %1 */
4992 printf ("\033[33m%s\033[0m %02x\n",
4993 "/** 1011 1110 movw %s0, %1 */",
4996 SYNTAX("movw %s0, %1");
4997 #line 907 "rl78-decode.opc"
4998 ID(mov
); W(); DM(None
, SFR
); SR(AX
);
5000 /*----------------------------------------------------------------------*/
5006 /** 1011 1111 movw %e!0, %1 */
5009 printf ("\033[33m%s\033[0m %02x\n",
5010 "/** 1011 1111 movw %e!0, %1 */",
5013 SYNTAX("movw %e!0, %1");
5014 #line 822 "rl78-decode.opc"
5015 ID(mov
); W(); DM(None
, IMMU(2)); SR(AX
);
5024 /** 1100 0rg0 pop %0 */
5025 #line 992 "rl78-decode.opc"
5026 int rg AU
= (op
[0] >> 1) & 0x03;
5029 printf ("\033[33m%s\033[0m %02x\n",
5030 "/** 1100 0rg0 pop %0 */",
5032 printf (" rg = 0x%x\n", rg
);
5035 #line 992 "rl78-decode.opc"
5036 ID(mov
); W(); DRW(rg
); SPOP();
5045 /** 1100 0rg1 push %1 */
5046 #line 1000 "rl78-decode.opc"
5047 int rg AU
= (op
[0] >> 1) & 0x03;
5050 printf ("\033[33m%s\033[0m %02x\n",
5051 "/** 1100 0rg1 push %1 */",
5053 printf (" rg = 0x%x\n", rg
);
5056 #line 1000 "rl78-decode.opc"
5057 ID(mov
); W(); DPUSH(); SRW(rg
);
5063 /** 1100 1000 mov %a0, #%1 */
5066 printf ("\033[33m%s\033[0m %02x\n",
5067 "/** 1100 1000 mov %a0, #%1 */",
5070 SYNTAX("mov %a0, #%1");
5071 #line 645 "rl78-decode.opc"
5072 ID(mov
); DM(SP
, IMMU(1)); SC(IMMU(1));
5078 /** 1100 1001 movw %0, #%1 */
5081 printf ("\033[33m%s\033[0m %02x\n",
5082 "/** 1100 1001 movw %0, #%1 */",
5085 SYNTAX("movw %0, #%1");
5086 #line 898 "rl78-decode.opc"
5087 ID(mov
); W(); DM(None
, SADDR
); SC(IMMU(2));
5093 /** 1100 1010 mov %ea0, #%1 */
5096 printf ("\033[33m%s\033[0m %02x\n",
5097 "/** 1100 1010 mov %ea0, #%1 */",
5100 SYNTAX("mov %ea0, #%1");
5101 #line 624 "rl78-decode.opc"
5102 ID(mov
); DM(DE
, IMMU(1)); SC(IMMU(1));
5108 /** 1100 1011 movw %s0, #%1 */
5111 printf ("\033[33m%s\033[0m %02x\n",
5112 "/** 1100 1011 movw %s0, #%1 */",
5115 SYNTAX("movw %s0, #%1");
5116 #line 904 "rl78-decode.opc"
5117 ID(mov
); W(); DM(None
, SFR
); SC(IMMU(2));
5123 /** 1100 1100 mov %ea0, #%1 */
5126 printf ("\033[33m%s\033[0m %02x\n",
5127 "/** 1100 1100 mov %ea0, #%1 */",
5130 SYNTAX("mov %ea0, #%1");
5131 #line 636 "rl78-decode.opc"
5132 ID(mov
); DM(HL
, IMMU(1)); SC(IMMU(1));
5138 /** 1100 1101 mov %0, #%1 */
5141 printf ("\033[33m%s\033[0m %02x\n",
5142 "/** 1100 1101 mov %0, #%1 */",
5145 SYNTAX("mov %0, #%1");
5146 #line 750 "rl78-decode.opc"
5147 ID(mov
); DM(None
, SADDR
); SC(IMMU(1));
5153 /** 1100 1110 mov %s0, #%1 */
5156 printf ("\033[33m%s\033[0m %02x\n",
5157 "/** 1100 1110 mov %s0, #%1 */",
5160 SYNTAX("mov %s0, #%1");
5161 #line 756 "rl78-decode.opc"
5164 ID(mov
); DM(None
, op0
); SC(op1
);
5165 if (op0
== 0xffffb && isa
== RL78_ISA_G14
)
5169 rl78
->syntax
= "mulhu"; ID(mulhu
);
5172 rl78
->syntax
= "mulh"; ID(mulh
);
5175 rl78
->syntax
= "divhu"; ID(divhu
);
5178 rl78
->syntax
= "divwu <old-encoding>"; ID(divwu
);
5181 rl78
->syntax
= "machu"; ID(machu
);
5184 rl78
->syntax
= "mach"; ID(mach
);
5187 rl78
->syntax
= "divwu"; ID(divwu
);
5195 /** 1100 1111 mov %e!0, #%1 */
5198 printf ("\033[33m%s\033[0m %02x\n",
5199 "/** 1100 1111 mov %e!0, #%1 */",
5202 SYNTAX("mov %e!0, #%1");
5203 #line 615 "rl78-decode.opc"
5204 ID(mov
); DM(None
, IMMU(2)); SC(IMMU(1));
5213 /** 1101 00rg cmp0 %0 */
5214 #line 524 "rl78-decode.opc"
5215 int rg AU
= op
[0] & 0x03;
5218 printf ("\033[33m%s\033[0m %02x\n",
5219 "/** 1101 00rg cmp0 %0 */",
5221 printf (" rg = 0x%x\n", rg
);
5224 #line 524 "rl78-decode.opc"
5225 ID(cmp
); DRB(rg
); SC(0); Fzac
;
5231 /** 1101 0100 cmp0 %0 */
5234 printf ("\033[33m%s\033[0m %02x\n",
5235 "/** 1101 0100 cmp0 %0 */",
5239 #line 527 "rl78-decode.opc"
5240 ID(cmp
); DM(None
, SADDR
); SC(0); Fzac
;
5242 /*----------------------------------------------------------------------*/
5248 /** 1101 0101 cmp0 %e!0 */
5251 printf ("\033[33m%s\033[0m %02x\n",
5252 "/** 1101 0101 cmp0 %e!0 */",
5255 SYNTAX("cmp0 %e!0");
5256 #line 521 "rl78-decode.opc"
5257 ID(cmp
); DM(None
, IMMU(2)); SC(0); Fzac
;
5263 /** 1101 0110 mulu x */
5266 printf ("\033[33m%s\033[0m %02x\n",
5267 "/** 1101 0110 mulu x */",
5271 #line 912 "rl78-decode.opc"
5274 /*----------------------------------------------------------------------*/
5280 /** 1101 0111 ret */
5283 printf ("\033[33m%s\033[0m %02x\n",
5284 "/** 1101 0111 ret */",
5288 #line 1008 "rl78-decode.opc"
5295 /** 1101 1000 mov %0, %1 */
5298 printf ("\033[33m%s\033[0m %02x\n",
5299 "/** 1101 1000 mov %0, %1 */",
5302 SYNTAX("mov %0, %1");
5303 #line 717 "rl78-decode.opc"
5304 ID(mov
); DR(X
); SM(None
, SADDR
);
5310 /** 1101 1001 mov %0, %e!1 */
5313 printf ("\033[33m%s\033[0m %02x\n",
5314 "/** 1101 1001 mov %0, %e!1 */",
5317 SYNTAX("mov %0, %e!1");
5318 #line 714 "rl78-decode.opc"
5319 ID(mov
); DR(X
); SM(None
, IMMU(2));
5327 /** 11ra 1010 movw %0, %1 */
5328 #line 895 "rl78-decode.opc"
5329 int ra AU
= (op
[0] >> 4) & 0x03;
5332 printf ("\033[33m%s\033[0m %02x\n",
5333 "/** 11ra 1010 movw %0, %1 */",
5335 printf (" ra = 0x%x\n", ra
);
5337 SYNTAX("movw %0, %1");
5338 #line 895 "rl78-decode.opc"
5339 ID(mov
); W(); DRW(ra
); SM(None
, SADDR
);
5347 /** 11ra 1011 movw %0, %es!1 */
5348 #line 892 "rl78-decode.opc"
5349 int ra AU
= (op
[0] >> 4) & 0x03;
5352 printf ("\033[33m%s\033[0m %02x\n",
5353 "/** 11ra 1011 movw %0, %es!1 */",
5355 printf (" ra = 0x%x\n", ra
);
5357 SYNTAX("movw %0, %es!1");
5358 #line 892 "rl78-decode.opc"
5359 ID(mov
); W(); DRW(ra
); SM(None
, IMMU(2));
5365 /** 1101 1100 bc $%a0 */
5368 printf ("\033[33m%s\033[0m %02x\n",
5369 "/** 1101 1100 bc $%a0 */",
5373 #line 340 "rl78-decode.opc"
5374 ID(branch_cond
); DC(pc
+IMMS(1)+2); SR(None
); COND(C
);
5380 /** 1101 1101 bz $%a0 */
5383 printf ("\033[33m%s\033[0m %02x\n",
5384 "/** 1101 1101 bz $%a0 */",
5388 #line 352 "rl78-decode.opc"
5389 ID(branch_cond
); DC(pc
+IMMS(1)+2); SR(None
); COND(Z
);
5395 /** 1101 1110 bnc $%a0 */
5398 printf ("\033[33m%s\033[0m %02x\n",
5399 "/** 1101 1110 bnc $%a0 */",
5403 #line 343 "rl78-decode.opc"
5404 ID(branch_cond
); DC(pc
+IMMS(1)+2); SR(None
); COND(NC
);
5410 /** 1101 1111 bnz $%a0 */
5413 printf ("\033[33m%s\033[0m %02x\n",
5414 "/** 1101 1111 bnz $%a0 */",
5418 #line 355 "rl78-decode.opc"
5419 ID(branch_cond
); DC(pc
+IMMS(1)+2); SR(None
); COND(NZ
);
5421 /*----------------------------------------------------------------------*/
5430 /** 1110 00rg oneb %0 */
5431 #line 930 "rl78-decode.opc"
5432 int rg AU
= op
[0] & 0x03;
5435 printf ("\033[33m%s\033[0m %02x\n",
5436 "/** 1110 00rg oneb %0 */",
5438 printf (" rg = 0x%x\n", rg
);
5441 #line 930 "rl78-decode.opc"
5442 ID(mov
); DRB(rg
); SC(1);
5448 /** 1110 0100 oneb %0 */
5451 printf ("\033[33m%s\033[0m %02x\n",
5452 "/** 1110 0100 oneb %0 */",
5456 #line 933 "rl78-decode.opc"
5457 ID(mov
); DM(None
, SADDR
); SC(1);
5459 /*----------------------------------------------------------------------*/
5465 /** 1110 0101 oneb %e!0 */
5468 printf ("\033[33m%s\033[0m %02x\n",
5469 "/** 1110 0101 oneb %e!0 */",
5472 SYNTAX("oneb %e!0");
5473 #line 927 "rl78-decode.opc"
5474 ID(mov
); DM(None
, IMMU(2)); SC(1);
5480 /** 1110 0110 onew %0 */
5483 printf ("\033[33m%s\033[0m %02x\n",
5484 "/** 1110 0110 onew %0 */",
5488 #line 938 "rl78-decode.opc"
5489 ID(mov
); DR(AX
); SC(1);
5495 /** 1110 0111 onew %0 */
5498 printf ("\033[33m%s\033[0m %02x\n",
5499 "/** 1110 0111 onew %0 */",
5503 #line 941 "rl78-decode.opc"
5504 ID(mov
); DR(BC
); SC(1);
5506 /*----------------------------------------------------------------------*/
5512 /** 1110 1000 mov %0, %1 */
5515 printf ("\033[33m%s\033[0m %02x\n",
5516 "/** 1110 1000 mov %0, %1 */",
5519 SYNTAX("mov %0, %1");
5520 #line 705 "rl78-decode.opc"
5521 ID(mov
); DR(B
); SM(None
, SADDR
);
5527 /** 1110 1001 mov %0, %e!1 */
5530 printf ("\033[33m%s\033[0m %02x\n",
5531 "/** 1110 1001 mov %0, %e!1 */",
5534 SYNTAX("mov %0, %e!1");
5535 #line 699 "rl78-decode.opc"
5536 ID(mov
); DR(B
); SM(None
, IMMU(2));
5542 /** 1110 1100 br !%!a0 */
5545 printf ("\033[33m%s\033[0m %02x\n",
5546 "/** 1110 1100 br !%!a0 */",
5550 #line 374 "rl78-decode.opc"
5551 ID(branch
); DC(IMMU(3));
5557 /** 1110 1101 br %!a0 */
5560 printf ("\033[33m%s\033[0m %02x\n",
5561 "/** 1110 1101 br %!a0 */",
5565 #line 377 "rl78-decode.opc"
5566 ID(branch
); DC(IMMU(2));
5572 /** 1110 1110 br $%!a0 */
5575 printf ("\033[33m%s\033[0m %02x\n",
5576 "/** 1110 1110 br $%!a0 */",
5580 #line 380 "rl78-decode.opc"
5581 ID(branch
); DC(pc
+IMMS(2)+3);
5587 /** 1110 1111 br $%a0 */
5590 printf ("\033[33m%s\033[0m %02x\n",
5591 "/** 1110 1111 br $%a0 */",
5595 #line 383 "rl78-decode.opc"
5596 ID(branch
); DC(pc
+IMMS(1)+2);
5605 /** 1111 00rg clrb %0 */
5606 #line 470 "rl78-decode.opc"
5607 int rg AU
= op
[0] & 0x03;
5610 printf ("\033[33m%s\033[0m %02x\n",
5611 "/** 1111 00rg clrb %0 */",
5613 printf (" rg = 0x%x\n", rg
);
5616 #line 470 "rl78-decode.opc"
5617 ID(mov
); DRB(rg
); SC(0);
5623 /** 1111 0100 clrb %0 */
5626 printf ("\033[33m%s\033[0m %02x\n",
5627 "/** 1111 0100 clrb %0 */",
5631 #line 473 "rl78-decode.opc"
5632 ID(mov
); DM(None
, SADDR
); SC(0);
5634 /*----------------------------------------------------------------------*/
5640 /** 1111 0101 clrb %e!0 */
5643 printf ("\033[33m%s\033[0m %02x\n",
5644 "/** 1111 0101 clrb %e!0 */",
5647 SYNTAX("clrb %e!0");
5648 #line 467 "rl78-decode.opc"
5649 ID(mov
); DM(None
, IMMU(2)); SC(0);
5655 /** 1111 0110 clrw %0 */
5658 printf ("\033[33m%s\033[0m %02x\n",
5659 "/** 1111 0110 clrw %0 */",
5663 #line 478 "rl78-decode.opc"
5664 ID(mov
); DR(AX
); SC(0);
5670 /** 1111 0111 clrw %0 */
5673 printf ("\033[33m%s\033[0m %02x\n",
5674 "/** 1111 0111 clrw %0 */",
5678 #line 481 "rl78-decode.opc"
5679 ID(mov
); DR(BC
); SC(0);
5681 /*----------------------------------------------------------------------*/
5687 /** 1111 1000 mov %0, %1 */
5690 printf ("\033[33m%s\033[0m %02x\n",
5691 "/** 1111 1000 mov %0, %1 */",
5694 SYNTAX("mov %0, %1");
5695 #line 711 "rl78-decode.opc"
5696 ID(mov
); DR(C
); SM(None
, SADDR
);
5702 /** 1111 1001 mov %0, %e!1 */
5705 printf ("\033[33m%s\033[0m %02x\n",
5706 "/** 1111 1001 mov %0, %e!1 */",
5709 SYNTAX("mov %0, %e!1");
5710 #line 708 "rl78-decode.opc"
5711 ID(mov
); DR(C
); SM(None
, IMMU(2));
5717 /** 1111 1100 call !%!a0 */
5720 printf ("\033[33m%s\033[0m %02x\n",
5721 "/** 1111 1100 call !%!a0 */",
5724 SYNTAX("call !%!a0");
5725 #line 427 "rl78-decode.opc"
5726 ID(call
); DC(IMMU(3));
5732 /** 1111 1101 call %!a0 */
5735 printf ("\033[33m%s\033[0m %02x\n",
5736 "/** 1111 1101 call %!a0 */",
5739 SYNTAX("call %!a0");
5740 #line 430 "rl78-decode.opc"
5741 ID(call
); DC(IMMU(2));
5747 /** 1111 1110 call $%!a0 */
5750 printf ("\033[33m%s\033[0m %02x\n",
5751 "/** 1111 1110 call $%!a0 */",
5754 SYNTAX("call $%!a0");
5755 #line 433 "rl78-decode.opc"
5756 ID(call
); DC(pc
+IMMS(2)+3);
5762 /** 1111 1111 brk1 */
5765 printf ("\033[33m%s\033[0m %02x\n",
5766 "/** 1111 1111 brk1 */",
5770 #line 391 "rl78-decode.opc"
5776 #line 1296 "rl78-decode.opc"
5778 return rl78
->n_bytes
;