Convert generic probe interface to C++ (and perform some cleanups)
[external/binutils.git] / opcodes / rl78-decode.c
1 #line 1 "rl78-decode.opc"
2 /* -*- c -*- */
3 /* Copyright (C) 2012-2017 Free Software Foundation, Inc.
4    Contributed by Red Hat.
5    Written by DJ Delorie.
6
7    This file is part of the GNU opcodes library.
8
9    This library is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 3, or (at your option)
12    any later version.
13
14    It is distributed in the hope that it will be useful, but WITHOUT
15    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
17    License for more details.
18
19    You should have received a copy of the GNU General Public License
20    along with this program; if not, write to the Free Software
21    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
22    MA 02110-1301, USA.  */
23
24 #include "sysdep.h"
25 #include <stdio.h>
26 #include <stdlib.h>
27 #include <string.h>
28 #include "ansidecl.h"
29 #include "opcode/rl78.h"
30
31 static int trace = 0;
32
33 typedef struct
34 {
35   RL78_Opcode_Decoded * rl78;
36   int (* getbyte)(void *);
37   void * ptr;
38   unsigned char * op;
39 } LocalData;
40
41 #define ID(x) rl78->id = RLO_##x, rl78->lineno = __LINE__
42 #define OP(n,t,r,a) (rl78->op[n].type = t, \
43                      rl78->op[n].reg = r,            \
44                      rl78->op[n].addend = a )
45 #define OPX(n,t,r1,r2,a) \
46         (rl78->op[n].type = t, \
47         rl78->op[n].reg = r1, \
48         rl78->op[n].reg2 = r2, \
49         rl78->op[n].addend = a )
50
51 #define W() rl78->size = RL78_Word
52
53 #define AU ATTRIBUTE_UNUSED
54
55 #define OP_BUF_LEN 20
56 #define GETBYTE() (ld->rl78->n_bytes < (OP_BUF_LEN - 1) ? ld->op [ld->rl78->n_bytes++] = ld->getbyte (ld->ptr): 0)
57 #define B ((unsigned long) GETBYTE())
58
59 #define SYNTAX(x) rl78->syntax = x
60
61 #define UNSUPPORTED() \
62   rl78->syntax = "*unknown*"
63
64 #define RB(x) ((x)+RL78_Reg_X)
65 #define RW(x) ((x)+RL78_Reg_AX)
66
67 #define Fz      rl78->flags = RL78_PSW_Z
68 #define Fza     rl78->flags = RL78_PSW_Z | RL78_PSW_AC
69 #define Fzc     rl78->flags = RL78_PSW_Z | RL78_PSW_CY
70 #define Fzac    rl78->flags = RL78_PSW_Z | RL78_PSW_AC | RL78_PSW_CY
71 #define Fa      rl78->flags = RL78_PSW_AC
72 #define Fc      rl78->flags = RL78_PSW_CY
73 #define Fac     rl78->flags = RL78_PSW_AC | RL78_PSW_CY
74
75 #define IMMU(bytes)   immediate (bytes, 0, ld)
76 #define IMMS(bytes)   immediate (bytes, 1, ld)
77
78 static int
79 immediate (int bytes, int sign_extend, LocalData * ld)
80 {
81   unsigned long i = 0;
82
83   switch (bytes)
84     {
85     case 1:
86       i |= B;
87       if (sign_extend && (i & 0x80))
88         i -= 0x100;
89       break;
90     case 2:
91       i |= B;
92       i |= B << 8;
93       if (sign_extend && (i & 0x8000))
94         i -= 0x10000;
95       break;
96     case 3:
97       i |= B;
98       i |= B << 8;
99       i |= B << 16;
100       if (sign_extend && (i & 0x800000))
101         i -= 0x1000000;
102       break;
103     default:
104       fprintf (stderr, "Programmer error: immediate() called with invalid byte count %d\n", bytes);
105       abort();
106     }
107   return i;
108 }
109
110 #define DC(c)           OP (0, RL78_Operand_Immediate, 0, c)
111 #define DR(r)           OP (0, RL78_Operand_Register, RL78_Reg_##r, 0)
112 #define DRB(r)          OP (0, RL78_Operand_Register, RB(r), 0)
113 #define DRW(r)          OP (0, RL78_Operand_Register, RW(r), 0)
114 #define DM(r,a)         OP (0, RL78_Operand_Indirect, RL78_Reg_##r, a)
115 #define DM2(r1,r2,a)    OPX (0, RL78_Operand_Indirect, RL78_Reg_##r1, RL78_Reg_##r2, a)
116 #define DE()            rl78->op[0].use_es = 1
117 #define DB(b)           set_bit (rl78->op, b)
118 #define DCY()           DR(PSW); DB(0)
119 #define DPUSH()         OP (0, RL78_Operand_PreDec, RL78_Reg_SP, 0);
120
121 #define SC(c)           OP (1, RL78_Operand_Immediate, 0, c)
122 #define SR(r)           OP (1, RL78_Operand_Register, RL78_Reg_##r, 0)
123 #define SRB(r)          OP (1, RL78_Operand_Register, RB(r), 0)
124 #define SRW(r)          OP (1, RL78_Operand_Register, RW(r), 0)
125 #define SM(r,a)         OP (1, RL78_Operand_Indirect, RL78_Reg_##r, a)
126 #define SM2(r1,r2,a)    OPX (1, RL78_Operand_Indirect, RL78_Reg_##r1, RL78_Reg_##r2, a)
127 #define SE()            rl78->op[1].use_es = 1
128 #define SB(b)           set_bit (rl78->op+1, b)
129 #define SCY()           SR(PSW); SB(0)
130 #define COND(c)         rl78->op[1].condition = RL78_Condition_##c
131 #define SPOP()          OP (1, RL78_Operand_PostInc, RL78_Reg_SP, 0);
132
133 static void
134 set_bit (RL78_Opcode_Operand *op, int bit)
135 {
136   op->bit_number = bit;
137   switch (op->type) {
138   case RL78_Operand_Register:
139     op->type = RL78_Operand_Bit;
140     break;
141   case RL78_Operand_Indirect:
142     op->type = RL78_Operand_BitIndirect;
143     break;
144   default:
145     break;
146   }
147 }
148
149 static int
150 saddr (int x)
151 {
152   if (x < 0x20)
153     return 0xfff00 + x;
154   return 0xffe00 + x;
155 }
156
157 static int
158 sfr (int x)
159 {
160   return 0xfff00 + x;
161 }
162
163 #define SADDR saddr (IMMU (1))
164 #define SFR sfr (IMMU (1))
165
166 int
167 rl78_decode_opcode (unsigned long pc AU,
168                   RL78_Opcode_Decoded * rl78,
169                   int (* getbyte)(void *),
170                   void * ptr,
171                   RL78_Dis_Isa isa)
172 {
173   LocalData lds, * ld = &lds;
174   unsigned char op_buf[OP_BUF_LEN] = {0};
175   unsigned char *op = op_buf;
176   int op0, op1;
177
178   lds.rl78 = rl78;
179   lds.getbyte = getbyte;
180   lds.ptr = ptr;
181   lds.op = op;
182
183   memset (rl78, 0, sizeof (*rl78));
184
185  start_again:
186
187 /* Byte registers, not including A.  */
188 /* Word registers, not including AX.  */
189
190 /*----------------------------------------------------------------------*/
191 /* ES: prefix                                                           */
192
193   GETBYTE ();
194   switch (op[0] & 0xff)
195   {
196     case 0x00:
197         {
198           /** 0000 0000                 nop                                     */
199           if (trace)
200             {
201               printf ("\033[33m%s\033[0m  %02x\n",
202                      "/** 0000 0000                     nop                                     */",
203                      op[0]);
204             }
205           SYNTAX("nop");
206 #line 913 "rl78-decode.opc"
207           ID(nop);
208
209         /*----------------------------------------------------------------------*/
210
211         }
212       break;
213     case 0x01:
214     case 0x03:
215     case 0x05:
216     case 0x07:
217         {
218           /** 0000 0rw1                 addw    %0, %1                          */
219 #line 276 "rl78-decode.opc"
220           int rw AU = (op[0] >> 1) & 0x03;
221           if (trace)
222             {
223               printf ("\033[33m%s\033[0m  %02x\n",
224                      "/** 0000 0rw1                     addw    %0, %1                          */",
225                      op[0]);
226               printf ("  rw = 0x%x\n", rw);
227             }
228           SYNTAX("addw  %0, %1");
229 #line 276 "rl78-decode.opc"
230           ID(add); W(); DR(AX); SRW(rw); Fzac;
231
232         }
233       break;
234     case 0x02:
235         {
236           /** 0000 0010                 addw    %0, %e!1                        */
237           if (trace)
238             {
239               printf ("\033[33m%s\033[0m  %02x\n",
240                      "/** 0000 0010                     addw    %0, %e!1                        */",
241                      op[0]);
242             }
243           SYNTAX("addw  %0, %e!1");
244 #line 267 "rl78-decode.opc"
245           ID(add); W(); DR(AX); SM(None, IMMU(2)); Fzac;
246
247         }
248       break;
249     case 0x04:
250         {
251           /** 0000 0100                 addw    %0, #%1                         */
252           if (trace)
253             {
254               printf ("\033[33m%s\033[0m  %02x\n",
255                      "/** 0000 0100                     addw    %0, #%1                         */",
256                      op[0]);
257             }
258           SYNTAX("addw  %0, #%1");
259 #line 273 "rl78-decode.opc"
260           ID(add); W(); DR(AX); SC(IMMU(2)); Fzac;
261
262         }
263       break;
264     case 0x06:
265         {
266           /** 0000 0110                 addw    %0, %1                          */
267           if (trace)
268             {
269               printf ("\033[33m%s\033[0m  %02x\n",
270                      "/** 0000 0110                     addw    %0, %1                          */",
271                      op[0]);
272             }
273           SYNTAX("addw  %0, %1");
274 #line 279 "rl78-decode.opc"
275           ID(add); W(); DR(AX); SM(None, SADDR); Fzac;
276
277         }
278       break;
279     case 0x08:
280         {
281           /** 0000 1000                 xch     a, x                            */
282           if (trace)
283             {
284               printf ("\033[33m%s\033[0m  %02x\n",
285                      "/** 0000 1000                     xch     a, x                            */",
286                      op[0]);
287             }
288           SYNTAX("xch   a, x");
289 #line 1236 "rl78-decode.opc"
290           ID(xch); DR(A); SR(X);
291
292         /*----------------------------------------------------------------------*/
293
294         }
295       break;
296     case 0x09:
297         {
298           /** 0000 1001                 mov     %0, %e1                         */
299           if (trace)
300             {
301               printf ("\033[33m%s\033[0m  %02x\n",
302                      "/** 0000 1001                     mov     %0, %e1                         */",
303                      op[0]);
304             }
305           SYNTAX("mov   %0, %e1");
306 #line 680 "rl78-decode.opc"
307           ID(mov); DR(A); SM(B, IMMU(2));
308
309         }
310       break;
311     case 0x0a:
312         {
313           /** 0000 1010                 add     %0, #%1                         */
314           if (trace)
315             {
316               printf ("\033[33m%s\033[0m  %02x\n",
317                      "/** 0000 1010                     add     %0, #%1                         */",
318                      op[0]);
319             }
320           SYNTAX("add   %0, #%1");
321 #line 230 "rl78-decode.opc"
322           ID(add); DM(None, SADDR); SC(IMMU(1)); Fzac;
323
324         /*----------------------------------------------------------------------*/
325
326         }
327       break;
328     case 0x0b:
329         {
330           /** 0000 1011                 add     %0, %1                          */
331           if (trace)
332             {
333               printf ("\033[33m%s\033[0m  %02x\n",
334                      "/** 0000 1011                     add     %0, %1                          */",
335                      op[0]);
336             }
337           SYNTAX("add   %0, %1");
338 #line 224 "rl78-decode.opc"
339           ID(add); DR(A); SM(None, SADDR); Fzac;
340
341         }
342       break;
343     case 0x0c:
344         {
345           /** 0000 1100                 add     %0, #%1                         */
346           if (trace)
347             {
348               printf ("\033[33m%s\033[0m  %02x\n",
349                      "/** 0000 1100                     add     %0, #%1                         */",
350                      op[0]);
351             }
352           SYNTAX("add   %0, #%1");
353 #line 218 "rl78-decode.opc"
354           ID(add); DR(A); SC(IMMU(1)); Fzac;
355
356         }
357       break;
358     case 0x0d:
359         {
360           /** 0000 1101                 add     %0, %e1                         */
361           if (trace)
362             {
363               printf ("\033[33m%s\033[0m  %02x\n",
364                      "/** 0000 1101                     add     %0, %e1                         */",
365                      op[0]);
366             }
367           SYNTAX("add   %0, %e1");
368 #line 206 "rl78-decode.opc"
369           ID(add); DR(A); SM(HL, 0); Fzac;
370
371         }
372       break;
373     case 0x0e:
374         {
375           /** 0000 1110                 add     %0, %ea1                        */
376           if (trace)
377             {
378               printf ("\033[33m%s\033[0m  %02x\n",
379                      "/** 0000 1110                     add     %0, %ea1                        */",
380                      op[0]);
381             }
382           SYNTAX("add   %0, %ea1");
383 #line 212 "rl78-decode.opc"
384           ID(add); DR(A); SM(HL, IMMU(1)); Fzac;
385
386         }
387       break;
388     case 0x0f:
389         {
390           /** 0000 1111                 add     %0, %e!1                        */
391           if (trace)
392             {
393               printf ("\033[33m%s\033[0m  %02x\n",
394                      "/** 0000 1111                     add     %0, %e!1                        */",
395                      op[0]);
396             }
397           SYNTAX("add   %0, %e!1");
398 #line 203 "rl78-decode.opc"
399           ID(add); DR(A); SM(None, IMMU(2)); Fzac;
400
401         }
402       break;
403     case 0x10:
404         {
405           /** 0001 0000                 addw    %0, #%1                         */
406           if (trace)
407             {
408               printf ("\033[33m%s\033[0m  %02x\n",
409                      "/** 0001 0000                     addw    %0, #%1                         */",
410                      op[0]);
411             }
412           SYNTAX("addw  %0, #%1");
413 #line 282 "rl78-decode.opc"
414           ID(add); W(); DR(SP); SC(IMMU(1)); Fzac;
415
416         /*----------------------------------------------------------------------*/
417
418         }
419       break;
420     case 0x11:
421         {
422           /** 0001 0001                 es:                                     */
423           if (trace)
424             {
425               printf ("\033[33m%s\033[0m  %02x\n",
426                      "/** 0001 0001                     es:                                     */",
427                      op[0]);
428             }
429           SYNTAX("es:");
430 #line 195 "rl78-decode.opc"
431           DE(); SE();
432           op ++;
433           pc ++;
434           goto start_again;
435
436         /*----------------------------------------------------------------------*/
437
438         }
439       break;
440     case 0x12:
441     case 0x14:
442     case 0x16:
443         {
444           /** 0001 0ra0                 movw    %0, %1                          */
445 #line 861 "rl78-decode.opc"
446           int ra AU = (op[0] >> 1) & 0x03;
447           if (trace)
448             {
449               printf ("\033[33m%s\033[0m  %02x\n",
450                      "/** 0001 0ra0                     movw    %0, %1                          */",
451                      op[0]);
452               printf ("  ra = 0x%x\n", ra);
453             }
454           SYNTAX("movw  %0, %1");
455 #line 861 "rl78-decode.opc"
456           ID(mov); W(); DRW(ra); SR(AX);
457
458         }
459       break;
460     case 0x13:
461     case 0x15:
462     case 0x17:
463         {
464           /** 0001 0ra1                 movw    %0, %1                          */
465 #line 858 "rl78-decode.opc"
466           int ra AU = (op[0] >> 1) & 0x03;
467           if (trace)
468             {
469               printf ("\033[33m%s\033[0m  %02x\n",
470                      "/** 0001 0ra1                     movw    %0, %1                          */",
471                      op[0]);
472               printf ("  ra = 0x%x\n", ra);
473             }
474           SYNTAX("movw  %0, %1");
475 #line 858 "rl78-decode.opc"
476           ID(mov); W(); DR(AX); SRW(ra);
477
478         }
479       break;
480     case 0x18:
481         {
482           /** 0001 1000                 mov     %e0, %1                         */
483           if (trace)
484             {
485               printf ("\033[33m%s\033[0m  %02x\n",
486                      "/** 0001 1000                     mov     %e0, %1                         */",
487                      op[0]);
488             }
489           SYNTAX("mov   %e0, %1");
490 #line 731 "rl78-decode.opc"
491           ID(mov); DM(B, IMMU(2)); SR(A);
492
493         }
494       break;
495     case 0x19:
496         {
497           /** 0001 1001                 mov     %e0, #%1                        */
498           if (trace)
499             {
500               printf ("\033[33m%s\033[0m  %02x\n",
501                      "/** 0001 1001                     mov     %e0, #%1                        */",
502                      op[0]);
503             }
504           SYNTAX("mov   %e0, #%1");
505 #line 728 "rl78-decode.opc"
506           ID(mov); DM(B, IMMU(2)); SC(IMMU(1));
507
508         }
509       break;
510     case 0x1a:
511         {
512           /** 0001 1010                 addc    %0, #%1                         */
513           if (trace)
514             {
515               printf ("\033[33m%s\033[0m  %02x\n",
516                      "/** 0001 1010                     addc    %0, #%1                         */",
517                      op[0]);
518             }
519           SYNTAX("addc  %0, #%1");
520 #line 262 "rl78-decode.opc"
521           ID(addc); DM(None, SADDR); SC(IMMU(1)); Fzac;
522
523         /*----------------------------------------------------------------------*/
524
525         }
526       break;
527     case 0x1b:
528         {
529           /** 0001 1011                 addc    %0, %1                          */
530           if (trace)
531             {
532               printf ("\033[33m%s\033[0m  %02x\n",
533                      "/** 0001 1011                     addc    %0, %1                          */",
534                      op[0]);
535             }
536           SYNTAX("addc  %0, %1");
537 #line 259 "rl78-decode.opc"
538           ID(addc); DR(A); SM(None, SADDR); Fzac;
539
540         }
541       break;
542     case 0x1c:
543         {
544           /** 0001 1100                 addc    %0, #%1                         */
545           if (trace)
546             {
547               printf ("\033[33m%s\033[0m  %02x\n",
548                      "/** 0001 1100                     addc    %0, #%1                         */",
549                      op[0]);
550             }
551           SYNTAX("addc  %0, #%1");
552 #line 250 "rl78-decode.opc"
553           ID(addc); DR(A); SC(IMMU(1)); Fzac;
554
555         }
556       break;
557     case 0x1d:
558         {
559           /** 0001 1101                 addc    %0, %e1                         */
560           if (trace)
561             {
562               printf ("\033[33m%s\033[0m  %02x\n",
563                      "/** 0001 1101                     addc    %0, %e1                         */",
564                      op[0]);
565             }
566           SYNTAX("addc  %0, %e1");
567 #line 238 "rl78-decode.opc"
568           ID(addc); DR(A); SM(HL, 0); Fzac;
569
570         }
571       break;
572     case 0x1e:
573         {
574           /** 0001 1110                 addc    %0, %ea1                        */
575           if (trace)
576             {
577               printf ("\033[33m%s\033[0m  %02x\n",
578                      "/** 0001 1110                     addc    %0, %ea1                        */",
579                      op[0]);
580             }
581           SYNTAX("addc  %0, %ea1");
582 #line 247 "rl78-decode.opc"
583           ID(addc); DR(A); SM(HL, IMMU(1)); Fzac;
584
585         }
586       break;
587     case 0x1f:
588         {
589           /** 0001 1111                 addc    %0, %e!1                        */
590           if (trace)
591             {
592               printf ("\033[33m%s\033[0m  %02x\n",
593                      "/** 0001 1111                     addc    %0, %e!1                        */",
594                      op[0]);
595             }
596           SYNTAX("addc  %0, %e!1");
597 #line 235 "rl78-decode.opc"
598           ID(addc); DR(A); SM(None, IMMU(2)); Fzac;
599
600         }
601       break;
602     case 0x20:
603         {
604           /** 0010 0000                 subw    %0, #%1                         */
605           if (trace)
606             {
607               printf ("\033[33m%s\033[0m  %02x\n",
608                      "/** 0010 0000                     subw    %0, #%1                         */",
609                      op[0]);
610             }
611           SYNTAX("subw  %0, #%1");
612 #line 1200 "rl78-decode.opc"
613           ID(sub); W(); DR(SP); SC(IMMU(1)); Fzac;
614
615         /*----------------------------------------------------------------------*/
616
617         }
618       break;
619     case 0x21:
620     case 0x23:
621     case 0x25:
622     case 0x27:
623         {
624           /** 0010 0rw1                 subw    %0, %1                          */
625 #line 1194 "rl78-decode.opc"
626           int rw AU = (op[0] >> 1) & 0x03;
627           if (trace)
628             {
629               printf ("\033[33m%s\033[0m  %02x\n",
630                      "/** 0010 0rw1                     subw    %0, %1                          */",
631                      op[0]);
632               printf ("  rw = 0x%x\n", rw);
633             }
634           SYNTAX("subw  %0, %1");
635 #line 1194 "rl78-decode.opc"
636           ID(sub); W(); DR(AX); SRW(rw); Fzac;
637
638         }
639       break;
640     case 0x22:
641         {
642           /** 0010 0010                 subw    %0, %e!1                        */
643           if (trace)
644             {
645               printf ("\033[33m%s\033[0m  %02x\n",
646                      "/** 0010 0010                     subw    %0, %e!1                        */",
647                      op[0]);
648             }
649           SYNTAX("subw  %0, %e!1");
650 #line 1185 "rl78-decode.opc"
651           ID(sub); W(); DR(AX); SM(None, IMMU(2)); Fzac;
652
653         }
654       break;
655     case 0x24:
656         {
657           /** 0010 0100                 subw    %0, #%1                         */
658           if (trace)
659             {
660               printf ("\033[33m%s\033[0m  %02x\n",
661                      "/** 0010 0100                     subw    %0, #%1                         */",
662                      op[0]);
663             }
664           SYNTAX("subw  %0, #%1");
665 #line 1191 "rl78-decode.opc"
666           ID(sub); W(); DR(AX); SC(IMMU(2)); Fzac;
667
668         }
669       break;
670     case 0x26:
671         {
672           /** 0010 0110                 subw    %0, %1                          */
673           if (trace)
674             {
675               printf ("\033[33m%s\033[0m  %02x\n",
676                      "/** 0010 0110                     subw    %0, %1                          */",
677                      op[0]);
678             }
679           SYNTAX("subw  %0, %1");
680 #line 1197 "rl78-decode.opc"
681           ID(sub); W(); DR(AX); SM(None, SADDR); Fzac;
682
683         }
684       break;
685     case 0x28:
686         {
687           /** 0010 1000                 mov     %e0, %1                         */
688           if (trace)
689             {
690               printf ("\033[33m%s\033[0m  %02x\n",
691                      "/** 0010 1000                     mov     %e0, %1                         */",
692                      op[0]);
693             }
694           SYNTAX("mov   %e0, %1");
695 #line 743 "rl78-decode.opc"
696           ID(mov); DM(C, IMMU(2)); SR(A);
697
698         }
699       break;
700     case 0x29:
701         {
702           /** 0010 1001                 mov     %0, %e1                         */
703           if (trace)
704             {
705               printf ("\033[33m%s\033[0m  %02x\n",
706                      "/** 0010 1001                     mov     %0, %e1                         */",
707                      op[0]);
708             }
709           SYNTAX("mov   %0, %e1");
710 #line 686 "rl78-decode.opc"
711           ID(mov); DR(A); SM(C, IMMU(2));
712
713         }
714       break;
715     case 0x2a:
716         {
717           /** 0010 1010                 sub     %0, #%1                         */
718           if (trace)
719             {
720               printf ("\033[33m%s\033[0m  %02x\n",
721                      "/** 0010 1010                     sub     %0, #%1                         */",
722                      op[0]);
723             }
724           SYNTAX("sub   %0, #%1");
725 #line 1148 "rl78-decode.opc"
726           ID(sub); DM(None, SADDR); SC(IMMU(1)); Fzac;
727
728         /*----------------------------------------------------------------------*/
729
730         }
731       break;
732     case 0x2b:
733         {
734           /** 0010 1011                 sub     %0, %1                          */
735           if (trace)
736             {
737               printf ("\033[33m%s\033[0m  %02x\n",
738                      "/** 0010 1011                     sub     %0, %1                          */",
739                      op[0]);
740             }
741           SYNTAX("sub   %0, %1");
742 #line 1142 "rl78-decode.opc"
743           ID(sub); DR(A); SM(None, SADDR); Fzac;
744
745         }
746       break;
747     case 0x2c:
748         {
749           /** 0010 1100                 sub     %0, #%1                         */
750           if (trace)
751             {
752               printf ("\033[33m%s\033[0m  %02x\n",
753                      "/** 0010 1100                     sub     %0, #%1                         */",
754                      op[0]);
755             }
756           SYNTAX("sub   %0, #%1");
757 #line 1136 "rl78-decode.opc"
758           ID(sub); DR(A); SC(IMMU(1)); Fzac;
759
760         }
761       break;
762     case 0x2d:
763         {
764           /** 0010 1101                 sub     %0, %e1                         */
765           if (trace)
766             {
767               printf ("\033[33m%s\033[0m  %02x\n",
768                      "/** 0010 1101                     sub     %0, %e1                         */",
769                      op[0]);
770             }
771           SYNTAX("sub   %0, %e1");
772 #line 1124 "rl78-decode.opc"
773           ID(sub); DR(A); SM(HL, 0); Fzac;
774
775         }
776       break;
777     case 0x2e:
778         {
779           /** 0010 1110                 sub     %0, %ea1                        */
780           if (trace)
781             {
782               printf ("\033[33m%s\033[0m  %02x\n",
783                      "/** 0010 1110                     sub     %0, %ea1                        */",
784                      op[0]);
785             }
786           SYNTAX("sub   %0, %ea1");
787 #line 1130 "rl78-decode.opc"
788           ID(sub); DR(A); SM(HL, IMMU(1)); Fzac;
789
790         }
791       break;
792     case 0x2f:
793         {
794           /** 0010 1111                 sub     %0, %e!1                        */
795           if (trace)
796             {
797               printf ("\033[33m%s\033[0m  %02x\n",
798                      "/** 0010 1111                     sub     %0, %e!1                        */",
799                      op[0]);
800             }
801           SYNTAX("sub   %0, %e!1");
802 #line 1121 "rl78-decode.opc"
803           ID(sub); DR(A); SM(None, IMMU(2)); Fzac;
804
805         }
806       break;
807     case 0x30:
808     case 0x32:
809     case 0x34:
810     case 0x36:
811         {
812           /** 0011 0rg0                 movw    %0, #%1                         */
813 #line 855 "rl78-decode.opc"
814           int rg AU = (op[0] >> 1) & 0x03;
815           if (trace)
816             {
817               printf ("\033[33m%s\033[0m  %02x\n",
818                      "/** 0011 0rg0                     movw    %0, #%1                         */",
819                      op[0]);
820               printf ("  rg = 0x%x\n", rg);
821             }
822           SYNTAX("movw  %0, #%1");
823 #line 855 "rl78-decode.opc"
824           ID(mov); W(); DRW(rg); SC(IMMU(2));
825
826         }
827       break;
828     case 0x31:
829         GETBYTE ();
830         switch (op[1] & 0x8f)
831         {
832           case 0x00:
833               {
834                 /** 0011 0001 0bit 0000         btclr   %s1, $%a0                       */
835 #line 418 "rl78-decode.opc"
836                 int bit AU = (op[1] >> 4) & 0x07;
837                 if (trace)
838                   {
839                     printf ("\033[33m%s\033[0m  %02x %02x\n",
840                            "/** 0011 0001 0bit 0000             btclr   %s1, $%a0                       */",
841                            op[0], op[1]);
842                     printf ("  bit = 0x%x\n", bit);
843                   }
844                 SYNTAX("btclr   %s1, $%a0");
845 #line 418 "rl78-decode.opc"
846                 ID(branch_cond_clear); SM(None, SADDR); SB(bit); DC(pc+IMMS(1)+4); COND(T);
847
848               /*----------------------------------------------------------------------*/
849
850               }
851             break;
852           case 0x01:
853               {
854                 /** 0011 0001 0bit 0001         btclr   %1, $%a0                        */
855 #line 412 "rl78-decode.opc"
856                 int bit AU = (op[1] >> 4) & 0x07;
857                 if (trace)
858                   {
859                     printf ("\033[33m%s\033[0m  %02x %02x\n",
860                            "/** 0011 0001 0bit 0001             btclr   %1, $%a0                        */",
861                            op[0], op[1]);
862                     printf ("  bit = 0x%x\n", bit);
863                   }
864                 SYNTAX("btclr   %1, $%a0");
865 #line 412 "rl78-decode.opc"
866                 ID(branch_cond_clear); DC(pc+IMMS(1)+3); SR(A); SB(bit); COND(T);
867
868               }
869             break;
870           case 0x02:
871               {
872                 /** 0011 0001 0bit 0010         bt      %s1, $%a0                       */
873 #line 404 "rl78-decode.opc"
874                 int bit AU = (op[1] >> 4) & 0x07;
875                 if (trace)
876                   {
877                     printf ("\033[33m%s\033[0m  %02x %02x\n",
878                            "/** 0011 0001 0bit 0010             bt      %s1, $%a0                       */",
879                            op[0], op[1]);
880                     printf ("  bit = 0x%x\n", bit);
881                   }
882                 SYNTAX("bt      %s1, $%a0");
883 #line 404 "rl78-decode.opc"
884                 ID(branch_cond); SM(None, SADDR); SB(bit); DC(pc+IMMS(1)+4); COND(T);
885
886               /*----------------------------------------------------------------------*/
887
888               }
889             break;
890           case 0x03:
891               {
892                 /** 0011 0001 0bit 0011         bt      %1, $%a0                        */
893 #line 398 "rl78-decode.opc"
894                 int bit AU = (op[1] >> 4) & 0x07;
895                 if (trace)
896                   {
897                     printf ("\033[33m%s\033[0m  %02x %02x\n",
898                            "/** 0011 0001 0bit 0011             bt      %1, $%a0                        */",
899                            op[0], op[1]);
900                     printf ("  bit = 0x%x\n", bit);
901                   }
902                 SYNTAX("bt      %1, $%a0");
903 #line 398 "rl78-decode.opc"
904                 ID(branch_cond); DC(pc+IMMS(1)+3); SR(A); SB(bit); COND(T);
905
906               }
907             break;
908           case 0x04:
909               {
910                 /** 0011 0001 0bit 0100         bf      %s1, $%a0                       */
911 #line 365 "rl78-decode.opc"
912                 int bit AU = (op[1] >> 4) & 0x07;
913                 if (trace)
914                   {
915                     printf ("\033[33m%s\033[0m  %02x %02x\n",
916                            "/** 0011 0001 0bit 0100             bf      %s1, $%a0                       */",
917                            op[0], op[1]);
918                     printf ("  bit = 0x%x\n", bit);
919                   }
920                 SYNTAX("bf      %s1, $%a0");
921 #line 365 "rl78-decode.opc"
922                 ID(branch_cond); SM(None, SADDR); SB(bit); DC(pc+IMMS(1)+4); COND(F);
923
924               /*----------------------------------------------------------------------*/
925
926               }
927             break;
928           case 0x05:
929               {
930                 /** 0011 0001 0bit 0101         bf      %1, $%a0                        */
931 #line 359 "rl78-decode.opc"
932                 int bit AU = (op[1] >> 4) & 0x07;
933                 if (trace)
934                   {
935                     printf ("\033[33m%s\033[0m  %02x %02x\n",
936                            "/** 0011 0001 0bit 0101             bf      %1, $%a0                        */",
937                            op[0], op[1]);
938                     printf ("  bit = 0x%x\n", bit);
939                   }
940                 SYNTAX("bf      %1, $%a0");
941 #line 359 "rl78-decode.opc"
942                 ID(branch_cond); DC(pc+IMMS(1)+3); SR(A); SB(bit); COND(F);
943
944               }
945             break;
946           case 0x07:
947               {
948                 /** 0011 0001 0cnt 0111         shl     %0, %1                          */
949 #line 1077 "rl78-decode.opc"
950                 int cnt AU = (op[1] >> 4) & 0x07;
951                 if (trace)
952                   {
953                     printf ("\033[33m%s\033[0m  %02x %02x\n",
954                            "/** 0011 0001 0cnt 0111             shl     %0, %1                          */",
955                            op[0], op[1]);
956                     printf ("  cnt = 0x%x\n", cnt);
957                   }
958                 SYNTAX("shl     %0, %1");
959 #line 1077 "rl78-decode.opc"
960                 ID(shl); DR(C); SC(cnt);
961
962               }
963             break;
964           case 0x08:
965               {
966                 /** 0011 0001 0cnt 1000         shl     %0, %1                          */
967 #line 1074 "rl78-decode.opc"
968                 int cnt AU = (op[1] >> 4) & 0x07;
969                 if (trace)
970                   {
971                     printf ("\033[33m%s\033[0m  %02x %02x\n",
972                            "/** 0011 0001 0cnt 1000             shl     %0, %1                          */",
973                            op[0], op[1]);
974                     printf ("  cnt = 0x%x\n", cnt);
975                   }
976                 SYNTAX("shl     %0, %1");
977 #line 1074 "rl78-decode.opc"
978                 ID(shl); DR(B); SC(cnt);
979
980               }
981             break;
982           case 0x09:
983               {
984                 /** 0011 0001 0cnt 1001         shl     %0, %1                          */
985 #line 1071 "rl78-decode.opc"
986                 int cnt AU = (op[1] >> 4) & 0x07;
987                 if (trace)
988                   {
989                     printf ("\033[33m%s\033[0m  %02x %02x\n",
990                            "/** 0011 0001 0cnt 1001             shl     %0, %1                          */",
991                            op[0], op[1]);
992                     printf ("  cnt = 0x%x\n", cnt);
993                   }
994                 SYNTAX("shl     %0, %1");
995 #line 1071 "rl78-decode.opc"
996                 ID(shl); DR(A); SC(cnt);
997
998               }
999             break;
1000           case 0x0a:
1001               {
1002                 /** 0011 0001 0cnt 1010         shr     %0, %1                          */
1003 #line 1088 "rl78-decode.opc"
1004                 int cnt AU = (op[1] >> 4) & 0x07;
1005                 if (trace)
1006                   {
1007                     printf ("\033[33m%s\033[0m  %02x %02x\n",
1008                            "/** 0011 0001 0cnt 1010             shr     %0, %1                          */",
1009                            op[0], op[1]);
1010                     printf ("  cnt = 0x%x\n", cnt);
1011                   }
1012                 SYNTAX("shr     %0, %1");
1013 #line 1088 "rl78-decode.opc"
1014                 ID(shr); DR(A); SC(cnt);
1015
1016               }
1017             break;
1018           case 0x0b:
1019               {
1020                 /** 0011 0001 0cnt 1011         sar     %0, %1                          */
1021 #line 1035 "rl78-decode.opc"
1022                 int cnt AU = (op[1] >> 4) & 0x07;
1023                 if (trace)
1024                   {
1025                     printf ("\033[33m%s\033[0m  %02x %02x\n",
1026                            "/** 0011 0001 0cnt 1011             sar     %0, %1                          */",
1027                            op[0], op[1]);
1028                     printf ("  cnt = 0x%x\n", cnt);
1029                   }
1030                 SYNTAX("sar     %0, %1");
1031 #line 1035 "rl78-decode.opc"
1032                 ID(sar); DR(A); SC(cnt);
1033
1034               }
1035             break;
1036           case 0x0c:
1037           case 0x8c:
1038               {
1039                 /** 0011 0001 wcnt 1100         shlw    %0, %1                          */
1040 #line 1083 "rl78-decode.opc"
1041                 int wcnt AU = (op[1] >> 4) & 0x0f;
1042                 if (trace)
1043                   {
1044                     printf ("\033[33m%s\033[0m  %02x %02x\n",
1045                            "/** 0011 0001 wcnt 1100             shlw    %0, %1                          */",
1046                            op[0], op[1]);
1047                     printf ("  wcnt = 0x%x\n", wcnt);
1048                   }
1049                 SYNTAX("shlw    %0, %1");
1050 #line 1083 "rl78-decode.opc"
1051                 ID(shl); W(); DR(BC); SC(wcnt);
1052
1053               /*----------------------------------------------------------------------*/
1054
1055               }
1056             break;
1057           case 0x0d:
1058           case 0x8d:
1059               {
1060                 /** 0011 0001 wcnt 1101         shlw    %0, %1                          */
1061 #line 1080 "rl78-decode.opc"
1062                 int wcnt AU = (op[1] >> 4) & 0x0f;
1063                 if (trace)
1064                   {
1065                     printf ("\033[33m%s\033[0m  %02x %02x\n",
1066                            "/** 0011 0001 wcnt 1101             shlw    %0, %1                          */",
1067                            op[0], op[1]);
1068                     printf ("  wcnt = 0x%x\n", wcnt);
1069                   }
1070                 SYNTAX("shlw    %0, %1");
1071 #line 1080 "rl78-decode.opc"
1072                 ID(shl); W(); DR(AX); SC(wcnt);
1073
1074               }
1075             break;
1076           case 0x0e:
1077           case 0x8e:
1078               {
1079                 /** 0011 0001 wcnt 1110         shrw    %0, %1                          */
1080 #line 1091 "rl78-decode.opc"
1081                 int wcnt AU = (op[1] >> 4) & 0x0f;
1082                 if (trace)
1083                   {
1084                     printf ("\033[33m%s\033[0m  %02x %02x\n",
1085                            "/** 0011 0001 wcnt 1110             shrw    %0, %1                          */",
1086                            op[0], op[1]);
1087                     printf ("  wcnt = 0x%x\n", wcnt);
1088                   }
1089                 SYNTAX("shrw    %0, %1");
1090 #line 1091 "rl78-decode.opc"
1091                 ID(shr); W(); DR(AX); SC(wcnt);
1092
1093               /*----------------------------------------------------------------------*/
1094
1095               }
1096             break;
1097           case 0x0f:
1098           case 0x8f:
1099               {
1100                 /** 0011 0001 wcnt 1111         sarw    %0, %1                          */
1101 #line 1038 "rl78-decode.opc"
1102                 int wcnt AU = (op[1] >> 4) & 0x0f;
1103                 if (trace)
1104                   {
1105                     printf ("\033[33m%s\033[0m  %02x %02x\n",
1106                            "/** 0011 0001 wcnt 1111             sarw    %0, %1                          */",
1107                            op[0], op[1]);
1108                     printf ("  wcnt = 0x%x\n", wcnt);
1109                   }
1110                 SYNTAX("sarw    %0, %1");
1111 #line 1038 "rl78-decode.opc"
1112                 ID(sar); W(); DR(AX); SC(wcnt);
1113
1114               /*----------------------------------------------------------------------*/
1115
1116               }
1117             break;
1118           case 0x80:
1119               {
1120                 /** 0011 0001 1bit 0000         btclr   %s1, $%a0                       */
1121 #line 415 "rl78-decode.opc"
1122                 int bit AU = (op[1] >> 4) & 0x07;
1123                 if (trace)
1124                   {
1125                     printf ("\033[33m%s\033[0m  %02x %02x\n",
1126                            "/** 0011 0001 1bit 0000             btclr   %s1, $%a0                       */",
1127                            op[0], op[1]);
1128                     printf ("  bit = 0x%x\n", bit);
1129                   }
1130                 SYNTAX("btclr   %s1, $%a0");
1131 #line 415 "rl78-decode.opc"
1132                 ID(branch_cond_clear); SM(None, SFR); SB(bit); DC(pc+IMMS(1)+4); COND(T);
1133
1134               }
1135             break;
1136           case 0x81:
1137               {
1138                 /** 0011 0001 1bit 0001         btclr   %e1, $%a0                       */
1139 #line 409 "rl78-decode.opc"
1140                 int bit AU = (op[1] >> 4) & 0x07;
1141                 if (trace)
1142                   {
1143                     printf ("\033[33m%s\033[0m  %02x %02x\n",
1144                            "/** 0011 0001 1bit 0001             btclr   %e1, $%a0                       */",
1145                            op[0], op[1]);
1146                     printf ("  bit = 0x%x\n", bit);
1147                   }
1148                 SYNTAX("btclr   %e1, $%a0");
1149 #line 409 "rl78-decode.opc"
1150                 ID(branch_cond_clear); DC(pc+IMMS(1)+3); SM(HL,0); SB(bit); COND(T);
1151
1152               }
1153             break;
1154           case 0x82:
1155               {
1156                 /** 0011 0001 1bit 0010         bt      %s1, $%a0                       */
1157 #line 401 "rl78-decode.opc"
1158                 int bit AU = (op[1] >> 4) & 0x07;
1159                 if (trace)
1160                   {
1161                     printf ("\033[33m%s\033[0m  %02x %02x\n",
1162                            "/** 0011 0001 1bit 0010             bt      %s1, $%a0                       */",
1163                            op[0], op[1]);
1164                     printf ("  bit = 0x%x\n", bit);
1165                   }
1166                 SYNTAX("bt      %s1, $%a0");
1167 #line 401 "rl78-decode.opc"
1168                 ID(branch_cond); SM(None, SFR); SB(bit); DC(pc+IMMS(1)+4); COND(T);
1169
1170               }
1171             break;
1172           case 0x83:
1173               {
1174                 /** 0011 0001 1bit 0011         bt      %e1, $%a0                       */
1175 #line 395 "rl78-decode.opc"
1176                 int bit AU = (op[1] >> 4) & 0x07;
1177                 if (trace)
1178                   {
1179                     printf ("\033[33m%s\033[0m  %02x %02x\n",
1180                            "/** 0011 0001 1bit 0011             bt      %e1, $%a0                       */",
1181                            op[0], op[1]);
1182                     printf ("  bit = 0x%x\n", bit);
1183                   }
1184                 SYNTAX("bt      %e1, $%a0");
1185 #line 395 "rl78-decode.opc"
1186                 ID(branch_cond); DC(pc+IMMS(1)+3); SM(HL,0); SB(bit); COND(T);
1187
1188               }
1189             break;
1190           case 0x84:
1191               {
1192                 /** 0011 0001 1bit 0100         bf      %s1, $%a0                       */
1193 #line 362 "rl78-decode.opc"
1194                 int bit AU = (op[1] >> 4) & 0x07;
1195                 if (trace)
1196                   {
1197                     printf ("\033[33m%s\033[0m  %02x %02x\n",
1198                            "/** 0011 0001 1bit 0100             bf      %s1, $%a0                       */",
1199                            op[0], op[1]);
1200                     printf ("  bit = 0x%x\n", bit);
1201                   }
1202                 SYNTAX("bf      %s1, $%a0");
1203 #line 362 "rl78-decode.opc"
1204                 ID(branch_cond); SM(None, SFR); SB(bit); DC(pc+IMMS(1)+4); COND(F);
1205
1206               }
1207             break;
1208           case 0x85:
1209               {
1210                 /** 0011 0001 1bit 0101         bf      %e1, $%a0                       */
1211 #line 356 "rl78-decode.opc"
1212                 int bit AU = (op[1] >> 4) & 0x07;
1213                 if (trace)
1214                   {
1215                     printf ("\033[33m%s\033[0m  %02x %02x\n",
1216                            "/** 0011 0001 1bit 0101             bf      %e1, $%a0                       */",
1217                            op[0], op[1]);
1218                     printf ("  bit = 0x%x\n", bit);
1219                   }
1220                 SYNTAX("bf      %e1, $%a0");
1221 #line 356 "rl78-decode.opc"
1222                 ID(branch_cond); DC(pc+IMMS(1)+3); SM(HL,0); SB(bit); COND(F);
1223
1224               }
1225             break;
1226           default: UNSUPPORTED(); break;
1227         }
1228       break;
1229     case 0x33:
1230     case 0x35:
1231     case 0x37:
1232         {
1233           /** 0011 0ra1                 xchw    %0, %1                          */
1234 #line 1241 "rl78-decode.opc"
1235           int ra AU = (op[0] >> 1) & 0x03;
1236           if (trace)
1237             {
1238               printf ("\033[33m%s\033[0m  %02x\n",
1239                      "/** 0011 0ra1                     xchw    %0, %1                          */",
1240                      op[0]);
1241               printf ("  ra = 0x%x\n", ra);
1242             }
1243           SYNTAX("xchw  %0, %1");
1244 #line 1241 "rl78-decode.opc"
1245           ID(xch); W(); DR(AX); SRW(ra);
1246
1247         /*----------------------------------------------------------------------*/
1248
1249         }
1250       break;
1251     case 0x38:
1252         {
1253           /** 0011 1000                 mov     %e0, #%1                        */
1254           if (trace)
1255             {
1256               printf ("\033[33m%s\033[0m  %02x\n",
1257                      "/** 0011 1000                     mov     %e0, #%1                        */",
1258                      op[0]);
1259             }
1260           SYNTAX("mov   %e0, #%1");
1261 #line 740 "rl78-decode.opc"
1262           ID(mov); DM(C, IMMU(2)); SC(IMMU(1));
1263
1264         }
1265       break;
1266     case 0x39:
1267         {
1268           /** 0011 1001                 mov     %e0, #%1                        */
1269           if (trace)
1270             {
1271               printf ("\033[33m%s\033[0m  %02x\n",
1272                      "/** 0011 1001                     mov     %e0, #%1                        */",
1273                      op[0]);
1274             }
1275           SYNTAX("mov   %e0, #%1");
1276 #line 734 "rl78-decode.opc"
1277           ID(mov); DM(BC, IMMU(2)); SC(IMMU(1));
1278
1279         }
1280       break;
1281     case 0x3a:
1282         {
1283           /** 0011 1010                 subc    %0, #%1                         */
1284           if (trace)
1285             {
1286               printf ("\033[33m%s\033[0m  %02x\n",
1287                      "/** 0011 1010                     subc    %0, #%1                         */",
1288                      op[0]);
1289             }
1290           SYNTAX("subc  %0, #%1");
1291 #line 1180 "rl78-decode.opc"
1292           ID(subc); DM(None, SADDR); SC(IMMU(1)); Fzac;
1293
1294         /*----------------------------------------------------------------------*/
1295
1296         }
1297       break;
1298     case 0x3b:
1299         {
1300           /** 0011 1011                 subc    %0, %1                          */
1301           if (trace)
1302             {
1303               printf ("\033[33m%s\033[0m  %02x\n",
1304                      "/** 0011 1011                     subc    %0, %1                          */",
1305                      op[0]);
1306             }
1307           SYNTAX("subc  %0, %1");
1308 #line 1177 "rl78-decode.opc"
1309           ID(subc); DR(A); SM(None, SADDR); Fzac;
1310
1311         }
1312       break;
1313     case 0x3c:
1314         {
1315           /** 0011 1100                 subc    %0, #%1                         */
1316           if (trace)
1317             {
1318               printf ("\033[33m%s\033[0m  %02x\n",
1319                      "/** 0011 1100                     subc    %0, #%1                         */",
1320                      op[0]);
1321             }
1322           SYNTAX("subc  %0, #%1");
1323 #line 1168 "rl78-decode.opc"
1324           ID(subc); DR(A); SC(IMMU(1)); Fzac;
1325
1326         }
1327       break;
1328     case 0x3d:
1329         {
1330           /** 0011 1101                 subc    %0, %e1                         */
1331           if (trace)
1332             {
1333               printf ("\033[33m%s\033[0m  %02x\n",
1334                      "/** 0011 1101                     subc    %0, %e1                         */",
1335                      op[0]);
1336             }
1337           SYNTAX("subc  %0, %e1");
1338 #line 1156 "rl78-decode.opc"
1339           ID(subc); DR(A); SM(HL, 0); Fzac;
1340
1341         }
1342       break;
1343     case 0x3e:
1344         {
1345           /** 0011 1110                 subc    %0, %ea1                        */
1346           if (trace)
1347             {
1348               printf ("\033[33m%s\033[0m  %02x\n",
1349                      "/** 0011 1110                     subc    %0, %ea1                        */",
1350                      op[0]);
1351             }
1352           SYNTAX("subc  %0, %ea1");
1353 #line 1165 "rl78-decode.opc"
1354           ID(subc); DR(A); SM(HL, IMMU(1)); Fzac;
1355
1356         }
1357       break;
1358     case 0x3f:
1359         {
1360           /** 0011 1111                 subc    %0, %e!1                        */
1361           if (trace)
1362             {
1363               printf ("\033[33m%s\033[0m  %02x\n",
1364                      "/** 0011 1111                     subc    %0, %e!1                        */",
1365                      op[0]);
1366             }
1367           SYNTAX("subc  %0, %e!1");
1368 #line 1153 "rl78-decode.opc"
1369           ID(subc); DR(A); SM(None, IMMU(2)); Fzac;
1370
1371         }
1372       break;
1373     case 0x40:
1374         {
1375           /** 0100 0000                 cmp     %e!0, #%1                       */
1376           if (trace)
1377             {
1378               printf ("\033[33m%s\033[0m  %02x\n",
1379                      "/** 0100 0000                     cmp     %e!0, #%1                       */",
1380                      op[0]);
1381             }
1382           SYNTAX("cmp   %e!0, #%1");
1383 #line 482 "rl78-decode.opc"
1384           ID(cmp); DM(None, IMMU(2)); SC(IMMU(1)); Fzac;
1385
1386         }
1387       break;
1388     case 0x41:
1389         {
1390           /** 0100 0001                 mov     %0, #%1                         */
1391           if (trace)
1392             {
1393               printf ("\033[33m%s\033[0m  %02x\n",
1394                      "/** 0100 0001                     mov     %0, #%1                         */",
1395                      op[0]);
1396             }
1397           SYNTAX("mov   %0, #%1");
1398 #line 719 "rl78-decode.opc"
1399           ID(mov); DR(ES); SC(IMMU(1));
1400
1401         }
1402       break;
1403     case 0x42:
1404         {
1405           /** 0100 0010                 cmpw    %0, %e!1                        */
1406           if (trace)
1407             {
1408               printf ("\033[33m%s\033[0m  %02x\n",
1409                      "/** 0100 0010                     cmpw    %0, %e!1                        */",
1410                      op[0]);
1411             }
1412           SYNTAX("cmpw  %0, %e!1");
1413 #line 533 "rl78-decode.opc"
1414           ID(cmp); W(); DR(AX); SM(None, IMMU(2)); Fzac;
1415
1416         }
1417       break;
1418     case 0x43:
1419     case 0x45:
1420     case 0x47:
1421         {
1422           /** 0100 0ra1                 cmpw    %0, %1                          */
1423 #line 542 "rl78-decode.opc"
1424           int ra AU = (op[0] >> 1) & 0x03;
1425           if (trace)
1426             {
1427               printf ("\033[33m%s\033[0m  %02x\n",
1428                      "/** 0100 0ra1                     cmpw    %0, %1                          */",
1429                      op[0]);
1430               printf ("  ra = 0x%x\n", ra);
1431             }
1432           SYNTAX("cmpw  %0, %1");
1433 #line 542 "rl78-decode.opc"
1434           ID(cmp); W(); DR(AX); SRW(ra); Fzac;
1435
1436         }
1437       break;
1438     case 0x44:
1439         {
1440           /** 0100 0100                 cmpw    %0, #%1                         */
1441           if (trace)
1442             {
1443               printf ("\033[33m%s\033[0m  %02x\n",
1444                      "/** 0100 0100                     cmpw    %0, #%1                         */",
1445                      op[0]);
1446             }
1447           SYNTAX("cmpw  %0, #%1");
1448 #line 539 "rl78-decode.opc"
1449           ID(cmp); W(); DR(AX); SC(IMMU(2)); Fzac;
1450
1451         }
1452       break;
1453     case 0x46:
1454         {
1455           /** 0100 0110                 cmpw    %0, %1                          */
1456           if (trace)
1457             {
1458               printf ("\033[33m%s\033[0m  %02x\n",
1459                      "/** 0100 0110                     cmpw    %0, %1                          */",
1460                      op[0]);
1461             }
1462           SYNTAX("cmpw  %0, %1");
1463 #line 545 "rl78-decode.opc"
1464           ID(cmp); W(); DR(AX); SM(None, SADDR); Fzac;
1465
1466         /*----------------------------------------------------------------------*/
1467
1468         }
1469       break;
1470     case 0x48:
1471         {
1472           /** 0100 1000                 mov     %e0, %1                         */
1473           if (trace)
1474             {
1475               printf ("\033[33m%s\033[0m  %02x\n",
1476                      "/** 0100 1000                     mov     %e0, %1                         */",
1477                      op[0]);
1478             }
1479           SYNTAX("mov   %e0, %1");
1480 #line 737 "rl78-decode.opc"
1481           ID(mov); DM(BC, IMMU(2)); SR(A);
1482
1483         }
1484       break;
1485     case 0x49:
1486         {
1487           /** 0100 1001                 mov     %0, %e1                         */
1488           if (trace)
1489             {
1490               printf ("\033[33m%s\033[0m  %02x\n",
1491                      "/** 0100 1001                     mov     %0, %e1                         */",
1492                      op[0]);
1493             }
1494           SYNTAX("mov   %0, %e1");
1495 #line 683 "rl78-decode.opc"
1496           ID(mov); DR(A); SM(BC, IMMU(2));
1497
1498         }
1499       break;
1500     case 0x4a:
1501         {
1502           /** 0100 1010                 cmp     %0, #%1                         */
1503           if (trace)
1504             {
1505               printf ("\033[33m%s\033[0m  %02x\n",
1506                      "/** 0100 1010                     cmp     %0, #%1                         */",
1507                      op[0]);
1508             }
1509           SYNTAX("cmp   %0, #%1");
1510 #line 485 "rl78-decode.opc"
1511           ID(cmp); DM(None, SADDR); SC(IMMU(1)); Fzac;
1512
1513         }
1514       break;
1515     case 0x4b:
1516         {
1517           /** 0100 1011                 cmp     %0, %1                          */
1518           if (trace)
1519             {
1520               printf ("\033[33m%s\033[0m  %02x\n",
1521                      "/** 0100 1011                     cmp     %0, %1                          */",
1522                      op[0]);
1523             }
1524           SYNTAX("cmp   %0, %1");
1525 #line 512 "rl78-decode.opc"
1526           ID(cmp); DR(A); SM(None, SADDR); Fzac;
1527
1528         /*----------------------------------------------------------------------*/
1529
1530         }
1531       break;
1532     case 0x4c:
1533         {
1534           /** 0100 1100                 cmp     %0, #%1                         */
1535           if (trace)
1536             {
1537               printf ("\033[33m%s\033[0m  %02x\n",
1538                      "/** 0100 1100                     cmp     %0, #%1                         */",
1539                      op[0]);
1540             }
1541           SYNTAX("cmp   %0, #%1");
1542 #line 503 "rl78-decode.opc"
1543           ID(cmp); DR(A); SC(IMMU(1)); Fzac;
1544
1545         }
1546       break;
1547     case 0x4d:
1548         {
1549           /** 0100 1101                 cmp     %0, %e1                         */
1550           if (trace)
1551             {
1552               printf ("\033[33m%s\033[0m  %02x\n",
1553                      "/** 0100 1101                     cmp     %0, %e1                         */",
1554                      op[0]);
1555             }
1556           SYNTAX("cmp   %0, %e1");
1557 #line 491 "rl78-decode.opc"
1558           ID(cmp); DR(A); SM(HL, 0); Fzac;
1559
1560         }
1561       break;
1562     case 0x4e:
1563         {
1564           /** 0100 1110                 cmp     %0, %ea1                        */
1565           if (trace)
1566             {
1567               printf ("\033[33m%s\033[0m  %02x\n",
1568                      "/** 0100 1110                     cmp     %0, %ea1                        */",
1569                      op[0]);
1570             }
1571           SYNTAX("cmp   %0, %ea1");
1572 #line 500 "rl78-decode.opc"
1573           ID(cmp); DR(A); SM(HL, IMMU(1)); Fzac;
1574
1575         }
1576       break;
1577     case 0x4f:
1578         {
1579           /** 0100 1111                 cmp     %0, %e!1                        */
1580           if (trace)
1581             {
1582               printf ("\033[33m%s\033[0m  %02x\n",
1583                      "/** 0100 1111                     cmp     %0, %e!1                        */",
1584                      op[0]);
1585             }
1586           SYNTAX("cmp   %0, %e!1");
1587 #line 488 "rl78-decode.opc"
1588           ID(cmp); DR(A); SM(None, IMMU(2)); Fzac;
1589
1590         }
1591       break;
1592     case 0x50:
1593     case 0x51:
1594     case 0x52:
1595     case 0x53:
1596     case 0x54:
1597     case 0x55:
1598     case 0x56:
1599     case 0x57:
1600         {
1601           /** 0101 0reg                 mov     %0, #%1                         */
1602 #line 671 "rl78-decode.opc"
1603           int reg AU = op[0] & 0x07;
1604           if (trace)
1605             {
1606               printf ("\033[33m%s\033[0m  %02x\n",
1607                      "/** 0101 0reg                     mov     %0, #%1                         */",
1608                      op[0]);
1609               printf ("  reg = 0x%x\n", reg);
1610             }
1611           SYNTAX("mov   %0, #%1");
1612 #line 671 "rl78-decode.opc"
1613           ID(mov); DRB(reg); SC(IMMU(1));
1614
1615         }
1616       break;
1617     case 0x58:
1618         {
1619           /** 0101 1000                 movw    %e0, %1                         */
1620           if (trace)
1621             {
1622               printf ("\033[33m%s\033[0m  %02x\n",
1623                      "/** 0101 1000                     movw    %e0, %1                         */",
1624                      op[0]);
1625             }
1626           SYNTAX("movw  %e0, %1");
1627 #line 873 "rl78-decode.opc"
1628           ID(mov); W(); DM(B, IMMU(2)); SR(AX);
1629
1630         }
1631       break;
1632     case 0x59:
1633         {
1634           /** 0101 1001                 movw    %0, %e1                         */
1635           if (trace)
1636             {
1637               printf ("\033[33m%s\033[0m  %02x\n",
1638                      "/** 0101 1001                     movw    %0, %e1                         */",
1639                      op[0]);
1640             }
1641           SYNTAX("movw  %0, %e1");
1642 #line 864 "rl78-decode.opc"
1643           ID(mov); W(); DR(AX); SM(B, IMMU(2));
1644
1645         }
1646       break;
1647     case 0x5a:
1648         {
1649           /** 0101 1010                 and     %0, #%1                         */
1650           if (trace)
1651             {
1652               printf ("\033[33m%s\033[0m  %02x\n",
1653                      "/** 0101 1010                     and     %0, #%1                         */",
1654                      op[0]);
1655             }
1656           SYNTAX("and   %0, #%1");
1657 #line 314 "rl78-decode.opc"
1658           ID(and); DM(None, SADDR); SC(IMMU(1)); Fz;
1659
1660         /*----------------------------------------------------------------------*/
1661
1662         }
1663       break;
1664     case 0x5b:
1665         {
1666           /** 0101 1011                 and     %0, %1                          */
1667           if (trace)
1668             {
1669               printf ("\033[33m%s\033[0m  %02x\n",
1670                      "/** 0101 1011                     and     %0, %1                          */",
1671                      op[0]);
1672             }
1673           SYNTAX("and   %0, %1");
1674 #line 311 "rl78-decode.opc"
1675           ID(and); DR(A); SM(None, SADDR); Fz;
1676
1677         }
1678       break;
1679     case 0x5c:
1680         {
1681           /** 0101 1100                 and     %0, #%1                         */
1682           if (trace)
1683             {
1684               printf ("\033[33m%s\033[0m  %02x\n",
1685                      "/** 0101 1100                     and     %0, #%1                         */",
1686                      op[0]);
1687             }
1688           SYNTAX("and   %0, #%1");
1689 #line 302 "rl78-decode.opc"
1690           ID(and); DR(A); SC(IMMU(1)); Fz;
1691
1692         }
1693       break;
1694     case 0x5d:
1695         {
1696           /** 0101 1101                 and     %0, %e1                 */
1697           if (trace)
1698             {
1699               printf ("\033[33m%s\033[0m  %02x\n",
1700                      "/** 0101 1101                     and     %0, %e1                 */",
1701                      op[0]);
1702             }
1703           SYNTAX("and   %0, %e1");
1704 #line 290 "rl78-decode.opc"
1705           ID(and); DR(A); SM(HL, 0); Fz;
1706
1707         }
1708       break;
1709     case 0x5e:
1710         {
1711           /** 0101 1110                 and     %0, %ea1                        */
1712           if (trace)
1713             {
1714               printf ("\033[33m%s\033[0m  %02x\n",
1715                      "/** 0101 1110                     and     %0, %ea1                        */",
1716                      op[0]);
1717             }
1718           SYNTAX("and   %0, %ea1");
1719 #line 296 "rl78-decode.opc"
1720           ID(and); DR(A); SM(HL, IMMU(1)); Fz;
1721
1722         }
1723       break;
1724     case 0x5f:
1725         {
1726           /** 0101 1111                 and     %0, %e!1                        */
1727           if (trace)
1728             {
1729               printf ("\033[33m%s\033[0m  %02x\n",
1730                      "/** 0101 1111                     and     %0, %e!1                        */",
1731                      op[0]);
1732             }
1733           SYNTAX("and   %0, %e!1");
1734 #line 287 "rl78-decode.opc"
1735           ID(and); DR(A); SM(None, IMMU(2)); Fz;
1736
1737         }
1738       break;
1739     case 0x60:
1740     case 0x62:
1741     case 0x63:
1742     case 0x64:
1743     case 0x65:
1744     case 0x66:
1745     case 0x67:
1746         {
1747           /** 0110 0rba                 mov     %0, %1                          */
1748 #line 674 "rl78-decode.opc"
1749           int rba AU = op[0] & 0x07;
1750           if (trace)
1751             {
1752               printf ("\033[33m%s\033[0m  %02x\n",
1753                      "/** 0110 0rba                     mov     %0, %1                          */",
1754                      op[0]);
1755               printf ("  rba = 0x%x\n", rba);
1756             }
1757           SYNTAX("mov   %0, %1");
1758 #line 674 "rl78-decode.opc"
1759           ID(mov); DR(A); SRB(rba);
1760
1761         }
1762       break;
1763     case 0x61:
1764         GETBYTE ();
1765         switch (op[1] & 0xff)
1766         {
1767           case 0x00:
1768           case 0x01:
1769           case 0x02:
1770           case 0x03:
1771           case 0x04:
1772           case 0x05:
1773           case 0x06:
1774           case 0x07:
1775               {
1776                 /** 0110 0001 0000 0reg         add     %0, %1                          */
1777 #line 227 "rl78-decode.opc"
1778                 int reg AU = op[1] & 0x07;
1779                 if (trace)
1780                   {
1781                     printf ("\033[33m%s\033[0m  %02x %02x\n",
1782                            "/** 0110 0001 0000 0reg             add     %0, %1                          */",
1783                            op[0], op[1]);
1784                     printf ("  reg = 0x%x\n", reg);
1785                   }
1786                 SYNTAX("add     %0, %1");
1787 #line 227 "rl78-decode.opc"
1788                 ID(add); DRB(reg); SR(A); Fzac;
1789
1790               }
1791             break;
1792           case 0x08:
1793           case 0x0a:
1794           case 0x0b:
1795           case 0x0c:
1796           case 0x0d:
1797           case 0x0e:
1798           case 0x0f:
1799               {
1800                 /** 0110 0001 0000 1rba         add     %0, %1                          */
1801 #line 221 "rl78-decode.opc"
1802                 int rba AU = op[1] & 0x07;
1803                 if (trace)
1804                   {
1805                     printf ("\033[33m%s\033[0m  %02x %02x\n",
1806                            "/** 0110 0001 0000 1rba             add     %0, %1                          */",
1807                            op[0], op[1]);
1808                     printf ("  rba = 0x%x\n", rba);
1809                   }
1810                 SYNTAX("add     %0, %1");
1811 #line 221 "rl78-decode.opc"
1812                 ID(add); DR(A); SRB(rba); Fzac;
1813
1814               }
1815             break;
1816           case 0x09:
1817               {
1818                 /** 0110 0001 0000 1001         addw    %0, %ea1                        */
1819                 if (trace)
1820                   {
1821                     printf ("\033[33m%s\033[0m  %02x %02x\n",
1822                            "/** 0110 0001 0000 1001             addw    %0, %ea1                        */",
1823                            op[0], op[1]);
1824                   }
1825                 SYNTAX("addw    %0, %ea1");
1826 #line 270 "rl78-decode.opc"
1827                 ID(add); W(); DR(AX); SM(HL, IMMU(1)); Fzac;
1828
1829               }
1830             break;
1831           case 0x10:
1832           case 0x11:
1833           case 0x12:
1834           case 0x13:
1835           case 0x14:
1836           case 0x15:
1837           case 0x16:
1838           case 0x17:
1839               {
1840                 /** 0110 0001 0001 0reg         addc    %0, %1                          */
1841 #line 256 "rl78-decode.opc"
1842                 int reg AU = op[1] & 0x07;
1843                 if (trace)
1844                   {
1845                     printf ("\033[33m%s\033[0m  %02x %02x\n",
1846                            "/** 0110 0001 0001 0reg             addc    %0, %1                          */",
1847                            op[0], op[1]);
1848                     printf ("  reg = 0x%x\n", reg);
1849                   }
1850                 SYNTAX("addc    %0, %1");
1851 #line 256 "rl78-decode.opc"
1852                 ID(addc); DRB(reg); SR(A); Fzac;
1853
1854               }
1855             break;
1856           case 0x18:
1857           case 0x1a:
1858           case 0x1b:
1859           case 0x1c:
1860           case 0x1d:
1861           case 0x1e:
1862           case 0x1f:
1863               {
1864                 /** 0110 0001 0001 1rba         addc    %0, %1                          */
1865 #line 253 "rl78-decode.opc"
1866                 int rba AU = op[1] & 0x07;
1867                 if (trace)
1868                   {
1869                     printf ("\033[33m%s\033[0m  %02x %02x\n",
1870                            "/** 0110 0001 0001 1rba             addc    %0, %1                          */",
1871                            op[0], op[1]);
1872                     printf ("  rba = 0x%x\n", rba);
1873                   }
1874                 SYNTAX("addc    %0, %1");
1875 #line 253 "rl78-decode.opc"
1876                 ID(addc); DR(A); SRB(rba); Fzac;
1877
1878               }
1879             break;
1880           case 0x20:
1881           case 0x21:
1882           case 0x22:
1883           case 0x23:
1884           case 0x24:
1885           case 0x25:
1886           case 0x26:
1887           case 0x27:
1888               {
1889                 /** 0110 0001 0010 0reg         sub     %0, %1                          */
1890 #line 1145 "rl78-decode.opc"
1891                 int reg AU = op[1] & 0x07;
1892                 if (trace)
1893                   {
1894                     printf ("\033[33m%s\033[0m  %02x %02x\n",
1895                            "/** 0110 0001 0010 0reg             sub     %0, %1                          */",
1896                            op[0], op[1]);
1897                     printf ("  reg = 0x%x\n", reg);
1898                   }
1899                 SYNTAX("sub     %0, %1");
1900 #line 1145 "rl78-decode.opc"
1901                 ID(sub); DRB(reg); SR(A); Fzac;
1902
1903               }
1904             break;
1905           case 0x28:
1906           case 0x2a:
1907           case 0x2b:
1908           case 0x2c:
1909           case 0x2d:
1910           case 0x2e:
1911           case 0x2f:
1912               {
1913                 /** 0110 0001 0010 1rba         sub     %0, %1                          */
1914 #line 1139 "rl78-decode.opc"
1915                 int rba AU = op[1] & 0x07;
1916                 if (trace)
1917                   {
1918                     printf ("\033[33m%s\033[0m  %02x %02x\n",
1919                            "/** 0110 0001 0010 1rba             sub     %0, %1                          */",
1920                            op[0], op[1]);
1921                     printf ("  rba = 0x%x\n", rba);
1922                   }
1923                 SYNTAX("sub     %0, %1");
1924 #line 1139 "rl78-decode.opc"
1925                 ID(sub); DR(A); SRB(rba); Fzac;
1926
1927               }
1928             break;
1929           case 0x29:
1930               {
1931                 /** 0110 0001 0010 1001         subw    %0, %ea1                        */
1932                 if (trace)
1933                   {
1934                     printf ("\033[33m%s\033[0m  %02x %02x\n",
1935                            "/** 0110 0001 0010 1001             subw    %0, %ea1                        */",
1936                            op[0], op[1]);
1937                   }
1938                 SYNTAX("subw    %0, %ea1");
1939 #line 1188 "rl78-decode.opc"
1940                 ID(sub); W(); DR(AX); SM(HL, IMMU(1)); Fzac;
1941
1942               }
1943             break;
1944           case 0x30:
1945           case 0x31:
1946           case 0x32:
1947           case 0x33:
1948           case 0x34:
1949           case 0x35:
1950           case 0x36:
1951           case 0x37:
1952               {
1953                 /** 0110 0001 0011 0reg         subc    %0, %1                          */
1954 #line 1174 "rl78-decode.opc"
1955                 int reg AU = op[1] & 0x07;
1956                 if (trace)
1957                   {
1958                     printf ("\033[33m%s\033[0m  %02x %02x\n",
1959                            "/** 0110 0001 0011 0reg             subc    %0, %1                          */",
1960                            op[0], op[1]);
1961                     printf ("  reg = 0x%x\n", reg);
1962                   }
1963                 SYNTAX("subc    %0, %1");
1964 #line 1174 "rl78-decode.opc"
1965                 ID(subc); DRB(reg); SR(A); Fzac;
1966
1967               }
1968             break;
1969           case 0x38:
1970           case 0x3a:
1971           case 0x3b:
1972           case 0x3c:
1973           case 0x3d:
1974           case 0x3e:
1975           case 0x3f:
1976               {
1977                 /** 0110 0001 0011 1rba         subc    %0, %1                          */
1978 #line 1171 "rl78-decode.opc"
1979                 int rba AU = op[1] & 0x07;
1980                 if (trace)
1981                   {
1982                     printf ("\033[33m%s\033[0m  %02x %02x\n",
1983                            "/** 0110 0001 0011 1rba             subc    %0, %1                          */",
1984                            op[0], op[1]);
1985                     printf ("  rba = 0x%x\n", rba);
1986                   }
1987                 SYNTAX("subc    %0, %1");
1988 #line 1171 "rl78-decode.opc"
1989                 ID(subc); DR(A); SRB(rba); Fzac;
1990
1991               }
1992             break;
1993           case 0x40:
1994           case 0x41:
1995           case 0x42:
1996           case 0x43:
1997           case 0x44:
1998           case 0x45:
1999           case 0x46:
2000           case 0x47:
2001               {
2002                 /** 0110 0001 0100 0reg         cmp     %0, %1                          */
2003 #line 509 "rl78-decode.opc"
2004                 int reg AU = op[1] & 0x07;
2005                 if (trace)
2006                   {
2007                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2008                            "/** 0110 0001 0100 0reg             cmp     %0, %1                          */",
2009                            op[0], op[1]);
2010                     printf ("  reg = 0x%x\n", reg);
2011                   }
2012                 SYNTAX("cmp     %0, %1");
2013 #line 509 "rl78-decode.opc"
2014                 ID(cmp); DRB(reg); SR(A); Fzac;
2015
2016               }
2017             break;
2018           case 0x48:
2019           case 0x4a:
2020           case 0x4b:
2021           case 0x4c:
2022           case 0x4d:
2023           case 0x4e:
2024           case 0x4f:
2025               {
2026                 /** 0110 0001 0100 1rba         cmp     %0, %1                          */
2027 #line 506 "rl78-decode.opc"
2028                 int rba AU = op[1] & 0x07;
2029                 if (trace)
2030                   {
2031                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2032                            "/** 0110 0001 0100 1rba             cmp     %0, %1                          */",
2033                            op[0], op[1]);
2034                     printf ("  rba = 0x%x\n", rba);
2035                   }
2036                 SYNTAX("cmp     %0, %1");
2037 #line 506 "rl78-decode.opc"
2038                 ID(cmp); DR(A); SRB(rba); Fzac;
2039
2040               }
2041             break;
2042           case 0x49:
2043               {
2044                 /** 0110 0001 0100 1001         cmpw    %0, %ea1                        */
2045                 if (trace)
2046                   {
2047                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2048                            "/** 0110 0001 0100 1001             cmpw    %0, %ea1                        */",
2049                            op[0], op[1]);
2050                   }
2051                 SYNTAX("cmpw    %0, %ea1");
2052 #line 536 "rl78-decode.opc"
2053                 ID(cmp); W(); DR(AX); SM(HL, IMMU(1)); Fzac;
2054
2055               }
2056             break;
2057           case 0x50:
2058           case 0x51:
2059           case 0x52:
2060           case 0x53:
2061           case 0x54:
2062           case 0x55:
2063           case 0x56:
2064           case 0x57:
2065               {
2066                 /** 0110 0001 0101 0reg         and     %0, %1                          */
2067 #line 308 "rl78-decode.opc"
2068                 int reg AU = op[1] & 0x07;
2069                 if (trace)
2070                   {
2071                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2072                            "/** 0110 0001 0101 0reg             and     %0, %1                          */",
2073                            op[0], op[1]);
2074                     printf ("  reg = 0x%x\n", reg);
2075                   }
2076                 SYNTAX("and     %0, %1");
2077 #line 308 "rl78-decode.opc"
2078                 ID(and); DRB(reg); SR(A); Fz;
2079
2080               }
2081             break;
2082           case 0x58:
2083           case 0x5a:
2084           case 0x5b:
2085           case 0x5c:
2086           case 0x5d:
2087           case 0x5e:
2088           case 0x5f:
2089               {
2090                 /** 0110 0001 0101 1rba         and     %0, %1                          */
2091 #line 305 "rl78-decode.opc"
2092                 int rba AU = op[1] & 0x07;
2093                 if (trace)
2094                   {
2095                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2096                            "/** 0110 0001 0101 1rba             and     %0, %1                          */",
2097                            op[0], op[1]);
2098                     printf ("  rba = 0x%x\n", rba);
2099                   }
2100                 SYNTAX("and     %0, %1");
2101 #line 305 "rl78-decode.opc"
2102                 ID(and); DR(A); SRB(rba); Fz;
2103
2104               }
2105             break;
2106           case 0x59:
2107               {
2108                 /** 0110 0001 0101 1001         inc     %ea0                            */
2109                 if (trace)
2110                   {
2111                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2112                            "/** 0110 0001 0101 1001             inc     %ea0                            */",
2113                            op[0], op[1]);
2114                   }
2115                 SYNTAX("inc     %ea0");
2116 #line 586 "rl78-decode.opc"
2117                 ID(add); DM(HL, IMMU(1)); SC(1); Fza;
2118
2119               }
2120             break;
2121           case 0x60:
2122           case 0x61:
2123           case 0x62:
2124           case 0x63:
2125           case 0x64:
2126           case 0x65:
2127           case 0x66:
2128           case 0x67:
2129               {
2130                 /** 0110 0001 0110 0reg         or      %0, %1                          */
2131 #line 963 "rl78-decode.opc"
2132                 int reg AU = op[1] & 0x07;
2133                 if (trace)
2134                   {
2135                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2136                            "/** 0110 0001 0110 0reg             or      %0, %1                          */",
2137                            op[0], op[1]);
2138                     printf ("  reg = 0x%x\n", reg);
2139                   }
2140                 SYNTAX("or      %0, %1");
2141 #line 963 "rl78-decode.opc"
2142                 ID(or); DRB(reg); SR(A); Fz;
2143
2144               }
2145             break;
2146           case 0x68:
2147           case 0x6a:
2148           case 0x6b:
2149           case 0x6c:
2150           case 0x6d:
2151           case 0x6e:
2152           case 0x6f:
2153               {
2154                 /** 0110 0001 0110 1rba         or      %0, %1                          */
2155 #line 960 "rl78-decode.opc"
2156                 int rba AU = op[1] & 0x07;
2157                 if (trace)
2158                   {
2159                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2160                            "/** 0110 0001 0110 1rba             or      %0, %1                          */",
2161                            op[0], op[1]);
2162                     printf ("  rba = 0x%x\n", rba);
2163                   }
2164                 SYNTAX("or      %0, %1");
2165 #line 960 "rl78-decode.opc"
2166                 ID(or); DR(A); SRB(rba); Fz;
2167
2168               }
2169             break;
2170           case 0x69:
2171               {
2172                 /** 0110 0001 0110 1001         dec     %ea0                            */
2173                 if (trace)
2174                   {
2175                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2176                            "/** 0110 0001 0110 1001             dec     %ea0                            */",
2177                            op[0], op[1]);
2178                   }
2179                 SYNTAX("dec     %ea0");
2180 #line 553 "rl78-decode.opc"
2181                 ID(sub); DM(HL, IMMU(1)); SC(1); Fza;
2182
2183               }
2184             break;
2185           case 0x70:
2186           case 0x71:
2187           case 0x72:
2188           case 0x73:
2189           case 0x74:
2190           case 0x75:
2191           case 0x76:
2192           case 0x77:
2193               {
2194                 /** 0110 0001 0111 0reg         xor     %0, %1                          */
2195 #line 1267 "rl78-decode.opc"
2196                 int reg AU = op[1] & 0x07;
2197                 if (trace)
2198                   {
2199                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2200                            "/** 0110 0001 0111 0reg             xor     %0, %1                          */",
2201                            op[0], op[1]);
2202                     printf ("  reg = 0x%x\n", reg);
2203                   }
2204                 SYNTAX("xor     %0, %1");
2205 #line 1267 "rl78-decode.opc"
2206                 ID(xor); DRB(reg); SR(A); Fz;
2207
2208               }
2209             break;
2210           case 0x78:
2211           case 0x7a:
2212           case 0x7b:
2213           case 0x7c:
2214           case 0x7d:
2215           case 0x7e:
2216           case 0x7f:
2217               {
2218                 /** 0110 0001 0111 1rba         xor     %0, %1                          */
2219 #line 1264 "rl78-decode.opc"
2220                 int rba AU = op[1] & 0x07;
2221                 if (trace)
2222                   {
2223                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2224                            "/** 0110 0001 0111 1rba             xor     %0, %1                          */",
2225                            op[0], op[1]);
2226                     printf ("  rba = 0x%x\n", rba);
2227                   }
2228                 SYNTAX("xor     %0, %1");
2229 #line 1264 "rl78-decode.opc"
2230                 ID(xor); DR(A); SRB(rba); Fz;
2231
2232               }
2233             break;
2234           case 0x79:
2235               {
2236                 /** 0110 0001 0111 1001         incw    %ea0                            */
2237                 if (trace)
2238                   {
2239                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2240                            "/** 0110 0001 0111 1001             incw    %ea0                            */",
2241                            op[0], op[1]);
2242                   }
2243                 SYNTAX("incw    %ea0");
2244 #line 600 "rl78-decode.opc"
2245                 ID(add); W(); DM(HL, IMMU(1)); SC(1);
2246
2247               }
2248             break;
2249           case 0x80:
2250           case 0x81:
2251               {
2252                 /** 0110 0001 1000 000          add     %0, %e1                         */
2253                 if (trace)
2254                   {
2255                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2256                            "/** 0110 0001 1000 000              add     %0, %e1                         */",
2257                            op[0], op[1]);
2258                   }
2259                 SYNTAX("add     %0, %e1");
2260 #line 209 "rl78-decode.opc"
2261                 ID(add); DR(A); SM2(HL, B, 0); Fzac;
2262
2263               }
2264             break;
2265           case 0x82:
2266               {
2267                 /** 0110 0001 1000 0010         add     %0, %e1                         */
2268                 if (trace)
2269                   {
2270                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2271                            "/** 0110 0001 1000 0010             add     %0, %e1                         */",
2272                            op[0], op[1]);
2273                   }
2274                 SYNTAX("add     %0, %e1");
2275 #line 215 "rl78-decode.opc"
2276                 ID(add); DR(A); SM2(HL, C, 0); Fzac;
2277
2278               }
2279             break;
2280           case 0x84:
2281           case 0x85:
2282           case 0x86:
2283           case 0x87:
2284           case 0x94:
2285           case 0x95:
2286           case 0x96:
2287           case 0x97:
2288           case 0xa4:
2289           case 0xa5:
2290           case 0xa6:
2291           case 0xa7:
2292           case 0xb4:
2293           case 0xb5:
2294           case 0xb6:
2295           case 0xb7:
2296           case 0xc4:
2297           case 0xc5:
2298           case 0xc6:
2299           case 0xc7:
2300           case 0xd4:
2301           case 0xd5:
2302           case 0xd6:
2303           case 0xd7:
2304           case 0xe4:
2305           case 0xe5:
2306           case 0xe6:
2307           case 0xe7:
2308           case 0xf4:
2309           case 0xf5:
2310           case 0xf6:
2311           case 0xf7:
2312               {
2313                 /** 0110 0001 1nnn 01mm         callt   [%x0]                           */
2314 #line 435 "rl78-decode.opc"
2315                 int nnn AU = (op[1] >> 4) & 0x07;
2316 #line 435 "rl78-decode.opc"
2317                 int mm AU = op[1] & 0x03;
2318                 if (trace)
2319                   {
2320                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2321                            "/** 0110 0001 1nnn 01mm             callt   [%x0]                           */",
2322                            op[0], op[1]);
2323                     printf ("  nnn = 0x%x,", nnn);
2324                     printf ("  mm = 0x%x\n", mm);
2325                   }
2326                 SYNTAX("callt   [%x0]");
2327 #line 435 "rl78-decode.opc"
2328                 ID(call); DM(None, 0x80 + mm*16 + nnn*2);
2329
2330               /*----------------------------------------------------------------------*/
2331
2332               }
2333             break;
2334           case 0x88:
2335           case 0x8a:
2336           case 0x8b:
2337           case 0x8c:
2338           case 0x8d:
2339           case 0x8e:
2340           case 0x8f:
2341               {
2342                 /** 0110 0001 1000 1reg         xch     %0, %1                          */
2343 #line 1226 "rl78-decode.opc"
2344                 int reg AU = op[1] & 0x07;
2345                 if (trace)
2346                   {
2347                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2348                            "/** 0110 0001 1000 1reg             xch     %0, %1                          */",
2349                            op[0], op[1]);
2350                     printf ("  reg = 0x%x\n", reg);
2351                   }
2352                 SYNTAX("xch     %0, %1");
2353 #line 1226 "rl78-decode.opc"
2354                 /* Note: DECW uses reg == X, so this must follow DECW */
2355                 ID(xch); DR(A); SRB(reg);
2356
2357               }
2358             break;
2359           case 0x89:
2360               {
2361                 /** 0110 0001 1000 1001         decw    %ea0                            */
2362                 if (trace)
2363                   {
2364                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2365                            "/** 0110 0001 1000 1001             decw    %ea0                            */",
2366                            op[0], op[1]);
2367                   }
2368                 SYNTAX("decw    %ea0");
2369 #line 567 "rl78-decode.opc"
2370                 ID(sub); W(); DM(HL, IMMU(1)); SC(1);
2371
2372               }
2373             break;
2374           case 0x90:
2375               {
2376                 /** 0110 0001 1001 0000         addc    %0, %e1                         */
2377                 if (trace)
2378                   {
2379                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2380                            "/** 0110 0001 1001 0000             addc    %0, %e1                         */",
2381                            op[0], op[1]);
2382                   }
2383                 SYNTAX("addc    %0, %e1");
2384 #line 241 "rl78-decode.opc"
2385                 ID(addc); DR(A); SM2(HL, B, 0); Fzac;
2386
2387               }
2388             break;
2389           case 0x92:
2390               {
2391                 /** 0110 0001 1001 0010         addc    %0, %e1                         */
2392                 if (trace)
2393                   {
2394                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2395                            "/** 0110 0001 1001 0010             addc    %0, %e1                         */",
2396                            op[0], op[1]);
2397                   }
2398                 SYNTAX("addc    %0, %e1");
2399 #line 244 "rl78-decode.opc"
2400                 ID(addc); DR(A); SM2(HL, C, 0); Fzac;
2401
2402               }
2403             break;
2404           case 0xa0:
2405           case 0xa1:
2406               {
2407                 /** 0110 0001 1010 000          sub     %0, %e1                         */
2408                 if (trace)
2409                   {
2410                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2411                            "/** 0110 0001 1010 000              sub     %0, %e1                         */",
2412                            op[0], op[1]);
2413                   }
2414                 SYNTAX("sub     %0, %e1");
2415 #line 1127 "rl78-decode.opc"
2416                 ID(sub); DR(A); SM2(HL, B, 0); Fzac;
2417
2418               }
2419             break;
2420           case 0xa2:
2421               {
2422                 /** 0110 0001 1010 0010         sub     %0, %e1                         */
2423                 if (trace)
2424                   {
2425                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2426                            "/** 0110 0001 1010 0010             sub     %0, %e1                         */",
2427                            op[0], op[1]);
2428                   }
2429                 SYNTAX("sub     %0, %e1");
2430 #line 1133 "rl78-decode.opc"
2431                 ID(sub); DR(A); SM2(HL, C, 0); Fzac;
2432
2433               }
2434             break;
2435           case 0xa8:
2436               {
2437                 /** 0110 0001 1010 1000         xch     %0, %1                          */
2438                 if (trace)
2439                   {
2440                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2441                            "/** 0110 0001 1010 1000             xch     %0, %1                          */",
2442                            op[0], op[1]);
2443                   }
2444                 SYNTAX("xch     %0, %1");
2445 #line 1230 "rl78-decode.opc"
2446                 ID(xch); DR(A); SM(None, SADDR);
2447
2448               }
2449             break;
2450           case 0xa9:
2451               {
2452                 /** 0110 0001 1010 1001         xch     %0, %e1                         */
2453                 if (trace)
2454                   {
2455                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2456                            "/** 0110 0001 1010 1001             xch     %0, %e1                         */",
2457                            op[0], op[1]);
2458                   }
2459                 SYNTAX("xch     %0, %e1");
2460 #line 1223 "rl78-decode.opc"
2461                 ID(xch); DR(A); SM2(HL, C, 0);
2462
2463               }
2464             break;
2465           case 0xaa:
2466               {
2467                 /** 0110 0001 1010 1010         xch     %0, %e!1                        */
2468                 if (trace)
2469                   {
2470                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2471                            "/** 0110 0001 1010 1010             xch     %0, %e!1                        */",
2472                            op[0], op[1]);
2473                   }
2474                 SYNTAX("xch     %0, %e!1");
2475 #line 1205 "rl78-decode.opc"
2476                 ID(xch); DR(A); SM(None, IMMU(2));
2477
2478               }
2479             break;
2480           case 0xab:
2481               {
2482                 /** 0110 0001 1010 1011         xch     %0, %s1                         */
2483                 if (trace)
2484                   {
2485                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2486                            "/** 0110 0001 1010 1011             xch     %0, %s1                         */",
2487                            op[0], op[1]);
2488                   }
2489                 SYNTAX("xch     %0, %s1");
2490 #line 1233 "rl78-decode.opc"
2491                 ID(xch); DR(A); SM(None, SFR);
2492
2493               }
2494             break;
2495           case 0xac:
2496               {
2497                 /** 0110 0001 1010 1100         xch     %0, %e1                         */
2498                 if (trace)
2499                   {
2500                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2501                            "/** 0110 0001 1010 1100             xch     %0, %e1                         */",
2502                            op[0], op[1]);
2503                   }
2504                 SYNTAX("xch     %0, %e1");
2505 #line 1214 "rl78-decode.opc"
2506                 ID(xch); DR(A); SM(HL, 0);
2507
2508               }
2509             break;
2510           case 0xad:
2511               {
2512                 /** 0110 0001 1010 1101         xch     %0, %ea1                        */
2513                 if (trace)
2514                   {
2515                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2516                            "/** 0110 0001 1010 1101             xch     %0, %ea1                        */",
2517                            op[0], op[1]);
2518                   }
2519                 SYNTAX("xch     %0, %ea1");
2520 #line 1220 "rl78-decode.opc"
2521                 ID(xch); DR(A); SM(HL, IMMU(1));
2522
2523               }
2524             break;
2525           case 0xae:
2526               {
2527                 /** 0110 0001 1010 1110         xch     %0, %e1                         */
2528                 if (trace)
2529                   {
2530                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2531                            "/** 0110 0001 1010 1110             xch     %0, %e1                         */",
2532                            op[0], op[1]);
2533                   }
2534                 SYNTAX("xch     %0, %e1");
2535 #line 1208 "rl78-decode.opc"
2536                 ID(xch); DR(A); SM(DE, 0);
2537
2538               }
2539             break;
2540           case 0xaf:
2541               {
2542                 /** 0110 0001 1010 1111         xch     %0, %ea1                                */
2543                 if (trace)
2544                   {
2545                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2546                            "/** 0110 0001 1010 1111             xch     %0, %ea1                                */",
2547                            op[0], op[1]);
2548                   }
2549                 SYNTAX("xch     %0, %ea1");
2550 #line 1211 "rl78-decode.opc"
2551                 ID(xch); DR(A); SM(DE, IMMU(1));
2552
2553               }
2554             break;
2555           case 0xb0:
2556               {
2557                 /** 0110 0001 1011 0000         subc    %0, %e1                         */
2558                 if (trace)
2559                   {
2560                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2561                            "/** 0110 0001 1011 0000             subc    %0, %e1                         */",
2562                            op[0], op[1]);
2563                   }
2564                 SYNTAX("subc    %0, %e1");
2565 #line 1159 "rl78-decode.opc"
2566                 ID(subc); DR(A); SM2(HL, B, 0); Fzac;
2567
2568               }
2569             break;
2570           case 0xb2:
2571               {
2572                 /** 0110 0001 1011 0010         subc    %0, %e1                         */
2573                 if (trace)
2574                   {
2575                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2576                            "/** 0110 0001 1011 0010             subc    %0, %e1                         */",
2577                            op[0], op[1]);
2578                   }
2579                 SYNTAX("subc    %0, %e1");
2580 #line 1162 "rl78-decode.opc"
2581                 ID(subc); DR(A); SM2(HL, C, 0); Fzac;
2582
2583               }
2584             break;
2585           case 0xb8:
2586               {
2587                 /** 0110 0001 1011 1000         mov     %0, %1                          */
2588                 if (trace)
2589                   {
2590                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2591                            "/** 0110 0001 1011 1000             mov     %0, %1                          */",
2592                            op[0], op[1]);
2593                   }
2594                 SYNTAX("mov     %0, %1");
2595 #line 725 "rl78-decode.opc"
2596                 ID(mov); DR(ES); SM(None, SADDR);
2597
2598               }
2599             break;
2600           case 0xb9:
2601               {
2602                 /** 0110 0001 1011 1001         xch     %0, %e1                         */
2603                 if (trace)
2604                   {
2605                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2606                            "/** 0110 0001 1011 1001             xch     %0, %e1                         */",
2607                            op[0], op[1]);
2608                   }
2609                 SYNTAX("xch     %0, %e1");
2610 #line 1217 "rl78-decode.opc"
2611                 ID(xch); DR(A); SM2(HL, B, 0);
2612
2613               }
2614             break;
2615           case 0xc0:
2616               {
2617                 /** 0110 0001 1100 0000         cmp     %0, %e1                         */
2618                 if (trace)
2619                   {
2620                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2621                            "/** 0110 0001 1100 0000             cmp     %0, %e1                         */",
2622                            op[0], op[1]);
2623                   }
2624                 SYNTAX("cmp     %0, %e1");
2625 #line 494 "rl78-decode.opc"
2626                 ID(cmp); DR(A); SM2(HL, B, 0); Fzac;
2627
2628               }
2629             break;
2630           case 0xc2:
2631               {
2632                 /** 0110 0001 1100 0010         cmp     %0, %e1                         */
2633                 if (trace)
2634                   {
2635                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2636                            "/** 0110 0001 1100 0010             cmp     %0, %e1                         */",
2637                            op[0], op[1]);
2638                   }
2639                 SYNTAX("cmp     %0, %e1");
2640 #line 497 "rl78-decode.opc"
2641                 ID(cmp); DR(A); SM2(HL, C, 0); Fzac;
2642
2643               }
2644             break;
2645           case 0xc3:
2646               {
2647                 /** 0110 0001 1100 0011         bh      $%a0                            */
2648                 if (trace)
2649                   {
2650                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2651                            "/** 0110 0001 1100 0011             bh      $%a0                            */",
2652                            op[0], op[1]);
2653                   }
2654                 SYNTAX("bh      $%a0");
2655 #line 342 "rl78-decode.opc"
2656                 ID(branch_cond); DC(pc+IMMS(1)+3); SR(None); COND(H);
2657
2658               }
2659             break;
2660           case 0xc8:
2661               {
2662                 /** 0110 0001 1100 1000         sk%c1                                   */
2663                 if (trace)
2664                   {
2665                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2666                            "/** 0110 0001 1100 1000             sk%c1                                   */",
2667                            op[0], op[1]);
2668                   }
2669                 SYNTAX("sk%c1");
2670 #line 1096 "rl78-decode.opc"
2671                 ID(skip); COND(C);
2672
2673               }
2674             break;
2675           case 0xc9:
2676               {
2677                 /** 0110 0001 1100 1001         mov     %0, %e1                         */
2678                 if (trace)
2679                   {
2680                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2681                            "/** 0110 0001 1100 1001             mov     %0, %e1                         */",
2682                            op[0], op[1]);
2683                   }
2684                 SYNTAX("mov     %0, %e1");
2685 #line 662 "rl78-decode.opc"
2686                 ID(mov); DR(A); SM2(HL, B, 0);
2687
2688               }
2689             break;
2690           case 0xca:
2691           case 0xda:
2692           case 0xea:
2693           case 0xfa:
2694               {
2695                 /** 0110 0001 11rg 1010         call    %0                              */
2696 #line 432 "rl78-decode.opc"
2697                 int rg AU = (op[1] >> 4) & 0x03;
2698                 if (trace)
2699                   {
2700                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2701                            "/** 0110 0001 11rg 1010             call    %0                              */",
2702                            op[0], op[1]);
2703                     printf ("  rg = 0x%x\n", rg);
2704                   }
2705                 SYNTAX("call    %0");
2706 #line 432 "rl78-decode.opc"
2707                 ID(call); DRW(rg);
2708
2709               }
2710             break;
2711           case 0xcb:
2712               {
2713                 /** 0110 0001 1100 1011         br      ax                              */
2714                 if (trace)
2715                   {
2716                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2717                            "/** 0110 0001 1100 1011             br      ax                              */",
2718                            op[0], op[1]);
2719                   }
2720                 SYNTAX("br      ax");
2721 #line 382 "rl78-decode.opc"
2722                 ID(branch); DR(AX);
2723
2724               /*----------------------------------------------------------------------*/
2725
2726               }
2727             break;
2728           case 0xcc:
2729               {
2730                 /** 0110 0001 1100 1100         brk                                     */
2731                 if (trace)
2732                   {
2733                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2734                            "/** 0110 0001 1100 1100             brk                                     */",
2735                            op[0], op[1]);
2736                   }
2737                 SYNTAX("brk");
2738 #line 390 "rl78-decode.opc"
2739                 ID(break);
2740
2741               /*----------------------------------------------------------------------*/
2742
2743               }
2744             break;
2745           case 0xcd:
2746               {
2747                 /** 0110 0001 1100 1101         pop     %s0                             */
2748                 if (trace)
2749                   {
2750                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2751                            "/** 0110 0001 1100 1101             pop     %s0                             */",
2752                            op[0], op[1]);
2753                   }
2754                 SYNTAX("pop     %s0");
2755 #line 991 "rl78-decode.opc"
2756                 ID(mov); W(); DR(PSW); SPOP();
2757
2758               /*----------------------------------------------------------------------*/
2759
2760               }
2761             break;
2762           case 0xce:
2763               {
2764                 /** 0110 0001 1100 1110         movs    %ea0, %1                        */
2765                 if (trace)
2766                   {
2767                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2768                            "/** 0110 0001 1100 1110             movs    %ea0, %1                        */",
2769                            op[0], op[1]);
2770                   }
2771                 SYNTAX("movs    %ea0, %1");
2772 #line 813 "rl78-decode.opc"
2773                 ID(mov); DM(HL, IMMU(1)); SR(X); Fzc;
2774
2775               /*----------------------------------------------------------------------*/
2776
2777               }
2778             break;
2779           case 0xcf:
2780           case 0xdf:
2781           case 0xef:
2782           case 0xff:
2783               {
2784                 /** 0110 0001 11rb 1111         sel     rb%1                            */
2785 #line 1043 "rl78-decode.opc"
2786                 int rb AU = (op[1] >> 4) & 0x03;
2787                 if (trace)
2788                   {
2789                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2790                            "/** 0110 0001 11rb 1111             sel     rb%1                            */",
2791                            op[0], op[1]);
2792                     printf ("  rb = 0x%x\n", rb);
2793                   }
2794                 SYNTAX("sel     rb%1");
2795 #line 1043 "rl78-decode.opc"
2796                 ID(sel); SC(rb);
2797
2798               /*----------------------------------------------------------------------*/
2799
2800               }
2801             break;
2802           case 0xd0:
2803               {
2804                 /** 0110 0001 1101 0000         and     %0, %e1                 */
2805                 if (trace)
2806                   {
2807                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2808                            "/** 0110 0001 1101 0000             and     %0, %e1                 */",
2809                            op[0], op[1]);
2810                   }
2811                 SYNTAX("and     %0, %e1");
2812 #line 293 "rl78-decode.opc"
2813                 ID(and); DR(A); SM2(HL, B, 0); Fz;
2814
2815               }
2816             break;
2817           case 0xd2:
2818               {
2819                 /** 0110 0001 1101 0010         and     %0, %e1                 */
2820                 if (trace)
2821                   {
2822                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2823                            "/** 0110 0001 1101 0010             and     %0, %e1                 */",
2824                            op[0], op[1]);
2825                   }
2826                 SYNTAX("and     %0, %e1");
2827 #line 299 "rl78-decode.opc"
2828                 ID(and); DR(A); SM2(HL, C, 0); Fz;
2829
2830               }
2831             break;
2832           case 0xd3:
2833               {
2834                 /** 0110 0001 1101 0011         bnh     $%a0                            */
2835                 if (trace)
2836                   {
2837                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2838                            "/** 0110 0001 1101 0011             bnh     $%a0                            */",
2839                            op[0], op[1]);
2840                   }
2841                 SYNTAX("bnh     $%a0");
2842 #line 345 "rl78-decode.opc"
2843                 ID(branch_cond); DC(pc+IMMS(1)+3); SR(None); COND(NH);
2844
2845               }
2846             break;
2847           case 0xd8:
2848               {
2849                 /** 0110 0001 1101 1000         sk%c1                                   */
2850                 if (trace)
2851                   {
2852                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2853                            "/** 0110 0001 1101 1000             sk%c1                                   */",
2854                            op[0], op[1]);
2855                   }
2856                 SYNTAX("sk%c1");
2857 #line 1102 "rl78-decode.opc"
2858                 ID(skip); COND(NC);
2859
2860               }
2861             break;
2862           case 0xd9:
2863               {
2864                 /** 0110 0001 1101 1001         mov     %e0, %1                         */
2865                 if (trace)
2866                   {
2867                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2868                            "/** 0110 0001 1101 1001             mov     %e0, %1                         */",
2869                            op[0], op[1]);
2870                   }
2871                 SYNTAX("mov     %e0, %1");
2872 #line 629 "rl78-decode.opc"
2873                 ID(mov); DM2(HL, B, 0); SR(A);
2874
2875               }
2876             break;
2877           case 0xdb:
2878               {
2879                 /** 0110 0001 1101 1011         ror     %0, %1                          */
2880                 if (trace)
2881                   {
2882                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2883                            "/** 0110 0001 1101 1011             ror     %0, %1                          */",
2884                            op[0], op[1]);
2885                   }
2886                 SYNTAX("ror     %0, %1");
2887 #line 1024 "rl78-decode.opc"
2888                 ID(ror); DR(A); SC(1);
2889
2890               }
2891             break;
2892           case 0xdc:
2893               {
2894                 /** 0110 0001 1101 1100         rolc    %0, %1                          */
2895                 if (trace)
2896                   {
2897                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2898                            "/** 0110 0001 1101 1100             rolc    %0, %1                          */",
2899                            op[0], op[1]);
2900                   }
2901                 SYNTAX("rolc    %0, %1");
2902 #line 1018 "rl78-decode.opc"
2903                 ID(rolc); DR(A); SC(1);
2904
2905               }
2906             break;
2907           case 0xdd:
2908               {
2909                 /** 0110 0001 1101 1101         push    %s1                             */
2910                 if (trace)
2911                   {
2912                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2913                            "/** 0110 0001 1101 1101             push    %s1                             */",
2914                            op[0], op[1]);
2915                   }
2916                 SYNTAX("push    %s1");
2917 #line 999 "rl78-decode.opc"
2918                 ID(mov); W(); DPUSH(); SR(PSW);
2919
2920               /*----------------------------------------------------------------------*/
2921
2922               }
2923             break;
2924           case 0xde:
2925               {
2926                 /** 0110 0001 1101 1110         cmps    %0, %ea1                        */
2927                 if (trace)
2928                   {
2929                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2930                            "/** 0110 0001 1101 1110             cmps    %0, %ea1                        */",
2931                            op[0], op[1]);
2932                   }
2933                 SYNTAX("cmps    %0, %ea1");
2934 #line 528 "rl78-decode.opc"
2935                 ID(cmp); DR(X); SM(HL, IMMU(1)); Fzac;
2936
2937               /*----------------------------------------------------------------------*/
2938
2939               }
2940             break;
2941           case 0xe0:
2942               {
2943                 /** 0110 0001 1110 0000         or      %0, %e1                         */
2944                 if (trace)
2945                   {
2946                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2947                            "/** 0110 0001 1110 0000             or      %0, %e1                         */",
2948                            op[0], op[1]);
2949                   }
2950                 SYNTAX("or      %0, %e1");
2951 #line 948 "rl78-decode.opc"
2952                 ID(or); DR(A); SM2(HL, B, 0); Fz;
2953
2954               }
2955             break;
2956           case 0xe2:
2957               {
2958                 /** 0110 0001 1110 0010         or      %0, %e1                         */
2959                 if (trace)
2960                   {
2961                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2962                            "/** 0110 0001 1110 0010             or      %0, %e1                         */",
2963                            op[0], op[1]);
2964                   }
2965                 SYNTAX("or      %0, %e1");
2966 #line 954 "rl78-decode.opc"
2967                 ID(or); DR(A); SM2(HL, C, 0); Fz;
2968
2969               }
2970             break;
2971           case 0xe3:
2972               {
2973                 /** 0110 0001 1110 0011         sk%c1                                   */
2974                 if (trace)
2975                   {
2976                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2977                            "/** 0110 0001 1110 0011             sk%c1                                   */",
2978                            op[0], op[1]);
2979                   }
2980                 SYNTAX("sk%c1");
2981 #line 1099 "rl78-decode.opc"
2982                 ID(skip); COND(H);
2983
2984               }
2985             break;
2986           case 0xe8:
2987               {
2988                 /** 0110 0001 1110 1000         sk%c1                                   */
2989                 if (trace)
2990                   {
2991                     printf ("\033[33m%s\033[0m  %02x %02x\n",
2992                            "/** 0110 0001 1110 1000             sk%c1                                   */",
2993                            op[0], op[1]);
2994                   }
2995                 SYNTAX("sk%c1");
2996 #line 1111 "rl78-decode.opc"
2997                 ID(skip); COND(Z);
2998
2999               /*----------------------------------------------------------------------*/
3000
3001               }
3002             break;
3003           case 0xe9:
3004               {
3005                 /** 0110 0001 1110 1001         mov     %0, %e1                         */
3006                 if (trace)
3007                   {
3008                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3009                            "/** 0110 0001 1110 1001             mov     %0, %e1                         */",
3010                            op[0], op[1]);
3011                   }
3012                 SYNTAX("mov     %0, %e1");
3013 #line 665 "rl78-decode.opc"
3014                 ID(mov); DR(A); SM2(HL, C, 0);
3015
3016               }
3017             break;
3018           case 0xeb:
3019               {
3020                 /** 0110 0001 1110 1011         rol     %0, %1                          */
3021                 if (trace)
3022                   {
3023                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3024                            "/** 0110 0001 1110 1011             rol     %0, %1                          */",
3025                            op[0], op[1]);
3026                   }
3027                 SYNTAX("rol     %0, %1");
3028 #line 1015 "rl78-decode.opc"
3029                 ID(rol); DR(A); SC(1);
3030
3031               }
3032             break;
3033           case 0xec:
3034               {
3035                 /** 0110 0001 1110 1100         retb                                    */
3036                 if (trace)
3037                   {
3038                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3039                            "/** 0110 0001 1110 1100             retb                                    */",
3040                            op[0], op[1]);
3041                   }
3042                 SYNTAX("retb");
3043 #line 1010 "rl78-decode.opc"
3044                 ID(reti);
3045
3046               /*----------------------------------------------------------------------*/
3047
3048               }
3049             break;
3050           case 0xed:
3051               {
3052                 /** 0110 0001 1110 1101         halt                                    */
3053                 if (trace)
3054                   {
3055                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3056                            "/** 0110 0001 1110 1101             halt                                    */",
3057                            op[0], op[1]);
3058                   }
3059                 SYNTAX("halt");
3060 #line 578 "rl78-decode.opc"
3061                 ID(halt);
3062
3063               /*----------------------------------------------------------------------*/
3064
3065               }
3066             break;
3067           case 0xee:
3068           case 0xfe:
3069               {
3070                 /** 0110 0001 111r 1110         rolwc   %0, %1                          */
3071 #line 1021 "rl78-decode.opc"
3072                 int r AU = (op[1] >> 4) & 0x01;
3073                 if (trace)
3074                   {
3075                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3076                            "/** 0110 0001 111r 1110             rolwc   %0, %1                          */",
3077                            op[0], op[1]);
3078                     printf ("  r = 0x%x\n", r);
3079                   }
3080                 SYNTAX("rolwc   %0, %1");
3081 #line 1021 "rl78-decode.opc"
3082                 ID(rolc); W(); DRW(r); SC(1);
3083
3084               }
3085             break;
3086           case 0xf0:
3087               {
3088                 /** 0110 0001 1111 0000         xor     %0, %e1                         */
3089                 if (trace)
3090                   {
3091                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3092                            "/** 0110 0001 1111 0000             xor     %0, %e1                         */",
3093                            op[0], op[1]);
3094                   }
3095                 SYNTAX("xor     %0, %e1");
3096 #line 1252 "rl78-decode.opc"
3097                 ID(xor); DR(A); SM2(HL, B, 0); Fz;
3098
3099               }
3100             break;
3101           case 0xf2:
3102               {
3103                 /** 0110 0001 1111 0010         xor     %0, %e1                         */
3104                 if (trace)
3105                   {
3106                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3107                            "/** 0110 0001 1111 0010             xor     %0, %e1                         */",
3108                            op[0], op[1]);
3109                   }
3110                 SYNTAX("xor     %0, %e1");
3111 #line 1258 "rl78-decode.opc"
3112                 ID(xor); DR(A); SM2(HL, C, 0); Fz;
3113
3114               }
3115             break;
3116           case 0xf3:
3117               {
3118                 /** 0110 0001 1111 0011         sk%c1                                   */
3119                 if (trace)
3120                   {
3121                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3122                            "/** 0110 0001 1111 0011             sk%c1                                   */",
3123                            op[0], op[1]);
3124                   }
3125                 SYNTAX("sk%c1");
3126 #line 1105 "rl78-decode.opc"
3127                 ID(skip); COND(NH);
3128
3129               }
3130             break;
3131           case 0xf8:
3132               {
3133                 /** 0110 0001 1111 1000         sk%c1                                   */
3134                 if (trace)
3135                   {
3136                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3137                            "/** 0110 0001 1111 1000             sk%c1                                   */",
3138                            op[0], op[1]);
3139                   }
3140                 SYNTAX("sk%c1");
3141 #line 1108 "rl78-decode.opc"
3142                 ID(skip); COND(NZ);
3143
3144               }
3145             break;
3146           case 0xf9:
3147               {
3148                 /** 0110 0001 1111 1001         mov     %e0, %1                         */
3149                 if (trace)
3150                   {
3151                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3152                            "/** 0110 0001 1111 1001             mov     %e0, %1                         */",
3153                            op[0], op[1]);
3154                   }
3155                 SYNTAX("mov     %e0, %1");
3156 #line 638 "rl78-decode.opc"
3157                 ID(mov); DM2(HL, C, 0); SR(A);
3158
3159               }
3160             break;
3161           case 0xfb:
3162               {
3163                 /** 0110 0001 1111 1011         rorc    %0, %1                          */
3164                 if (trace)
3165                   {
3166                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3167                            "/** 0110 0001 1111 1011             rorc    %0, %1                          */",
3168                            op[0], op[1]);
3169                   }
3170                 SYNTAX("rorc    %0, %1");
3171 #line 1027 "rl78-decode.opc"
3172                 ID(rorc); DR(A); SC(1);
3173
3174               /*----------------------------------------------------------------------*/
3175
3176               /* Note that the branch insns need to be listed before the shift
3177                  ones, as "shift count of zero" means "branch insn" */
3178
3179               }
3180             break;
3181           case 0xfc:
3182               {
3183                 /** 0110 0001 1111 1100         reti                                    */
3184                 if (trace)
3185                   {
3186                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3187                            "/** 0110 0001 1111 1100             reti                                    */",
3188                            op[0], op[1]);
3189                   }
3190                 SYNTAX("reti");
3191 #line 1007 "rl78-decode.opc"
3192                 ID(reti);
3193
3194               }
3195             break;
3196           case 0xfd:
3197               {
3198                 /** 0110 0001 1111 1101 stop                                            */
3199                 if (trace)
3200                   {
3201                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3202                            "/** 0110 0001 1111 1101     stop                                            */",
3203                            op[0], op[1]);
3204                   }
3205                 SYNTAX("stop");
3206 #line 1116 "rl78-decode.opc"
3207                 ID(stop);
3208
3209               /*----------------------------------------------------------------------*/
3210
3211               }
3212             break;
3213           default: UNSUPPORTED(); break;
3214         }
3215       break;
3216     case 0x68:
3217         {
3218           /** 0110 1000                 movw    %e0, %1                         */
3219           if (trace)
3220             {
3221               printf ("\033[33m%s\033[0m  %02x\n",
3222                      "/** 0110 1000                     movw    %e0, %1                         */",
3223                      op[0]);
3224             }
3225           SYNTAX("movw  %e0, %1");
3226 #line 876 "rl78-decode.opc"
3227           ID(mov); W(); DM(C, IMMU(2)); SR(AX);
3228
3229         }
3230       break;
3231     case 0x69:
3232         {
3233           /** 0110 1001                 movw    %0, %e1                         */
3234           if (trace)
3235             {
3236               printf ("\033[33m%s\033[0m  %02x\n",
3237                      "/** 0110 1001                     movw    %0, %e1                         */",
3238                      op[0]);
3239             }
3240           SYNTAX("movw  %0, %e1");
3241 #line 867 "rl78-decode.opc"
3242           ID(mov); W(); DR(AX); SM(C, IMMU(2));
3243
3244         }
3245       break;
3246     case 0x6a:
3247         {
3248           /** 0110 1010                 or      %0, #%1                         */
3249           if (trace)
3250             {
3251               printf ("\033[33m%s\033[0m  %02x\n",
3252                      "/** 0110 1010                     or      %0, #%1                         */",
3253                      op[0]);
3254             }
3255           SYNTAX("or    %0, #%1");
3256 #line 969 "rl78-decode.opc"
3257           ID(or); DM(None, SADDR); SC(IMMU(1)); Fz;
3258
3259         /*----------------------------------------------------------------------*/
3260
3261         }
3262       break;
3263     case 0x6b:
3264         {
3265           /** 0110 1011                 or      %0, %1                          */
3266           if (trace)
3267             {
3268               printf ("\033[33m%s\033[0m  %02x\n",
3269                      "/** 0110 1011                     or      %0, %1                          */",
3270                      op[0]);
3271             }
3272           SYNTAX("or    %0, %1");
3273 #line 966 "rl78-decode.opc"
3274           ID(or); DR(A); SM(None, SADDR); Fz;
3275
3276         }
3277       break;
3278     case 0x6c:
3279         {
3280           /** 0110 1100                 or      %0, #%1                         */
3281           if (trace)
3282             {
3283               printf ("\033[33m%s\033[0m  %02x\n",
3284                      "/** 0110 1100                     or      %0, #%1                         */",
3285                      op[0]);
3286             }
3287           SYNTAX("or    %0, #%1");
3288 #line 957 "rl78-decode.opc"
3289           ID(or); DR(A); SC(IMMU(1)); Fz;
3290
3291         }
3292       break;
3293     case 0x6d:
3294         {
3295           /** 0110 1101                 or      %0, %e1                         */
3296           if (trace)
3297             {
3298               printf ("\033[33m%s\033[0m  %02x\n",
3299                      "/** 0110 1101                     or      %0, %e1                         */",
3300                      op[0]);
3301             }
3302           SYNTAX("or    %0, %e1");
3303 #line 945 "rl78-decode.opc"
3304           ID(or); DR(A); SM(HL, 0); Fz;
3305
3306         }
3307       break;
3308     case 0x6e:
3309         {
3310           /** 0110 1110                 or      %0, %ea1                        */
3311           if (trace)
3312             {
3313               printf ("\033[33m%s\033[0m  %02x\n",
3314                      "/** 0110 1110                     or      %0, %ea1                        */",
3315                      op[0]);
3316             }
3317           SYNTAX("or    %0, %ea1");
3318 #line 951 "rl78-decode.opc"
3319           ID(or); DR(A); SM(HL, IMMU(1)); Fz;
3320
3321         }
3322       break;
3323     case 0x6f:
3324         {
3325           /** 0110 1111                 or      %0, %e!1                        */
3326           if (trace)
3327             {
3328               printf ("\033[33m%s\033[0m  %02x\n",
3329                      "/** 0110 1111                     or      %0, %e!1                        */",
3330                      op[0]);
3331             }
3332           SYNTAX("or    %0, %e!1");
3333 #line 942 "rl78-decode.opc"
3334           ID(or); DR(A); SM(None, IMMU(2)); Fz;
3335
3336         }
3337       break;
3338     case 0x70:
3339     case 0x72:
3340     case 0x73:
3341     case 0x74:
3342     case 0x75:
3343     case 0x76:
3344     case 0x77:
3345         {
3346           /** 0111 0rba                 mov     %0, %1                          */
3347 #line 698 "rl78-decode.opc"
3348           int rba AU = op[0] & 0x07;
3349           if (trace)
3350             {
3351               printf ("\033[33m%s\033[0m  %02x\n",
3352                      "/** 0111 0rba                     mov     %0, %1                          */",
3353                      op[0]);
3354               printf ("  rba = 0x%x\n", rba);
3355             }
3356           SYNTAX("mov   %0, %1");
3357 #line 698 "rl78-decode.opc"
3358           ID(mov); DRB(rba); SR(A);
3359
3360         }
3361       break;
3362     case 0x71:
3363         GETBYTE ();
3364         switch (op[1] & 0xff)
3365         {
3366           case 0x00:
3367           case 0x10:
3368           case 0x20:
3369           case 0x30:
3370           case 0x40:
3371           case 0x50:
3372           case 0x60:
3373           case 0x70:
3374               {
3375                 /** 0111 0001 0bit 0000         set1    %e!0                            */
3376 #line 1048 "rl78-decode.opc"
3377                 int bit AU = (op[1] >> 4) & 0x07;
3378                 if (trace)
3379                   {
3380                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3381                            "/** 0111 0001 0bit 0000             set1    %e!0                            */",
3382                            op[0], op[1]);
3383                     printf ("  bit = 0x%x\n", bit);
3384                   }
3385                 SYNTAX("set1    %e!0");
3386 #line 1048 "rl78-decode.opc"
3387                 ID(mov); DM(None, IMMU(2)); DB(bit); SC(1);
3388
3389               }
3390             break;
3391           case 0x01:
3392           case 0x11:
3393           case 0x21:
3394           case 0x31:
3395           case 0x41:
3396           case 0x51:
3397           case 0x61:
3398           case 0x71:
3399               {
3400                 /** 0111 0001 0bit 0001         mov1    %0, cy                          */
3401 #line 805 "rl78-decode.opc"
3402                 int bit AU = (op[1] >> 4) & 0x07;
3403                 if (trace)
3404                   {
3405                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3406                            "/** 0111 0001 0bit 0001             mov1    %0, cy                          */",
3407                            op[0], op[1]);
3408                     printf ("  bit = 0x%x\n", bit);
3409                   }
3410                 SYNTAX("mov1    %0, cy");
3411 #line 805 "rl78-decode.opc"
3412                 ID(mov); DM(None, SADDR); DB(bit); SCY();
3413
3414               }
3415             break;
3416           case 0x02:
3417           case 0x12:
3418           case 0x22:
3419           case 0x32:
3420           case 0x42:
3421           case 0x52:
3422           case 0x62:
3423           case 0x72:
3424               {
3425                 /** 0111 0001 0bit 0010         set1    %0                              */
3426 #line 1066 "rl78-decode.opc"
3427                 int bit AU = (op[1] >> 4) & 0x07;
3428                 if (trace)
3429                   {
3430                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3431                            "/** 0111 0001 0bit 0010             set1    %0                              */",
3432                            op[0], op[1]);
3433                     printf ("  bit = 0x%x\n", bit);
3434                   }
3435                 SYNTAX("set1    %0");
3436 #line 1066 "rl78-decode.opc"
3437                 ID(mov); DM(None, SADDR); DB(bit); SC(1);
3438
3439               /*----------------------------------------------------------------------*/
3440
3441               }
3442             break;
3443           case 0x03:
3444           case 0x13:
3445           case 0x23:
3446           case 0x33:
3447           case 0x43:
3448           case 0x53:
3449           case 0x63:
3450           case 0x73:
3451               {
3452                 /** 0111 0001 0bit 0011         clr1    %0                              */
3453 #line 458 "rl78-decode.opc"
3454                 int bit AU = (op[1] >> 4) & 0x07;
3455                 if (trace)
3456                   {
3457                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3458                            "/** 0111 0001 0bit 0011             clr1    %0                              */",
3459                            op[0], op[1]);
3460                     printf ("  bit = 0x%x\n", bit);
3461                   }
3462                 SYNTAX("clr1    %0");
3463 #line 458 "rl78-decode.opc"
3464                 ID(mov); DM(None, SADDR); DB(bit); SC(0);
3465
3466               /*----------------------------------------------------------------------*/
3467
3468               }
3469             break;
3470           case 0x04:
3471           case 0x14:
3472           case 0x24:
3473           case 0x34:
3474           case 0x44:
3475           case 0x54:
3476           case 0x64:
3477           case 0x74:
3478               {
3479                 /** 0111 0001 0bit 0100         mov1    cy, %1                          */
3480 #line 799 "rl78-decode.opc"
3481                 int bit AU = (op[1] >> 4) & 0x07;
3482                 if (trace)
3483                   {
3484                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3485                            "/** 0111 0001 0bit 0100             mov1    cy, %1                          */",
3486                            op[0], op[1]);
3487                     printf ("  bit = 0x%x\n", bit);
3488                   }
3489                 SYNTAX("mov1    cy, %1");
3490 #line 799 "rl78-decode.opc"
3491                 ID(mov); DCY(); SM(None, SADDR); SB(bit);
3492
3493               }
3494             break;
3495           case 0x05:
3496           case 0x15:
3497           case 0x25:
3498           case 0x35:
3499           case 0x45:
3500           case 0x55:
3501           case 0x65:
3502           case 0x75:
3503               {
3504                 /** 0111 0001 0bit 0101         and1    cy, %s1                         */
3505 #line 328 "rl78-decode.opc"
3506                 int bit AU = (op[1] >> 4) & 0x07;
3507                 if (trace)
3508                   {
3509                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3510                            "/** 0111 0001 0bit 0101             and1    cy, %s1                         */",
3511                            op[0], op[1]);
3512                     printf ("  bit = 0x%x\n", bit);
3513                   }
3514                 SYNTAX("and1    cy, %s1");
3515 #line 328 "rl78-decode.opc"
3516                 ID(and); DCY(); SM(None, SADDR); SB(bit);
3517
3518               /*----------------------------------------------------------------------*/
3519
3520               /* Note that the branch insns need to be listed before the shift
3521                  ones, as "shift count of zero" means "branch insn" */
3522
3523               }
3524             break;
3525           case 0x06:
3526           case 0x16:
3527           case 0x26:
3528           case 0x36:
3529           case 0x46:
3530           case 0x56:
3531           case 0x66:
3532           case 0x76:
3533               {
3534                 /** 0111 0001 0bit 0110         or1     cy, %s1                         */
3535 #line 983 "rl78-decode.opc"
3536                 int bit AU = (op[1] >> 4) & 0x07;
3537                 if (trace)
3538                   {
3539                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3540                            "/** 0111 0001 0bit 0110             or1     cy, %s1                         */",
3541                            op[0], op[1]);
3542                     printf ("  bit = 0x%x\n", bit);
3543                   }
3544                 SYNTAX("or1     cy, %s1");
3545 #line 983 "rl78-decode.opc"
3546                 ID(or); DCY(); SM(None, SADDR); SB(bit);
3547
3548               /*----------------------------------------------------------------------*/
3549
3550               }
3551             break;
3552           case 0x07:
3553           case 0x17:
3554           case 0x27:
3555           case 0x37:
3556           case 0x47:
3557           case 0x57:
3558           case 0x67:
3559           case 0x77:
3560               {
3561                 /** 0111 0001 0bit 0111         xor1    cy, %s1                         */
3562 #line 1287 "rl78-decode.opc"
3563                 int bit AU = (op[1] >> 4) & 0x07;
3564                 if (trace)
3565                   {
3566                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3567                            "/** 0111 0001 0bit 0111             xor1    cy, %s1                         */",
3568                            op[0], op[1]);
3569                     printf ("  bit = 0x%x\n", bit);
3570                   }
3571                 SYNTAX("xor1    cy, %s1");
3572 #line 1287 "rl78-decode.opc"
3573                 ID(xor); DCY(); SM(None, SADDR); SB(bit);
3574
3575               /*----------------------------------------------------------------------*/
3576
3577               }
3578             break;
3579           case 0x08:
3580           case 0x18:
3581           case 0x28:
3582           case 0x38:
3583           case 0x48:
3584           case 0x58:
3585           case 0x68:
3586           case 0x78:
3587               {
3588                 /** 0111 0001 0bit 1000         clr1    %e!0                            */
3589 #line 440 "rl78-decode.opc"
3590                 int bit AU = (op[1] >> 4) & 0x07;
3591                 if (trace)
3592                   {
3593                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3594                            "/** 0111 0001 0bit 1000             clr1    %e!0                            */",
3595                            op[0], op[1]);
3596                     printf ("  bit = 0x%x\n", bit);
3597                   }
3598                 SYNTAX("clr1    %e!0");
3599 #line 440 "rl78-decode.opc"
3600                 ID(mov); DM(None, IMMU(2)); DB(bit); SC(0);
3601
3602               }
3603             break;
3604           case 0x09:
3605           case 0x19:
3606           case 0x29:
3607           case 0x39:
3608           case 0x49:
3609           case 0x59:
3610           case 0x69:
3611           case 0x79:
3612               {
3613                 /** 0111 0001 0bit 1001         mov1    %s0, cy                         */
3614 #line 808 "rl78-decode.opc"
3615                 int bit AU = (op[1] >> 4) & 0x07;
3616                 if (trace)
3617                   {
3618                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3619                            "/** 0111 0001 0bit 1001             mov1    %s0, cy                         */",
3620                            op[0], op[1]);
3621                     printf ("  bit = 0x%x\n", bit);
3622                   }
3623                 SYNTAX("mov1    %s0, cy");
3624 #line 808 "rl78-decode.opc"
3625                 ID(mov); DM(None, SFR); DB(bit); SCY();
3626
3627               /*----------------------------------------------------------------------*/
3628
3629               }
3630             break;
3631           case 0x0a:
3632           case 0x1a:
3633           case 0x2a:
3634           case 0x3a:
3635           case 0x4a:
3636           case 0x5a:
3637           case 0x6a:
3638           case 0x7a:
3639               {
3640                 /** 0111 0001 0bit 1010         set1    %s0                             */
3641 #line 1060 "rl78-decode.opc"
3642                 int bit AU = (op[1] >> 4) & 0x07;
3643                 if (trace)
3644                   {
3645                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3646                            "/** 0111 0001 0bit 1010             set1    %s0                             */",
3647                            op[0], op[1]);
3648                     printf ("  bit = 0x%x\n", bit);
3649                   }
3650                 SYNTAX("set1    %s0");
3651 #line 1060 "rl78-decode.opc"
3652                 op0 = SFR;
3653                 ID(mov); DM(None, op0); DB(bit); SC(1);
3654                 if (op0 == RL78_SFR_PSW && bit == 7)
3655                   rl78->syntax = "ei";
3656
3657               }
3658             break;
3659           case 0x0b:
3660           case 0x1b:
3661           case 0x2b:
3662           case 0x3b:
3663           case 0x4b:
3664           case 0x5b:
3665           case 0x6b:
3666           case 0x7b:
3667               {
3668                 /** 0111 0001 0bit 1011         clr1    %s0                             */
3669 #line 452 "rl78-decode.opc"
3670                 int bit AU = (op[1] >> 4) & 0x07;
3671                 if (trace)
3672                   {
3673                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3674                            "/** 0111 0001 0bit 1011             clr1    %s0                             */",
3675                            op[0], op[1]);
3676                     printf ("  bit = 0x%x\n", bit);
3677                   }
3678                 SYNTAX("clr1    %s0");
3679 #line 452 "rl78-decode.opc"
3680                 op0 = SFR;
3681                 ID(mov); DM(None, op0); DB(bit); SC(0);
3682                 if (op0 == RL78_SFR_PSW && bit == 7)
3683                   rl78->syntax = "di";
3684
3685               }
3686             break;
3687           case 0x0c:
3688           case 0x1c:
3689           case 0x2c:
3690           case 0x3c:
3691           case 0x4c:
3692           case 0x5c:
3693           case 0x6c:
3694           case 0x7c:
3695               {
3696                 /** 0111 0001 0bit 1100         mov1    cy, %s1                         */
3697 #line 802 "rl78-decode.opc"
3698                 int bit AU = (op[1] >> 4) & 0x07;
3699                 if (trace)
3700                   {
3701                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3702                            "/** 0111 0001 0bit 1100             mov1    cy, %s1                         */",
3703                            op[0], op[1]);
3704                     printf ("  bit = 0x%x\n", bit);
3705                   }
3706                 SYNTAX("mov1    cy, %s1");
3707 #line 802 "rl78-decode.opc"
3708                 ID(mov); DCY(); SM(None, SFR); SB(bit);
3709
3710               }
3711             break;
3712           case 0x0d:
3713           case 0x1d:
3714           case 0x2d:
3715           case 0x3d:
3716           case 0x4d:
3717           case 0x5d:
3718           case 0x6d:
3719           case 0x7d:
3720               {
3721                 /** 0111 0001 0bit 1101         and1    cy, %s1                         */
3722 #line 325 "rl78-decode.opc"
3723                 int bit AU = (op[1] >> 4) & 0x07;
3724                 if (trace)
3725                   {
3726                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3727                            "/** 0111 0001 0bit 1101             and1    cy, %s1                         */",
3728                            op[0], op[1]);
3729                     printf ("  bit = 0x%x\n", bit);
3730                   }
3731                 SYNTAX("and1    cy, %s1");
3732 #line 325 "rl78-decode.opc"
3733                 ID(and); DCY(); SM(None, SFR); SB(bit);
3734
3735               }
3736             break;
3737           case 0x0e:
3738           case 0x1e:
3739           case 0x2e:
3740           case 0x3e:
3741           case 0x4e:
3742           case 0x5e:
3743           case 0x6e:
3744           case 0x7e:
3745               {
3746                 /** 0111 0001 0bit 1110         or1     cy, %s1                         */
3747 #line 980 "rl78-decode.opc"
3748                 int bit AU = (op[1] >> 4) & 0x07;
3749                 if (trace)
3750                   {
3751                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3752                            "/** 0111 0001 0bit 1110             or1     cy, %s1                         */",
3753                            op[0], op[1]);
3754                     printf ("  bit = 0x%x\n", bit);
3755                   }
3756                 SYNTAX("or1     cy, %s1");
3757 #line 980 "rl78-decode.opc"
3758                 ID(or); DCY(); SM(None, SFR); SB(bit);
3759
3760               }
3761             break;
3762           case 0x0f:
3763           case 0x1f:
3764           case 0x2f:
3765           case 0x3f:
3766           case 0x4f:
3767           case 0x5f:
3768           case 0x6f:
3769           case 0x7f:
3770               {
3771                 /** 0111 0001 0bit 1111         xor1    cy, %s1                         */
3772 #line 1284 "rl78-decode.opc"
3773                 int bit AU = (op[1] >> 4) & 0x07;
3774                 if (trace)
3775                   {
3776                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3777                            "/** 0111 0001 0bit 1111             xor1    cy, %s1                         */",
3778                            op[0], op[1]);
3779                     printf ("  bit = 0x%x\n", bit);
3780                   }
3781                 SYNTAX("xor1    cy, %s1");
3782 #line 1284 "rl78-decode.opc"
3783                 ID(xor); DCY(); SM(None, SFR); SB(bit);
3784
3785               }
3786             break;
3787           case 0x80:
3788               {
3789                 /** 0111 0001 1000 0000         set1    cy                              */
3790                 if (trace)
3791                   {
3792                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3793                            "/** 0111 0001 1000 0000             set1    cy                              */",
3794                            op[0], op[1]);
3795                   }
3796                 SYNTAX("set1    cy");
3797 #line 1057 "rl78-decode.opc"
3798                 ID(mov); DCY(); SC(1);
3799
3800               }
3801             break;
3802           case 0x81:
3803           case 0x91:
3804           case 0xa1:
3805           case 0xb1:
3806           case 0xc1:
3807           case 0xd1:
3808           case 0xe1:
3809           case 0xf1:
3810               {
3811                 /** 0111 0001 1bit 0001         mov1    %e0, cy                         */
3812 #line 787 "rl78-decode.opc"
3813                 int bit AU = (op[1] >> 4) & 0x07;
3814                 if (trace)
3815                   {
3816                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3817                            "/** 0111 0001 1bit 0001             mov1    %e0, cy                         */",
3818                            op[0], op[1]);
3819                     printf ("  bit = 0x%x\n", bit);
3820                   }
3821                 SYNTAX("mov1    %e0, cy");
3822 #line 787 "rl78-decode.opc"
3823                 ID(mov); DM(HL, 0); DB(bit); SCY();
3824
3825               }
3826             break;
3827           case 0x82:
3828           case 0x92:
3829           case 0xa2:
3830           case 0xb2:
3831           case 0xc2:
3832           case 0xd2:
3833           case 0xe2:
3834           case 0xf2:
3835               {
3836                 /** 0111 0001 1bit 0010         set1    %e0                             */
3837 #line 1051 "rl78-decode.opc"
3838                 int bit AU = (op[1] >> 4) & 0x07;
3839                 if (trace)
3840                   {
3841                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3842                            "/** 0111 0001 1bit 0010             set1    %e0                             */",
3843                            op[0], op[1]);
3844                     printf ("  bit = 0x%x\n", bit);
3845                   }
3846                 SYNTAX("set1    %e0");
3847 #line 1051 "rl78-decode.opc"
3848                 ID(mov); DM(HL, 0); DB(bit); SC(1);
3849
3850               }
3851             break;
3852           case 0x83:
3853           case 0x93:
3854           case 0xa3:
3855           case 0xb3:
3856           case 0xc3:
3857           case 0xd3:
3858           case 0xe3:
3859           case 0xf3:
3860               {
3861                 /** 0111 0001 1bit 0011         clr1    %e0                             */
3862 #line 443 "rl78-decode.opc"
3863                 int bit AU = (op[1] >> 4) & 0x07;
3864                 if (trace)
3865                   {
3866                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3867                            "/** 0111 0001 1bit 0011             clr1    %e0                             */",
3868                            op[0], op[1]);
3869                     printf ("  bit = 0x%x\n", bit);
3870                   }
3871                 SYNTAX("clr1    %e0");
3872 #line 443 "rl78-decode.opc"
3873                 ID(mov); DM(HL, 0); DB(bit); SC(0);
3874
3875               }
3876             break;
3877           case 0x84:
3878           case 0x94:
3879           case 0xa4:
3880           case 0xb4:
3881           case 0xc4:
3882           case 0xd4:
3883           case 0xe4:
3884           case 0xf4:
3885               {
3886                 /** 0111 0001 1bit 0100         mov1    cy, %e1                         */
3887 #line 793 "rl78-decode.opc"
3888                 int bit AU = (op[1] >> 4) & 0x07;
3889                 if (trace)
3890                   {
3891                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3892                            "/** 0111 0001 1bit 0100             mov1    cy, %e1                         */",
3893                            op[0], op[1]);
3894                     printf ("  bit = 0x%x\n", bit);
3895                   }
3896                 SYNTAX("mov1    cy, %e1");
3897 #line 793 "rl78-decode.opc"
3898                 ID(mov); DCY(); SM(HL, 0); SB(bit);
3899
3900               }
3901             break;
3902           case 0x85:
3903           case 0x95:
3904           case 0xa5:
3905           case 0xb5:
3906           case 0xc5:
3907           case 0xd5:
3908           case 0xe5:
3909           case 0xf5:
3910               {
3911                 /** 0111 0001 1bit 0101         and1    cy, %e1                 */
3912 #line 319 "rl78-decode.opc"
3913                 int bit AU = (op[1] >> 4) & 0x07;
3914                 if (trace)
3915                   {
3916                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3917                            "/** 0111 0001 1bit 0101             and1    cy, %e1                 */",
3918                            op[0], op[1]);
3919                     printf ("  bit = 0x%x\n", bit);
3920                   }
3921                 SYNTAX("and1    cy, %e1");
3922 #line 319 "rl78-decode.opc"
3923                 ID(and); DCY(); SM(HL, 0); SB(bit);
3924
3925               }
3926             break;
3927           case 0x86:
3928           case 0x96:
3929           case 0xa6:
3930           case 0xb6:
3931           case 0xc6:
3932           case 0xd6:
3933           case 0xe6:
3934           case 0xf6:
3935               {
3936                 /** 0111 0001 1bit 0110         or1     cy, %e1                         */
3937 #line 974 "rl78-decode.opc"
3938                 int bit AU = (op[1] >> 4) & 0x07;
3939                 if (trace)
3940                   {
3941                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3942                            "/** 0111 0001 1bit 0110             or1     cy, %e1                         */",
3943                            op[0], op[1]);
3944                     printf ("  bit = 0x%x\n", bit);
3945                   }
3946                 SYNTAX("or1     cy, %e1");
3947 #line 974 "rl78-decode.opc"
3948                 ID(or); DCY(); SM(HL, 0); SB(bit);
3949
3950               }
3951             break;
3952           case 0x87:
3953           case 0x97:
3954           case 0xa7:
3955           case 0xb7:
3956           case 0xc7:
3957           case 0xd7:
3958           case 0xe7:
3959           case 0xf7:
3960               {
3961                 /** 0111 0001 1bit 0111         xor1    cy, %e1                         */
3962 #line 1278 "rl78-decode.opc"
3963                 int bit AU = (op[1] >> 4) & 0x07;
3964                 if (trace)
3965                   {
3966                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3967                            "/** 0111 0001 1bit 0111             xor1    cy, %e1                         */",
3968                            op[0], op[1]);
3969                     printf ("  bit = 0x%x\n", bit);
3970                   }
3971                 SYNTAX("xor1    cy, %e1");
3972 #line 1278 "rl78-decode.opc"
3973                 ID(xor); DCY(); SM(HL, 0); SB(bit);
3974
3975               }
3976             break;
3977           case 0x88:
3978               {
3979                 /** 0111 0001 1000 1000         clr1    cy                              */
3980                 if (trace)
3981                   {
3982                     printf ("\033[33m%s\033[0m  %02x %02x\n",
3983                            "/** 0111 0001 1000 1000             clr1    cy                              */",
3984                            op[0], op[1]);
3985                   }
3986                 SYNTAX("clr1    cy");
3987 #line 449 "rl78-decode.opc"
3988                 ID(mov); DCY(); SC(0);
3989
3990               }
3991             break;
3992           case 0x89:
3993           case 0x99:
3994           case 0xa9:
3995           case 0xb9:
3996           case 0xc9:
3997           case 0xd9:
3998           case 0xe9:
3999           case 0xf9:
4000               {
4001                 /** 0111 0001 1bit 1001         mov1    %e0, cy                         */
4002 #line 790 "rl78-decode.opc"
4003                 int bit AU = (op[1] >> 4) & 0x07;
4004                 if (trace)
4005                   {
4006                     printf ("\033[33m%s\033[0m  %02x %02x\n",
4007                            "/** 0111 0001 1bit 1001             mov1    %e0, cy                         */",
4008                            op[0], op[1]);
4009                     printf ("  bit = 0x%x\n", bit);
4010                   }
4011                 SYNTAX("mov1    %e0, cy");
4012 #line 790 "rl78-decode.opc"
4013                 ID(mov); DR(A); DB(bit); SCY();
4014
4015               }
4016             break;
4017           case 0x8a:
4018           case 0x9a:
4019           case 0xaa:
4020           case 0xba:
4021           case 0xca:
4022           case 0xda:
4023           case 0xea:
4024           case 0xfa:
4025               {
4026                 /** 0111 0001 1bit 1010         set1    %0                              */
4027 #line 1054 "rl78-decode.opc"
4028                 int bit AU = (op[1] >> 4) & 0x07;
4029                 if (trace)
4030                   {
4031                     printf ("\033[33m%s\033[0m  %02x %02x\n",
4032                            "/** 0111 0001 1bit 1010             set1    %0                              */",
4033                            op[0], op[1]);
4034                     printf ("  bit = 0x%x\n", bit);
4035                   }
4036                 SYNTAX("set1    %0");
4037 #line 1054 "rl78-decode.opc"
4038                 ID(mov); DR(A); DB(bit); SC(1);
4039
4040               }
4041             break;
4042           case 0x8b:
4043           case 0x9b:
4044           case 0xab:
4045           case 0xbb:
4046           case 0xcb:
4047           case 0xdb:
4048           case 0xeb:
4049           case 0xfb:
4050               {
4051                 /** 0111 0001 1bit 1011         clr1    %0                              */
4052 #line 446 "rl78-decode.opc"
4053                 int bit AU = (op[1] >> 4) & 0x07;
4054                 if (trace)
4055                   {
4056                     printf ("\033[33m%s\033[0m  %02x %02x\n",
4057                            "/** 0111 0001 1bit 1011             clr1    %0                              */",
4058                            op[0], op[1]);
4059                     printf ("  bit = 0x%x\n", bit);
4060                   }
4061                 SYNTAX("clr1    %0");
4062 #line 446 "rl78-decode.opc"
4063                 ID(mov); DR(A); DB(bit); SC(0);
4064
4065               }
4066             break;
4067           case 0x8c:
4068           case 0x9c:
4069           case 0xac:
4070           case 0xbc:
4071           case 0xcc:
4072           case 0xdc:
4073           case 0xec:
4074           case 0xfc:
4075               {
4076                 /** 0111 0001 1bit 1100         mov1    cy, %e1                         */
4077 #line 796 "rl78-decode.opc"
4078                 int bit AU = (op[1] >> 4) & 0x07;
4079                 if (trace)
4080                   {
4081                     printf ("\033[33m%s\033[0m  %02x %02x\n",
4082                            "/** 0111 0001 1bit 1100             mov1    cy, %e1                         */",
4083                            op[0], op[1]);
4084                     printf ("  bit = 0x%x\n", bit);
4085                   }
4086                 SYNTAX("mov1    cy, %e1");
4087 #line 796 "rl78-decode.opc"
4088                 ID(mov); DCY(); SR(A); SB(bit);
4089
4090               }
4091             break;
4092           case 0x8d:
4093           case 0x9d:
4094           case 0xad:
4095           case 0xbd:
4096           case 0xcd:
4097           case 0xdd:
4098           case 0xed:
4099           case 0xfd:
4100               {
4101                 /** 0111 0001 1bit 1101         and1    cy, %1                          */
4102 #line 322 "rl78-decode.opc"
4103                 int bit AU = (op[1] >> 4) & 0x07;
4104                 if (trace)
4105                   {
4106                     printf ("\033[33m%s\033[0m  %02x %02x\n",
4107                            "/** 0111 0001 1bit 1101             and1    cy, %1                          */",
4108                            op[0], op[1]);
4109                     printf ("  bit = 0x%x\n", bit);
4110                   }
4111                 SYNTAX("and1    cy, %1");
4112 #line 322 "rl78-decode.opc"
4113                 ID(and); DCY(); SR(A); SB(bit);
4114
4115               }
4116             break;
4117           case 0x8e:
4118           case 0x9e:
4119           case 0xae:
4120           case 0xbe:
4121           case 0xce:
4122           case 0xde:
4123           case 0xee:
4124           case 0xfe:
4125               {
4126                 /** 0111 0001 1bit 1110         or1     cy, %1                          */
4127 #line 977 "rl78-decode.opc"
4128                 int bit AU = (op[1] >> 4) & 0x07;
4129                 if (trace)
4130                   {
4131                     printf ("\033[33m%s\033[0m  %02x %02x\n",
4132                            "/** 0111 0001 1bit 1110             or1     cy, %1                          */",
4133                            op[0], op[1]);
4134                     printf ("  bit = 0x%x\n", bit);
4135                   }
4136                 SYNTAX("or1     cy, %1");
4137 #line 977 "rl78-decode.opc"
4138                 ID(or); DCY(); SR(A); SB(bit);
4139
4140               }
4141             break;
4142           case 0x8f:
4143           case 0x9f:
4144           case 0xaf:
4145           case 0xbf:
4146           case 0xcf:
4147           case 0xdf:
4148           case 0xef:
4149           case 0xff:
4150               {
4151                 /** 0111 0001 1bit 1111         xor1    cy, %1                          */
4152 #line 1281 "rl78-decode.opc"
4153                 int bit AU = (op[1] >> 4) & 0x07;
4154                 if (trace)
4155                   {
4156                     printf ("\033[33m%s\033[0m  %02x %02x\n",
4157                            "/** 0111 0001 1bit 1111             xor1    cy, %1                          */",
4158                            op[0], op[1]);
4159                     printf ("  bit = 0x%x\n", bit);
4160                   }
4161                 SYNTAX("xor1    cy, %1");
4162 #line 1281 "rl78-decode.opc"
4163                 ID(xor); DCY(); SR(A); SB(bit);
4164
4165               }
4166             break;
4167           case 0xc0:
4168               {
4169                 /** 0111 0001 1100 0000         not1    cy                              */
4170                 if (trace)
4171                   {
4172                     printf ("\033[33m%s\033[0m  %02x %02x\n",
4173                            "/** 0111 0001 1100 0000             not1    cy                              */",
4174                            op[0], op[1]);
4175                   }
4176                 SYNTAX("not1    cy");
4177 #line 918 "rl78-decode.opc"
4178                 ID(xor); DCY(); SC(1);
4179
4180               /*----------------------------------------------------------------------*/
4181
4182               }
4183             break;
4184           default: UNSUPPORTED(); break;
4185         }
4186       break;
4187     case 0x78:
4188         {
4189           /** 0111 1000                 movw    %e0, %1                         */
4190           if (trace)
4191             {
4192               printf ("\033[33m%s\033[0m  %02x\n",
4193                      "/** 0111 1000                     movw    %e0, %1                         */",
4194                      op[0]);
4195             }
4196           SYNTAX("movw  %e0, %1");
4197 #line 879 "rl78-decode.opc"
4198           ID(mov); W(); DM(BC, IMMU(2)); SR(AX);
4199
4200         }
4201       break;
4202     case 0x79:
4203         {
4204           /** 0111 1001                 movw    %0, %e1                         */
4205           if (trace)
4206             {
4207               printf ("\033[33m%s\033[0m  %02x\n",
4208                      "/** 0111 1001                     movw    %0, %e1                         */",
4209                      op[0]);
4210             }
4211           SYNTAX("movw  %0, %e1");
4212 #line 870 "rl78-decode.opc"
4213           ID(mov); W(); DR(AX); SM(BC, IMMU(2));
4214
4215         }
4216       break;
4217     case 0x7a:
4218         {
4219           /** 0111 1010                 xor     %0, #%1                         */
4220           if (trace)
4221             {
4222               printf ("\033[33m%s\033[0m  %02x\n",
4223                      "/** 0111 1010                     xor     %0, #%1                         */",
4224                      op[0]);
4225             }
4226           SYNTAX("xor   %0, #%1");
4227 #line 1273 "rl78-decode.opc"
4228           ID(xor); DM(None, SADDR); SC(IMMU(1)); Fz;
4229
4230         /*----------------------------------------------------------------------*/
4231
4232         }
4233       break;
4234     case 0x7b:
4235         {
4236           /** 0111 1011                 xor     %0, %1                          */
4237           if (trace)
4238             {
4239               printf ("\033[33m%s\033[0m  %02x\n",
4240                      "/** 0111 1011                     xor     %0, %1                          */",
4241                      op[0]);
4242             }
4243           SYNTAX("xor   %0, %1");
4244 #line 1270 "rl78-decode.opc"
4245           ID(xor); DR(A); SM(None, SADDR); Fz;
4246
4247         }
4248       break;
4249     case 0x7c:
4250         {
4251           /** 0111 1100                 xor     %0, #%1                         */
4252           if (trace)
4253             {
4254               printf ("\033[33m%s\033[0m  %02x\n",
4255                      "/** 0111 1100                     xor     %0, #%1                         */",
4256                      op[0]);
4257             }
4258           SYNTAX("xor   %0, #%1");
4259 #line 1261 "rl78-decode.opc"
4260           ID(xor); DR(A); SC(IMMU(1)); Fz;
4261
4262         }
4263       break;
4264     case 0x7d:
4265         {
4266           /** 0111 1101                 xor     %0, %e1                         */
4267           if (trace)
4268             {
4269               printf ("\033[33m%s\033[0m  %02x\n",
4270                      "/** 0111 1101                     xor     %0, %e1                         */",
4271                      op[0]);
4272             }
4273           SYNTAX("xor   %0, %e1");
4274 #line 1249 "rl78-decode.opc"
4275           ID(xor); DR(A); SM(HL, 0); Fz;
4276
4277         }
4278       break;
4279     case 0x7e:
4280         {
4281           /** 0111 1110                 xor     %0, %ea1                        */
4282           if (trace)
4283             {
4284               printf ("\033[33m%s\033[0m  %02x\n",
4285                      "/** 0111 1110                     xor     %0, %ea1                        */",
4286                      op[0]);
4287             }
4288           SYNTAX("xor   %0, %ea1");
4289 #line 1255 "rl78-decode.opc"
4290           ID(xor); DR(A); SM(HL, IMMU(1)); Fz;
4291
4292         }
4293       break;
4294     case 0x7f:
4295         {
4296           /** 0111 1111                 xor     %0, %e!1                        */
4297           if (trace)
4298             {
4299               printf ("\033[33m%s\033[0m  %02x\n",
4300                      "/** 0111 1111                     xor     %0, %e!1                        */",
4301                      op[0]);
4302             }
4303           SYNTAX("xor   %0, %e!1");
4304 #line 1246 "rl78-decode.opc"
4305           ID(xor); DR(A); SM(None, IMMU(2)); Fz;
4306
4307         }
4308       break;
4309     case 0x80:
4310     case 0x81:
4311     case 0x82:
4312     case 0x83:
4313     case 0x84:
4314     case 0x85:
4315     case 0x86:
4316     case 0x87:
4317         {
4318           /** 1000 0reg                 inc     %0                              */
4319 #line 589 "rl78-decode.opc"
4320           int reg AU = op[0] & 0x07;
4321           if (trace)
4322             {
4323               printf ("\033[33m%s\033[0m  %02x\n",
4324                      "/** 1000 0reg                     inc     %0                              */",
4325                      op[0]);
4326               printf ("  reg = 0x%x\n", reg);
4327             }
4328           SYNTAX("inc   %0");
4329 #line 589 "rl78-decode.opc"
4330           ID(add); DRB(reg); SC(1); Fza;
4331
4332         }
4333       break;
4334     case 0x88:
4335         {
4336           /** 1000 1000                 mov     %0, %ea1                        */
4337           if (trace)
4338             {
4339               printf ("\033[33m%s\033[0m  %02x\n",
4340                      "/** 1000 1000                     mov     %0, %ea1                        */",
4341                      op[0]);
4342             }
4343           SYNTAX("mov   %0, %ea1");
4344 #line 668 "rl78-decode.opc"
4345           ID(mov); DR(A); SM(SP, IMMU(1));
4346
4347         }
4348       break;
4349     case 0x89:
4350         {
4351           /** 1000 1001                 mov     %0, %e1                         */
4352           if (trace)
4353             {
4354               printf ("\033[33m%s\033[0m  %02x\n",
4355                      "/** 1000 1001                     mov     %0, %e1                         */",
4356                      op[0]);
4357             }
4358           SYNTAX("mov   %0, %e1");
4359 #line 650 "rl78-decode.opc"
4360           ID(mov); DR(A); SM(DE, 0);
4361
4362         }
4363       break;
4364     case 0x8a:
4365         {
4366           /** 1000 1010                 mov     %0, %ea1                        */
4367           if (trace)
4368             {
4369               printf ("\033[33m%s\033[0m  %02x\n",
4370                      "/** 1000 1010                     mov     %0, %ea1                        */",
4371                      op[0]);
4372             }
4373           SYNTAX("mov   %0, %ea1");
4374 #line 653 "rl78-decode.opc"
4375           ID(mov); DR(A); SM(DE, IMMU(1));
4376
4377         }
4378       break;
4379     case 0x8b:
4380         {
4381           /** 1000 1011                 mov     %0, %e1                         */
4382           if (trace)
4383             {
4384               printf ("\033[33m%s\033[0m  %02x\n",
4385                      "/** 1000 1011                     mov     %0, %e1                         */",
4386                      op[0]);
4387             }
4388           SYNTAX("mov   %0, %e1");
4389 #line 656 "rl78-decode.opc"
4390           ID(mov); DR(A); SM(HL, 0);
4391
4392         }
4393       break;
4394     case 0x8c:
4395         {
4396           /** 1000 1100                 mov     %0, %ea1                        */
4397           if (trace)
4398             {
4399               printf ("\033[33m%s\033[0m  %02x\n",
4400                      "/** 1000 1100                     mov     %0, %ea1                        */",
4401                      op[0]);
4402             }
4403           SYNTAX("mov   %0, %ea1");
4404 #line 659 "rl78-decode.opc"
4405           ID(mov); DR(A); SM(HL, IMMU(1));
4406
4407         }
4408       break;
4409     case 0x8d:
4410         {
4411           /** 1000 1101                 mov     %0, %1                          */
4412           if (trace)
4413             {
4414               printf ("\033[33m%s\033[0m  %02x\n",
4415                      "/** 1000 1101                     mov     %0, %1                          */",
4416                      op[0]);
4417             }
4418           SYNTAX("mov   %0, %1");
4419 #line 692 "rl78-decode.opc"
4420           ID(mov); DR(A); SM(None, SADDR);
4421
4422         }
4423       break;
4424     case 0x8e:
4425         {
4426           /** 1000 1110                 mov     %0, %s1                         */
4427           if (trace)
4428             {
4429               printf ("\033[33m%s\033[0m  %02x\n",
4430                      "/** 1000 1110                     mov     %0, %s1                         */",
4431                      op[0]);
4432             }
4433           SYNTAX("mov   %0, %s1");
4434 #line 689 "rl78-decode.opc"
4435           ID(mov); DR(A); SM(None, SFR);
4436
4437         }
4438       break;
4439     case 0x8f:
4440         {
4441           /** 1000 1111                 mov     %0, %e!1                        */
4442           if (trace)
4443             {
4444               printf ("\033[33m%s\033[0m  %02x\n",
4445                      "/** 1000 1111                     mov     %0, %e!1                        */",
4446                      op[0]);
4447             }
4448           SYNTAX("mov   %0, %e!1");
4449 #line 647 "rl78-decode.opc"
4450           ID(mov); DR(A); SM(None, IMMU(2));
4451
4452         }
4453       break;
4454     case 0x90:
4455     case 0x91:
4456     case 0x92:
4457     case 0x93:
4458     case 0x94:
4459     case 0x95:
4460     case 0x96:
4461     case 0x97:
4462         {
4463           /** 1001 0reg                 dec     %0                              */
4464 #line 556 "rl78-decode.opc"
4465           int reg AU = op[0] & 0x07;
4466           if (trace)
4467             {
4468               printf ("\033[33m%s\033[0m  %02x\n",
4469                      "/** 1001 0reg                     dec     %0                              */",
4470                      op[0]);
4471               printf ("  reg = 0x%x\n", reg);
4472             }
4473           SYNTAX("dec   %0");
4474 #line 556 "rl78-decode.opc"
4475           ID(sub); DRB(reg); SC(1); Fza;
4476
4477         }
4478       break;
4479     case 0x98:
4480         {
4481           /** 1001 1000                 mov     %a0, %1                         */
4482           if (trace)
4483             {
4484               printf ("\033[33m%s\033[0m  %02x\n",
4485                      "/** 1001 1000                     mov     %a0, %1                         */",
4486                      op[0]);
4487             }
4488           SYNTAX("mov   %a0, %1");
4489 #line 644 "rl78-decode.opc"
4490           ID(mov); DM(SP, IMMU(1)); SR(A);
4491
4492         }
4493       break;
4494     case 0x99:
4495         {
4496           /** 1001 1001                 mov     %e0, %1                         */
4497           if (trace)
4498             {
4499               printf ("\033[33m%s\033[0m  %02x\n",
4500                      "/** 1001 1001                     mov     %e0, %1                         */",
4501                      op[0]);
4502             }
4503           SYNTAX("mov   %e0, %1");
4504 #line 617 "rl78-decode.opc"
4505           ID(mov); DM(DE, 0); SR(A);
4506
4507         }
4508       break;
4509     case 0x9a:
4510         {
4511           /** 1001 1010                 mov     %ea0, %1                                */
4512           if (trace)
4513             {
4514               printf ("\033[33m%s\033[0m  %02x\n",
4515                      "/** 1001 1010                     mov     %ea0, %1                                */",
4516                      op[0]);
4517             }
4518           SYNTAX("mov   %ea0, %1");
4519 #line 623 "rl78-decode.opc"
4520           ID(mov); DM(DE, IMMU(1)); SR(A);
4521
4522         }
4523       break;
4524     case 0x9b:
4525         {
4526           /** 1001 1011                 mov     %e0, %1                         */
4527           if (trace)
4528             {
4529               printf ("\033[33m%s\033[0m  %02x\n",
4530                      "/** 1001 1011                     mov     %e0, %1                         */",
4531                      op[0]);
4532             }
4533           SYNTAX("mov   %e0, %1");
4534 #line 626 "rl78-decode.opc"
4535           ID(mov); DM(HL, 0); SR(A);
4536
4537         }
4538       break;
4539     case 0x9c:
4540         {
4541           /** 1001 1100                 mov     %ea0, %1                        */
4542           if (trace)
4543             {
4544               printf ("\033[33m%s\033[0m  %02x\n",
4545                      "/** 1001 1100                     mov     %ea0, %1                        */",
4546                      op[0]);
4547             }
4548           SYNTAX("mov   %ea0, %1");
4549 #line 635 "rl78-decode.opc"
4550           ID(mov); DM(HL, IMMU(1)); SR(A);
4551
4552         }
4553       break;
4554     case 0x9d:
4555         {
4556           /** 1001 1101                 mov     %0, %1                          */
4557           if (trace)
4558             {
4559               printf ("\033[33m%s\033[0m  %02x\n",
4560                      "/** 1001 1101                     mov     %0, %1                          */",
4561                      op[0]);
4562             }
4563           SYNTAX("mov   %0, %1");
4564 #line 749 "rl78-decode.opc"
4565           ID(mov); DM(None, SADDR); SR(A);
4566
4567         }
4568       break;
4569     case 0x9e:
4570         {
4571           /** 1001 1110                 mov     %s0, %1                         */
4572           if (trace)
4573             {
4574               printf ("\033[33m%s\033[0m  %02x\n",
4575                      "/** 1001 1110                     mov     %s0, %1                         */",
4576                      op[0]);
4577             }
4578           SYNTAX("mov   %s0, %1");
4579 #line 782 "rl78-decode.opc"
4580           ID(mov); DM(None, SFR); SR(A);
4581
4582         /*----------------------------------------------------------------------*/
4583
4584         }
4585       break;
4586     case 0x9f:
4587         {
4588           /** 1001 1111                 mov     %e!0, %1                        */
4589           if (trace)
4590             {
4591               printf ("\033[33m%s\033[0m  %02x\n",
4592                      "/** 1001 1111                     mov     %e!0, %1                        */",
4593                      op[0]);
4594             }
4595           SYNTAX("mov   %e!0, %1");
4596 #line 614 "rl78-decode.opc"
4597           ID(mov); DM(None, IMMU(2)); SR(A);
4598
4599         }
4600       break;
4601     case 0xa0:
4602         {
4603           /** 1010 0000                 inc     %e!0                            */
4604           if (trace)
4605             {
4606               printf ("\033[33m%s\033[0m  %02x\n",
4607                      "/** 1010 0000                     inc     %e!0                            */",
4608                      op[0]);
4609             }
4610           SYNTAX("inc   %e!0");
4611 #line 583 "rl78-decode.opc"
4612           ID(add); DM(None, IMMU(2)); SC(1); Fza;
4613
4614         }
4615       break;
4616     case 0xa1:
4617     case 0xa3:
4618     case 0xa5:
4619     case 0xa7:
4620         {
4621           /** 1010 0rg1                 incw    %0                              */
4622 #line 603 "rl78-decode.opc"
4623           int rg AU = (op[0] >> 1) & 0x03;
4624           if (trace)
4625             {
4626               printf ("\033[33m%s\033[0m  %02x\n",
4627                      "/** 1010 0rg1                     incw    %0                              */",
4628                      op[0]);
4629               printf ("  rg = 0x%x\n", rg);
4630             }
4631           SYNTAX("incw  %0");
4632 #line 603 "rl78-decode.opc"
4633           ID(add); W(); DRW(rg); SC(1);
4634
4635         }
4636       break;
4637     case 0xa2:
4638         {
4639           /** 1010 0010                 incw    %e!0                            */
4640           if (trace)
4641             {
4642               printf ("\033[33m%s\033[0m  %02x\n",
4643                      "/** 1010 0010                     incw    %e!0                            */",
4644                      op[0]);
4645             }
4646           SYNTAX("incw  %e!0");
4647 #line 597 "rl78-decode.opc"
4648           ID(add); W(); DM(None, IMMU(2)); SC(1);
4649
4650         }
4651       break;
4652     case 0xa4:
4653         {
4654           /** 1010 0100                 inc     %0                              */
4655           if (trace)
4656             {
4657               printf ("\033[33m%s\033[0m  %02x\n",
4658                      "/** 1010 0100                     inc     %0                              */",
4659                      op[0]);
4660             }
4661           SYNTAX("inc   %0");
4662 #line 592 "rl78-decode.opc"
4663           ID(add); DM(None, SADDR); SC(1); Fza;
4664
4665         /*----------------------------------------------------------------------*/
4666
4667         }
4668       break;
4669     case 0xa6:
4670         {
4671           /** 1010 0110                 incw    %0                              */
4672           if (trace)
4673             {
4674               printf ("\033[33m%s\033[0m  %02x\n",
4675                      "/** 1010 0110                     incw    %0                              */",
4676                      op[0]);
4677             }
4678           SYNTAX("incw  %0");
4679 #line 606 "rl78-decode.opc"
4680           ID(add); W(); DM(None, SADDR); SC(1);
4681
4682         /*----------------------------------------------------------------------*/
4683
4684         }
4685       break;
4686     case 0xa8:
4687         {
4688           /** 1010 1000                 movw    %0, %a1                         */
4689           if (trace)
4690             {
4691               printf ("\033[33m%s\033[0m  %02x\n",
4692                      "/** 1010 1000                     movw    %0, %a1                         */",
4693                      op[0]);
4694             }
4695           SYNTAX("movw  %0, %a1");
4696 #line 852 "rl78-decode.opc"
4697           ID(mov); W(); DR(AX); SM(SP, IMMU(1));
4698
4699         }
4700       break;
4701     case 0xa9:
4702         {
4703           /** 1010 1001                 movw    %0, %e1                         */
4704           if (trace)
4705             {
4706               printf ("\033[33m%s\033[0m  %02x\n",
4707                      "/** 1010 1001                     movw    %0, %e1                         */",
4708                      op[0]);
4709             }
4710           SYNTAX("movw  %0, %e1");
4711 #line 840 "rl78-decode.opc"
4712           ID(mov); W(); DR(AX); SM(DE, 0);
4713
4714         }
4715       break;
4716     case 0xaa:
4717         {
4718           /** 1010 1010                 movw    %0, %ea1                                */
4719           if (trace)
4720             {
4721               printf ("\033[33m%s\033[0m  %02x\n",
4722                      "/** 1010 1010                     movw    %0, %ea1                                */",
4723                      op[0]);
4724             }
4725           SYNTAX("movw  %0, %ea1");
4726 #line 843 "rl78-decode.opc"
4727           ID(mov); W(); DR(AX); SM(DE, IMMU(1));
4728
4729         }
4730       break;
4731     case 0xab:
4732         {
4733           /** 1010 1011                 movw    %0, %e1                         */
4734           if (trace)
4735             {
4736               printf ("\033[33m%s\033[0m  %02x\n",
4737                      "/** 1010 1011                     movw    %0, %e1                         */",
4738                      op[0]);
4739             }
4740           SYNTAX("movw  %0, %e1");
4741 #line 846 "rl78-decode.opc"
4742           ID(mov); W(); DR(AX); SM(HL, 0);
4743
4744         }
4745       break;
4746     case 0xac:
4747         {
4748           /** 1010 1100                 movw    %0, %ea1                        */
4749           if (trace)
4750             {
4751               printf ("\033[33m%s\033[0m  %02x\n",
4752                      "/** 1010 1100                     movw    %0, %ea1                        */",
4753                      op[0]);
4754             }
4755           SYNTAX("movw  %0, %ea1");
4756 #line 849 "rl78-decode.opc"
4757           ID(mov); W(); DR(AX); SM(HL, IMMU(1));
4758
4759         }
4760       break;
4761     case 0xad:
4762         {
4763           /** 1010 1101                 movw    %0, %1                          */
4764           if (trace)
4765             {
4766               printf ("\033[33m%s\033[0m  %02x\n",
4767                      "/** 1010 1101                     movw    %0, %1                          */",
4768                      op[0]);
4769             }
4770           SYNTAX("movw  %0, %1");
4771 #line 882 "rl78-decode.opc"
4772           ID(mov); W(); DR(AX); SM(None, SADDR);
4773
4774         }
4775       break;
4776     case 0xae:
4777         {
4778           /** 1010 1110                 movw    %0, %s1                         */
4779           if (trace)
4780             {
4781               printf ("\033[33m%s\033[0m  %02x\n",
4782                      "/** 1010 1110                     movw    %0, %s1                         */",
4783                      op[0]);
4784             }
4785           SYNTAX("movw  %0, %s1");
4786 #line 885 "rl78-decode.opc"
4787           ID(mov); W(); DR(AX); SM(None, SFR);
4788
4789         }
4790       break;
4791     case 0xaf:
4792         {
4793           /** 1010 1111                 movw    %0, %e!1                        */
4794           if (trace)
4795             {
4796               printf ("\033[33m%s\033[0m  %02x\n",
4797                      "/** 1010 1111                     movw    %0, %e!1                        */",
4798                      op[0]);
4799             }
4800           SYNTAX("movw  %0, %e!1");
4801 #line 836 "rl78-decode.opc"
4802           ID(mov); W(); DR(AX); SM(None, IMMU(2));
4803
4804
4805         }
4806       break;
4807     case 0xb0:
4808         {
4809           /** 1011 0000                 dec     %e!0                            */
4810           if (trace)
4811             {
4812               printf ("\033[33m%s\033[0m  %02x\n",
4813                      "/** 1011 0000                     dec     %e!0                            */",
4814                      op[0]);
4815             }
4816           SYNTAX("dec   %e!0");
4817 #line 550 "rl78-decode.opc"
4818           ID(sub); DM(None, IMMU(2)); SC(1); Fza;
4819
4820         }
4821       break;
4822     case 0xb1:
4823     case 0xb3:
4824     case 0xb5:
4825     case 0xb7:
4826         {
4827           /** 1011 0rg1                         decw    %0                              */
4828 #line 570 "rl78-decode.opc"
4829           int rg AU = (op[0] >> 1) & 0x03;
4830           if (trace)
4831             {
4832               printf ("\033[33m%s\033[0m  %02x\n",
4833                      "/** 1011 0rg1                     decw    %0                              */",
4834                      op[0]);
4835               printf ("  rg = 0x%x\n", rg);
4836             }
4837           SYNTAX("decw  %0");
4838 #line 570 "rl78-decode.opc"
4839           ID(sub); W(); DRW(rg); SC(1);
4840
4841         }
4842       break;
4843     case 0xb2:
4844         {
4845           /** 1011 0010                 decw    %e!0                            */
4846           if (trace)
4847             {
4848               printf ("\033[33m%s\033[0m  %02x\n",
4849                      "/** 1011 0010                     decw    %e!0                            */",
4850                      op[0]);
4851             }
4852           SYNTAX("decw  %e!0");
4853 #line 564 "rl78-decode.opc"
4854           ID(sub); W(); DM(None, IMMU(2)); SC(1);
4855
4856         }
4857       break;
4858     case 0xb4:
4859         {
4860           /** 1011 0100                 dec     %0                              */
4861           if (trace)
4862             {
4863               printf ("\033[33m%s\033[0m  %02x\n",
4864                      "/** 1011 0100                     dec     %0                              */",
4865                      op[0]);
4866             }
4867           SYNTAX("dec   %0");
4868 #line 559 "rl78-decode.opc"
4869           ID(sub); DM(None, SADDR); SC(1); Fza;
4870
4871         /*----------------------------------------------------------------------*/
4872
4873         }
4874       break;
4875     case 0xb6:
4876         {
4877           /** 1011 0110                 decw    %0                              */
4878           if (trace)
4879             {
4880               printf ("\033[33m%s\033[0m  %02x\n",
4881                      "/** 1011 0110                     decw    %0                              */",
4882                      op[0]);
4883             }
4884           SYNTAX("decw  %0");
4885 #line 573 "rl78-decode.opc"
4886           ID(sub); W(); DM(None, SADDR); SC(1);
4887
4888         /*----------------------------------------------------------------------*/
4889
4890         }
4891       break;
4892     case 0xb8:
4893         {
4894           /** 1011 1000                 movw    %a0, %1                         */
4895           if (trace)
4896             {
4897               printf ("\033[33m%s\033[0m  %02x\n",
4898                      "/** 1011 1000                     movw    %a0, %1                         */",
4899                      op[0]);
4900             }
4901           SYNTAX("movw  %a0, %1");
4902 #line 833 "rl78-decode.opc"
4903           ID(mov); W(); DM(SP, IMMU(1)); SR(AX);
4904
4905         }
4906       break;
4907     case 0xb9:
4908         {
4909           /** 1011 1001                 movw    %e0, %1                         */
4910           if (trace)
4911             {
4912               printf ("\033[33m%s\033[0m  %02x\n",
4913                      "/** 1011 1001                     movw    %e0, %1                         */",
4914                      op[0]);
4915             }
4916           SYNTAX("movw  %e0, %1");
4917 #line 821 "rl78-decode.opc"
4918           ID(mov); W(); DM(DE, 0); SR(AX);
4919
4920         }
4921       break;
4922     case 0xba:
4923         {
4924           /** 1011 1010                 movw    %ea0, %1                                */
4925           if (trace)
4926             {
4927               printf ("\033[33m%s\033[0m  %02x\n",
4928                      "/** 1011 1010                     movw    %ea0, %1                                */",
4929                      op[0]);
4930             }
4931           SYNTAX("movw  %ea0, %1");
4932 #line 824 "rl78-decode.opc"
4933           ID(mov); W(); DM(DE, IMMU(1)); SR(AX);
4934
4935         }
4936       break;
4937     case 0xbb:
4938         {
4939           /** 1011 1011                 movw    %e0, %1                         */
4940           if (trace)
4941             {
4942               printf ("\033[33m%s\033[0m  %02x\n",
4943                      "/** 1011 1011                     movw    %e0, %1                         */",
4944                      op[0]);
4945             }
4946           SYNTAX("movw  %e0, %1");
4947 #line 827 "rl78-decode.opc"
4948           ID(mov); W(); DM(HL, 0); SR(AX);
4949
4950         }
4951       break;
4952     case 0xbc:
4953         {
4954           /** 1011 1100                 movw    %ea0, %1                        */
4955           if (trace)
4956             {
4957               printf ("\033[33m%s\033[0m  %02x\n",
4958                      "/** 1011 1100                     movw    %ea0, %1                        */",
4959                      op[0]);
4960             }
4961           SYNTAX("movw  %ea0, %1");
4962 #line 830 "rl78-decode.opc"
4963           ID(mov); W(); DM(HL, IMMU(1)); SR(AX);
4964
4965         }
4966       break;
4967     case 0xbd:
4968         {
4969           /** 1011 1101                 movw    %0, %1                          */
4970           if (trace)
4971             {
4972               printf ("\033[33m%s\033[0m  %02x\n",
4973                      "/** 1011 1101                     movw    %0, %1                          */",
4974                      op[0]);
4975             }
4976           SYNTAX("movw  %0, %1");
4977 #line 897 "rl78-decode.opc"
4978           ID(mov); W(); DM(None, SADDR); SR(AX);
4979
4980         }
4981       break;
4982     case 0xbe:
4983         {
4984           /** 1011 1110                 movw    %s0, %1                         */
4985           if (trace)
4986             {
4987               printf ("\033[33m%s\033[0m  %02x\n",
4988                      "/** 1011 1110                     movw    %s0, %1                         */",
4989                      op[0]);
4990             }
4991           SYNTAX("movw  %s0, %1");
4992 #line 903 "rl78-decode.opc"
4993           ID(mov); W(); DM(None, SFR); SR(AX);
4994
4995         /*----------------------------------------------------------------------*/
4996
4997         }
4998       break;
4999     case 0xbf:
5000         {
5001           /** 1011 1111                 movw    %e!0, %1                        */
5002           if (trace)
5003             {
5004               printf ("\033[33m%s\033[0m  %02x\n",
5005                      "/** 1011 1111                     movw    %e!0, %1                        */",
5006                      op[0]);
5007             }
5008           SYNTAX("movw  %e!0, %1");
5009 #line 818 "rl78-decode.opc"
5010           ID(mov); W(); DM(None, IMMU(2)); SR(AX);
5011
5012         }
5013       break;
5014     case 0xc0:
5015     case 0xc2:
5016     case 0xc4:
5017     case 0xc6:
5018         {
5019           /** 1100 0rg0                 pop     %0                              */
5020 #line 988 "rl78-decode.opc"
5021           int rg AU = (op[0] >> 1) & 0x03;
5022           if (trace)
5023             {
5024               printf ("\033[33m%s\033[0m  %02x\n",
5025                      "/** 1100 0rg0                     pop     %0                              */",
5026                      op[0]);
5027               printf ("  rg = 0x%x\n", rg);
5028             }
5029           SYNTAX("pop   %0");
5030 #line 988 "rl78-decode.opc"
5031           ID(mov); W(); DRW(rg); SPOP();
5032
5033         }
5034       break;
5035     case 0xc1:
5036     case 0xc3:
5037     case 0xc5:
5038     case 0xc7:
5039         {
5040           /** 1100 0rg1                 push    %1                              */
5041 #line 996 "rl78-decode.opc"
5042           int rg AU = (op[0] >> 1) & 0x03;
5043           if (trace)
5044             {
5045               printf ("\033[33m%s\033[0m  %02x\n",
5046                      "/** 1100 0rg1                     push    %1                              */",
5047                      op[0]);
5048               printf ("  rg = 0x%x\n", rg);
5049             }
5050           SYNTAX("push  %1");
5051 #line 996 "rl78-decode.opc"
5052           ID(mov); W(); DPUSH(); SRW(rg);
5053
5054         }
5055       break;
5056     case 0xc8:
5057         {
5058           /** 1100 1000                 mov     %a0, #%1                        */
5059           if (trace)
5060             {
5061               printf ("\033[33m%s\033[0m  %02x\n",
5062                      "/** 1100 1000                     mov     %a0, #%1                        */",
5063                      op[0]);
5064             }
5065           SYNTAX("mov   %a0, #%1");
5066 #line 641 "rl78-decode.opc"
5067           ID(mov); DM(SP, IMMU(1)); SC(IMMU(1));
5068
5069         }
5070       break;
5071     case 0xc9:
5072         {
5073           /** 1100 1001                 movw    %0, #%1                         */
5074           if (trace)
5075             {
5076               printf ("\033[33m%s\033[0m  %02x\n",
5077                      "/** 1100 1001                     movw    %0, #%1                         */",
5078                      op[0]);
5079             }
5080           SYNTAX("movw  %0, #%1");
5081 #line 894 "rl78-decode.opc"
5082           ID(mov); W(); DM(None, SADDR); SC(IMMU(2));
5083
5084         }
5085       break;
5086     case 0xca:
5087         {
5088           /** 1100 1010                 mov     %ea0, #%1                       */
5089           if (trace)
5090             {
5091               printf ("\033[33m%s\033[0m  %02x\n",
5092                      "/** 1100 1010                     mov     %ea0, #%1                       */",
5093                      op[0]);
5094             }
5095           SYNTAX("mov   %ea0, #%1");
5096 #line 620 "rl78-decode.opc"
5097           ID(mov); DM(DE, IMMU(1)); SC(IMMU(1));
5098
5099         }
5100       break;
5101     case 0xcb:
5102         {
5103           /** 1100 1011                 movw    %s0, #%1                        */
5104           if (trace)
5105             {
5106               printf ("\033[33m%s\033[0m  %02x\n",
5107                      "/** 1100 1011                     movw    %s0, #%1                        */",
5108                      op[0]);
5109             }
5110           SYNTAX("movw  %s0, #%1");
5111 #line 900 "rl78-decode.opc"
5112           ID(mov); W(); DM(None, SFR); SC(IMMU(2));
5113
5114         }
5115       break;
5116     case 0xcc:
5117         {
5118           /** 1100 1100                 mov     %ea0, #%1                       */
5119           if (trace)
5120             {
5121               printf ("\033[33m%s\033[0m  %02x\n",
5122                      "/** 1100 1100                     mov     %ea0, #%1                       */",
5123                      op[0]);
5124             }
5125           SYNTAX("mov   %ea0, #%1");
5126 #line 632 "rl78-decode.opc"
5127           ID(mov); DM(HL, IMMU(1)); SC(IMMU(1));
5128
5129         }
5130       break;
5131     case 0xcd:
5132         {
5133           /** 1100 1101                 mov     %0, #%1                         */
5134           if (trace)
5135             {
5136               printf ("\033[33m%s\033[0m  %02x\n",
5137                      "/** 1100 1101                     mov     %0, #%1                         */",
5138                      op[0]);
5139             }
5140           SYNTAX("mov   %0, #%1");
5141 #line 746 "rl78-decode.opc"
5142           ID(mov); DM(None, SADDR); SC(IMMU(1));
5143
5144         }
5145       break;
5146     case 0xce:
5147         {
5148           /** 1100 1110                 mov     %s0, #%1                        */
5149           if (trace)
5150             {
5151               printf ("\033[33m%s\033[0m  %02x\n",
5152                      "/** 1100 1110                     mov     %s0, #%1                        */",
5153                      op[0]);
5154             }
5155           SYNTAX("mov   %s0, #%1");
5156 #line 752 "rl78-decode.opc"
5157           op0 = SFR;
5158           op1 = IMMU(1);
5159           ID(mov); DM(None, op0); SC(op1);
5160           if (op0 == 0xffffb && isa == RL78_ISA_G14)
5161             switch (op1)
5162               {
5163               case 0x01:
5164                 rl78->syntax = "mulhu"; ID(mulhu);
5165                 break;
5166               case 0x02:
5167                 rl78->syntax = "mulh"; ID(mulh);
5168                 break;
5169               case 0x03:
5170                 rl78->syntax = "divhu"; ID(divhu);
5171                 break;
5172               case 0x04:
5173                 rl78->syntax = "divwu <old-encoding>"; ID(divwu);
5174                 break;
5175               case 0x05:
5176                 rl78->syntax = "machu"; ID(machu);
5177                 break;
5178               case 0x06:
5179                 rl78->syntax = "mach"; ID(mach);
5180                 break;
5181               case 0x0b:
5182                 rl78->syntax = "divwu"; ID(divwu);
5183                 break;
5184               }
5185
5186         }
5187       break;
5188     case 0xcf:
5189         {
5190           /** 1100 1111                 mov     %e!0, #%1                       */
5191           if (trace)
5192             {
5193               printf ("\033[33m%s\033[0m  %02x\n",
5194                      "/** 1100 1111                     mov     %e!0, #%1                       */",
5195                      op[0]);
5196             }
5197           SYNTAX("mov   %e!0, #%1");
5198 #line 611 "rl78-decode.opc"
5199           ID(mov); DM(None, IMMU(2)); SC(IMMU(1));
5200
5201         }
5202       break;
5203     case 0xd0:
5204     case 0xd1:
5205     case 0xd2:
5206     case 0xd3:
5207         {
5208           /** 1101 00rg                 cmp0    %0                              */
5209 #line 520 "rl78-decode.opc"
5210           int rg AU = op[0] & 0x03;
5211           if (trace)
5212             {
5213               printf ("\033[33m%s\033[0m  %02x\n",
5214                      "/** 1101 00rg                     cmp0    %0                              */",
5215                      op[0]);
5216               printf ("  rg = 0x%x\n", rg);
5217             }
5218           SYNTAX("cmp0  %0");
5219 #line 520 "rl78-decode.opc"
5220           ID(cmp); DRB(rg); SC(0); Fzac;
5221
5222         }
5223       break;
5224     case 0xd4:
5225         {
5226           /** 1101 0100                 cmp0    %0                              */
5227           if (trace)
5228             {
5229               printf ("\033[33m%s\033[0m  %02x\n",
5230                      "/** 1101 0100                     cmp0    %0                              */",
5231                      op[0]);
5232             }
5233           SYNTAX("cmp0  %0");
5234 #line 523 "rl78-decode.opc"
5235           ID(cmp); DM(None, SADDR); SC(0); Fzac;
5236
5237         /*----------------------------------------------------------------------*/
5238
5239         }
5240       break;
5241     case 0xd5:
5242         {
5243           /** 1101 0101                 cmp0    %e!0                            */
5244           if (trace)
5245             {
5246               printf ("\033[33m%s\033[0m  %02x\n",
5247                      "/** 1101 0101                     cmp0    %e!0                            */",
5248                      op[0]);
5249             }
5250           SYNTAX("cmp0  %e!0");
5251 #line 517 "rl78-decode.opc"
5252           ID(cmp); DM(None, IMMU(2)); SC(0); Fzac;
5253
5254         }
5255       break;
5256     case 0xd6:
5257         {
5258           /** 1101 0110                 mulu    x                               */
5259           if (trace)
5260             {
5261               printf ("\033[33m%s\033[0m  %02x\n",
5262                      "/** 1101 0110                     mulu    x                               */",
5263                      op[0]);
5264             }
5265           SYNTAX("mulu  x");
5266 #line 908 "rl78-decode.opc"
5267           ID(mulu);
5268
5269         /*----------------------------------------------------------------------*/
5270
5271         }
5272       break;
5273     case 0xd7:
5274         {
5275           /** 1101 0111                 ret                                     */
5276           if (trace)
5277             {
5278               printf ("\033[33m%s\033[0m  %02x\n",
5279                      "/** 1101 0111                     ret                                     */",
5280                      op[0]);
5281             }
5282           SYNTAX("ret");
5283 #line 1004 "rl78-decode.opc"
5284           ID(ret);
5285
5286         }
5287       break;
5288     case 0xd8:
5289         {
5290           /** 1101 1000                 mov     %0, %1                          */
5291           if (trace)
5292             {
5293               printf ("\033[33m%s\033[0m  %02x\n",
5294                      "/** 1101 1000                     mov     %0, %1                          */",
5295                      op[0]);
5296             }
5297           SYNTAX("mov   %0, %1");
5298 #line 713 "rl78-decode.opc"
5299           ID(mov); DR(X); SM(None, SADDR);
5300
5301         }
5302       break;
5303     case 0xd9:
5304         {
5305           /** 1101 1001                 mov     %0, %e!1                        */
5306           if (trace)
5307             {
5308               printf ("\033[33m%s\033[0m  %02x\n",
5309                      "/** 1101 1001                     mov     %0, %e!1                        */",
5310                      op[0]);
5311             }
5312           SYNTAX("mov   %0, %e!1");
5313 #line 710 "rl78-decode.opc"
5314           ID(mov); DR(X); SM(None, IMMU(2));
5315
5316         }
5317       break;
5318     case 0xda:
5319     case 0xea:
5320     case 0xfa:
5321         {
5322           /** 11ra 1010                 movw    %0, %1                          */
5323 #line 891 "rl78-decode.opc"
5324           int ra AU = (op[0] >> 4) & 0x03;
5325           if (trace)
5326             {
5327               printf ("\033[33m%s\033[0m  %02x\n",
5328                      "/** 11ra 1010                     movw    %0, %1                          */",
5329                      op[0]);
5330               printf ("  ra = 0x%x\n", ra);
5331             }
5332           SYNTAX("movw  %0, %1");
5333 #line 891 "rl78-decode.opc"
5334           ID(mov); W(); DRW(ra); SM(None, SADDR);
5335
5336         }
5337       break;
5338     case 0xdb:
5339     case 0xeb:
5340     case 0xfb:
5341         {
5342           /** 11ra 1011                 movw    %0, %es!1                       */
5343 #line 888 "rl78-decode.opc"
5344           int ra AU = (op[0] >> 4) & 0x03;
5345           if (trace)
5346             {
5347               printf ("\033[33m%s\033[0m  %02x\n",
5348                      "/** 11ra 1011                     movw    %0, %es!1                       */",
5349                      op[0]);
5350               printf ("  ra = 0x%x\n", ra);
5351             }
5352           SYNTAX("movw  %0, %es!1");
5353 #line 888 "rl78-decode.opc"
5354           ID(mov); W(); DRW(ra); SM(None, IMMU(2));
5355
5356         }
5357       break;
5358     case 0xdc:
5359         {
5360           /** 1101 1100                 bc      $%a0                            */
5361           if (trace)
5362             {
5363               printf ("\033[33m%s\033[0m  %02x\n",
5364                      "/** 1101 1100                     bc      $%a0                            */",
5365                      op[0]);
5366             }
5367           SYNTAX("bc    $%a0");
5368 #line 336 "rl78-decode.opc"
5369           ID(branch_cond); DC(pc+IMMS(1)+2); SR(None); COND(C);
5370
5371         }
5372       break;
5373     case 0xdd:
5374         {
5375           /** 1101 1101                 bz      $%a0                            */
5376           if (trace)
5377             {
5378               printf ("\033[33m%s\033[0m  %02x\n",
5379                      "/** 1101 1101                     bz      $%a0                            */",
5380                      op[0]);
5381             }
5382           SYNTAX("bz    $%a0");
5383 #line 348 "rl78-decode.opc"
5384           ID(branch_cond); DC(pc+IMMS(1)+2); SR(None); COND(Z);
5385
5386         }
5387       break;
5388     case 0xde:
5389         {
5390           /** 1101 1110                 bnc     $%a0                            */
5391           if (trace)
5392             {
5393               printf ("\033[33m%s\033[0m  %02x\n",
5394                      "/** 1101 1110                     bnc     $%a0                            */",
5395                      op[0]);
5396             }
5397           SYNTAX("bnc   $%a0");
5398 #line 339 "rl78-decode.opc"
5399           ID(branch_cond); DC(pc+IMMS(1)+2); SR(None); COND(NC);
5400
5401         }
5402       break;
5403     case 0xdf:
5404         {
5405           /** 1101 1111                 bnz     $%a0                            */
5406           if (trace)
5407             {
5408               printf ("\033[33m%s\033[0m  %02x\n",
5409                      "/** 1101 1111                     bnz     $%a0                            */",
5410                      op[0]);
5411             }
5412           SYNTAX("bnz   $%a0");
5413 #line 351 "rl78-decode.opc"
5414           ID(branch_cond); DC(pc+IMMS(1)+2); SR(None); COND(NZ);
5415
5416         /*----------------------------------------------------------------------*/
5417
5418         }
5419       break;
5420     case 0xe0:
5421     case 0xe1:
5422     case 0xe2:
5423     case 0xe3:
5424         {
5425           /** 1110 00rg                 oneb    %0                              */
5426 #line 926 "rl78-decode.opc"
5427           int rg AU = op[0] & 0x03;
5428           if (trace)
5429             {
5430               printf ("\033[33m%s\033[0m  %02x\n",
5431                      "/** 1110 00rg                     oneb    %0                              */",
5432                      op[0]);
5433               printf ("  rg = 0x%x\n", rg);
5434             }
5435           SYNTAX("oneb  %0");
5436 #line 926 "rl78-decode.opc"
5437           ID(mov); DRB(rg); SC(1);
5438
5439         }
5440       break;
5441     case 0xe4:
5442         {
5443           /** 1110 0100                 oneb    %0                              */
5444           if (trace)
5445             {
5446               printf ("\033[33m%s\033[0m  %02x\n",
5447                      "/** 1110 0100                     oneb    %0                              */",
5448                      op[0]);
5449             }
5450           SYNTAX("oneb  %0");
5451 #line 929 "rl78-decode.opc"
5452           ID(mov); DM(None, SADDR); SC(1);
5453
5454         /*----------------------------------------------------------------------*/
5455
5456         }
5457       break;
5458     case 0xe5:
5459         {
5460           /** 1110 0101                 oneb    %e!0                            */
5461           if (trace)
5462             {
5463               printf ("\033[33m%s\033[0m  %02x\n",
5464                      "/** 1110 0101                     oneb    %e!0                            */",
5465                      op[0]);
5466             }
5467           SYNTAX("oneb  %e!0");
5468 #line 923 "rl78-decode.opc"
5469           ID(mov); DM(None, IMMU(2)); SC(1);
5470
5471         }
5472       break;
5473     case 0xe6:
5474         {
5475           /** 1110 0110                 onew    %0                              */
5476           if (trace)
5477             {
5478               printf ("\033[33m%s\033[0m  %02x\n",
5479                      "/** 1110 0110                     onew    %0                              */",
5480                      op[0]);
5481             }
5482           SYNTAX("onew  %0");
5483 #line 934 "rl78-decode.opc"
5484           ID(mov); DR(AX); SC(1);
5485
5486         }
5487       break;
5488     case 0xe7:
5489         {
5490           /** 1110 0111                 onew    %0                              */
5491           if (trace)
5492             {
5493               printf ("\033[33m%s\033[0m  %02x\n",
5494                      "/** 1110 0111                     onew    %0                              */",
5495                      op[0]);
5496             }
5497           SYNTAX("onew  %0");
5498 #line 937 "rl78-decode.opc"
5499           ID(mov); DR(BC); SC(1);
5500
5501         /*----------------------------------------------------------------------*/
5502
5503         }
5504       break;
5505     case 0xe8:
5506         {
5507           /** 1110 1000                 mov     %0, %1                          */
5508           if (trace)
5509             {
5510               printf ("\033[33m%s\033[0m  %02x\n",
5511                      "/** 1110 1000                     mov     %0, %1                          */",
5512                      op[0]);
5513             }
5514           SYNTAX("mov   %0, %1");
5515 #line 701 "rl78-decode.opc"
5516           ID(mov); DR(B); SM(None, SADDR);
5517
5518         }
5519       break;
5520     case 0xe9:
5521         {
5522           /** 1110 1001                 mov     %0, %e!1                        */
5523           if (trace)
5524             {
5525               printf ("\033[33m%s\033[0m  %02x\n",
5526                      "/** 1110 1001                     mov     %0, %e!1                        */",
5527                      op[0]);
5528             }
5529           SYNTAX("mov   %0, %e!1");
5530 #line 695 "rl78-decode.opc"
5531           ID(mov); DR(B); SM(None, IMMU(2));
5532
5533         }
5534       break;
5535     case 0xec:
5536         {
5537           /** 1110 1100                 br      !%!a0                           */
5538           if (trace)
5539             {
5540               printf ("\033[33m%s\033[0m  %02x\n",
5541                      "/** 1110 1100                     br      !%!a0                           */",
5542                      op[0]);
5543             }
5544           SYNTAX("br    !%!a0");
5545 #line 370 "rl78-decode.opc"
5546           ID(branch); DC(IMMU(3));
5547
5548         }
5549       break;
5550     case 0xed:
5551         {
5552           /** 1110 1101                 br      %!a0                            */
5553           if (trace)
5554             {
5555               printf ("\033[33m%s\033[0m  %02x\n",
5556                      "/** 1110 1101                     br      %!a0                            */",
5557                      op[0]);
5558             }
5559           SYNTAX("br    %!a0");
5560 #line 373 "rl78-decode.opc"
5561           ID(branch); DC(IMMU(2));
5562
5563         }
5564       break;
5565     case 0xee:
5566         {
5567           /** 1110 1110                 br      $%!a0                           */
5568           if (trace)
5569             {
5570               printf ("\033[33m%s\033[0m  %02x\n",
5571                      "/** 1110 1110                     br      $%!a0                           */",
5572                      op[0]);
5573             }
5574           SYNTAX("br    $%!a0");
5575 #line 376 "rl78-decode.opc"
5576           ID(branch); DC(pc+IMMS(2)+3);
5577
5578         }
5579       break;
5580     case 0xef:
5581         {
5582           /** 1110 1111                 br      $%a0                            */
5583           if (trace)
5584             {
5585               printf ("\033[33m%s\033[0m  %02x\n",
5586                      "/** 1110 1111                     br      $%a0                            */",
5587                      op[0]);
5588             }
5589           SYNTAX("br    $%a0");
5590 #line 379 "rl78-decode.opc"
5591           ID(branch); DC(pc+IMMS(1)+2);
5592
5593         }
5594       break;
5595     case 0xf0:
5596     case 0xf1:
5597     case 0xf2:
5598     case 0xf3:
5599         {
5600           /** 1111 00rg                 clrb    %0                              */
5601 #line 466 "rl78-decode.opc"
5602           int rg AU = op[0] & 0x03;
5603           if (trace)
5604             {
5605               printf ("\033[33m%s\033[0m  %02x\n",
5606                      "/** 1111 00rg                     clrb    %0                              */",
5607                      op[0]);
5608               printf ("  rg = 0x%x\n", rg);
5609             }
5610           SYNTAX("clrb  %0");
5611 #line 466 "rl78-decode.opc"
5612           ID(mov); DRB(rg); SC(0);
5613
5614         }
5615       break;
5616     case 0xf4:
5617         {
5618           /** 1111 0100                 clrb    %0                              */
5619           if (trace)
5620             {
5621               printf ("\033[33m%s\033[0m  %02x\n",
5622                      "/** 1111 0100                     clrb    %0                              */",
5623                      op[0]);
5624             }
5625           SYNTAX("clrb  %0");
5626 #line 469 "rl78-decode.opc"
5627           ID(mov); DM(None, SADDR); SC(0);
5628
5629         /*----------------------------------------------------------------------*/
5630
5631         }
5632       break;
5633     case 0xf5:
5634         {
5635           /** 1111 0101                 clrb    %e!0                            */
5636           if (trace)
5637             {
5638               printf ("\033[33m%s\033[0m  %02x\n",
5639                      "/** 1111 0101                     clrb    %e!0                            */",
5640                      op[0]);
5641             }
5642           SYNTAX("clrb  %e!0");
5643 #line 463 "rl78-decode.opc"
5644           ID(mov); DM(None, IMMU(2)); SC(0);
5645
5646         }
5647       break;
5648     case 0xf6:
5649         {
5650           /** 1111 0110                 clrw    %0                              */
5651           if (trace)
5652             {
5653               printf ("\033[33m%s\033[0m  %02x\n",
5654                      "/** 1111 0110                     clrw    %0                              */",
5655                      op[0]);
5656             }
5657           SYNTAX("clrw  %0");
5658 #line 474 "rl78-decode.opc"
5659           ID(mov); DR(AX); SC(0);
5660
5661         }
5662       break;
5663     case 0xf7:
5664         {
5665           /** 1111 0111                 clrw    %0                              */
5666           if (trace)
5667             {
5668               printf ("\033[33m%s\033[0m  %02x\n",
5669                      "/** 1111 0111                     clrw    %0                              */",
5670                      op[0]);
5671             }
5672           SYNTAX("clrw  %0");
5673 #line 477 "rl78-decode.opc"
5674           ID(mov); DR(BC); SC(0);
5675
5676         /*----------------------------------------------------------------------*/
5677
5678         }
5679       break;
5680     case 0xf8:
5681         {
5682           /** 1111 1000                 mov     %0, %1                          */
5683           if (trace)
5684             {
5685               printf ("\033[33m%s\033[0m  %02x\n",
5686                      "/** 1111 1000                     mov     %0, %1                          */",
5687                      op[0]);
5688             }
5689           SYNTAX("mov   %0, %1");
5690 #line 707 "rl78-decode.opc"
5691           ID(mov); DR(C); SM(None, SADDR);
5692
5693         }
5694       break;
5695     case 0xf9:
5696         {
5697           /** 1111 1001                 mov     %0, %e!1                        */
5698           if (trace)
5699             {
5700               printf ("\033[33m%s\033[0m  %02x\n",
5701                      "/** 1111 1001                     mov     %0, %e!1                        */",
5702                      op[0]);
5703             }
5704           SYNTAX("mov   %0, %e!1");
5705 #line 704 "rl78-decode.opc"
5706           ID(mov); DR(C); SM(None, IMMU(2));
5707
5708         }
5709       break;
5710     case 0xfc:
5711         {
5712           /** 1111 1100                 call    !%!a0                           */
5713           if (trace)
5714             {
5715               printf ("\033[33m%s\033[0m  %02x\n",
5716                      "/** 1111 1100                     call    !%!a0                           */",
5717                      op[0]);
5718             }
5719           SYNTAX("call  !%!a0");
5720 #line 423 "rl78-decode.opc"
5721           ID(call); DC(IMMU(3));
5722
5723         }
5724       break;
5725     case 0xfd:
5726         {
5727           /** 1111 1101                 call    %!a0                            */
5728           if (trace)
5729             {
5730               printf ("\033[33m%s\033[0m  %02x\n",
5731                      "/** 1111 1101                     call    %!a0                            */",
5732                      op[0]);
5733             }
5734           SYNTAX("call  %!a0");
5735 #line 426 "rl78-decode.opc"
5736           ID(call); DC(IMMU(2));
5737
5738         }
5739       break;
5740     case 0xfe:
5741         {
5742           /** 1111 1110                 call    $%!a0                           */
5743           if (trace)
5744             {
5745               printf ("\033[33m%s\033[0m  %02x\n",
5746                      "/** 1111 1110                     call    $%!a0                           */",
5747                      op[0]);
5748             }
5749           SYNTAX("call  $%!a0");
5750 #line 429 "rl78-decode.opc"
5751           ID(call); DC(pc+IMMS(2)+3);
5752
5753         }
5754       break;
5755     case 0xff:
5756         {
5757           /** 1111 1111                 brk1                                    */
5758           if (trace)
5759             {
5760               printf ("\033[33m%s\033[0m  %02x\n",
5761                      "/** 1111 1111                     brk1                                    */",
5762                      op[0]);
5763             }
5764           SYNTAX("brk1");
5765 #line 387 "rl78-decode.opc"
5766           ID(break);
5767
5768         }
5769       break;
5770   }
5771 #line 1292 "rl78-decode.opc"
5772
5773   return rl78->n_bytes;
5774 }