Automatic date update in version.in
[binutils-gdb.git] / opcodes / rl78-decode.c
blobf3e8269e4d2368ab94e776ec9234db78a8299dc9
1 /* DO NOT EDIT! -*- buffer-read-only: t -*- vi:set ro: */
2 #line 1 "rl78-decode.opc"
3 /* -*- c -*- */
4 /* Copyright (C) 2012-2024 Free Software Foundation, Inc.
5 Contributed by Red Hat.
6 Written by DJ Delorie.
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)
13 any later version.
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. */
25 #include "sysdep.h"
26 #include <stdio.h>
27 #include <stdlib.h>
28 #include <string.h>
29 #include "bfd.h"
30 #include "opintl.h"
31 #include "opcode/rl78.h"
33 static int trace = 0;
35 typedef struct
37 RL78_Opcode_Decoded * rl78;
38 int (* getbyte)(void *);
39 void * ptr;
40 unsigned char * op;
41 } LocalData;
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
57 #define OP_BUF_LEN 20
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)
80 static int
81 immediate (int bytes, int sign_extend, LocalData * ld)
83 unsigned long i = 0;
85 switch (bytes)
87 case 1:
88 i |= B;
89 if (sign_extend && (i & 0x80))
90 i -= 0x100;
91 break;
92 case 2:
93 i |= B;
94 i |= B << 8;
95 if (sign_extend && (i & 0x8000))
96 i -= 0x10000;
97 break;
98 case 3:
99 i |= B;
100 i |= B << 8;
101 i |= B << 16;
102 if (sign_extend && (i & 0x800000))
103 i -= 0x1000000;
104 break;
105 default:
106 opcodes_error_handler
107 /* xgettext:c-format */
108 (_("internal error: immediate() called with invalid byte count %d"),
109 bytes);
110 abort();
112 return i;
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);
138 static void
139 set_bit (RL78_Opcode_Operand *op, int bit)
141 op->bit_number = bit;
142 switch (op->type) {
143 case RL78_Operand_Register:
144 op->type = RL78_Operand_Bit;
145 break;
146 case RL78_Operand_Indirect:
147 op->type = RL78_Operand_BitIndirect;
148 break;
149 default:
150 break;
154 static int
155 saddr (int x)
157 if (x < 0x20)
158 return 0xfff00 + x;
159 return 0xffe00 + x;
162 static int
163 sfr (int x)
165 return 0xfff00 + x;
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 *),
175 void * ptr,
176 RL78_Dis_Isa isa)
178 LocalData lds, * ld = &lds;
179 unsigned char op_buf[OP_BUF_LEN] = {0};
180 unsigned char *op = op_buf;
181 int op0, op1;
183 lds.rl78 = rl78;
184 lds.getbyte = getbyte;
185 lds.ptr = ptr;
186 lds.op = op;
188 memset (rl78, 0, sizeof (*rl78));
190 start_again:
192 /* Byte registers, not including A. */
193 /* Word registers, not including AX. */
195 /*----------------------------------------------------------------------*/
196 /* ES: prefix */
198 GETBYTE ();
199 switch (op[0] & 0xff)
201 case 0x00:
203 /** 0000 0000 nop */
204 if (trace)
206 printf ("\033[33m%s\033[0m %02x\n",
207 "/** 0000 0000 nop */",
208 op[0]);
210 SYNTAX("nop");
211 #line 917 "rl78-decode.opc"
212 ID(nop);
214 /*----------------------------------------------------------------------*/
217 break;
218 case 0x01:
219 case 0x03:
220 case 0x05:
221 case 0x07:
223 /** 0000 0rw1 addw %0, %1 */
224 #line 280 "rl78-decode.opc"
225 int rw AU = (op[0] >> 1) & 0x03;
226 if (trace)
228 printf ("\033[33m%s\033[0m %02x\n",
229 "/** 0000 0rw1 addw %0, %1 */",
230 op[0]);
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;
238 break;
239 case 0x02:
241 /** 0000 0010 addw %0, %e!1 */
242 if (trace)
244 printf ("\033[33m%s\033[0m %02x\n",
245 "/** 0000 0010 addw %0, %e!1 */",
246 op[0]);
248 SYNTAX("addw %0, %e!1");
249 #line 271 "rl78-decode.opc"
250 ID(add); W(); DR(AX); SM(None, IMMU(2)); Fzac;
253 break;
254 case 0x04:
256 /** 0000 0100 addw %0, #%1 */
257 if (trace)
259 printf ("\033[33m%s\033[0m %02x\n",
260 "/** 0000 0100 addw %0, #%1 */",
261 op[0]);
263 SYNTAX("addw %0, #%1");
264 #line 277 "rl78-decode.opc"
265 ID(add); W(); DR(AX); SC(IMMU(2)); Fzac;
268 break;
269 case 0x06:
271 /** 0000 0110 addw %0, %1 */
272 if (trace)
274 printf ("\033[33m%s\033[0m %02x\n",
275 "/** 0000 0110 addw %0, %1 */",
276 op[0]);
278 SYNTAX("addw %0, %1");
279 #line 283 "rl78-decode.opc"
280 ID(add); W(); DR(AX); SM(None, SADDR); Fzac;
283 break;
284 case 0x08:
286 /** 0000 1000 xch a, x */
287 if (trace)
289 printf ("\033[33m%s\033[0m %02x\n",
290 "/** 0000 1000 xch a, x */",
291 op[0]);
293 SYNTAX("xch a, x");
294 #line 1240 "rl78-decode.opc"
295 ID(xch); DR(A); SR(X);
297 /*----------------------------------------------------------------------*/
300 break;
301 case 0x09:
303 /** 0000 1001 mov %0, %e1 */
304 if (trace)
306 printf ("\033[33m%s\033[0m %02x\n",
307 "/** 0000 1001 mov %0, %e1 */",
308 op[0]);
310 SYNTAX("mov %0, %e1");
311 #line 684 "rl78-decode.opc"
312 ID(mov); DR(A); SM(B, IMMU(2));
315 break;
316 case 0x0a:
318 /** 0000 1010 add %0, #%1 */
319 if (trace)
321 printf ("\033[33m%s\033[0m %02x\n",
322 "/** 0000 1010 add %0, #%1 */",
323 op[0]);
325 SYNTAX("add %0, #%1");
326 #line 234 "rl78-decode.opc"
327 ID(add); DM(None, SADDR); SC(IMMU(1)); Fzac;
329 /*----------------------------------------------------------------------*/
332 break;
333 case 0x0b:
335 /** 0000 1011 add %0, %1 */
336 if (trace)
338 printf ("\033[33m%s\033[0m %02x\n",
339 "/** 0000 1011 add %0, %1 */",
340 op[0]);
342 SYNTAX("add %0, %1");
343 #line 228 "rl78-decode.opc"
344 ID(add); DR(A); SM(None, SADDR); Fzac;
347 break;
348 case 0x0c:
350 /** 0000 1100 add %0, #%1 */
351 if (trace)
353 printf ("\033[33m%s\033[0m %02x\n",
354 "/** 0000 1100 add %0, #%1 */",
355 op[0]);
357 SYNTAX("add %0, #%1");
358 #line 222 "rl78-decode.opc"
359 ID(add); DR(A); SC(IMMU(1)); Fzac;
362 break;
363 case 0x0d:
365 /** 0000 1101 add %0, %e1 */
366 if (trace)
368 printf ("\033[33m%s\033[0m %02x\n",
369 "/** 0000 1101 add %0, %e1 */",
370 op[0]);
372 SYNTAX("add %0, %e1");
373 #line 210 "rl78-decode.opc"
374 ID(add); DR(A); SM(HL, 0); Fzac;
377 break;
378 case 0x0e:
380 /** 0000 1110 add %0, %ea1 */
381 if (trace)
383 printf ("\033[33m%s\033[0m %02x\n",
384 "/** 0000 1110 add %0, %ea1 */",
385 op[0]);
387 SYNTAX("add %0, %ea1");
388 #line 216 "rl78-decode.opc"
389 ID(add); DR(A); SM(HL, IMMU(1)); Fzac;
392 break;
393 case 0x0f:
395 /** 0000 1111 add %0, %e!1 */
396 if (trace)
398 printf ("\033[33m%s\033[0m %02x\n",
399 "/** 0000 1111 add %0, %e!1 */",
400 op[0]);
402 SYNTAX("add %0, %e!1");
403 #line 207 "rl78-decode.opc"
404 ID(add); DR(A); SM(None, IMMU(2)); Fzac;
407 break;
408 case 0x10:
410 /** 0001 0000 addw %0, #%1 */
411 if (trace)
413 printf ("\033[33m%s\033[0m %02x\n",
414 "/** 0001 0000 addw %0, #%1 */",
415 op[0]);
417 SYNTAX("addw %0, #%1");
418 #line 286 "rl78-decode.opc"
419 ID(add); W(); DR(SP); SC(IMMU(1)); Fzac;
421 /*----------------------------------------------------------------------*/
424 break;
425 case 0x11:
427 /** 0001 0001 es: */
428 if (trace)
430 printf ("\033[33m%s\033[0m %02x\n",
431 "/** 0001 0001 es: */",
432 op[0]);
434 SYNTAX("es:");
435 #line 199 "rl78-decode.opc"
436 DE(); SE();
437 op ++;
438 pc ++;
439 goto start_again;
441 /*----------------------------------------------------------------------*/
444 break;
445 case 0x12:
446 case 0x14:
447 case 0x16:
449 /** 0001 0ra0 movw %0, %1 */
450 #line 865 "rl78-decode.opc"
451 int ra AU = (op[0] >> 1) & 0x03;
452 if (trace)
454 printf ("\033[33m%s\033[0m %02x\n",
455 "/** 0001 0ra0 movw %0, %1 */",
456 op[0]);
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);
464 break;
465 case 0x13:
466 case 0x15:
467 case 0x17:
469 /** 0001 0ra1 movw %0, %1 */
470 #line 862 "rl78-decode.opc"
471 int ra AU = (op[0] >> 1) & 0x03;
472 if (trace)
474 printf ("\033[33m%s\033[0m %02x\n",
475 "/** 0001 0ra1 movw %0, %1 */",
476 op[0]);
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);
484 break;
485 case 0x18:
487 /** 0001 1000 mov %e0, %1 */
488 if (trace)
490 printf ("\033[33m%s\033[0m %02x\n",
491 "/** 0001 1000 mov %e0, %1 */",
492 op[0]);
494 SYNTAX("mov %e0, %1");
495 #line 735 "rl78-decode.opc"
496 ID(mov); DM(B, IMMU(2)); SR(A);
499 break;
500 case 0x19:
502 /** 0001 1001 mov %e0, #%1 */
503 if (trace)
505 printf ("\033[33m%s\033[0m %02x\n",
506 "/** 0001 1001 mov %e0, #%1 */",
507 op[0]);
509 SYNTAX("mov %e0, #%1");
510 #line 732 "rl78-decode.opc"
511 ID(mov); DM(B, IMMU(2)); SC(IMMU(1));
514 break;
515 case 0x1a:
517 /** 0001 1010 addc %0, #%1 */
518 if (trace)
520 printf ("\033[33m%s\033[0m %02x\n",
521 "/** 0001 1010 addc %0, #%1 */",
522 op[0]);
524 SYNTAX("addc %0, #%1");
525 #line 266 "rl78-decode.opc"
526 ID(addc); DM(None, SADDR); SC(IMMU(1)); Fzac;
528 /*----------------------------------------------------------------------*/
531 break;
532 case 0x1b:
534 /** 0001 1011 addc %0, %1 */
535 if (trace)
537 printf ("\033[33m%s\033[0m %02x\n",
538 "/** 0001 1011 addc %0, %1 */",
539 op[0]);
541 SYNTAX("addc %0, %1");
542 #line 263 "rl78-decode.opc"
543 ID(addc); DR(A); SM(None, SADDR); Fzac;
546 break;
547 case 0x1c:
549 /** 0001 1100 addc %0, #%1 */
550 if (trace)
552 printf ("\033[33m%s\033[0m %02x\n",
553 "/** 0001 1100 addc %0, #%1 */",
554 op[0]);
556 SYNTAX("addc %0, #%1");
557 #line 254 "rl78-decode.opc"
558 ID(addc); DR(A); SC(IMMU(1)); Fzac;
561 break;
562 case 0x1d:
564 /** 0001 1101 addc %0, %e1 */
565 if (trace)
567 printf ("\033[33m%s\033[0m %02x\n",
568 "/** 0001 1101 addc %0, %e1 */",
569 op[0]);
571 SYNTAX("addc %0, %e1");
572 #line 242 "rl78-decode.opc"
573 ID(addc); DR(A); SM(HL, 0); Fzac;
576 break;
577 case 0x1e:
579 /** 0001 1110 addc %0, %ea1 */
580 if (trace)
582 printf ("\033[33m%s\033[0m %02x\n",
583 "/** 0001 1110 addc %0, %ea1 */",
584 op[0]);
586 SYNTAX("addc %0, %ea1");
587 #line 251 "rl78-decode.opc"
588 ID(addc); DR(A); SM(HL, IMMU(1)); Fzac;
591 break;
592 case 0x1f:
594 /** 0001 1111 addc %0, %e!1 */
595 if (trace)
597 printf ("\033[33m%s\033[0m %02x\n",
598 "/** 0001 1111 addc %0, %e!1 */",
599 op[0]);
601 SYNTAX("addc %0, %e!1");
602 #line 239 "rl78-decode.opc"
603 ID(addc); DR(A); SM(None, IMMU(2)); Fzac;
606 break;
607 case 0x20:
609 /** 0010 0000 subw %0, #%1 */
610 if (trace)
612 printf ("\033[33m%s\033[0m %02x\n",
613 "/** 0010 0000 subw %0, #%1 */",
614 op[0]);
616 SYNTAX("subw %0, #%1");
617 #line 1204 "rl78-decode.opc"
618 ID(sub); W(); DR(SP); SC(IMMU(1)); Fzac;
620 /*----------------------------------------------------------------------*/
623 break;
624 case 0x21:
625 case 0x23:
626 case 0x25:
627 case 0x27:
629 /** 0010 0rw1 subw %0, %1 */
630 #line 1198 "rl78-decode.opc"
631 int rw AU = (op[0] >> 1) & 0x03;
632 if (trace)
634 printf ("\033[33m%s\033[0m %02x\n",
635 "/** 0010 0rw1 subw %0, %1 */",
636 op[0]);
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;
644 break;
645 case 0x22:
647 /** 0010 0010 subw %0, %e!1 */
648 if (trace)
650 printf ("\033[33m%s\033[0m %02x\n",
651 "/** 0010 0010 subw %0, %e!1 */",
652 op[0]);
654 SYNTAX("subw %0, %e!1");
655 #line 1189 "rl78-decode.opc"
656 ID(sub); W(); DR(AX); SM(None, IMMU(2)); Fzac;
659 break;
660 case 0x24:
662 /** 0010 0100 subw %0, #%1 */
663 if (trace)
665 printf ("\033[33m%s\033[0m %02x\n",
666 "/** 0010 0100 subw %0, #%1 */",
667 op[0]);
669 SYNTAX("subw %0, #%1");
670 #line 1195 "rl78-decode.opc"
671 ID(sub); W(); DR(AX); SC(IMMU(2)); Fzac;
674 break;
675 case 0x26:
677 /** 0010 0110 subw %0, %1 */
678 if (trace)
680 printf ("\033[33m%s\033[0m %02x\n",
681 "/** 0010 0110 subw %0, %1 */",
682 op[0]);
684 SYNTAX("subw %0, %1");
685 #line 1201 "rl78-decode.opc"
686 ID(sub); W(); DR(AX); SM(None, SADDR); Fzac;
689 break;
690 case 0x28:
692 /** 0010 1000 mov %e0, %1 */
693 if (trace)
695 printf ("\033[33m%s\033[0m %02x\n",
696 "/** 0010 1000 mov %e0, %1 */",
697 op[0]);
699 SYNTAX("mov %e0, %1");
700 #line 747 "rl78-decode.opc"
701 ID(mov); DM(C, IMMU(2)); SR(A);
704 break;
705 case 0x29:
707 /** 0010 1001 mov %0, %e1 */
708 if (trace)
710 printf ("\033[33m%s\033[0m %02x\n",
711 "/** 0010 1001 mov %0, %e1 */",
712 op[0]);
714 SYNTAX("mov %0, %e1");
715 #line 690 "rl78-decode.opc"
716 ID(mov); DR(A); SM(C, IMMU(2));
719 break;
720 case 0x2a:
722 /** 0010 1010 sub %0, #%1 */
723 if (trace)
725 printf ("\033[33m%s\033[0m %02x\n",
726 "/** 0010 1010 sub %0, #%1 */",
727 op[0]);
729 SYNTAX("sub %0, #%1");
730 #line 1152 "rl78-decode.opc"
731 ID(sub); DM(None, SADDR); SC(IMMU(1)); Fzac;
733 /*----------------------------------------------------------------------*/
736 break;
737 case 0x2b:
739 /** 0010 1011 sub %0, %1 */
740 if (trace)
742 printf ("\033[33m%s\033[0m %02x\n",
743 "/** 0010 1011 sub %0, %1 */",
744 op[0]);
746 SYNTAX("sub %0, %1");
747 #line 1146 "rl78-decode.opc"
748 ID(sub); DR(A); SM(None, SADDR); Fzac;
751 break;
752 case 0x2c:
754 /** 0010 1100 sub %0, #%1 */
755 if (trace)
757 printf ("\033[33m%s\033[0m %02x\n",
758 "/** 0010 1100 sub %0, #%1 */",
759 op[0]);
761 SYNTAX("sub %0, #%1");
762 #line 1140 "rl78-decode.opc"
763 ID(sub); DR(A); SC(IMMU(1)); Fzac;
766 break;
767 case 0x2d:
769 /** 0010 1101 sub %0, %e1 */
770 if (trace)
772 printf ("\033[33m%s\033[0m %02x\n",
773 "/** 0010 1101 sub %0, %e1 */",
774 op[0]);
776 SYNTAX("sub %0, %e1");
777 #line 1128 "rl78-decode.opc"
778 ID(sub); DR(A); SM(HL, 0); Fzac;
781 break;
782 case 0x2e:
784 /** 0010 1110 sub %0, %ea1 */
785 if (trace)
787 printf ("\033[33m%s\033[0m %02x\n",
788 "/** 0010 1110 sub %0, %ea1 */",
789 op[0]);
791 SYNTAX("sub %0, %ea1");
792 #line 1134 "rl78-decode.opc"
793 ID(sub); DR(A); SM(HL, IMMU(1)); Fzac;
796 break;
797 case 0x2f:
799 /** 0010 1111 sub %0, %e!1 */
800 if (trace)
802 printf ("\033[33m%s\033[0m %02x\n",
803 "/** 0010 1111 sub %0, %e!1 */",
804 op[0]);
806 SYNTAX("sub %0, %e!1");
807 #line 1125 "rl78-decode.opc"
808 ID(sub); DR(A); SM(None, IMMU(2)); Fzac;
811 break;
812 case 0x30:
813 case 0x32:
814 case 0x34:
815 case 0x36:
817 /** 0011 0rg0 movw %0, #%1 */
818 #line 859 "rl78-decode.opc"
819 int rg AU = (op[0] >> 1) & 0x03;
820 if (trace)
822 printf ("\033[33m%s\033[0m %02x\n",
823 "/** 0011 0rg0 movw %0, #%1 */",
824 op[0]);
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));
832 break;
833 case 0x31:
834 GETBYTE ();
835 switch (op[1] & 0x8f)
837 case 0x00:
839 /** 0011 0001 0bit 0000 btclr %s1, $%a0 */
840 #line 422 "rl78-decode.opc"
841 int bit AU = (op[1] >> 4) & 0x07;
842 if (trace)
844 printf ("\033[33m%s\033[0m %02x %02x\n",
845 "/** 0011 0001 0bit 0000 btclr %s1, $%a0 */",
846 op[0], op[1]);
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 /*----------------------------------------------------------------------*/
856 break;
857 case 0x01:
859 /** 0011 0001 0bit 0001 btclr %1, $%a0 */
860 #line 416 "rl78-decode.opc"
861 int bit AU = (op[1] >> 4) & 0x07;
862 if (trace)
864 printf ("\033[33m%s\033[0m %02x %02x\n",
865 "/** 0011 0001 0bit 0001 btclr %1, $%a0 */",
866 op[0], op[1]);
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);
874 break;
875 case 0x02:
877 /** 0011 0001 0bit 0010 bt %s1, $%a0 */
878 #line 408 "rl78-decode.opc"
879 int bit AU = (op[1] >> 4) & 0x07;
880 if (trace)
882 printf ("\033[33m%s\033[0m %02x %02x\n",
883 "/** 0011 0001 0bit 0010 bt %s1, $%a0 */",
884 op[0], op[1]);
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 /*----------------------------------------------------------------------*/
894 break;
895 case 0x03:
897 /** 0011 0001 0bit 0011 bt %1, $%a0 */
898 #line 402 "rl78-decode.opc"
899 int bit AU = (op[1] >> 4) & 0x07;
900 if (trace)
902 printf ("\033[33m%s\033[0m %02x %02x\n",
903 "/** 0011 0001 0bit 0011 bt %1, $%a0 */",
904 op[0], op[1]);
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);
912 break;
913 case 0x04:
915 /** 0011 0001 0bit 0100 bf %s1, $%a0 */
916 #line 369 "rl78-decode.opc"
917 int bit AU = (op[1] >> 4) & 0x07;
918 if (trace)
920 printf ("\033[33m%s\033[0m %02x %02x\n",
921 "/** 0011 0001 0bit 0100 bf %s1, $%a0 */",
922 op[0], op[1]);
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 /*----------------------------------------------------------------------*/
932 break;
933 case 0x05:
935 /** 0011 0001 0bit 0101 bf %1, $%a0 */
936 #line 363 "rl78-decode.opc"
937 int bit AU = (op[1] >> 4) & 0x07;
938 if (trace)
940 printf ("\033[33m%s\033[0m %02x %02x\n",
941 "/** 0011 0001 0bit 0101 bf %1, $%a0 */",
942 op[0], op[1]);
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);
950 break;
951 case 0x07:
953 /** 0011 0001 0cnt 0111 shl %0, %1 */
954 #line 1081 "rl78-decode.opc"
955 int cnt AU = (op[1] >> 4) & 0x07;
956 if (trace)
958 printf ("\033[33m%s\033[0m %02x %02x\n",
959 "/** 0011 0001 0cnt 0111 shl %0, %1 */",
960 op[0], op[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);
968 break;
969 case 0x08:
971 /** 0011 0001 0cnt 1000 shl %0, %1 */
972 #line 1078 "rl78-decode.opc"
973 int cnt AU = (op[1] >> 4) & 0x07;
974 if (trace)
976 printf ("\033[33m%s\033[0m %02x %02x\n",
977 "/** 0011 0001 0cnt 1000 shl %0, %1 */",
978 op[0], op[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);
986 break;
987 case 0x09:
989 /** 0011 0001 0cnt 1001 shl %0, %1 */
990 #line 1075 "rl78-decode.opc"
991 int cnt AU = (op[1] >> 4) & 0x07;
992 if (trace)
994 printf ("\033[33m%s\033[0m %02x %02x\n",
995 "/** 0011 0001 0cnt 1001 shl %0, %1 */",
996 op[0], op[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);
1004 break;
1005 case 0x0a:
1007 /** 0011 0001 0cnt 1010 shr %0, %1 */
1008 #line 1092 "rl78-decode.opc"
1009 int cnt AU = (op[1] >> 4) & 0x07;
1010 if (trace)
1012 printf ("\033[33m%s\033[0m %02x %02x\n",
1013 "/** 0011 0001 0cnt 1010 shr %0, %1 */",
1014 op[0], op[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);
1022 break;
1023 case 0x0b:
1025 /** 0011 0001 0cnt 1011 sar %0, %1 */
1026 #line 1039 "rl78-decode.opc"
1027 int cnt AU = (op[1] >> 4) & 0x07;
1028 if (trace)
1030 printf ("\033[33m%s\033[0m %02x %02x\n",
1031 "/** 0011 0001 0cnt 1011 sar %0, %1 */",
1032 op[0], op[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);
1040 break;
1041 case 0x0c:
1042 case 0x8c:
1044 /** 0011 0001 wcnt 1100 shlw %0, %1 */
1045 #line 1087 "rl78-decode.opc"
1046 int wcnt AU = (op[1] >> 4) & 0x0f;
1047 if (trace)
1049 printf ("\033[33m%s\033[0m %02x %02x\n",
1050 "/** 0011 0001 wcnt 1100 shlw %0, %1 */",
1051 op[0], op[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 /*----------------------------------------------------------------------*/
1061 break;
1062 case 0x0d:
1063 case 0x8d:
1065 /** 0011 0001 wcnt 1101 shlw %0, %1 */
1066 #line 1084 "rl78-decode.opc"
1067 int wcnt AU = (op[1] >> 4) & 0x0f;
1068 if (trace)
1070 printf ("\033[33m%s\033[0m %02x %02x\n",
1071 "/** 0011 0001 wcnt 1101 shlw %0, %1 */",
1072 op[0], op[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);
1080 break;
1081 case 0x0e:
1082 case 0x8e:
1084 /** 0011 0001 wcnt 1110 shrw %0, %1 */
1085 #line 1095 "rl78-decode.opc"
1086 int wcnt AU = (op[1] >> 4) & 0x0f;
1087 if (trace)
1089 printf ("\033[33m%s\033[0m %02x %02x\n",
1090 "/** 0011 0001 wcnt 1110 shrw %0, %1 */",
1091 op[0], op[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 /*----------------------------------------------------------------------*/
1101 break;
1102 case 0x0f:
1103 case 0x8f:
1105 /** 0011 0001 wcnt 1111 sarw %0, %1 */
1106 #line 1042 "rl78-decode.opc"
1107 int wcnt AU = (op[1] >> 4) & 0x0f;
1108 if (trace)
1110 printf ("\033[33m%s\033[0m %02x %02x\n",
1111 "/** 0011 0001 wcnt 1111 sarw %0, %1 */",
1112 op[0], op[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 /*----------------------------------------------------------------------*/
1122 break;
1123 case 0x80:
1125 /** 0011 0001 1bit 0000 btclr %s1, $%a0 */
1126 #line 419 "rl78-decode.opc"
1127 int bit AU = (op[1] >> 4) & 0x07;
1128 if (trace)
1130 printf ("\033[33m%s\033[0m %02x %02x\n",
1131 "/** 0011 0001 1bit 0000 btclr %s1, $%a0 */",
1132 op[0], op[1]);
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);
1140 break;
1141 case 0x81:
1143 /** 0011 0001 1bit 0001 btclr %e1, $%a0 */
1144 #line 413 "rl78-decode.opc"
1145 int bit AU = (op[1] >> 4) & 0x07;
1146 if (trace)
1148 printf ("\033[33m%s\033[0m %02x %02x\n",
1149 "/** 0011 0001 1bit 0001 btclr %e1, $%a0 */",
1150 op[0], op[1]);
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);
1158 break;
1159 case 0x82:
1161 /** 0011 0001 1bit 0010 bt %s1, $%a0 */
1162 #line 405 "rl78-decode.opc"
1163 int bit AU = (op[1] >> 4) & 0x07;
1164 if (trace)
1166 printf ("\033[33m%s\033[0m %02x %02x\n",
1167 "/** 0011 0001 1bit 0010 bt %s1, $%a0 */",
1168 op[0], op[1]);
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);
1176 break;
1177 case 0x83:
1179 /** 0011 0001 1bit 0011 bt %e1, $%a0 */
1180 #line 399 "rl78-decode.opc"
1181 int bit AU = (op[1] >> 4) & 0x07;
1182 if (trace)
1184 printf ("\033[33m%s\033[0m %02x %02x\n",
1185 "/** 0011 0001 1bit 0011 bt %e1, $%a0 */",
1186 op[0], op[1]);
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);
1194 break;
1195 case 0x84:
1197 /** 0011 0001 1bit 0100 bf %s1, $%a0 */
1198 #line 366 "rl78-decode.opc"
1199 int bit AU = (op[1] >> 4) & 0x07;
1200 if (trace)
1202 printf ("\033[33m%s\033[0m %02x %02x\n",
1203 "/** 0011 0001 1bit 0100 bf %s1, $%a0 */",
1204 op[0], op[1]);
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);
1212 break;
1213 case 0x85:
1215 /** 0011 0001 1bit 0101 bf %e1, $%a0 */
1216 #line 360 "rl78-decode.opc"
1217 int bit AU = (op[1] >> 4) & 0x07;
1218 if (trace)
1220 printf ("\033[33m%s\033[0m %02x %02x\n",
1221 "/** 0011 0001 1bit 0101 bf %e1, $%a0 */",
1222 op[0], op[1]);
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);
1230 break;
1231 default: UNSUPPORTED(); break;
1233 break;
1234 case 0x33:
1235 case 0x35:
1236 case 0x37:
1238 /** 0011 0ra1 xchw %0, %1 */
1239 #line 1245 "rl78-decode.opc"
1240 int ra AU = (op[0] >> 1) & 0x03;
1241 if (trace)
1243 printf ("\033[33m%s\033[0m %02x\n",
1244 "/** 0011 0ra1 xchw %0, %1 */",
1245 op[0]);
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 /*----------------------------------------------------------------------*/
1255 break;
1256 case 0x38:
1258 /** 0011 1000 mov %e0, #%1 */
1259 if (trace)
1261 printf ("\033[33m%s\033[0m %02x\n",
1262 "/** 0011 1000 mov %e0, #%1 */",
1263 op[0]);
1265 SYNTAX("mov %e0, #%1");
1266 #line 744 "rl78-decode.opc"
1267 ID(mov); DM(C, IMMU(2)); SC(IMMU(1));
1270 break;
1271 case 0x39:
1273 /** 0011 1001 mov %e0, #%1 */
1274 if (trace)
1276 printf ("\033[33m%s\033[0m %02x\n",
1277 "/** 0011 1001 mov %e0, #%1 */",
1278 op[0]);
1280 SYNTAX("mov %e0, #%1");
1281 #line 738 "rl78-decode.opc"
1282 ID(mov); DM(BC, IMMU(2)); SC(IMMU(1));
1285 break;
1286 case 0x3a:
1288 /** 0011 1010 subc %0, #%1 */
1289 if (trace)
1291 printf ("\033[33m%s\033[0m %02x\n",
1292 "/** 0011 1010 subc %0, #%1 */",
1293 op[0]);
1295 SYNTAX("subc %0, #%1");
1296 #line 1184 "rl78-decode.opc"
1297 ID(subc); DM(None, SADDR); SC(IMMU(1)); Fzac;
1299 /*----------------------------------------------------------------------*/
1302 break;
1303 case 0x3b:
1305 /** 0011 1011 subc %0, %1 */
1306 if (trace)
1308 printf ("\033[33m%s\033[0m %02x\n",
1309 "/** 0011 1011 subc %0, %1 */",
1310 op[0]);
1312 SYNTAX("subc %0, %1");
1313 #line 1181 "rl78-decode.opc"
1314 ID(subc); DR(A); SM(None, SADDR); Fzac;
1317 break;
1318 case 0x3c:
1320 /** 0011 1100 subc %0, #%1 */
1321 if (trace)
1323 printf ("\033[33m%s\033[0m %02x\n",
1324 "/** 0011 1100 subc %0, #%1 */",
1325 op[0]);
1327 SYNTAX("subc %0, #%1");
1328 #line 1172 "rl78-decode.opc"
1329 ID(subc); DR(A); SC(IMMU(1)); Fzac;
1332 break;
1333 case 0x3d:
1335 /** 0011 1101 subc %0, %e1 */
1336 if (trace)
1338 printf ("\033[33m%s\033[0m %02x\n",
1339 "/** 0011 1101 subc %0, %e1 */",
1340 op[0]);
1342 SYNTAX("subc %0, %e1");
1343 #line 1160 "rl78-decode.opc"
1344 ID(subc); DR(A); SM(HL, 0); Fzac;
1347 break;
1348 case 0x3e:
1350 /** 0011 1110 subc %0, %ea1 */
1351 if (trace)
1353 printf ("\033[33m%s\033[0m %02x\n",
1354 "/** 0011 1110 subc %0, %ea1 */",
1355 op[0]);
1357 SYNTAX("subc %0, %ea1");
1358 #line 1169 "rl78-decode.opc"
1359 ID(subc); DR(A); SM(HL, IMMU(1)); Fzac;
1362 break;
1363 case 0x3f:
1365 /** 0011 1111 subc %0, %e!1 */
1366 if (trace)
1368 printf ("\033[33m%s\033[0m %02x\n",
1369 "/** 0011 1111 subc %0, %e!1 */",
1370 op[0]);
1372 SYNTAX("subc %0, %e!1");
1373 #line 1157 "rl78-decode.opc"
1374 ID(subc); DR(A); SM(None, IMMU(2)); Fzac;
1377 break;
1378 case 0x40:
1380 /** 0100 0000 cmp %e!0, #%1 */
1381 if (trace)
1383 printf ("\033[33m%s\033[0m %02x\n",
1384 "/** 0100 0000 cmp %e!0, #%1 */",
1385 op[0]);
1387 SYNTAX("cmp %e!0, #%1");
1388 #line 486 "rl78-decode.opc"
1389 ID(cmp); DM(None, IMMU(2)); SC(IMMU(1)); Fzac;
1392 break;
1393 case 0x41:
1395 /** 0100 0001 mov %0, #%1 */
1396 if (trace)
1398 printf ("\033[33m%s\033[0m %02x\n",
1399 "/** 0100 0001 mov %0, #%1 */",
1400 op[0]);
1402 SYNTAX("mov %0, #%1");
1403 #line 723 "rl78-decode.opc"
1404 ID(mov); DR(ES); SC(IMMU(1));
1407 break;
1408 case 0x42:
1410 /** 0100 0010 cmpw %0, %e!1 */
1411 if (trace)
1413 printf ("\033[33m%s\033[0m %02x\n",
1414 "/** 0100 0010 cmpw %0, %e!1 */",
1415 op[0]);
1417 SYNTAX("cmpw %0, %e!1");
1418 #line 537 "rl78-decode.opc"
1419 ID(cmp); W(); DR(AX); SM(None, IMMU(2)); Fzac;
1422 break;
1423 case 0x43:
1424 case 0x45:
1425 case 0x47:
1427 /** 0100 0ra1 cmpw %0, %1 */
1428 #line 546 "rl78-decode.opc"
1429 int ra AU = (op[0] >> 1) & 0x03;
1430 if (trace)
1432 printf ("\033[33m%s\033[0m %02x\n",
1433 "/** 0100 0ra1 cmpw %0, %1 */",
1434 op[0]);
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;
1442 break;
1443 case 0x44:
1445 /** 0100 0100 cmpw %0, #%1 */
1446 if (trace)
1448 printf ("\033[33m%s\033[0m %02x\n",
1449 "/** 0100 0100 cmpw %0, #%1 */",
1450 op[0]);
1452 SYNTAX("cmpw %0, #%1");
1453 #line 543 "rl78-decode.opc"
1454 ID(cmp); W(); DR(AX); SC(IMMU(2)); Fzac;
1457 break;
1458 case 0x46:
1460 /** 0100 0110 cmpw %0, %1 */
1461 if (trace)
1463 printf ("\033[33m%s\033[0m %02x\n",
1464 "/** 0100 0110 cmpw %0, %1 */",
1465 op[0]);
1467 SYNTAX("cmpw %0, %1");
1468 #line 549 "rl78-decode.opc"
1469 ID(cmp); W(); DR(AX); SM(None, SADDR); Fzac;
1471 /*----------------------------------------------------------------------*/
1474 break;
1475 case 0x48:
1477 /** 0100 1000 mov %e0, %1 */
1478 if (trace)
1480 printf ("\033[33m%s\033[0m %02x\n",
1481 "/** 0100 1000 mov %e0, %1 */",
1482 op[0]);
1484 SYNTAX("mov %e0, %1");
1485 #line 741 "rl78-decode.opc"
1486 ID(mov); DM(BC, IMMU(2)); SR(A);
1489 break;
1490 case 0x49:
1492 /** 0100 1001 mov %0, %e1 */
1493 if (trace)
1495 printf ("\033[33m%s\033[0m %02x\n",
1496 "/** 0100 1001 mov %0, %e1 */",
1497 op[0]);
1499 SYNTAX("mov %0, %e1");
1500 #line 687 "rl78-decode.opc"
1501 ID(mov); DR(A); SM(BC, IMMU(2));
1504 break;
1505 case 0x4a:
1507 /** 0100 1010 cmp %0, #%1 */
1508 if (trace)
1510 printf ("\033[33m%s\033[0m %02x\n",
1511 "/** 0100 1010 cmp %0, #%1 */",
1512 op[0]);
1514 SYNTAX("cmp %0, #%1");
1515 #line 489 "rl78-decode.opc"
1516 ID(cmp); DM(None, SADDR); SC(IMMU(1)); Fzac;
1519 break;
1520 case 0x4b:
1522 /** 0100 1011 cmp %0, %1 */
1523 if (trace)
1525 printf ("\033[33m%s\033[0m %02x\n",
1526 "/** 0100 1011 cmp %0, %1 */",
1527 op[0]);
1529 SYNTAX("cmp %0, %1");
1530 #line 516 "rl78-decode.opc"
1531 ID(cmp); DR(A); SM(None, SADDR); Fzac;
1533 /*----------------------------------------------------------------------*/
1536 break;
1537 case 0x4c:
1539 /** 0100 1100 cmp %0, #%1 */
1540 if (trace)
1542 printf ("\033[33m%s\033[0m %02x\n",
1543 "/** 0100 1100 cmp %0, #%1 */",
1544 op[0]);
1546 SYNTAX("cmp %0, #%1");
1547 #line 507 "rl78-decode.opc"
1548 ID(cmp); DR(A); SC(IMMU(1)); Fzac;
1551 break;
1552 case 0x4d:
1554 /** 0100 1101 cmp %0, %e1 */
1555 if (trace)
1557 printf ("\033[33m%s\033[0m %02x\n",
1558 "/** 0100 1101 cmp %0, %e1 */",
1559 op[0]);
1561 SYNTAX("cmp %0, %e1");
1562 #line 495 "rl78-decode.opc"
1563 ID(cmp); DR(A); SM(HL, 0); Fzac;
1566 break;
1567 case 0x4e:
1569 /** 0100 1110 cmp %0, %ea1 */
1570 if (trace)
1572 printf ("\033[33m%s\033[0m %02x\n",
1573 "/** 0100 1110 cmp %0, %ea1 */",
1574 op[0]);
1576 SYNTAX("cmp %0, %ea1");
1577 #line 504 "rl78-decode.opc"
1578 ID(cmp); DR(A); SM(HL, IMMU(1)); Fzac;
1581 break;
1582 case 0x4f:
1584 /** 0100 1111 cmp %0, %e!1 */
1585 if (trace)
1587 printf ("\033[33m%s\033[0m %02x\n",
1588 "/** 0100 1111 cmp %0, %e!1 */",
1589 op[0]);
1591 SYNTAX("cmp %0, %e!1");
1592 #line 492 "rl78-decode.opc"
1593 ID(cmp); DR(A); SM(None, IMMU(2)); Fzac;
1596 break;
1597 case 0x50:
1598 case 0x51:
1599 case 0x52:
1600 case 0x53:
1601 case 0x54:
1602 case 0x55:
1603 case 0x56:
1604 case 0x57:
1606 /** 0101 0reg mov %0, #%1 */
1607 #line 675 "rl78-decode.opc"
1608 int reg AU = op[0] & 0x07;
1609 if (trace)
1611 printf ("\033[33m%s\033[0m %02x\n",
1612 "/** 0101 0reg mov %0, #%1 */",
1613 op[0]);
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));
1621 break;
1622 case 0x58:
1624 /** 0101 1000 movw %e0, %1 */
1625 if (trace)
1627 printf ("\033[33m%s\033[0m %02x\n",
1628 "/** 0101 1000 movw %e0, %1 */",
1629 op[0]);
1631 SYNTAX("movw %e0, %1");
1632 #line 877 "rl78-decode.opc"
1633 ID(mov); W(); DM(B, IMMU(2)); SR(AX);
1636 break;
1637 case 0x59:
1639 /** 0101 1001 movw %0, %e1 */
1640 if (trace)
1642 printf ("\033[33m%s\033[0m %02x\n",
1643 "/** 0101 1001 movw %0, %e1 */",
1644 op[0]);
1646 SYNTAX("movw %0, %e1");
1647 #line 868 "rl78-decode.opc"
1648 ID(mov); W(); DR(AX); SM(B, IMMU(2));
1651 break;
1652 case 0x5a:
1654 /** 0101 1010 and %0, #%1 */
1655 if (trace)
1657 printf ("\033[33m%s\033[0m %02x\n",
1658 "/** 0101 1010 and %0, #%1 */",
1659 op[0]);
1661 SYNTAX("and %0, #%1");
1662 #line 318 "rl78-decode.opc"
1663 ID(and); DM(None, SADDR); SC(IMMU(1)); Fz;
1665 /*----------------------------------------------------------------------*/
1668 break;
1669 case 0x5b:
1671 /** 0101 1011 and %0, %1 */
1672 if (trace)
1674 printf ("\033[33m%s\033[0m %02x\n",
1675 "/** 0101 1011 and %0, %1 */",
1676 op[0]);
1678 SYNTAX("and %0, %1");
1679 #line 315 "rl78-decode.opc"
1680 ID(and); DR(A); SM(None, SADDR); Fz;
1683 break;
1684 case 0x5c:
1686 /** 0101 1100 and %0, #%1 */
1687 if (trace)
1689 printf ("\033[33m%s\033[0m %02x\n",
1690 "/** 0101 1100 and %0, #%1 */",
1691 op[0]);
1693 SYNTAX("and %0, #%1");
1694 #line 306 "rl78-decode.opc"
1695 ID(and); DR(A); SC(IMMU(1)); Fz;
1698 break;
1699 case 0x5d:
1701 /** 0101 1101 and %0, %e1 */
1702 if (trace)
1704 printf ("\033[33m%s\033[0m %02x\n",
1705 "/** 0101 1101 and %0, %e1 */",
1706 op[0]);
1708 SYNTAX("and %0, %e1");
1709 #line 294 "rl78-decode.opc"
1710 ID(and); DR(A); SM(HL, 0); Fz;
1713 break;
1714 case 0x5e:
1716 /** 0101 1110 and %0, %ea1 */
1717 if (trace)
1719 printf ("\033[33m%s\033[0m %02x\n",
1720 "/** 0101 1110 and %0, %ea1 */",
1721 op[0]);
1723 SYNTAX("and %0, %ea1");
1724 #line 300 "rl78-decode.opc"
1725 ID(and); DR(A); SM(HL, IMMU(1)); Fz;
1728 break;
1729 case 0x5f:
1731 /** 0101 1111 and %0, %e!1 */
1732 if (trace)
1734 printf ("\033[33m%s\033[0m %02x\n",
1735 "/** 0101 1111 and %0, %e!1 */",
1736 op[0]);
1738 SYNTAX("and %0, %e!1");
1739 #line 291 "rl78-decode.opc"
1740 ID(and); DR(A); SM(None, IMMU(2)); Fz;
1743 break;
1744 case 0x60:
1745 case 0x62:
1746 case 0x63:
1747 case 0x64:
1748 case 0x65:
1749 case 0x66:
1750 case 0x67:
1752 /** 0110 0rba mov %0, %1 */
1753 #line 678 "rl78-decode.opc"
1754 int rba AU = op[0] & 0x07;
1755 if (trace)
1757 printf ("\033[33m%s\033[0m %02x\n",
1758 "/** 0110 0rba mov %0, %1 */",
1759 op[0]);
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);
1767 break;
1768 case 0x61:
1769 GETBYTE ();
1770 switch (op[1] & 0xff)
1772 case 0x00:
1773 case 0x01:
1774 case 0x02:
1775 case 0x03:
1776 case 0x04:
1777 case 0x05:
1778 case 0x06:
1779 case 0x07:
1781 /** 0110 0001 0000 0reg add %0, %1 */
1782 #line 231 "rl78-decode.opc"
1783 int reg AU = op[1] & 0x07;
1784 if (trace)
1786 printf ("\033[33m%s\033[0m %02x %02x\n",
1787 "/** 0110 0001 0000 0reg add %0, %1 */",
1788 op[0], op[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;
1796 break;
1797 case 0x08:
1798 case 0x0a:
1799 case 0x0b:
1800 case 0x0c:
1801 case 0x0d:
1802 case 0x0e:
1803 case 0x0f:
1805 /** 0110 0001 0000 1rba add %0, %1 */
1806 #line 225 "rl78-decode.opc"
1807 int rba AU = op[1] & 0x07;
1808 if (trace)
1810 printf ("\033[33m%s\033[0m %02x %02x\n",
1811 "/** 0110 0001 0000 1rba add %0, %1 */",
1812 op[0], op[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;
1820 break;
1821 case 0x09:
1823 /** 0110 0001 0000 1001 addw %0, %ea1 */
1824 if (trace)
1826 printf ("\033[33m%s\033[0m %02x %02x\n",
1827 "/** 0110 0001 0000 1001 addw %0, %ea1 */",
1828 op[0], op[1]);
1830 SYNTAX("addw %0, %ea1");
1831 #line 274 "rl78-decode.opc"
1832 ID(add); W(); DR(AX); SM(HL, IMMU(1)); Fzac;
1835 break;
1836 case 0x10:
1837 case 0x11:
1838 case 0x12:
1839 case 0x13:
1840 case 0x14:
1841 case 0x15:
1842 case 0x16:
1843 case 0x17:
1845 /** 0110 0001 0001 0reg addc %0, %1 */
1846 #line 260 "rl78-decode.opc"
1847 int reg AU = op[1] & 0x07;
1848 if (trace)
1850 printf ("\033[33m%s\033[0m %02x %02x\n",
1851 "/** 0110 0001 0001 0reg addc %0, %1 */",
1852 op[0], op[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;
1860 break;
1861 case 0x18:
1862 case 0x1a:
1863 case 0x1b:
1864 case 0x1c:
1865 case 0x1d:
1866 case 0x1e:
1867 case 0x1f:
1869 /** 0110 0001 0001 1rba addc %0, %1 */
1870 #line 257 "rl78-decode.opc"
1871 int rba AU = op[1] & 0x07;
1872 if (trace)
1874 printf ("\033[33m%s\033[0m %02x %02x\n",
1875 "/** 0110 0001 0001 1rba addc %0, %1 */",
1876 op[0], op[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;
1884 break;
1885 case 0x20:
1886 case 0x21:
1887 case 0x22:
1888 case 0x23:
1889 case 0x24:
1890 case 0x25:
1891 case 0x26:
1892 case 0x27:
1894 /** 0110 0001 0010 0reg sub %0, %1 */
1895 #line 1149 "rl78-decode.opc"
1896 int reg AU = op[1] & 0x07;
1897 if (trace)
1899 printf ("\033[33m%s\033[0m %02x %02x\n",
1900 "/** 0110 0001 0010 0reg sub %0, %1 */",
1901 op[0], op[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;
1909 break;
1910 case 0x28:
1911 case 0x2a:
1912 case 0x2b:
1913 case 0x2c:
1914 case 0x2d:
1915 case 0x2e:
1916 case 0x2f:
1918 /** 0110 0001 0010 1rba sub %0, %1 */
1919 #line 1143 "rl78-decode.opc"
1920 int rba AU = op[1] & 0x07;
1921 if (trace)
1923 printf ("\033[33m%s\033[0m %02x %02x\n",
1924 "/** 0110 0001 0010 1rba sub %0, %1 */",
1925 op[0], op[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;
1933 break;
1934 case 0x29:
1936 /** 0110 0001 0010 1001 subw %0, %ea1 */
1937 if (trace)
1939 printf ("\033[33m%s\033[0m %02x %02x\n",
1940 "/** 0110 0001 0010 1001 subw %0, %ea1 */",
1941 op[0], op[1]);
1943 SYNTAX("subw %0, %ea1");
1944 #line 1192 "rl78-decode.opc"
1945 ID(sub); W(); DR(AX); SM(HL, IMMU(1)); Fzac;
1948 break;
1949 case 0x30:
1950 case 0x31:
1951 case 0x32:
1952 case 0x33:
1953 case 0x34:
1954 case 0x35:
1955 case 0x36:
1956 case 0x37:
1958 /** 0110 0001 0011 0reg subc %0, %1 */
1959 #line 1178 "rl78-decode.opc"
1960 int reg AU = op[1] & 0x07;
1961 if (trace)
1963 printf ("\033[33m%s\033[0m %02x %02x\n",
1964 "/** 0110 0001 0011 0reg subc %0, %1 */",
1965 op[0], op[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;
1973 break;
1974 case 0x38:
1975 case 0x3a:
1976 case 0x3b:
1977 case 0x3c:
1978 case 0x3d:
1979 case 0x3e:
1980 case 0x3f:
1982 /** 0110 0001 0011 1rba subc %0, %1 */
1983 #line 1175 "rl78-decode.opc"
1984 int rba AU = op[1] & 0x07;
1985 if (trace)
1987 printf ("\033[33m%s\033[0m %02x %02x\n",
1988 "/** 0110 0001 0011 1rba subc %0, %1 */",
1989 op[0], op[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;
1997 break;
1998 case 0x40:
1999 case 0x41:
2000 case 0x42:
2001 case 0x43:
2002 case 0x44:
2003 case 0x45:
2004 case 0x46:
2005 case 0x47:
2007 /** 0110 0001 0100 0reg cmp %0, %1 */
2008 #line 513 "rl78-decode.opc"
2009 int reg AU = op[1] & 0x07;
2010 if (trace)
2012 printf ("\033[33m%s\033[0m %02x %02x\n",
2013 "/** 0110 0001 0100 0reg cmp %0, %1 */",
2014 op[0], op[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;
2022 break;
2023 case 0x48:
2024 case 0x4a:
2025 case 0x4b:
2026 case 0x4c:
2027 case 0x4d:
2028 case 0x4e:
2029 case 0x4f:
2031 /** 0110 0001 0100 1rba cmp %0, %1 */
2032 #line 510 "rl78-decode.opc"
2033 int rba AU = op[1] & 0x07;
2034 if (trace)
2036 printf ("\033[33m%s\033[0m %02x %02x\n",
2037 "/** 0110 0001 0100 1rba cmp %0, %1 */",
2038 op[0], op[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;
2046 break;
2047 case 0x49:
2049 /** 0110 0001 0100 1001 cmpw %0, %ea1 */
2050 if (trace)
2052 printf ("\033[33m%s\033[0m %02x %02x\n",
2053 "/** 0110 0001 0100 1001 cmpw %0, %ea1 */",
2054 op[0], op[1]);
2056 SYNTAX("cmpw %0, %ea1");
2057 #line 540 "rl78-decode.opc"
2058 ID(cmp); W(); DR(AX); SM(HL, IMMU(1)); Fzac;
2061 break;
2062 case 0x50:
2063 case 0x51:
2064 case 0x52:
2065 case 0x53:
2066 case 0x54:
2067 case 0x55:
2068 case 0x56:
2069 case 0x57:
2071 /** 0110 0001 0101 0reg and %0, %1 */
2072 #line 312 "rl78-decode.opc"
2073 int reg AU = op[1] & 0x07;
2074 if (trace)
2076 printf ("\033[33m%s\033[0m %02x %02x\n",
2077 "/** 0110 0001 0101 0reg and %0, %1 */",
2078 op[0], op[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;
2086 break;
2087 case 0x58:
2088 case 0x5a:
2089 case 0x5b:
2090 case 0x5c:
2091 case 0x5d:
2092 case 0x5e:
2093 case 0x5f:
2095 /** 0110 0001 0101 1rba and %0, %1 */
2096 #line 309 "rl78-decode.opc"
2097 int rba AU = op[1] & 0x07;
2098 if (trace)
2100 printf ("\033[33m%s\033[0m %02x %02x\n",
2101 "/** 0110 0001 0101 1rba and %0, %1 */",
2102 op[0], op[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;
2110 break;
2111 case 0x59:
2113 /** 0110 0001 0101 1001 inc %ea0 */
2114 if (trace)
2116 printf ("\033[33m%s\033[0m %02x %02x\n",
2117 "/** 0110 0001 0101 1001 inc %ea0 */",
2118 op[0], op[1]);
2120 SYNTAX("inc %ea0");
2121 #line 590 "rl78-decode.opc"
2122 ID(add); DM(HL, IMMU(1)); SC(1); Fza;
2125 break;
2126 case 0x60:
2127 case 0x61:
2128 case 0x62:
2129 case 0x63:
2130 case 0x64:
2131 case 0x65:
2132 case 0x66:
2133 case 0x67:
2135 /** 0110 0001 0110 0reg or %0, %1 */
2136 #line 967 "rl78-decode.opc"
2137 int reg AU = op[1] & 0x07;
2138 if (trace)
2140 printf ("\033[33m%s\033[0m %02x %02x\n",
2141 "/** 0110 0001 0110 0reg or %0, %1 */",
2142 op[0], op[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;
2150 break;
2151 case 0x68:
2152 case 0x6a:
2153 case 0x6b:
2154 case 0x6c:
2155 case 0x6d:
2156 case 0x6e:
2157 case 0x6f:
2159 /** 0110 0001 0110 1rba or %0, %1 */
2160 #line 964 "rl78-decode.opc"
2161 int rba AU = op[1] & 0x07;
2162 if (trace)
2164 printf ("\033[33m%s\033[0m %02x %02x\n",
2165 "/** 0110 0001 0110 1rba or %0, %1 */",
2166 op[0], op[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;
2174 break;
2175 case 0x69:
2177 /** 0110 0001 0110 1001 dec %ea0 */
2178 if (trace)
2180 printf ("\033[33m%s\033[0m %02x %02x\n",
2181 "/** 0110 0001 0110 1001 dec %ea0 */",
2182 op[0], op[1]);
2184 SYNTAX("dec %ea0");
2185 #line 557 "rl78-decode.opc"
2186 ID(sub); DM(HL, IMMU(1)); SC(1); Fza;
2189 break;
2190 case 0x70:
2191 case 0x71:
2192 case 0x72:
2193 case 0x73:
2194 case 0x74:
2195 case 0x75:
2196 case 0x76:
2197 case 0x77:
2199 /** 0110 0001 0111 0reg xor %0, %1 */
2200 #line 1271 "rl78-decode.opc"
2201 int reg AU = op[1] & 0x07;
2202 if (trace)
2204 printf ("\033[33m%s\033[0m %02x %02x\n",
2205 "/** 0110 0001 0111 0reg xor %0, %1 */",
2206 op[0], op[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;
2214 break;
2215 case 0x78:
2216 case 0x7a:
2217 case 0x7b:
2218 case 0x7c:
2219 case 0x7d:
2220 case 0x7e:
2221 case 0x7f:
2223 /** 0110 0001 0111 1rba xor %0, %1 */
2224 #line 1268 "rl78-decode.opc"
2225 int rba AU = op[1] & 0x07;
2226 if (trace)
2228 printf ("\033[33m%s\033[0m %02x %02x\n",
2229 "/** 0110 0001 0111 1rba xor %0, %1 */",
2230 op[0], op[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;
2238 break;
2239 case 0x79:
2241 /** 0110 0001 0111 1001 incw %ea0 */
2242 if (trace)
2244 printf ("\033[33m%s\033[0m %02x %02x\n",
2245 "/** 0110 0001 0111 1001 incw %ea0 */",
2246 op[0], op[1]);
2248 SYNTAX("incw %ea0");
2249 #line 604 "rl78-decode.opc"
2250 ID(add); W(); DM(HL, IMMU(1)); SC(1);
2253 break;
2254 case 0x80:
2255 case 0x81:
2257 /** 0110 0001 1000 000 add %0, %e1 */
2258 if (trace)
2260 printf ("\033[33m%s\033[0m %02x %02x\n",
2261 "/** 0110 0001 1000 000 add %0, %e1 */",
2262 op[0], op[1]);
2264 SYNTAX("add %0, %e1");
2265 #line 213 "rl78-decode.opc"
2266 ID(add); DR(A); SM2(HL, B, 0); Fzac;
2269 break;
2270 case 0x82:
2272 /** 0110 0001 1000 0010 add %0, %e1 */
2273 if (trace)
2275 printf ("\033[33m%s\033[0m %02x %02x\n",
2276 "/** 0110 0001 1000 0010 add %0, %e1 */",
2277 op[0], op[1]);
2279 SYNTAX("add %0, %e1");
2280 #line 219 "rl78-decode.opc"
2281 ID(add); DR(A); SM2(HL, C, 0); Fzac;
2284 break;
2285 case 0x84:
2286 case 0x85:
2287 case 0x86:
2288 case 0x87:
2289 case 0x94:
2290 case 0x95:
2291 case 0x96:
2292 case 0x97:
2293 case 0xa4:
2294 case 0xa5:
2295 case 0xa6:
2296 case 0xa7:
2297 case 0xb4:
2298 case 0xb5:
2299 case 0xb6:
2300 case 0xb7:
2301 case 0xc4:
2302 case 0xc5:
2303 case 0xc6:
2304 case 0xc7:
2305 case 0xd4:
2306 case 0xd5:
2307 case 0xd6:
2308 case 0xd7:
2309 case 0xe4:
2310 case 0xe5:
2311 case 0xe6:
2312 case 0xe7:
2313 case 0xf4:
2314 case 0xf5:
2315 case 0xf6:
2316 case 0xf7:
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;
2323 if (trace)
2325 printf ("\033[33m%s\033[0m %02x %02x\n",
2326 "/** 0110 0001 1nnn 01mm callt [%x0] */",
2327 op[0], op[1]);
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 /*----------------------------------------------------------------------*/
2338 break;
2339 case 0x88:
2340 case 0x8a:
2341 case 0x8b:
2342 case 0x8c:
2343 case 0x8d:
2344 case 0x8e:
2345 case 0x8f:
2347 /** 0110 0001 1000 1reg xch %0, %1 */
2348 #line 1230 "rl78-decode.opc"
2349 int reg AU = op[1] & 0x07;
2350 if (trace)
2352 printf ("\033[33m%s\033[0m %02x %02x\n",
2353 "/** 0110 0001 1000 1reg xch %0, %1 */",
2354 op[0], op[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);
2363 break;
2364 case 0x89:
2366 /** 0110 0001 1000 1001 decw %ea0 */
2367 if (trace)
2369 printf ("\033[33m%s\033[0m %02x %02x\n",
2370 "/** 0110 0001 1000 1001 decw %ea0 */",
2371 op[0], op[1]);
2373 SYNTAX("decw %ea0");
2374 #line 571 "rl78-decode.opc"
2375 ID(sub); W(); DM(HL, IMMU(1)); SC(1);
2378 break;
2379 case 0x90:
2381 /** 0110 0001 1001 0000 addc %0, %e1 */
2382 if (trace)
2384 printf ("\033[33m%s\033[0m %02x %02x\n",
2385 "/** 0110 0001 1001 0000 addc %0, %e1 */",
2386 op[0], op[1]);
2388 SYNTAX("addc %0, %e1");
2389 #line 245 "rl78-decode.opc"
2390 ID(addc); DR(A); SM2(HL, B, 0); Fzac;
2393 break;
2394 case 0x92:
2396 /** 0110 0001 1001 0010 addc %0, %e1 */
2397 if (trace)
2399 printf ("\033[33m%s\033[0m %02x %02x\n",
2400 "/** 0110 0001 1001 0010 addc %0, %e1 */",
2401 op[0], op[1]);
2403 SYNTAX("addc %0, %e1");
2404 #line 248 "rl78-decode.opc"
2405 ID(addc); DR(A); SM2(HL, C, 0); Fzac;
2408 break;
2409 case 0xa0:
2410 case 0xa1:
2412 /** 0110 0001 1010 000 sub %0, %e1 */
2413 if (trace)
2415 printf ("\033[33m%s\033[0m %02x %02x\n",
2416 "/** 0110 0001 1010 000 sub %0, %e1 */",
2417 op[0], op[1]);
2419 SYNTAX("sub %0, %e1");
2420 #line 1131 "rl78-decode.opc"
2421 ID(sub); DR(A); SM2(HL, B, 0); Fzac;
2424 break;
2425 case 0xa2:
2427 /** 0110 0001 1010 0010 sub %0, %e1 */
2428 if (trace)
2430 printf ("\033[33m%s\033[0m %02x %02x\n",
2431 "/** 0110 0001 1010 0010 sub %0, %e1 */",
2432 op[0], op[1]);
2434 SYNTAX("sub %0, %e1");
2435 #line 1137 "rl78-decode.opc"
2436 ID(sub); DR(A); SM2(HL, C, 0); Fzac;
2439 break;
2440 case 0xa8:
2442 /** 0110 0001 1010 1000 xch %0, %1 */
2443 if (trace)
2445 printf ("\033[33m%s\033[0m %02x %02x\n",
2446 "/** 0110 0001 1010 1000 xch %0, %1 */",
2447 op[0], op[1]);
2449 SYNTAX("xch %0, %1");
2450 #line 1234 "rl78-decode.opc"
2451 ID(xch); DR(A); SM(None, SADDR);
2454 break;
2455 case 0xa9:
2457 /** 0110 0001 1010 1001 xch %0, %e1 */
2458 if (trace)
2460 printf ("\033[33m%s\033[0m %02x %02x\n",
2461 "/** 0110 0001 1010 1001 xch %0, %e1 */",
2462 op[0], op[1]);
2464 SYNTAX("xch %0, %e1");
2465 #line 1227 "rl78-decode.opc"
2466 ID(xch); DR(A); SM2(HL, C, 0);
2469 break;
2470 case 0xaa:
2472 /** 0110 0001 1010 1010 xch %0, %e!1 */
2473 if (trace)
2475 printf ("\033[33m%s\033[0m %02x %02x\n",
2476 "/** 0110 0001 1010 1010 xch %0, %e!1 */",
2477 op[0], op[1]);
2479 SYNTAX("xch %0, %e!1");
2480 #line 1209 "rl78-decode.opc"
2481 ID(xch); DR(A); SM(None, IMMU(2));
2484 break;
2485 case 0xab:
2487 /** 0110 0001 1010 1011 xch %0, %s1 */
2488 if (trace)
2490 printf ("\033[33m%s\033[0m %02x %02x\n",
2491 "/** 0110 0001 1010 1011 xch %0, %s1 */",
2492 op[0], op[1]);
2494 SYNTAX("xch %0, %s1");
2495 #line 1237 "rl78-decode.opc"
2496 ID(xch); DR(A); SM(None, SFR);
2499 break;
2500 case 0xac:
2502 /** 0110 0001 1010 1100 xch %0, %e1 */
2503 if (trace)
2505 printf ("\033[33m%s\033[0m %02x %02x\n",
2506 "/** 0110 0001 1010 1100 xch %0, %e1 */",
2507 op[0], op[1]);
2509 SYNTAX("xch %0, %e1");
2510 #line 1218 "rl78-decode.opc"
2511 ID(xch); DR(A); SM(HL, 0);
2514 break;
2515 case 0xad:
2517 /** 0110 0001 1010 1101 xch %0, %ea1 */
2518 if (trace)
2520 printf ("\033[33m%s\033[0m %02x %02x\n",
2521 "/** 0110 0001 1010 1101 xch %0, %ea1 */",
2522 op[0], op[1]);
2524 SYNTAX("xch %0, %ea1");
2525 #line 1224 "rl78-decode.opc"
2526 ID(xch); DR(A); SM(HL, IMMU(1));
2529 break;
2530 case 0xae:
2532 /** 0110 0001 1010 1110 xch %0, %e1 */
2533 if (trace)
2535 printf ("\033[33m%s\033[0m %02x %02x\n",
2536 "/** 0110 0001 1010 1110 xch %0, %e1 */",
2537 op[0], op[1]);
2539 SYNTAX("xch %0, %e1");
2540 #line 1212 "rl78-decode.opc"
2541 ID(xch); DR(A); SM(DE, 0);
2544 break;
2545 case 0xaf:
2547 /** 0110 0001 1010 1111 xch %0, %ea1 */
2548 if (trace)
2550 printf ("\033[33m%s\033[0m %02x %02x\n",
2551 "/** 0110 0001 1010 1111 xch %0, %ea1 */",
2552 op[0], op[1]);
2554 SYNTAX("xch %0, %ea1");
2555 #line 1215 "rl78-decode.opc"
2556 ID(xch); DR(A); SM(DE, IMMU(1));
2559 break;
2560 case 0xb0:
2562 /** 0110 0001 1011 0000 subc %0, %e1 */
2563 if (trace)
2565 printf ("\033[33m%s\033[0m %02x %02x\n",
2566 "/** 0110 0001 1011 0000 subc %0, %e1 */",
2567 op[0], op[1]);
2569 SYNTAX("subc %0, %e1");
2570 #line 1163 "rl78-decode.opc"
2571 ID(subc); DR(A); SM2(HL, B, 0); Fzac;
2574 break;
2575 case 0xb2:
2577 /** 0110 0001 1011 0010 subc %0, %e1 */
2578 if (trace)
2580 printf ("\033[33m%s\033[0m %02x %02x\n",
2581 "/** 0110 0001 1011 0010 subc %0, %e1 */",
2582 op[0], op[1]);
2584 SYNTAX("subc %0, %e1");
2585 #line 1166 "rl78-decode.opc"
2586 ID(subc); DR(A); SM2(HL, C, 0); Fzac;
2589 break;
2590 case 0xb8:
2592 /** 0110 0001 1011 1000 mov %0, %1 */
2593 if (trace)
2595 printf ("\033[33m%s\033[0m %02x %02x\n",
2596 "/** 0110 0001 1011 1000 mov %0, %1 */",
2597 op[0], op[1]);
2599 SYNTAX("mov %0, %1");
2600 #line 729 "rl78-decode.opc"
2601 ID(mov); DR(ES); SM(None, SADDR);
2604 break;
2605 case 0xb9:
2607 /** 0110 0001 1011 1001 xch %0, %e1 */
2608 if (trace)
2610 printf ("\033[33m%s\033[0m %02x %02x\n",
2611 "/** 0110 0001 1011 1001 xch %0, %e1 */",
2612 op[0], op[1]);
2614 SYNTAX("xch %0, %e1");
2615 #line 1221 "rl78-decode.opc"
2616 ID(xch); DR(A); SM2(HL, B, 0);
2619 break;
2620 case 0xc0:
2622 /** 0110 0001 1100 0000 cmp %0, %e1 */
2623 if (trace)
2625 printf ("\033[33m%s\033[0m %02x %02x\n",
2626 "/** 0110 0001 1100 0000 cmp %0, %e1 */",
2627 op[0], op[1]);
2629 SYNTAX("cmp %0, %e1");
2630 #line 498 "rl78-decode.opc"
2631 ID(cmp); DR(A); SM2(HL, B, 0); Fzac;
2634 break;
2635 case 0xc2:
2637 /** 0110 0001 1100 0010 cmp %0, %e1 */
2638 if (trace)
2640 printf ("\033[33m%s\033[0m %02x %02x\n",
2641 "/** 0110 0001 1100 0010 cmp %0, %e1 */",
2642 op[0], op[1]);
2644 SYNTAX("cmp %0, %e1");
2645 #line 501 "rl78-decode.opc"
2646 ID(cmp); DR(A); SM2(HL, C, 0); Fzac;
2649 break;
2650 case 0xc3:
2652 /** 0110 0001 1100 0011 bh $%a0 */
2653 if (trace)
2655 printf ("\033[33m%s\033[0m %02x %02x\n",
2656 "/** 0110 0001 1100 0011 bh $%a0 */",
2657 op[0], op[1]);
2659 SYNTAX("bh $%a0");
2660 #line 346 "rl78-decode.opc"
2661 ID(branch_cond); DC(pc+IMMS(1)+3); SR(None); COND(H);
2664 break;
2665 case 0xc8:
2667 /** 0110 0001 1100 1000 sk%c1 */
2668 if (trace)
2670 printf ("\033[33m%s\033[0m %02x %02x\n",
2671 "/** 0110 0001 1100 1000 sk%c1 */",
2672 op[0], op[1]);
2674 SYNTAX("sk%c1");
2675 #line 1100 "rl78-decode.opc"
2676 ID(skip); COND(C);
2679 break;
2680 case 0xc9:
2682 /** 0110 0001 1100 1001 mov %0, %e1 */
2683 if (trace)
2685 printf ("\033[33m%s\033[0m %02x %02x\n",
2686 "/** 0110 0001 1100 1001 mov %0, %e1 */",
2687 op[0], op[1]);
2689 SYNTAX("mov %0, %e1");
2690 #line 666 "rl78-decode.opc"
2691 ID(mov); DR(A); SM2(HL, B, 0);
2694 break;
2695 case 0xca:
2696 case 0xda:
2697 case 0xea:
2698 case 0xfa:
2700 /** 0110 0001 11rg 1010 call %0 */
2701 #line 436 "rl78-decode.opc"
2702 int rg AU = (op[1] >> 4) & 0x03;
2703 if (trace)
2705 printf ("\033[33m%s\033[0m %02x %02x\n",
2706 "/** 0110 0001 11rg 1010 call %0 */",
2707 op[0], op[1]);
2708 printf (" rg = 0x%x\n", rg);
2710 SYNTAX("call %0");
2711 #line 436 "rl78-decode.opc"
2712 ID(call); DRW(rg);
2715 break;
2716 case 0xcb:
2718 /** 0110 0001 1100 1011 br ax */
2719 if (trace)
2721 printf ("\033[33m%s\033[0m %02x %02x\n",
2722 "/** 0110 0001 1100 1011 br ax */",
2723 op[0], op[1]);
2725 SYNTAX("br ax");
2726 #line 386 "rl78-decode.opc"
2727 ID(branch); DR(AX);
2729 /*----------------------------------------------------------------------*/
2732 break;
2733 case 0xcc:
2735 /** 0110 0001 1100 1100 brk */
2736 if (trace)
2738 printf ("\033[33m%s\033[0m %02x %02x\n",
2739 "/** 0110 0001 1100 1100 brk */",
2740 op[0], op[1]);
2742 SYNTAX("brk");
2743 #line 394 "rl78-decode.opc"
2744 ID(break);
2746 /*----------------------------------------------------------------------*/
2749 break;
2750 case 0xcd:
2752 /** 0110 0001 1100 1101 pop %s0 */
2753 if (trace)
2755 printf ("\033[33m%s\033[0m %02x %02x\n",
2756 "/** 0110 0001 1100 1101 pop %s0 */",
2757 op[0], op[1]);
2759 SYNTAX("pop %s0");
2760 #line 995 "rl78-decode.opc"
2761 ID(mov); W(); DR(PSW); SPOP();
2763 /*----------------------------------------------------------------------*/
2766 break;
2767 case 0xce:
2769 /** 0110 0001 1100 1110 movs %ea0, %1 */
2770 if (trace)
2772 printf ("\033[33m%s\033[0m %02x %02x\n",
2773 "/** 0110 0001 1100 1110 movs %ea0, %1 */",
2774 op[0], op[1]);
2776 SYNTAX("movs %ea0, %1");
2777 #line 817 "rl78-decode.opc"
2778 ID(mov); DM(HL, IMMU(1)); SR(X); Fzc;
2780 /*----------------------------------------------------------------------*/
2783 break;
2784 case 0xcf:
2785 case 0xdf:
2786 case 0xef:
2787 case 0xff:
2789 /** 0110 0001 11rb 1111 sel rb%1 */
2790 #line 1047 "rl78-decode.opc"
2791 int rb AU = (op[1] >> 4) & 0x03;
2792 if (trace)
2794 printf ("\033[33m%s\033[0m %02x %02x\n",
2795 "/** 0110 0001 11rb 1111 sel rb%1 */",
2796 op[0], op[1]);
2797 printf (" rb = 0x%x\n", rb);
2799 SYNTAX("sel rb%1");
2800 #line 1047 "rl78-decode.opc"
2801 ID(sel); SC(rb);
2803 /*----------------------------------------------------------------------*/
2806 break;
2807 case 0xd0:
2809 /** 0110 0001 1101 0000 and %0, %e1 */
2810 if (trace)
2812 printf ("\033[33m%s\033[0m %02x %02x\n",
2813 "/** 0110 0001 1101 0000 and %0, %e1 */",
2814 op[0], op[1]);
2816 SYNTAX("and %0, %e1");
2817 #line 297 "rl78-decode.opc"
2818 ID(and); DR(A); SM2(HL, B, 0); Fz;
2821 break;
2822 case 0xd2:
2824 /** 0110 0001 1101 0010 and %0, %e1 */
2825 if (trace)
2827 printf ("\033[33m%s\033[0m %02x %02x\n",
2828 "/** 0110 0001 1101 0010 and %0, %e1 */",
2829 op[0], op[1]);
2831 SYNTAX("and %0, %e1");
2832 #line 303 "rl78-decode.opc"
2833 ID(and); DR(A); SM2(HL, C, 0); Fz;
2836 break;
2837 case 0xd3:
2839 /** 0110 0001 1101 0011 bnh $%a0 */
2840 if (trace)
2842 printf ("\033[33m%s\033[0m %02x %02x\n",
2843 "/** 0110 0001 1101 0011 bnh $%a0 */",
2844 op[0], op[1]);
2846 SYNTAX("bnh $%a0");
2847 #line 349 "rl78-decode.opc"
2848 ID(branch_cond); DC(pc+IMMS(1)+3); SR(None); COND(NH);
2851 break;
2852 case 0xd8:
2854 /** 0110 0001 1101 1000 sk%c1 */
2855 if (trace)
2857 printf ("\033[33m%s\033[0m %02x %02x\n",
2858 "/** 0110 0001 1101 1000 sk%c1 */",
2859 op[0], op[1]);
2861 SYNTAX("sk%c1");
2862 #line 1106 "rl78-decode.opc"
2863 ID(skip); COND(NC);
2866 break;
2867 case 0xd9:
2869 /** 0110 0001 1101 1001 mov %e0, %1 */
2870 if (trace)
2872 printf ("\033[33m%s\033[0m %02x %02x\n",
2873 "/** 0110 0001 1101 1001 mov %e0, %1 */",
2874 op[0], op[1]);
2876 SYNTAX("mov %e0, %1");
2877 #line 633 "rl78-decode.opc"
2878 ID(mov); DM2(HL, B, 0); SR(A);
2881 break;
2882 case 0xdb:
2884 /** 0110 0001 1101 1011 ror %0, %1 */
2885 if (trace)
2887 printf ("\033[33m%s\033[0m %02x %02x\n",
2888 "/** 0110 0001 1101 1011 ror %0, %1 */",
2889 op[0], op[1]);
2891 SYNTAX("ror %0, %1");
2892 #line 1028 "rl78-decode.opc"
2893 ID(ror); DR(A); SC(1);
2896 break;
2897 case 0xdc:
2899 /** 0110 0001 1101 1100 rolc %0, %1 */
2900 if (trace)
2902 printf ("\033[33m%s\033[0m %02x %02x\n",
2903 "/** 0110 0001 1101 1100 rolc %0, %1 */",
2904 op[0], op[1]);
2906 SYNTAX("rolc %0, %1");
2907 #line 1022 "rl78-decode.opc"
2908 ID(rolc); DR(A); SC(1);
2911 break;
2912 case 0xdd:
2914 /** 0110 0001 1101 1101 push %s1 */
2915 if (trace)
2917 printf ("\033[33m%s\033[0m %02x %02x\n",
2918 "/** 0110 0001 1101 1101 push %s1 */",
2919 op[0], op[1]);
2921 SYNTAX("push %s1");
2922 #line 1003 "rl78-decode.opc"
2923 ID(mov); W(); DPUSH(); SR(PSW);
2925 /*----------------------------------------------------------------------*/
2928 break;
2929 case 0xde:
2931 /** 0110 0001 1101 1110 cmps %0, %ea1 */
2932 if (trace)
2934 printf ("\033[33m%s\033[0m %02x %02x\n",
2935 "/** 0110 0001 1101 1110 cmps %0, %ea1 */",
2936 op[0], op[1]);
2938 SYNTAX("cmps %0, %ea1");
2939 #line 532 "rl78-decode.opc"
2940 ID(cmp); DR(X); SM(HL, IMMU(1)); Fzac;
2942 /*----------------------------------------------------------------------*/
2945 break;
2946 case 0xe0:
2948 /** 0110 0001 1110 0000 or %0, %e1 */
2949 if (trace)
2951 printf ("\033[33m%s\033[0m %02x %02x\n",
2952 "/** 0110 0001 1110 0000 or %0, %e1 */",
2953 op[0], op[1]);
2955 SYNTAX("or %0, %e1");
2956 #line 952 "rl78-decode.opc"
2957 ID(or); DR(A); SM2(HL, B, 0); Fz;
2960 break;
2961 case 0xe2:
2963 /** 0110 0001 1110 0010 or %0, %e1 */
2964 if (trace)
2966 printf ("\033[33m%s\033[0m %02x %02x\n",
2967 "/** 0110 0001 1110 0010 or %0, %e1 */",
2968 op[0], op[1]);
2970 SYNTAX("or %0, %e1");
2971 #line 958 "rl78-decode.opc"
2972 ID(or); DR(A); SM2(HL, C, 0); Fz;
2975 break;
2976 case 0xe3:
2978 /** 0110 0001 1110 0011 sk%c1 */
2979 if (trace)
2981 printf ("\033[33m%s\033[0m %02x %02x\n",
2982 "/** 0110 0001 1110 0011 sk%c1 */",
2983 op[0], op[1]);
2985 SYNTAX("sk%c1");
2986 #line 1103 "rl78-decode.opc"
2987 ID(skip); COND(H);
2990 break;
2991 case 0xe8:
2993 /** 0110 0001 1110 1000 sk%c1 */
2994 if (trace)
2996 printf ("\033[33m%s\033[0m %02x %02x\n",
2997 "/** 0110 0001 1110 1000 sk%c1 */",
2998 op[0], op[1]);
3000 SYNTAX("sk%c1");
3001 #line 1115 "rl78-decode.opc"
3002 ID(skip); COND(Z);
3004 /*----------------------------------------------------------------------*/
3007 break;
3008 case 0xe9:
3010 /** 0110 0001 1110 1001 mov %0, %e1 */
3011 if (trace)
3013 printf ("\033[33m%s\033[0m %02x %02x\n",
3014 "/** 0110 0001 1110 1001 mov %0, %e1 */",
3015 op[0], op[1]);
3017 SYNTAX("mov %0, %e1");
3018 #line 669 "rl78-decode.opc"
3019 ID(mov); DR(A); SM2(HL, C, 0);
3022 break;
3023 case 0xeb:
3025 /** 0110 0001 1110 1011 rol %0, %1 */
3026 if (trace)
3028 printf ("\033[33m%s\033[0m %02x %02x\n",
3029 "/** 0110 0001 1110 1011 rol %0, %1 */",
3030 op[0], op[1]);
3032 SYNTAX("rol %0, %1");
3033 #line 1019 "rl78-decode.opc"
3034 ID(rol); DR(A); SC(1);
3037 break;
3038 case 0xec:
3040 /** 0110 0001 1110 1100 retb */
3041 if (trace)
3043 printf ("\033[33m%s\033[0m %02x %02x\n",
3044 "/** 0110 0001 1110 1100 retb */",
3045 op[0], op[1]);
3047 SYNTAX("retb");
3048 #line 1014 "rl78-decode.opc"
3049 ID(reti);
3051 /*----------------------------------------------------------------------*/
3054 break;
3055 case 0xed:
3057 /** 0110 0001 1110 1101 halt */
3058 if (trace)
3060 printf ("\033[33m%s\033[0m %02x %02x\n",
3061 "/** 0110 0001 1110 1101 halt */",
3062 op[0], op[1]);
3064 SYNTAX("halt");
3065 #line 582 "rl78-decode.opc"
3066 ID(halt);
3068 /*----------------------------------------------------------------------*/
3071 break;
3072 case 0xee:
3073 case 0xfe:
3075 /** 0110 0001 111r 1110 rolwc %0, %1 */
3076 #line 1025 "rl78-decode.opc"
3077 int r AU = (op[1] >> 4) & 0x01;
3078 if (trace)
3080 printf ("\033[33m%s\033[0m %02x %02x\n",
3081 "/** 0110 0001 111r 1110 rolwc %0, %1 */",
3082 op[0], op[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);
3090 break;
3091 case 0xf0:
3093 /** 0110 0001 1111 0000 xor %0, %e1 */
3094 if (trace)
3096 printf ("\033[33m%s\033[0m %02x %02x\n",
3097 "/** 0110 0001 1111 0000 xor %0, %e1 */",
3098 op[0], op[1]);
3100 SYNTAX("xor %0, %e1");
3101 #line 1256 "rl78-decode.opc"
3102 ID(xor); DR(A); SM2(HL, B, 0); Fz;
3105 break;
3106 case 0xf2:
3108 /** 0110 0001 1111 0010 xor %0, %e1 */
3109 if (trace)
3111 printf ("\033[33m%s\033[0m %02x %02x\n",
3112 "/** 0110 0001 1111 0010 xor %0, %e1 */",
3113 op[0], op[1]);
3115 SYNTAX("xor %0, %e1");
3116 #line 1262 "rl78-decode.opc"
3117 ID(xor); DR(A); SM2(HL, C, 0); Fz;
3120 break;
3121 case 0xf3:
3123 /** 0110 0001 1111 0011 sk%c1 */
3124 if (trace)
3126 printf ("\033[33m%s\033[0m %02x %02x\n",
3127 "/** 0110 0001 1111 0011 sk%c1 */",
3128 op[0], op[1]);
3130 SYNTAX("sk%c1");
3131 #line 1109 "rl78-decode.opc"
3132 ID(skip); COND(NH);
3135 break;
3136 case 0xf8:
3138 /** 0110 0001 1111 1000 sk%c1 */
3139 if (trace)
3141 printf ("\033[33m%s\033[0m %02x %02x\n",
3142 "/** 0110 0001 1111 1000 sk%c1 */",
3143 op[0], op[1]);
3145 SYNTAX("sk%c1");
3146 #line 1112 "rl78-decode.opc"
3147 ID(skip); COND(NZ);
3150 break;
3151 case 0xf9:
3153 /** 0110 0001 1111 1001 mov %e0, %1 */
3154 if (trace)
3156 printf ("\033[33m%s\033[0m %02x %02x\n",
3157 "/** 0110 0001 1111 1001 mov %e0, %1 */",
3158 op[0], op[1]);
3160 SYNTAX("mov %e0, %1");
3161 #line 642 "rl78-decode.opc"
3162 ID(mov); DM2(HL, C, 0); SR(A);
3165 break;
3166 case 0xfb:
3168 /** 0110 0001 1111 1011 rorc %0, %1 */
3169 if (trace)
3171 printf ("\033[33m%s\033[0m %02x %02x\n",
3172 "/** 0110 0001 1111 1011 rorc %0, %1 */",
3173 op[0], op[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" */
3185 break;
3186 case 0xfc:
3188 /** 0110 0001 1111 1100 reti */
3189 if (trace)
3191 printf ("\033[33m%s\033[0m %02x %02x\n",
3192 "/** 0110 0001 1111 1100 reti */",
3193 op[0], op[1]);
3195 SYNTAX("reti");
3196 #line 1011 "rl78-decode.opc"
3197 ID(reti);
3200 break;
3201 case 0xfd:
3203 /** 0110 0001 1111 1101 stop */
3204 if (trace)
3206 printf ("\033[33m%s\033[0m %02x %02x\n",
3207 "/** 0110 0001 1111 1101 stop */",
3208 op[0], op[1]);
3210 SYNTAX("stop");
3211 #line 1120 "rl78-decode.opc"
3212 ID(stop);
3214 /*----------------------------------------------------------------------*/
3217 break;
3218 default: UNSUPPORTED(); break;
3220 break;
3221 case 0x68:
3223 /** 0110 1000 movw %e0, %1 */
3224 if (trace)
3226 printf ("\033[33m%s\033[0m %02x\n",
3227 "/** 0110 1000 movw %e0, %1 */",
3228 op[0]);
3230 SYNTAX("movw %e0, %1");
3231 #line 880 "rl78-decode.opc"
3232 ID(mov); W(); DM(C, IMMU(2)); SR(AX);
3235 break;
3236 case 0x69:
3238 /** 0110 1001 movw %0, %e1 */
3239 if (trace)
3241 printf ("\033[33m%s\033[0m %02x\n",
3242 "/** 0110 1001 movw %0, %e1 */",
3243 op[0]);
3245 SYNTAX("movw %0, %e1");
3246 #line 871 "rl78-decode.opc"
3247 ID(mov); W(); DR(AX); SM(C, IMMU(2));
3250 break;
3251 case 0x6a:
3253 /** 0110 1010 or %0, #%1 */
3254 if (trace)
3256 printf ("\033[33m%s\033[0m %02x\n",
3257 "/** 0110 1010 or %0, #%1 */",
3258 op[0]);
3260 SYNTAX("or %0, #%1");
3261 #line 973 "rl78-decode.opc"
3262 ID(or); DM(None, SADDR); SC(IMMU(1)); Fz;
3264 /*----------------------------------------------------------------------*/
3267 break;
3268 case 0x6b:
3270 /** 0110 1011 or %0, %1 */
3271 if (trace)
3273 printf ("\033[33m%s\033[0m %02x\n",
3274 "/** 0110 1011 or %0, %1 */",
3275 op[0]);
3277 SYNTAX("or %0, %1");
3278 #line 970 "rl78-decode.opc"
3279 ID(or); DR(A); SM(None, SADDR); Fz;
3282 break;
3283 case 0x6c:
3285 /** 0110 1100 or %0, #%1 */
3286 if (trace)
3288 printf ("\033[33m%s\033[0m %02x\n",
3289 "/** 0110 1100 or %0, #%1 */",
3290 op[0]);
3292 SYNTAX("or %0, #%1");
3293 #line 961 "rl78-decode.opc"
3294 ID(or); DR(A); SC(IMMU(1)); Fz;
3297 break;
3298 case 0x6d:
3300 /** 0110 1101 or %0, %e1 */
3301 if (trace)
3303 printf ("\033[33m%s\033[0m %02x\n",
3304 "/** 0110 1101 or %0, %e1 */",
3305 op[0]);
3307 SYNTAX("or %0, %e1");
3308 #line 949 "rl78-decode.opc"
3309 ID(or); DR(A); SM(HL, 0); Fz;
3312 break;
3313 case 0x6e:
3315 /** 0110 1110 or %0, %ea1 */
3316 if (trace)
3318 printf ("\033[33m%s\033[0m %02x\n",
3319 "/** 0110 1110 or %0, %ea1 */",
3320 op[0]);
3322 SYNTAX("or %0, %ea1");
3323 #line 955 "rl78-decode.opc"
3324 ID(or); DR(A); SM(HL, IMMU(1)); Fz;
3327 break;
3328 case 0x6f:
3330 /** 0110 1111 or %0, %e!1 */
3331 if (trace)
3333 printf ("\033[33m%s\033[0m %02x\n",
3334 "/** 0110 1111 or %0, %e!1 */",
3335 op[0]);
3337 SYNTAX("or %0, %e!1");
3338 #line 946 "rl78-decode.opc"
3339 ID(or); DR(A); SM(None, IMMU(2)); Fz;
3342 break;
3343 case 0x70:
3344 case 0x72:
3345 case 0x73:
3346 case 0x74:
3347 case 0x75:
3348 case 0x76:
3349 case 0x77:
3351 /** 0111 0rba mov %0, %1 */
3352 #line 702 "rl78-decode.opc"
3353 int rba AU = op[0] & 0x07;
3354 if (trace)
3356 printf ("\033[33m%s\033[0m %02x\n",
3357 "/** 0111 0rba mov %0, %1 */",
3358 op[0]);
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);
3366 break;
3367 case 0x71:
3368 GETBYTE ();
3369 switch (op[1] & 0xff)
3371 case 0x00:
3372 case 0x10:
3373 case 0x20:
3374 case 0x30:
3375 case 0x40:
3376 case 0x50:
3377 case 0x60:
3378 case 0x70:
3380 /** 0111 0001 0bit 0000 set1 %e!0 */
3381 #line 1052 "rl78-decode.opc"
3382 int bit AU = (op[1] >> 4) & 0x07;
3383 if (trace)
3385 printf ("\033[33m%s\033[0m %02x %02x\n",
3386 "/** 0111 0001 0bit 0000 set1 %e!0 */",
3387 op[0], op[1]);
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);
3395 break;
3396 case 0x01:
3397 case 0x11:
3398 case 0x21:
3399 case 0x31:
3400 case 0x41:
3401 case 0x51:
3402 case 0x61:
3403 case 0x71:
3405 /** 0111 0001 0bit 0001 mov1 %0, cy */
3406 #line 809 "rl78-decode.opc"
3407 int bit AU = (op[1] >> 4) & 0x07;
3408 if (trace)
3410 printf ("\033[33m%s\033[0m %02x %02x\n",
3411 "/** 0111 0001 0bit 0001 mov1 %0, cy */",
3412 op[0], op[1]);
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();
3420 break;
3421 case 0x02:
3422 case 0x12:
3423 case 0x22:
3424 case 0x32:
3425 case 0x42:
3426 case 0x52:
3427 case 0x62:
3428 case 0x72:
3430 /** 0111 0001 0bit 0010 set1 %0 */
3431 #line 1070 "rl78-decode.opc"
3432 int bit AU = (op[1] >> 4) & 0x07;
3433 if (trace)
3435 printf ("\033[33m%s\033[0m %02x %02x\n",
3436 "/** 0111 0001 0bit 0010 set1 %0 */",
3437 op[0], op[1]);
3438 printf (" bit = 0x%x\n", bit);
3440 SYNTAX("set1 %0");
3441 #line 1070 "rl78-decode.opc"
3442 ID(mov); DM(None, SADDR); DB(bit); SC(1);
3444 /*----------------------------------------------------------------------*/
3447 break;
3448 case 0x03:
3449 case 0x13:
3450 case 0x23:
3451 case 0x33:
3452 case 0x43:
3453 case 0x53:
3454 case 0x63:
3455 case 0x73:
3457 /** 0111 0001 0bit 0011 clr1 %0 */
3458 #line 462 "rl78-decode.opc"
3459 int bit AU = (op[1] >> 4) & 0x07;
3460 if (trace)
3462 printf ("\033[33m%s\033[0m %02x %02x\n",
3463 "/** 0111 0001 0bit 0011 clr1 %0 */",
3464 op[0], op[1]);
3465 printf (" bit = 0x%x\n", bit);
3467 SYNTAX("clr1 %0");
3468 #line 462 "rl78-decode.opc"
3469 ID(mov); DM(None, SADDR); DB(bit); SC(0);
3471 /*----------------------------------------------------------------------*/
3474 break;
3475 case 0x04:
3476 case 0x14:
3477 case 0x24:
3478 case 0x34:
3479 case 0x44:
3480 case 0x54:
3481 case 0x64:
3482 case 0x74:
3484 /** 0111 0001 0bit 0100 mov1 cy, %1 */
3485 #line 803 "rl78-decode.opc"
3486 int bit AU = (op[1] >> 4) & 0x07;
3487 if (trace)
3489 printf ("\033[33m%s\033[0m %02x %02x\n",
3490 "/** 0111 0001 0bit 0100 mov1 cy, %1 */",
3491 op[0], op[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);
3499 break;
3500 case 0x05:
3501 case 0x15:
3502 case 0x25:
3503 case 0x35:
3504 case 0x45:
3505 case 0x55:
3506 case 0x65:
3507 case 0x75:
3509 /** 0111 0001 0bit 0101 and1 cy, %s1 */
3510 #line 332 "rl78-decode.opc"
3511 int bit AU = (op[1] >> 4) & 0x07;
3512 if (trace)
3514 printf ("\033[33m%s\033[0m %02x %02x\n",
3515 "/** 0111 0001 0bit 0101 and1 cy, %s1 */",
3516 op[0], op[1]);
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" */
3529 break;
3530 case 0x06:
3531 case 0x16:
3532 case 0x26:
3533 case 0x36:
3534 case 0x46:
3535 case 0x56:
3536 case 0x66:
3537 case 0x76:
3539 /** 0111 0001 0bit 0110 or1 cy, %s1 */
3540 #line 987 "rl78-decode.opc"
3541 int bit AU = (op[1] >> 4) & 0x07;
3542 if (trace)
3544 printf ("\033[33m%s\033[0m %02x %02x\n",
3545 "/** 0111 0001 0bit 0110 or1 cy, %s1 */",
3546 op[0], op[1]);
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 /*----------------------------------------------------------------------*/
3556 break;
3557 case 0x07:
3558 case 0x17:
3559 case 0x27:
3560 case 0x37:
3561 case 0x47:
3562 case 0x57:
3563 case 0x67:
3564 case 0x77:
3566 /** 0111 0001 0bit 0111 xor1 cy, %s1 */
3567 #line 1291 "rl78-decode.opc"
3568 int bit AU = (op[1] >> 4) & 0x07;
3569 if (trace)
3571 printf ("\033[33m%s\033[0m %02x %02x\n",
3572 "/** 0111 0001 0bit 0111 xor1 cy, %s1 */",
3573 op[0], op[1]);
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 /*----------------------------------------------------------------------*/
3583 break;
3584 case 0x08:
3585 case 0x18:
3586 case 0x28:
3587 case 0x38:
3588 case 0x48:
3589 case 0x58:
3590 case 0x68:
3591 case 0x78:
3593 /** 0111 0001 0bit 1000 clr1 %e!0 */
3594 #line 444 "rl78-decode.opc"
3595 int bit AU = (op[1] >> 4) & 0x07;
3596 if (trace)
3598 printf ("\033[33m%s\033[0m %02x %02x\n",
3599 "/** 0111 0001 0bit 1000 clr1 %e!0 */",
3600 op[0], op[1]);
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);
3608 break;
3609 case 0x09:
3610 case 0x19:
3611 case 0x29:
3612 case 0x39:
3613 case 0x49:
3614 case 0x59:
3615 case 0x69:
3616 case 0x79:
3618 /** 0111 0001 0bit 1001 mov1 %s0, cy */
3619 #line 812 "rl78-decode.opc"
3620 int bit AU = (op[1] >> 4) & 0x07;
3621 if (trace)
3623 printf ("\033[33m%s\033[0m %02x %02x\n",
3624 "/** 0111 0001 0bit 1001 mov1 %s0, cy */",
3625 op[0], op[1]);
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 /*----------------------------------------------------------------------*/
3635 break;
3636 case 0x0a:
3637 case 0x1a:
3638 case 0x2a:
3639 case 0x3a:
3640 case 0x4a:
3641 case 0x5a:
3642 case 0x6a:
3643 case 0x7a:
3645 /** 0111 0001 0bit 1010 set1 %s0 */
3646 #line 1064 "rl78-decode.opc"
3647 int bit AU = (op[1] >> 4) & 0x07;
3648 if (trace)
3650 printf ("\033[33m%s\033[0m %02x %02x\n",
3651 "/** 0111 0001 0bit 1010 set1 %s0 */",
3652 op[0], op[1]);
3653 printf (" bit = 0x%x\n", bit);
3655 SYNTAX("set1 %s0");
3656 #line 1064 "rl78-decode.opc"
3657 op0 = SFR;
3658 ID(mov); DM(None, op0); DB(bit); SC(1);
3659 if (op0 == RL78_SFR_PSW && bit == 7)
3660 rl78->syntax = "ei";
3663 break;
3664 case 0x0b:
3665 case 0x1b:
3666 case 0x2b:
3667 case 0x3b:
3668 case 0x4b:
3669 case 0x5b:
3670 case 0x6b:
3671 case 0x7b:
3673 /** 0111 0001 0bit 1011 clr1 %s0 */
3674 #line 456 "rl78-decode.opc"
3675 int bit AU = (op[1] >> 4) & 0x07;
3676 if (trace)
3678 printf ("\033[33m%s\033[0m %02x %02x\n",
3679 "/** 0111 0001 0bit 1011 clr1 %s0 */",
3680 op[0], op[1]);
3681 printf (" bit = 0x%x\n", bit);
3683 SYNTAX("clr1 %s0");
3684 #line 456 "rl78-decode.opc"
3685 op0 = SFR;
3686 ID(mov); DM(None, op0); DB(bit); SC(0);
3687 if (op0 == RL78_SFR_PSW && bit == 7)
3688 rl78->syntax = "di";
3691 break;
3692 case 0x0c:
3693 case 0x1c:
3694 case 0x2c:
3695 case 0x3c:
3696 case 0x4c:
3697 case 0x5c:
3698 case 0x6c:
3699 case 0x7c:
3701 /** 0111 0001 0bit 1100 mov1 cy, %s1 */
3702 #line 806 "rl78-decode.opc"
3703 int bit AU = (op[1] >> 4) & 0x07;
3704 if (trace)
3706 printf ("\033[33m%s\033[0m %02x %02x\n",
3707 "/** 0111 0001 0bit 1100 mov1 cy, %s1 */",
3708 op[0], op[1]);
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);
3716 break;
3717 case 0x0d:
3718 case 0x1d:
3719 case 0x2d:
3720 case 0x3d:
3721 case 0x4d:
3722 case 0x5d:
3723 case 0x6d:
3724 case 0x7d:
3726 /** 0111 0001 0bit 1101 and1 cy, %s1 */
3727 #line 329 "rl78-decode.opc"
3728 int bit AU = (op[1] >> 4) & 0x07;
3729 if (trace)
3731 printf ("\033[33m%s\033[0m %02x %02x\n",
3732 "/** 0111 0001 0bit 1101 and1 cy, %s1 */",
3733 op[0], op[1]);
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);
3741 break;
3742 case 0x0e:
3743 case 0x1e:
3744 case 0x2e:
3745 case 0x3e:
3746 case 0x4e:
3747 case 0x5e:
3748 case 0x6e:
3749 case 0x7e:
3751 /** 0111 0001 0bit 1110 or1 cy, %s1 */
3752 #line 984 "rl78-decode.opc"
3753 int bit AU = (op[1] >> 4) & 0x07;
3754 if (trace)
3756 printf ("\033[33m%s\033[0m %02x %02x\n",
3757 "/** 0111 0001 0bit 1110 or1 cy, %s1 */",
3758 op[0], op[1]);
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);
3766 break;
3767 case 0x0f:
3768 case 0x1f:
3769 case 0x2f:
3770 case 0x3f:
3771 case 0x4f:
3772 case 0x5f:
3773 case 0x6f:
3774 case 0x7f:
3776 /** 0111 0001 0bit 1111 xor1 cy, %s1 */
3777 #line 1288 "rl78-decode.opc"
3778 int bit AU = (op[1] >> 4) & 0x07;
3779 if (trace)
3781 printf ("\033[33m%s\033[0m %02x %02x\n",
3782 "/** 0111 0001 0bit 1111 xor1 cy, %s1 */",
3783 op[0], op[1]);
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);
3791 break;
3792 case 0x80:
3794 /** 0111 0001 1000 0000 set1 cy */
3795 if (trace)
3797 printf ("\033[33m%s\033[0m %02x %02x\n",
3798 "/** 0111 0001 1000 0000 set1 cy */",
3799 op[0], op[1]);
3801 SYNTAX("set1 cy");
3802 #line 1061 "rl78-decode.opc"
3803 ID(mov); DCY(); SC(1);
3806 break;
3807 case 0x81:
3808 case 0x91:
3809 case 0xa1:
3810 case 0xb1:
3811 case 0xc1:
3812 case 0xd1:
3813 case 0xe1:
3814 case 0xf1:
3816 /** 0111 0001 1bit 0001 mov1 %e0, cy */
3817 #line 791 "rl78-decode.opc"
3818 int bit AU = (op[1] >> 4) & 0x07;
3819 if (trace)
3821 printf ("\033[33m%s\033[0m %02x %02x\n",
3822 "/** 0111 0001 1bit 0001 mov1 %e0, cy */",
3823 op[0], op[1]);
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();
3831 break;
3832 case 0x82:
3833 case 0x92:
3834 case 0xa2:
3835 case 0xb2:
3836 case 0xc2:
3837 case 0xd2:
3838 case 0xe2:
3839 case 0xf2:
3841 /** 0111 0001 1bit 0010 set1 %e0 */
3842 #line 1055 "rl78-decode.opc"
3843 int bit AU = (op[1] >> 4) & 0x07;
3844 if (trace)
3846 printf ("\033[33m%s\033[0m %02x %02x\n",
3847 "/** 0111 0001 1bit 0010 set1 %e0 */",
3848 op[0], op[1]);
3849 printf (" bit = 0x%x\n", bit);
3851 SYNTAX("set1 %e0");
3852 #line 1055 "rl78-decode.opc"
3853 ID(mov); DM(HL, 0); DB(bit); SC(1);
3856 break;
3857 case 0x83:
3858 case 0x93:
3859 case 0xa3:
3860 case 0xb3:
3861 case 0xc3:
3862 case 0xd3:
3863 case 0xe3:
3864 case 0xf3:
3866 /** 0111 0001 1bit 0011 clr1 %e0 */
3867 #line 447 "rl78-decode.opc"
3868 int bit AU = (op[1] >> 4) & 0x07;
3869 if (trace)
3871 printf ("\033[33m%s\033[0m %02x %02x\n",
3872 "/** 0111 0001 1bit 0011 clr1 %e0 */",
3873 op[0], op[1]);
3874 printf (" bit = 0x%x\n", bit);
3876 SYNTAX("clr1 %e0");
3877 #line 447 "rl78-decode.opc"
3878 ID(mov); DM(HL, 0); DB(bit); SC(0);
3881 break;
3882 case 0x84:
3883 case 0x94:
3884 case 0xa4:
3885 case 0xb4:
3886 case 0xc4:
3887 case 0xd4:
3888 case 0xe4:
3889 case 0xf4:
3891 /** 0111 0001 1bit 0100 mov1 cy, %e1 */
3892 #line 797 "rl78-decode.opc"
3893 int bit AU = (op[1] >> 4) & 0x07;
3894 if (trace)
3896 printf ("\033[33m%s\033[0m %02x %02x\n",
3897 "/** 0111 0001 1bit 0100 mov1 cy, %e1 */",
3898 op[0], op[1]);
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);
3906 break;
3907 case 0x85:
3908 case 0x95:
3909 case 0xa5:
3910 case 0xb5:
3911 case 0xc5:
3912 case 0xd5:
3913 case 0xe5:
3914 case 0xf5:
3916 /** 0111 0001 1bit 0101 and1 cy, %e1 */
3917 #line 323 "rl78-decode.opc"
3918 int bit AU = (op[1] >> 4) & 0x07;
3919 if (trace)
3921 printf ("\033[33m%s\033[0m %02x %02x\n",
3922 "/** 0111 0001 1bit 0101 and1 cy, %e1 */",
3923 op[0], op[1]);
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);
3931 break;
3932 case 0x86:
3933 case 0x96:
3934 case 0xa6:
3935 case 0xb6:
3936 case 0xc6:
3937 case 0xd6:
3938 case 0xe6:
3939 case 0xf6:
3941 /** 0111 0001 1bit 0110 or1 cy, %e1 */
3942 #line 978 "rl78-decode.opc"
3943 int bit AU = (op[1] >> 4) & 0x07;
3944 if (trace)
3946 printf ("\033[33m%s\033[0m %02x %02x\n",
3947 "/** 0111 0001 1bit 0110 or1 cy, %e1 */",
3948 op[0], op[1]);
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);
3956 break;
3957 case 0x87:
3958 case 0x97:
3959 case 0xa7:
3960 case 0xb7:
3961 case 0xc7:
3962 case 0xd7:
3963 case 0xe7:
3964 case 0xf7:
3966 /** 0111 0001 1bit 0111 xor1 cy, %e1 */
3967 #line 1282 "rl78-decode.opc"
3968 int bit AU = (op[1] >> 4) & 0x07;
3969 if (trace)
3971 printf ("\033[33m%s\033[0m %02x %02x\n",
3972 "/** 0111 0001 1bit 0111 xor1 cy, %e1 */",
3973 op[0], op[1]);
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);
3981 break;
3982 case 0x88:
3984 /** 0111 0001 1000 1000 clr1 cy */
3985 if (trace)
3987 printf ("\033[33m%s\033[0m %02x %02x\n",
3988 "/** 0111 0001 1000 1000 clr1 cy */",
3989 op[0], op[1]);
3991 SYNTAX("clr1 cy");
3992 #line 453 "rl78-decode.opc"
3993 ID(mov); DCY(); SC(0);
3996 break;
3997 case 0x89:
3998 case 0x99:
3999 case 0xa9:
4000 case 0xb9:
4001 case 0xc9:
4002 case 0xd9:
4003 case 0xe9:
4004 case 0xf9:
4006 /** 0111 0001 1bit 1001 mov1 %e0, cy */
4007 #line 794 "rl78-decode.opc"
4008 int bit AU = (op[1] >> 4) & 0x07;
4009 if (trace)
4011 printf ("\033[33m%s\033[0m %02x %02x\n",
4012 "/** 0111 0001 1bit 1001 mov1 %e0, cy */",
4013 op[0], op[1]);
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();
4021 break;
4022 case 0x8a:
4023 case 0x9a:
4024 case 0xaa:
4025 case 0xba:
4026 case 0xca:
4027 case 0xda:
4028 case 0xea:
4029 case 0xfa:
4031 /** 0111 0001 1bit 1010 set1 %0 */
4032 #line 1058 "rl78-decode.opc"
4033 int bit AU = (op[1] >> 4) & 0x07;
4034 if (trace)
4036 printf ("\033[33m%s\033[0m %02x %02x\n",
4037 "/** 0111 0001 1bit 1010 set1 %0 */",
4038 op[0], op[1]);
4039 printf (" bit = 0x%x\n", bit);
4041 SYNTAX("set1 %0");
4042 #line 1058 "rl78-decode.opc"
4043 ID(mov); DR(A); DB(bit); SC(1);
4046 break;
4047 case 0x8b:
4048 case 0x9b:
4049 case 0xab:
4050 case 0xbb:
4051 case 0xcb:
4052 case 0xdb:
4053 case 0xeb:
4054 case 0xfb:
4056 /** 0111 0001 1bit 1011 clr1 %0 */
4057 #line 450 "rl78-decode.opc"
4058 int bit AU = (op[1] >> 4) & 0x07;
4059 if (trace)
4061 printf ("\033[33m%s\033[0m %02x %02x\n",
4062 "/** 0111 0001 1bit 1011 clr1 %0 */",
4063 op[0], op[1]);
4064 printf (" bit = 0x%x\n", bit);
4066 SYNTAX("clr1 %0");
4067 #line 450 "rl78-decode.opc"
4068 ID(mov); DR(A); DB(bit); SC(0);
4071 break;
4072 case 0x8c:
4073 case 0x9c:
4074 case 0xac:
4075 case 0xbc:
4076 case 0xcc:
4077 case 0xdc:
4078 case 0xec:
4079 case 0xfc:
4081 /** 0111 0001 1bit 1100 mov1 cy, %e1 */
4082 #line 800 "rl78-decode.opc"
4083 int bit AU = (op[1] >> 4) & 0x07;
4084 if (trace)
4086 printf ("\033[33m%s\033[0m %02x %02x\n",
4087 "/** 0111 0001 1bit 1100 mov1 cy, %e1 */",
4088 op[0], op[1]);
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);
4096 break;
4097 case 0x8d:
4098 case 0x9d:
4099 case 0xad:
4100 case 0xbd:
4101 case 0xcd:
4102 case 0xdd:
4103 case 0xed:
4104 case 0xfd:
4106 /** 0111 0001 1bit 1101 and1 cy, %1 */
4107 #line 326 "rl78-decode.opc"
4108 int bit AU = (op[1] >> 4) & 0x07;
4109 if (trace)
4111 printf ("\033[33m%s\033[0m %02x %02x\n",
4112 "/** 0111 0001 1bit 1101 and1 cy, %1 */",
4113 op[0], op[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);
4121 break;
4122 case 0x8e:
4123 case 0x9e:
4124 case 0xae:
4125 case 0xbe:
4126 case 0xce:
4127 case 0xde:
4128 case 0xee:
4129 case 0xfe:
4131 /** 0111 0001 1bit 1110 or1 cy, %1 */
4132 #line 981 "rl78-decode.opc"
4133 int bit AU = (op[1] >> 4) & 0x07;
4134 if (trace)
4136 printf ("\033[33m%s\033[0m %02x %02x\n",
4137 "/** 0111 0001 1bit 1110 or1 cy, %1 */",
4138 op[0], op[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);
4146 break;
4147 case 0x8f:
4148 case 0x9f:
4149 case 0xaf:
4150 case 0xbf:
4151 case 0xcf:
4152 case 0xdf:
4153 case 0xef:
4154 case 0xff:
4156 /** 0111 0001 1bit 1111 xor1 cy, %1 */
4157 #line 1285 "rl78-decode.opc"
4158 int bit AU = (op[1] >> 4) & 0x07;
4159 if (trace)
4161 printf ("\033[33m%s\033[0m %02x %02x\n",
4162 "/** 0111 0001 1bit 1111 xor1 cy, %1 */",
4163 op[0], op[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);
4171 break;
4172 case 0xc0:
4174 /** 0111 0001 1100 0000 not1 cy */
4175 if (trace)
4177 printf ("\033[33m%s\033[0m %02x %02x\n",
4178 "/** 0111 0001 1100 0000 not1 cy */",
4179 op[0], op[1]);
4181 SYNTAX("not1 cy");
4182 #line 922 "rl78-decode.opc"
4183 ID(xor); DCY(); SC(1);
4185 /*----------------------------------------------------------------------*/
4188 break;
4189 default: UNSUPPORTED(); break;
4191 break;
4192 case 0x78:
4194 /** 0111 1000 movw %e0, %1 */
4195 if (trace)
4197 printf ("\033[33m%s\033[0m %02x\n",
4198 "/** 0111 1000 movw %e0, %1 */",
4199 op[0]);
4201 SYNTAX("movw %e0, %1");
4202 #line 883 "rl78-decode.opc"
4203 ID(mov); W(); DM(BC, IMMU(2)); SR(AX);
4206 break;
4207 case 0x79:
4209 /** 0111 1001 movw %0, %e1 */
4210 if (trace)
4212 printf ("\033[33m%s\033[0m %02x\n",
4213 "/** 0111 1001 movw %0, %e1 */",
4214 op[0]);
4216 SYNTAX("movw %0, %e1");
4217 #line 874 "rl78-decode.opc"
4218 ID(mov); W(); DR(AX); SM(BC, IMMU(2));
4221 break;
4222 case 0x7a:
4224 /** 0111 1010 xor %0, #%1 */
4225 if (trace)
4227 printf ("\033[33m%s\033[0m %02x\n",
4228 "/** 0111 1010 xor %0, #%1 */",
4229 op[0]);
4231 SYNTAX("xor %0, #%1");
4232 #line 1277 "rl78-decode.opc"
4233 ID(xor); DM(None, SADDR); SC(IMMU(1)); Fz;
4235 /*----------------------------------------------------------------------*/
4238 break;
4239 case 0x7b:
4241 /** 0111 1011 xor %0, %1 */
4242 if (trace)
4244 printf ("\033[33m%s\033[0m %02x\n",
4245 "/** 0111 1011 xor %0, %1 */",
4246 op[0]);
4248 SYNTAX("xor %0, %1");
4249 #line 1274 "rl78-decode.opc"
4250 ID(xor); DR(A); SM(None, SADDR); Fz;
4253 break;
4254 case 0x7c:
4256 /** 0111 1100 xor %0, #%1 */
4257 if (trace)
4259 printf ("\033[33m%s\033[0m %02x\n",
4260 "/** 0111 1100 xor %0, #%1 */",
4261 op[0]);
4263 SYNTAX("xor %0, #%1");
4264 #line 1265 "rl78-decode.opc"
4265 ID(xor); DR(A); SC(IMMU(1)); Fz;
4268 break;
4269 case 0x7d:
4271 /** 0111 1101 xor %0, %e1 */
4272 if (trace)
4274 printf ("\033[33m%s\033[0m %02x\n",
4275 "/** 0111 1101 xor %0, %e1 */",
4276 op[0]);
4278 SYNTAX("xor %0, %e1");
4279 #line 1253 "rl78-decode.opc"
4280 ID(xor); DR(A); SM(HL, 0); Fz;
4283 break;
4284 case 0x7e:
4286 /** 0111 1110 xor %0, %ea1 */
4287 if (trace)
4289 printf ("\033[33m%s\033[0m %02x\n",
4290 "/** 0111 1110 xor %0, %ea1 */",
4291 op[0]);
4293 SYNTAX("xor %0, %ea1");
4294 #line 1259 "rl78-decode.opc"
4295 ID(xor); DR(A); SM(HL, IMMU(1)); Fz;
4298 break;
4299 case 0x7f:
4301 /** 0111 1111 xor %0, %e!1 */
4302 if (trace)
4304 printf ("\033[33m%s\033[0m %02x\n",
4305 "/** 0111 1111 xor %0, %e!1 */",
4306 op[0]);
4308 SYNTAX("xor %0, %e!1");
4309 #line 1250 "rl78-decode.opc"
4310 ID(xor); DR(A); SM(None, IMMU(2)); Fz;
4313 break;
4314 case 0x80:
4315 case 0x81:
4316 case 0x82:
4317 case 0x83:
4318 case 0x84:
4319 case 0x85:
4320 case 0x86:
4321 case 0x87:
4323 /** 1000 0reg inc %0 */
4324 #line 593 "rl78-decode.opc"
4325 int reg AU = op[0] & 0x07;
4326 if (trace)
4328 printf ("\033[33m%s\033[0m %02x\n",
4329 "/** 1000 0reg inc %0 */",
4330 op[0]);
4331 printf (" reg = 0x%x\n", reg);
4333 SYNTAX("inc %0");
4334 #line 593 "rl78-decode.opc"
4335 ID(add); DRB(reg); SC(1); Fza;
4338 break;
4339 case 0x88:
4341 /** 1000 1000 mov %0, %ea1 */
4342 if (trace)
4344 printf ("\033[33m%s\033[0m %02x\n",
4345 "/** 1000 1000 mov %0, %ea1 */",
4346 op[0]);
4348 SYNTAX("mov %0, %ea1");
4349 #line 672 "rl78-decode.opc"
4350 ID(mov); DR(A); SM(SP, IMMU(1));
4353 break;
4354 case 0x89:
4356 /** 1000 1001 mov %0, %e1 */
4357 if (trace)
4359 printf ("\033[33m%s\033[0m %02x\n",
4360 "/** 1000 1001 mov %0, %e1 */",
4361 op[0]);
4363 SYNTAX("mov %0, %e1");
4364 #line 654 "rl78-decode.opc"
4365 ID(mov); DR(A); SM(DE, 0);
4368 break;
4369 case 0x8a:
4371 /** 1000 1010 mov %0, %ea1 */
4372 if (trace)
4374 printf ("\033[33m%s\033[0m %02x\n",
4375 "/** 1000 1010 mov %0, %ea1 */",
4376 op[0]);
4378 SYNTAX("mov %0, %ea1");
4379 #line 657 "rl78-decode.opc"
4380 ID(mov); DR(A); SM(DE, IMMU(1));
4383 break;
4384 case 0x8b:
4386 /** 1000 1011 mov %0, %e1 */
4387 if (trace)
4389 printf ("\033[33m%s\033[0m %02x\n",
4390 "/** 1000 1011 mov %0, %e1 */",
4391 op[0]);
4393 SYNTAX("mov %0, %e1");
4394 #line 660 "rl78-decode.opc"
4395 ID(mov); DR(A); SM(HL, 0);
4398 break;
4399 case 0x8c:
4401 /** 1000 1100 mov %0, %ea1 */
4402 if (trace)
4404 printf ("\033[33m%s\033[0m %02x\n",
4405 "/** 1000 1100 mov %0, %ea1 */",
4406 op[0]);
4408 SYNTAX("mov %0, %ea1");
4409 #line 663 "rl78-decode.opc"
4410 ID(mov); DR(A); SM(HL, IMMU(1));
4413 break;
4414 case 0x8d:
4416 /** 1000 1101 mov %0, %1 */
4417 if (trace)
4419 printf ("\033[33m%s\033[0m %02x\n",
4420 "/** 1000 1101 mov %0, %1 */",
4421 op[0]);
4423 SYNTAX("mov %0, %1");
4424 #line 696 "rl78-decode.opc"
4425 ID(mov); DR(A); SM(None, SADDR);
4428 break;
4429 case 0x8e:
4431 /** 1000 1110 mov %0, %s1 */
4432 if (trace)
4434 printf ("\033[33m%s\033[0m %02x\n",
4435 "/** 1000 1110 mov %0, %s1 */",
4436 op[0]);
4438 SYNTAX("mov %0, %s1");
4439 #line 693 "rl78-decode.opc"
4440 ID(mov); DR(A); SM(None, SFR);
4443 break;
4444 case 0x8f:
4446 /** 1000 1111 mov %0, %e!1 */
4447 if (trace)
4449 printf ("\033[33m%s\033[0m %02x\n",
4450 "/** 1000 1111 mov %0, %e!1 */",
4451 op[0]);
4453 SYNTAX("mov %0, %e!1");
4454 #line 651 "rl78-decode.opc"
4455 ID(mov); DR(A); SM(None, IMMU(2));
4458 break;
4459 case 0x90:
4460 case 0x91:
4461 case 0x92:
4462 case 0x93:
4463 case 0x94:
4464 case 0x95:
4465 case 0x96:
4466 case 0x97:
4468 /** 1001 0reg dec %0 */
4469 #line 560 "rl78-decode.opc"
4470 int reg AU = op[0] & 0x07;
4471 if (trace)
4473 printf ("\033[33m%s\033[0m %02x\n",
4474 "/** 1001 0reg dec %0 */",
4475 op[0]);
4476 printf (" reg = 0x%x\n", reg);
4478 SYNTAX("dec %0");
4479 #line 560 "rl78-decode.opc"
4480 ID(sub); DRB(reg); SC(1); Fza;
4483 break;
4484 case 0x98:
4486 /** 1001 1000 mov %a0, %1 */
4487 if (trace)
4489 printf ("\033[33m%s\033[0m %02x\n",
4490 "/** 1001 1000 mov %a0, %1 */",
4491 op[0]);
4493 SYNTAX("mov %a0, %1");
4494 #line 648 "rl78-decode.opc"
4495 ID(mov); DM(SP, IMMU(1)); SR(A);
4498 break;
4499 case 0x99:
4501 /** 1001 1001 mov %e0, %1 */
4502 if (trace)
4504 printf ("\033[33m%s\033[0m %02x\n",
4505 "/** 1001 1001 mov %e0, %1 */",
4506 op[0]);
4508 SYNTAX("mov %e0, %1");
4509 #line 621 "rl78-decode.opc"
4510 ID(mov); DM(DE, 0); SR(A);
4513 break;
4514 case 0x9a:
4516 /** 1001 1010 mov %ea0, %1 */
4517 if (trace)
4519 printf ("\033[33m%s\033[0m %02x\n",
4520 "/** 1001 1010 mov %ea0, %1 */",
4521 op[0]);
4523 SYNTAX("mov %ea0, %1");
4524 #line 627 "rl78-decode.opc"
4525 ID(mov); DM(DE, IMMU(1)); SR(A);
4528 break;
4529 case 0x9b:
4531 /** 1001 1011 mov %e0, %1 */
4532 if (trace)
4534 printf ("\033[33m%s\033[0m %02x\n",
4535 "/** 1001 1011 mov %e0, %1 */",
4536 op[0]);
4538 SYNTAX("mov %e0, %1");
4539 #line 630 "rl78-decode.opc"
4540 ID(mov); DM(HL, 0); SR(A);
4543 break;
4544 case 0x9c:
4546 /** 1001 1100 mov %ea0, %1 */
4547 if (trace)
4549 printf ("\033[33m%s\033[0m %02x\n",
4550 "/** 1001 1100 mov %ea0, %1 */",
4551 op[0]);
4553 SYNTAX("mov %ea0, %1");
4554 #line 639 "rl78-decode.opc"
4555 ID(mov); DM(HL, IMMU(1)); SR(A);
4558 break;
4559 case 0x9d:
4561 /** 1001 1101 mov %0, %1 */
4562 if (trace)
4564 printf ("\033[33m%s\033[0m %02x\n",
4565 "/** 1001 1101 mov %0, %1 */",
4566 op[0]);
4568 SYNTAX("mov %0, %1");
4569 #line 753 "rl78-decode.opc"
4570 ID(mov); DM(None, SADDR); SR(A);
4573 break;
4574 case 0x9e:
4576 /** 1001 1110 mov %s0, %1 */
4577 if (trace)
4579 printf ("\033[33m%s\033[0m %02x\n",
4580 "/** 1001 1110 mov %s0, %1 */",
4581 op[0]);
4583 SYNTAX("mov %s0, %1");
4584 #line 786 "rl78-decode.opc"
4585 ID(mov); DM(None, SFR); SR(A);
4587 /*----------------------------------------------------------------------*/
4590 break;
4591 case 0x9f:
4593 /** 1001 1111 mov %e!0, %1 */
4594 if (trace)
4596 printf ("\033[33m%s\033[0m %02x\n",
4597 "/** 1001 1111 mov %e!0, %1 */",
4598 op[0]);
4600 SYNTAX("mov %e!0, %1");
4601 #line 618 "rl78-decode.opc"
4602 ID(mov); DM(None, IMMU(2)); SR(A);
4605 break;
4606 case 0xa0:
4608 /** 1010 0000 inc %e!0 */
4609 if (trace)
4611 printf ("\033[33m%s\033[0m %02x\n",
4612 "/** 1010 0000 inc %e!0 */",
4613 op[0]);
4615 SYNTAX("inc %e!0");
4616 #line 587 "rl78-decode.opc"
4617 ID(add); DM(None, IMMU(2)); SC(1); Fza;
4620 break;
4621 case 0xa1:
4622 case 0xa3:
4623 case 0xa5:
4624 case 0xa7:
4626 /** 1010 0rg1 incw %0 */
4627 #line 607 "rl78-decode.opc"
4628 int rg AU = (op[0] >> 1) & 0x03;
4629 if (trace)
4631 printf ("\033[33m%s\033[0m %02x\n",
4632 "/** 1010 0rg1 incw %0 */",
4633 op[0]);
4634 printf (" rg = 0x%x\n", rg);
4636 SYNTAX("incw %0");
4637 #line 607 "rl78-decode.opc"
4638 ID(add); W(); DRW(rg); SC(1);
4641 break;
4642 case 0xa2:
4644 /** 1010 0010 incw %e!0 */
4645 if (trace)
4647 printf ("\033[33m%s\033[0m %02x\n",
4648 "/** 1010 0010 incw %e!0 */",
4649 op[0]);
4651 SYNTAX("incw %e!0");
4652 #line 601 "rl78-decode.opc"
4653 ID(add); W(); DM(None, IMMU(2)); SC(1);
4656 break;
4657 case 0xa4:
4659 /** 1010 0100 inc %0 */
4660 if (trace)
4662 printf ("\033[33m%s\033[0m %02x\n",
4663 "/** 1010 0100 inc %0 */",
4664 op[0]);
4666 SYNTAX("inc %0");
4667 #line 596 "rl78-decode.opc"
4668 ID(add); DM(None, SADDR); SC(1); Fza;
4670 /*----------------------------------------------------------------------*/
4673 break;
4674 case 0xa6:
4676 /** 1010 0110 incw %0 */
4677 if (trace)
4679 printf ("\033[33m%s\033[0m %02x\n",
4680 "/** 1010 0110 incw %0 */",
4681 op[0]);
4683 SYNTAX("incw %0");
4684 #line 610 "rl78-decode.opc"
4685 ID(add); W(); DM(None, SADDR); SC(1);
4687 /*----------------------------------------------------------------------*/
4690 break;
4691 case 0xa8:
4693 /** 1010 1000 movw %0, %a1 */
4694 if (trace)
4696 printf ("\033[33m%s\033[0m %02x\n",
4697 "/** 1010 1000 movw %0, %a1 */",
4698 op[0]);
4700 SYNTAX("movw %0, %a1");
4701 #line 856 "rl78-decode.opc"
4702 ID(mov); W(); DR(AX); SM(SP, IMMU(1));
4705 break;
4706 case 0xa9:
4708 /** 1010 1001 movw %0, %e1 */
4709 if (trace)
4711 printf ("\033[33m%s\033[0m %02x\n",
4712 "/** 1010 1001 movw %0, %e1 */",
4713 op[0]);
4715 SYNTAX("movw %0, %e1");
4716 #line 844 "rl78-decode.opc"
4717 ID(mov); W(); DR(AX); SM(DE, 0);
4720 break;
4721 case 0xaa:
4723 /** 1010 1010 movw %0, %ea1 */
4724 if (trace)
4726 printf ("\033[33m%s\033[0m %02x\n",
4727 "/** 1010 1010 movw %0, %ea1 */",
4728 op[0]);
4730 SYNTAX("movw %0, %ea1");
4731 #line 847 "rl78-decode.opc"
4732 ID(mov); W(); DR(AX); SM(DE, IMMU(1));
4735 break;
4736 case 0xab:
4738 /** 1010 1011 movw %0, %e1 */
4739 if (trace)
4741 printf ("\033[33m%s\033[0m %02x\n",
4742 "/** 1010 1011 movw %0, %e1 */",
4743 op[0]);
4745 SYNTAX("movw %0, %e1");
4746 #line 850 "rl78-decode.opc"
4747 ID(mov); W(); DR(AX); SM(HL, 0);
4750 break;
4751 case 0xac:
4753 /** 1010 1100 movw %0, %ea1 */
4754 if (trace)
4756 printf ("\033[33m%s\033[0m %02x\n",
4757 "/** 1010 1100 movw %0, %ea1 */",
4758 op[0]);
4760 SYNTAX("movw %0, %ea1");
4761 #line 853 "rl78-decode.opc"
4762 ID(mov); W(); DR(AX); SM(HL, IMMU(1));
4765 break;
4766 case 0xad:
4768 /** 1010 1101 movw %0, %1 */
4769 if (trace)
4771 printf ("\033[33m%s\033[0m %02x\n",
4772 "/** 1010 1101 movw %0, %1 */",
4773 op[0]);
4775 SYNTAX("movw %0, %1");
4776 #line 886 "rl78-decode.opc"
4777 ID(mov); W(); DR(AX); SM(None, SADDR);
4780 break;
4781 case 0xae:
4783 /** 1010 1110 movw %0, %s1 */
4784 if (trace)
4786 printf ("\033[33m%s\033[0m %02x\n",
4787 "/** 1010 1110 movw %0, %s1 */",
4788 op[0]);
4790 SYNTAX("movw %0, %s1");
4791 #line 889 "rl78-decode.opc"
4792 ID(mov); W(); DR(AX); SM(None, SFR);
4795 break;
4796 case 0xaf:
4798 /** 1010 1111 movw %0, %e!1 */
4799 if (trace)
4801 printf ("\033[33m%s\033[0m %02x\n",
4802 "/** 1010 1111 movw %0, %e!1 */",
4803 op[0]);
4805 SYNTAX("movw %0, %e!1");
4806 #line 840 "rl78-decode.opc"
4807 ID(mov); W(); DR(AX); SM(None, IMMU(2));
4811 break;
4812 case 0xb0:
4814 /** 1011 0000 dec %e!0 */
4815 if (trace)
4817 printf ("\033[33m%s\033[0m %02x\n",
4818 "/** 1011 0000 dec %e!0 */",
4819 op[0]);
4821 SYNTAX("dec %e!0");
4822 #line 554 "rl78-decode.opc"
4823 ID(sub); DM(None, IMMU(2)); SC(1); Fza;
4826 break;
4827 case 0xb1:
4828 case 0xb3:
4829 case 0xb5:
4830 case 0xb7:
4832 /** 1011 0rg1 decw %0 */
4833 #line 574 "rl78-decode.opc"
4834 int rg AU = (op[0] >> 1) & 0x03;
4835 if (trace)
4837 printf ("\033[33m%s\033[0m %02x\n",
4838 "/** 1011 0rg1 decw %0 */",
4839 op[0]);
4840 printf (" rg = 0x%x\n", rg);
4842 SYNTAX("decw %0");
4843 #line 574 "rl78-decode.opc"
4844 ID(sub); W(); DRW(rg); SC(1);
4847 break;
4848 case 0xb2:
4850 /** 1011 0010 decw %e!0 */
4851 if (trace)
4853 printf ("\033[33m%s\033[0m %02x\n",
4854 "/** 1011 0010 decw %e!0 */",
4855 op[0]);
4857 SYNTAX("decw %e!0");
4858 #line 568 "rl78-decode.opc"
4859 ID(sub); W(); DM(None, IMMU(2)); SC(1);
4862 break;
4863 case 0xb4:
4865 /** 1011 0100 dec %0 */
4866 if (trace)
4868 printf ("\033[33m%s\033[0m %02x\n",
4869 "/** 1011 0100 dec %0 */",
4870 op[0]);
4872 SYNTAX("dec %0");
4873 #line 563 "rl78-decode.opc"
4874 ID(sub); DM(None, SADDR); SC(1); Fza;
4876 /*----------------------------------------------------------------------*/
4879 break;
4880 case 0xb6:
4882 /** 1011 0110 decw %0 */
4883 if (trace)
4885 printf ("\033[33m%s\033[0m %02x\n",
4886 "/** 1011 0110 decw %0 */",
4887 op[0]);
4889 SYNTAX("decw %0");
4890 #line 577 "rl78-decode.opc"
4891 ID(sub); W(); DM(None, SADDR); SC(1);
4893 /*----------------------------------------------------------------------*/
4896 break;
4897 case 0xb8:
4899 /** 1011 1000 movw %a0, %1 */
4900 if (trace)
4902 printf ("\033[33m%s\033[0m %02x\n",
4903 "/** 1011 1000 movw %a0, %1 */",
4904 op[0]);
4906 SYNTAX("movw %a0, %1");
4907 #line 837 "rl78-decode.opc"
4908 ID(mov); W(); DM(SP, IMMU(1)); SR(AX);
4911 break;
4912 case 0xb9:
4914 /** 1011 1001 movw %e0, %1 */
4915 if (trace)
4917 printf ("\033[33m%s\033[0m %02x\n",
4918 "/** 1011 1001 movw %e0, %1 */",
4919 op[0]);
4921 SYNTAX("movw %e0, %1");
4922 #line 825 "rl78-decode.opc"
4923 ID(mov); W(); DM(DE, 0); SR(AX);
4926 break;
4927 case 0xba:
4929 /** 1011 1010 movw %ea0, %1 */
4930 if (trace)
4932 printf ("\033[33m%s\033[0m %02x\n",
4933 "/** 1011 1010 movw %ea0, %1 */",
4934 op[0]);
4936 SYNTAX("movw %ea0, %1");
4937 #line 828 "rl78-decode.opc"
4938 ID(mov); W(); DM(DE, IMMU(1)); SR(AX);
4941 break;
4942 case 0xbb:
4944 /** 1011 1011 movw %e0, %1 */
4945 if (trace)
4947 printf ("\033[33m%s\033[0m %02x\n",
4948 "/** 1011 1011 movw %e0, %1 */",
4949 op[0]);
4951 SYNTAX("movw %e0, %1");
4952 #line 831 "rl78-decode.opc"
4953 ID(mov); W(); DM(HL, 0); SR(AX);
4956 break;
4957 case 0xbc:
4959 /** 1011 1100 movw %ea0, %1 */
4960 if (trace)
4962 printf ("\033[33m%s\033[0m %02x\n",
4963 "/** 1011 1100 movw %ea0, %1 */",
4964 op[0]);
4966 SYNTAX("movw %ea0, %1");
4967 #line 834 "rl78-decode.opc"
4968 ID(mov); W(); DM(HL, IMMU(1)); SR(AX);
4971 break;
4972 case 0xbd:
4974 /** 1011 1101 movw %0, %1 */
4975 if (trace)
4977 printf ("\033[33m%s\033[0m %02x\n",
4978 "/** 1011 1101 movw %0, %1 */",
4979 op[0]);
4981 SYNTAX("movw %0, %1");
4982 #line 901 "rl78-decode.opc"
4983 ID(mov); W(); DM(None, SADDR); SR(AX);
4986 break;
4987 case 0xbe:
4989 /** 1011 1110 movw %s0, %1 */
4990 if (trace)
4992 printf ("\033[33m%s\033[0m %02x\n",
4993 "/** 1011 1110 movw %s0, %1 */",
4994 op[0]);
4996 SYNTAX("movw %s0, %1");
4997 #line 907 "rl78-decode.opc"
4998 ID(mov); W(); DM(None, SFR); SR(AX);
5000 /*----------------------------------------------------------------------*/
5003 break;
5004 case 0xbf:
5006 /** 1011 1111 movw %e!0, %1 */
5007 if (trace)
5009 printf ("\033[33m%s\033[0m %02x\n",
5010 "/** 1011 1111 movw %e!0, %1 */",
5011 op[0]);
5013 SYNTAX("movw %e!0, %1");
5014 #line 822 "rl78-decode.opc"
5015 ID(mov); W(); DM(None, IMMU(2)); SR(AX);
5018 break;
5019 case 0xc0:
5020 case 0xc2:
5021 case 0xc4:
5022 case 0xc6:
5024 /** 1100 0rg0 pop %0 */
5025 #line 992 "rl78-decode.opc"
5026 int rg AU = (op[0] >> 1) & 0x03;
5027 if (trace)
5029 printf ("\033[33m%s\033[0m %02x\n",
5030 "/** 1100 0rg0 pop %0 */",
5031 op[0]);
5032 printf (" rg = 0x%x\n", rg);
5034 SYNTAX("pop %0");
5035 #line 992 "rl78-decode.opc"
5036 ID(mov); W(); DRW(rg); SPOP();
5039 break;
5040 case 0xc1:
5041 case 0xc3:
5042 case 0xc5:
5043 case 0xc7:
5045 /** 1100 0rg1 push %1 */
5046 #line 1000 "rl78-decode.opc"
5047 int rg AU = (op[0] >> 1) & 0x03;
5048 if (trace)
5050 printf ("\033[33m%s\033[0m %02x\n",
5051 "/** 1100 0rg1 push %1 */",
5052 op[0]);
5053 printf (" rg = 0x%x\n", rg);
5055 SYNTAX("push %1");
5056 #line 1000 "rl78-decode.opc"
5057 ID(mov); W(); DPUSH(); SRW(rg);
5060 break;
5061 case 0xc8:
5063 /** 1100 1000 mov %a0, #%1 */
5064 if (trace)
5066 printf ("\033[33m%s\033[0m %02x\n",
5067 "/** 1100 1000 mov %a0, #%1 */",
5068 op[0]);
5070 SYNTAX("mov %a0, #%1");
5071 #line 645 "rl78-decode.opc"
5072 ID(mov); DM(SP, IMMU(1)); SC(IMMU(1));
5075 break;
5076 case 0xc9:
5078 /** 1100 1001 movw %0, #%1 */
5079 if (trace)
5081 printf ("\033[33m%s\033[0m %02x\n",
5082 "/** 1100 1001 movw %0, #%1 */",
5083 op[0]);
5085 SYNTAX("movw %0, #%1");
5086 #line 898 "rl78-decode.opc"
5087 ID(mov); W(); DM(None, SADDR); SC(IMMU(2));
5090 break;
5091 case 0xca:
5093 /** 1100 1010 mov %ea0, #%1 */
5094 if (trace)
5096 printf ("\033[33m%s\033[0m %02x\n",
5097 "/** 1100 1010 mov %ea0, #%1 */",
5098 op[0]);
5100 SYNTAX("mov %ea0, #%1");
5101 #line 624 "rl78-decode.opc"
5102 ID(mov); DM(DE, IMMU(1)); SC(IMMU(1));
5105 break;
5106 case 0xcb:
5108 /** 1100 1011 movw %s0, #%1 */
5109 if (trace)
5111 printf ("\033[33m%s\033[0m %02x\n",
5112 "/** 1100 1011 movw %s0, #%1 */",
5113 op[0]);
5115 SYNTAX("movw %s0, #%1");
5116 #line 904 "rl78-decode.opc"
5117 ID(mov); W(); DM(None, SFR); SC(IMMU(2));
5120 break;
5121 case 0xcc:
5123 /** 1100 1100 mov %ea0, #%1 */
5124 if (trace)
5126 printf ("\033[33m%s\033[0m %02x\n",
5127 "/** 1100 1100 mov %ea0, #%1 */",
5128 op[0]);
5130 SYNTAX("mov %ea0, #%1");
5131 #line 636 "rl78-decode.opc"
5132 ID(mov); DM(HL, IMMU(1)); SC(IMMU(1));
5135 break;
5136 case 0xcd:
5138 /** 1100 1101 mov %0, #%1 */
5139 if (trace)
5141 printf ("\033[33m%s\033[0m %02x\n",
5142 "/** 1100 1101 mov %0, #%1 */",
5143 op[0]);
5145 SYNTAX("mov %0, #%1");
5146 #line 750 "rl78-decode.opc"
5147 ID(mov); DM(None, SADDR); SC(IMMU(1));
5150 break;
5151 case 0xce:
5153 /** 1100 1110 mov %s0, #%1 */
5154 if (trace)
5156 printf ("\033[33m%s\033[0m %02x\n",
5157 "/** 1100 1110 mov %s0, #%1 */",
5158 op[0]);
5160 SYNTAX("mov %s0, #%1");
5161 #line 756 "rl78-decode.opc"
5162 op0 = SFR;
5163 op1 = IMMU(1);
5164 ID(mov); DM(None, op0); SC(op1);
5165 if (op0 == 0xffffb && isa == RL78_ISA_G14)
5166 switch (op1)
5168 case 0x01:
5169 rl78->syntax = "mulhu"; ID(mulhu);
5170 break;
5171 case 0x02:
5172 rl78->syntax = "mulh"; ID(mulh);
5173 break;
5174 case 0x03:
5175 rl78->syntax = "divhu"; ID(divhu);
5176 break;
5177 case 0x04:
5178 rl78->syntax = "divwu <old-encoding>"; ID(divwu);
5179 break;
5180 case 0x05:
5181 rl78->syntax = "machu"; ID(machu);
5182 break;
5183 case 0x06:
5184 rl78->syntax = "mach"; ID(mach);
5185 break;
5186 case 0x0b:
5187 rl78->syntax = "divwu"; ID(divwu);
5188 break;
5192 break;
5193 case 0xcf:
5195 /** 1100 1111 mov %e!0, #%1 */
5196 if (trace)
5198 printf ("\033[33m%s\033[0m %02x\n",
5199 "/** 1100 1111 mov %e!0, #%1 */",
5200 op[0]);
5202 SYNTAX("mov %e!0, #%1");
5203 #line 615 "rl78-decode.opc"
5204 ID(mov); DM(None, IMMU(2)); SC(IMMU(1));
5207 break;
5208 case 0xd0:
5209 case 0xd1:
5210 case 0xd2:
5211 case 0xd3:
5213 /** 1101 00rg cmp0 %0 */
5214 #line 524 "rl78-decode.opc"
5215 int rg AU = op[0] & 0x03;
5216 if (trace)
5218 printf ("\033[33m%s\033[0m %02x\n",
5219 "/** 1101 00rg cmp0 %0 */",
5220 op[0]);
5221 printf (" rg = 0x%x\n", rg);
5223 SYNTAX("cmp0 %0");
5224 #line 524 "rl78-decode.opc"
5225 ID(cmp); DRB(rg); SC(0); Fzac;
5228 break;
5229 case 0xd4:
5231 /** 1101 0100 cmp0 %0 */
5232 if (trace)
5234 printf ("\033[33m%s\033[0m %02x\n",
5235 "/** 1101 0100 cmp0 %0 */",
5236 op[0]);
5238 SYNTAX("cmp0 %0");
5239 #line 527 "rl78-decode.opc"
5240 ID(cmp); DM(None, SADDR); SC(0); Fzac;
5242 /*----------------------------------------------------------------------*/
5245 break;
5246 case 0xd5:
5248 /** 1101 0101 cmp0 %e!0 */
5249 if (trace)
5251 printf ("\033[33m%s\033[0m %02x\n",
5252 "/** 1101 0101 cmp0 %e!0 */",
5253 op[0]);
5255 SYNTAX("cmp0 %e!0");
5256 #line 521 "rl78-decode.opc"
5257 ID(cmp); DM(None, IMMU(2)); SC(0); Fzac;
5260 break;
5261 case 0xd6:
5263 /** 1101 0110 mulu x */
5264 if (trace)
5266 printf ("\033[33m%s\033[0m %02x\n",
5267 "/** 1101 0110 mulu x */",
5268 op[0]);
5270 SYNTAX("mulu x");
5271 #line 912 "rl78-decode.opc"
5272 ID(mulu);
5274 /*----------------------------------------------------------------------*/
5277 break;
5278 case 0xd7:
5280 /** 1101 0111 ret */
5281 if (trace)
5283 printf ("\033[33m%s\033[0m %02x\n",
5284 "/** 1101 0111 ret */",
5285 op[0]);
5287 SYNTAX("ret");
5288 #line 1008 "rl78-decode.opc"
5289 ID(ret);
5292 break;
5293 case 0xd8:
5295 /** 1101 1000 mov %0, %1 */
5296 if (trace)
5298 printf ("\033[33m%s\033[0m %02x\n",
5299 "/** 1101 1000 mov %0, %1 */",
5300 op[0]);
5302 SYNTAX("mov %0, %1");
5303 #line 717 "rl78-decode.opc"
5304 ID(mov); DR(X); SM(None, SADDR);
5307 break;
5308 case 0xd9:
5310 /** 1101 1001 mov %0, %e!1 */
5311 if (trace)
5313 printf ("\033[33m%s\033[0m %02x\n",
5314 "/** 1101 1001 mov %0, %e!1 */",
5315 op[0]);
5317 SYNTAX("mov %0, %e!1");
5318 #line 714 "rl78-decode.opc"
5319 ID(mov); DR(X); SM(None, IMMU(2));
5322 break;
5323 case 0xda:
5324 case 0xea:
5325 case 0xfa:
5327 /** 11ra 1010 movw %0, %1 */
5328 #line 895 "rl78-decode.opc"
5329 int ra AU = (op[0] >> 4) & 0x03;
5330 if (trace)
5332 printf ("\033[33m%s\033[0m %02x\n",
5333 "/** 11ra 1010 movw %0, %1 */",
5334 op[0]);
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);
5342 break;
5343 case 0xdb:
5344 case 0xeb:
5345 case 0xfb:
5347 /** 11ra 1011 movw %0, %es!1 */
5348 #line 892 "rl78-decode.opc"
5349 int ra AU = (op[0] >> 4) & 0x03;
5350 if (trace)
5352 printf ("\033[33m%s\033[0m %02x\n",
5353 "/** 11ra 1011 movw %0, %es!1 */",
5354 op[0]);
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));
5362 break;
5363 case 0xdc:
5365 /** 1101 1100 bc $%a0 */
5366 if (trace)
5368 printf ("\033[33m%s\033[0m %02x\n",
5369 "/** 1101 1100 bc $%a0 */",
5370 op[0]);
5372 SYNTAX("bc $%a0");
5373 #line 340 "rl78-decode.opc"
5374 ID(branch_cond); DC(pc+IMMS(1)+2); SR(None); COND(C);
5377 break;
5378 case 0xdd:
5380 /** 1101 1101 bz $%a0 */
5381 if (trace)
5383 printf ("\033[33m%s\033[0m %02x\n",
5384 "/** 1101 1101 bz $%a0 */",
5385 op[0]);
5387 SYNTAX("bz $%a0");
5388 #line 352 "rl78-decode.opc"
5389 ID(branch_cond); DC(pc+IMMS(1)+2); SR(None); COND(Z);
5392 break;
5393 case 0xde:
5395 /** 1101 1110 bnc $%a0 */
5396 if (trace)
5398 printf ("\033[33m%s\033[0m %02x\n",
5399 "/** 1101 1110 bnc $%a0 */",
5400 op[0]);
5402 SYNTAX("bnc $%a0");
5403 #line 343 "rl78-decode.opc"
5404 ID(branch_cond); DC(pc+IMMS(1)+2); SR(None); COND(NC);
5407 break;
5408 case 0xdf:
5410 /** 1101 1111 bnz $%a0 */
5411 if (trace)
5413 printf ("\033[33m%s\033[0m %02x\n",
5414 "/** 1101 1111 bnz $%a0 */",
5415 op[0]);
5417 SYNTAX("bnz $%a0");
5418 #line 355 "rl78-decode.opc"
5419 ID(branch_cond); DC(pc+IMMS(1)+2); SR(None); COND(NZ);
5421 /*----------------------------------------------------------------------*/
5424 break;
5425 case 0xe0:
5426 case 0xe1:
5427 case 0xe2:
5428 case 0xe3:
5430 /** 1110 00rg oneb %0 */
5431 #line 930 "rl78-decode.opc"
5432 int rg AU = op[0] & 0x03;
5433 if (trace)
5435 printf ("\033[33m%s\033[0m %02x\n",
5436 "/** 1110 00rg oneb %0 */",
5437 op[0]);
5438 printf (" rg = 0x%x\n", rg);
5440 SYNTAX("oneb %0");
5441 #line 930 "rl78-decode.opc"
5442 ID(mov); DRB(rg); SC(1);
5445 break;
5446 case 0xe4:
5448 /** 1110 0100 oneb %0 */
5449 if (trace)
5451 printf ("\033[33m%s\033[0m %02x\n",
5452 "/** 1110 0100 oneb %0 */",
5453 op[0]);
5455 SYNTAX("oneb %0");
5456 #line 933 "rl78-decode.opc"
5457 ID(mov); DM(None, SADDR); SC(1);
5459 /*----------------------------------------------------------------------*/
5462 break;
5463 case 0xe5:
5465 /** 1110 0101 oneb %e!0 */
5466 if (trace)
5468 printf ("\033[33m%s\033[0m %02x\n",
5469 "/** 1110 0101 oneb %e!0 */",
5470 op[0]);
5472 SYNTAX("oneb %e!0");
5473 #line 927 "rl78-decode.opc"
5474 ID(mov); DM(None, IMMU(2)); SC(1);
5477 break;
5478 case 0xe6:
5480 /** 1110 0110 onew %0 */
5481 if (trace)
5483 printf ("\033[33m%s\033[0m %02x\n",
5484 "/** 1110 0110 onew %0 */",
5485 op[0]);
5487 SYNTAX("onew %0");
5488 #line 938 "rl78-decode.opc"
5489 ID(mov); DR(AX); SC(1);
5492 break;
5493 case 0xe7:
5495 /** 1110 0111 onew %0 */
5496 if (trace)
5498 printf ("\033[33m%s\033[0m %02x\n",
5499 "/** 1110 0111 onew %0 */",
5500 op[0]);
5502 SYNTAX("onew %0");
5503 #line 941 "rl78-decode.opc"
5504 ID(mov); DR(BC); SC(1);
5506 /*----------------------------------------------------------------------*/
5509 break;
5510 case 0xe8:
5512 /** 1110 1000 mov %0, %1 */
5513 if (trace)
5515 printf ("\033[33m%s\033[0m %02x\n",
5516 "/** 1110 1000 mov %0, %1 */",
5517 op[0]);
5519 SYNTAX("mov %0, %1");
5520 #line 705 "rl78-decode.opc"
5521 ID(mov); DR(B); SM(None, SADDR);
5524 break;
5525 case 0xe9:
5527 /** 1110 1001 mov %0, %e!1 */
5528 if (trace)
5530 printf ("\033[33m%s\033[0m %02x\n",
5531 "/** 1110 1001 mov %0, %e!1 */",
5532 op[0]);
5534 SYNTAX("mov %0, %e!1");
5535 #line 699 "rl78-decode.opc"
5536 ID(mov); DR(B); SM(None, IMMU(2));
5539 break;
5540 case 0xec:
5542 /** 1110 1100 br !%!a0 */
5543 if (trace)
5545 printf ("\033[33m%s\033[0m %02x\n",
5546 "/** 1110 1100 br !%!a0 */",
5547 op[0]);
5549 SYNTAX("br !%!a0");
5550 #line 374 "rl78-decode.opc"
5551 ID(branch); DC(IMMU(3));
5554 break;
5555 case 0xed:
5557 /** 1110 1101 br %!a0 */
5558 if (trace)
5560 printf ("\033[33m%s\033[0m %02x\n",
5561 "/** 1110 1101 br %!a0 */",
5562 op[0]);
5564 SYNTAX("br %!a0");
5565 #line 377 "rl78-decode.opc"
5566 ID(branch); DC(IMMU(2));
5569 break;
5570 case 0xee:
5572 /** 1110 1110 br $%!a0 */
5573 if (trace)
5575 printf ("\033[33m%s\033[0m %02x\n",
5576 "/** 1110 1110 br $%!a0 */",
5577 op[0]);
5579 SYNTAX("br $%!a0");
5580 #line 380 "rl78-decode.opc"
5581 ID(branch); DC(pc+IMMS(2)+3);
5584 break;
5585 case 0xef:
5587 /** 1110 1111 br $%a0 */
5588 if (trace)
5590 printf ("\033[33m%s\033[0m %02x\n",
5591 "/** 1110 1111 br $%a0 */",
5592 op[0]);
5594 SYNTAX("br $%a0");
5595 #line 383 "rl78-decode.opc"
5596 ID(branch); DC(pc+IMMS(1)+2);
5599 break;
5600 case 0xf0:
5601 case 0xf1:
5602 case 0xf2:
5603 case 0xf3:
5605 /** 1111 00rg clrb %0 */
5606 #line 470 "rl78-decode.opc"
5607 int rg AU = op[0] & 0x03;
5608 if (trace)
5610 printf ("\033[33m%s\033[0m %02x\n",
5611 "/** 1111 00rg clrb %0 */",
5612 op[0]);
5613 printf (" rg = 0x%x\n", rg);
5615 SYNTAX("clrb %0");
5616 #line 470 "rl78-decode.opc"
5617 ID(mov); DRB(rg); SC(0);
5620 break;
5621 case 0xf4:
5623 /** 1111 0100 clrb %0 */
5624 if (trace)
5626 printf ("\033[33m%s\033[0m %02x\n",
5627 "/** 1111 0100 clrb %0 */",
5628 op[0]);
5630 SYNTAX("clrb %0");
5631 #line 473 "rl78-decode.opc"
5632 ID(mov); DM(None, SADDR); SC(0);
5634 /*----------------------------------------------------------------------*/
5637 break;
5638 case 0xf5:
5640 /** 1111 0101 clrb %e!0 */
5641 if (trace)
5643 printf ("\033[33m%s\033[0m %02x\n",
5644 "/** 1111 0101 clrb %e!0 */",
5645 op[0]);
5647 SYNTAX("clrb %e!0");
5648 #line 467 "rl78-decode.opc"
5649 ID(mov); DM(None, IMMU(2)); SC(0);
5652 break;
5653 case 0xf6:
5655 /** 1111 0110 clrw %0 */
5656 if (trace)
5658 printf ("\033[33m%s\033[0m %02x\n",
5659 "/** 1111 0110 clrw %0 */",
5660 op[0]);
5662 SYNTAX("clrw %0");
5663 #line 478 "rl78-decode.opc"
5664 ID(mov); DR(AX); SC(0);
5667 break;
5668 case 0xf7:
5670 /** 1111 0111 clrw %0 */
5671 if (trace)
5673 printf ("\033[33m%s\033[0m %02x\n",
5674 "/** 1111 0111 clrw %0 */",
5675 op[0]);
5677 SYNTAX("clrw %0");
5678 #line 481 "rl78-decode.opc"
5679 ID(mov); DR(BC); SC(0);
5681 /*----------------------------------------------------------------------*/
5684 break;
5685 case 0xf8:
5687 /** 1111 1000 mov %0, %1 */
5688 if (trace)
5690 printf ("\033[33m%s\033[0m %02x\n",
5691 "/** 1111 1000 mov %0, %1 */",
5692 op[0]);
5694 SYNTAX("mov %0, %1");
5695 #line 711 "rl78-decode.opc"
5696 ID(mov); DR(C); SM(None, SADDR);
5699 break;
5700 case 0xf9:
5702 /** 1111 1001 mov %0, %e!1 */
5703 if (trace)
5705 printf ("\033[33m%s\033[0m %02x\n",
5706 "/** 1111 1001 mov %0, %e!1 */",
5707 op[0]);
5709 SYNTAX("mov %0, %e!1");
5710 #line 708 "rl78-decode.opc"
5711 ID(mov); DR(C); SM(None, IMMU(2));
5714 break;
5715 case 0xfc:
5717 /** 1111 1100 call !%!a0 */
5718 if (trace)
5720 printf ("\033[33m%s\033[0m %02x\n",
5721 "/** 1111 1100 call !%!a0 */",
5722 op[0]);
5724 SYNTAX("call !%!a0");
5725 #line 427 "rl78-decode.opc"
5726 ID(call); DC(IMMU(3));
5729 break;
5730 case 0xfd:
5732 /** 1111 1101 call %!a0 */
5733 if (trace)
5735 printf ("\033[33m%s\033[0m %02x\n",
5736 "/** 1111 1101 call %!a0 */",
5737 op[0]);
5739 SYNTAX("call %!a0");
5740 #line 430 "rl78-decode.opc"
5741 ID(call); DC(IMMU(2));
5744 break;
5745 case 0xfe:
5747 /** 1111 1110 call $%!a0 */
5748 if (trace)
5750 printf ("\033[33m%s\033[0m %02x\n",
5751 "/** 1111 1110 call $%!a0 */",
5752 op[0]);
5754 SYNTAX("call $%!a0");
5755 #line 433 "rl78-decode.opc"
5756 ID(call); DC(pc+IMMS(2)+3);
5759 break;
5760 case 0xff:
5762 /** 1111 1111 brk1 */
5763 if (trace)
5765 printf ("\033[33m%s\033[0m %02x\n",
5766 "/** 1111 1111 brk1 */",
5767 op[0]);
5769 SYNTAX("brk1");
5770 #line 391 "rl78-decode.opc"
5771 ID(break);
5774 break;
5776 #line 1296 "rl78-decode.opc"
5778 return rl78->n_bytes;