Fix FS#10486 - "fuze screen not drawn correctly on backlight turn-on if playlist...
[kugel-rb/myfork.git] / apps / plugins / zxbox / z80optab.c
blobda973277a23ea0640521ffc96ac2f3c08c5215d1
1 /*
2 * Copyright (C) 1996-1998 Szeredi Miklos
3 * Email: mszeredi@inf.bme.hu
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version. See the file COPYING.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include "z80_def.h"
22 #include "z80optab.h"
24 #ifdef PROCP
25 #define NEXTTAB(tab) \
26 { \
27 register byte nextop; \
28 nextop = *PCP; \
29 PC++; \
30 return (*z80c_op_tab_ ## tab [nextop])(z80p); \
32 #else
33 #define NEXTTAB(tab) \
34 { \
35 register byte nextop; \
36 nextop = *PCP; \
37 PC++; \
38 (*z80c_op_tab_ ## tab [nextop])(); \
40 #endif
43 OPDEF(special_cb, 0xCB)
45 RR++;
46 DANM(cbaddr) = HL;
47 NEXTTAB(cb);
50 OPDEF(special_dd, 0xDD)
52 RR++;
53 DANM(tc) -= 4;
54 NEXTTAB(dd);
58 OPDEF(special_ed, 0xED)
60 RR++;
61 NEXTTAB(ed);
64 OPDEF(special_fd, 0xFD)
66 RR++;
67 DANM(tc) -= 4;
68 NEXTTAB(fd);
71 OPDEF(special_xx, 0xDD 0xFD)
73 RR--;
74 PC--;
75 ENDOP();
78 OPDEF(special_dd_cb, 0xCB)
80 DANM(tc) -= 4;
81 IXDGET(IX, DANM(cbaddr));
82 #ifdef DEBUG_Z80
83 if((*PCP & 0x07) != 6)
84 printf("DD_CB unimplemented!\n");
85 #endif
86 NEXTTAB(cb);
89 OPDEF(special_fd_cb, 0xCB)
91 DANM(tc) -= 4;
92 IXDGET(IY, DANM(cbaddr));
93 #ifdef DEBUG_Z80
94 if((*PCP & 0x07) != 6)
95 printf("FD_CB unimplemented!\n");
96 #endif
97 NEXTTAB(cb);
100 op_f z80c_op_tab[] = {
101 z80op_nop,
102 z80op_ld_bc_nn,
103 z80op_ld_ibc_a,
104 z80op_inc_bc,
105 z80op_inc_b,
106 z80op_dec_b,
107 z80op_ld_b_n,
108 z80op_rlca,
109 z80op_ex_af_afb,
110 z80op_add_hl_bc,
111 z80op_ld_a_ibc,
112 z80op_dec_bc,
113 z80op_inc_c,
114 z80op_dec_c,
115 z80op_ld_c_n,
116 z80op_rrca,
118 z80op_djnz_e,
119 z80op_ld_de_nn,
120 z80op_ld_ide_a,
121 z80op_inc_de,
122 z80op_inc_d,
123 z80op_dec_d,
124 z80op_ld_d_n,
125 z80op_rla,
126 z80op_jr_e,
127 z80op_add_hl_de,
128 z80op_ld_a_ide,
129 z80op_dec_de,
130 z80op_inc_e,
131 z80op_dec_e,
132 z80op_ld_e_n,
133 z80op_rra,
135 z80op_jr_nz_e,
136 z80op_ld_hl_nn,
137 z80op_ld_inn_hl,
138 z80op_inc_hl,
139 z80op_inc_h,
140 z80op_dec_h,
141 z80op_ld_h_n,
142 z80op_daa,
143 z80op_jr_z_e,
144 z80op_add_hl_hl,
145 z80op_ld_hl_inn,
146 z80op_dec_hl,
147 z80op_inc_l,
148 z80op_dec_l,
149 z80op_ld_l_n,
150 z80op_cpl,
152 z80op_jr_nc_e,
153 z80op_ld_sp_nn,
154 z80op_ld_inn_a,
155 z80op_inc_sp,
156 z80op_inc_ihl,
157 z80op_dec_ihl,
158 z80op_ld_ihl_n,
159 z80op_scf,
160 z80op_jr_c_e,
161 z80op_add_hl_sp,
162 z80op_ld_a_inn,
163 z80op_dec_sp,
164 z80op_inc_a,
165 z80op_dec_a,
166 z80op_ld_a_n,
167 z80op_ccf,
169 z80op_nop,
170 z80op_ld_b_c,
171 z80op_ld_b_d,
172 z80op_ld_b_e,
173 z80op_ld_b_h,
174 z80op_ld_b_l,
175 z80op_ld_b_ihl,
176 z80op_ld_b_a,
177 z80op_ld_c_b,
178 z80op_nop,
179 z80op_ld_c_d,
180 z80op_ld_c_e,
181 z80op_ld_c_h,
182 z80op_ld_c_l,
183 z80op_ld_c_ihl,
184 z80op_ld_c_a,
186 z80op_ld_d_b,
187 z80op_ld_d_c,
188 z80op_nop,
189 z80op_ld_d_e,
190 z80op_ld_d_h,
191 z80op_ld_d_l,
192 z80op_ld_d_ihl,
193 z80op_ld_d_a,
194 z80op_ld_e_b,
195 z80op_ld_e_c,
196 z80op_ld_e_d,
197 z80op_nop,
198 z80op_ld_e_h,
199 z80op_ld_e_l,
200 z80op_ld_e_ihl,
201 z80op_ld_e_a,
203 z80op_ld_h_b,
204 z80op_ld_h_c,
205 z80op_ld_h_d,
206 z80op_ld_h_e,
207 z80op_nop,
208 z80op_ld_h_l,
209 z80op_ld_h_ihl,
210 z80op_ld_h_a,
211 z80op_ld_l_b,
212 z80op_ld_l_c,
213 z80op_ld_l_d,
214 z80op_ld_l_e,
215 z80op_ld_l_h,
216 z80op_nop,
217 z80op_ld_l_ihl,
218 z80op_ld_l_a,
220 z80op_ld_ihl_b,
221 z80op_ld_ihl_c,
222 z80op_ld_ihl_d,
223 z80op_ld_ihl_e,
224 z80op_ld_ihl_h,
225 z80op_ld_ihl_l,
226 z80op_halt,
227 z80op_ld_ihl_a,
228 z80op_ld_a_b,
229 z80op_ld_a_c,
230 z80op_ld_a_d,
231 z80op_ld_a_e,
232 z80op_ld_a_h,
233 z80op_ld_a_l,
234 z80op_ld_a_ihl,
235 z80op_nop,
237 z80op_add_a_b,
238 z80op_add_a_c,
239 z80op_add_a_d,
240 z80op_add_a_e,
241 z80op_add_a_h,
242 z80op_add_a_l,
243 z80op_add_a_ihl,
244 z80op_add_a_a,
245 z80op_adc_a_b,
246 z80op_adc_a_c,
247 z80op_adc_a_d,
248 z80op_adc_a_e,
249 z80op_adc_a_h,
250 z80op_adc_a_l,
251 z80op_adc_a_ihl,
252 z80op_adc_a_a,
254 z80op_sub_b,
255 z80op_sub_c,
256 z80op_sub_d,
257 z80op_sub_e,
258 z80op_sub_h,
259 z80op_sub_l,
260 z80op_sub_ihl,
261 z80op_sub_a,
262 z80op_sbc_a_b,
263 z80op_sbc_a_c,
264 z80op_sbc_a_d,
265 z80op_sbc_a_e,
266 z80op_sbc_a_h,
267 z80op_sbc_a_l,
268 z80op_sbc_a_ihl,
269 z80op_sbc_a_a,
271 z80op_and_b,
272 z80op_and_c,
273 z80op_and_d,
274 z80op_and_e,
275 z80op_and_h,
276 z80op_and_l,
277 z80op_and_ihl,
278 z80op_and_a,
279 z80op_xor_b,
280 z80op_xor_c,
281 z80op_xor_d,
282 z80op_xor_e,
283 z80op_xor_h,
284 z80op_xor_l,
285 z80op_xor_ihl,
286 z80op_xor_a,
288 z80op_or_b,
289 z80op_or_c,
290 z80op_or_d,
291 z80op_or_e,
292 z80op_or_h,
293 z80op_or_l,
294 z80op_or_ihl,
295 z80op_or_a,
296 z80op_cp_b,
297 z80op_cp_c,
298 z80op_cp_d,
299 z80op_cp_e,
300 z80op_cp_h,
301 z80op_cp_l,
302 z80op_cp_ihl,
303 z80op_cp_a,
305 z80op_ret_nz,
306 z80op_pop_bc,
307 z80op_jp_nz_nn,
308 z80op_jp_nn,
309 z80op_call_nz_nn,
310 z80op_push_bc,
311 z80op_add_a_n,
312 z80op_rst_00,
313 z80op_ret_z,
314 z80op_ret,
315 z80op_jp_z_nn,
316 z80op_special_cb,
317 z80op_call_z_nn,
318 z80op_call_nn,
319 z80op_adc_a_n,
320 z80op_rst_08,
322 z80op_ret_nc,
323 z80op_pop_de,
324 z80op_jp_nc_nn,
325 z80op_out_in_a,
326 z80op_call_nc_nn,
327 z80op_push_de,
328 z80op_sub_n,
329 z80op_rst_10,
330 z80op_ret_c,
331 z80op_exx,
332 z80op_jp_c_nn,
333 z80op_in_a_in,
334 z80op_call_c_nn,
335 z80op_special_dd,
336 z80op_sbc_a_n,
337 z80op_rst_18,
339 z80op_ret_po,
340 z80op_pop_hl,
341 z80op_jp_po_nn,
342 z80op_ex_isp_hl,
343 z80op_call_po_nn,
344 z80op_push_hl,
345 z80op_and_n,
346 z80op_rst_20,
347 z80op_ret_pe,
348 z80op_jp_hl,
349 z80op_jp_pe_nn,
350 z80op_ex_de_hl,
351 z80op_call_pe_nn,
352 z80op_special_ed,
353 z80op_xor_n,
354 z80op_rst_28,
356 z80op_ret_p,
357 z80op_pop_af,
358 z80op_jp_p_nn,
359 z80op_di,
360 z80op_call_p_nn,
361 z80op_push_af,
362 z80op_or_n,
363 z80op_rst_30,
364 z80op_ret_m,
365 z80op_ld_sp_hl,
366 z80op_jp_m_nn,
367 z80op_ei,
368 z80op_call_m_nn,
369 z80op_special_fd,
370 z80op_cp_n,
371 z80op_rst_38
375 op_f z80c_op_tab_ed[] = {
376 z80op_ill_ed,
377 z80op_ill_ed,
378 z80op_ill_ed,
379 z80op_ill_ed,
380 z80op_ill_ed,
381 z80op_ill_ed,
382 z80op_ill_ed,
383 z80op_ill_ed,
384 z80op_ill_ed,
385 z80op_ill_ed,
386 z80op_ill_ed,
387 z80op_ill_ed,
388 z80op_ill_ed,
389 z80op_ill_ed,
390 z80op_ill_ed,
391 z80op_ill_ed,
393 z80op_ill_ed,
394 z80op_ill_ed,
395 z80op_ill_ed,
396 z80op_ill_ed,
397 z80op_ill_ed,
398 z80op_ill_ed,
399 z80op_ill_ed,
400 z80op_ill_ed,
401 z80op_ill_ed,
402 z80op_ill_ed,
403 z80op_ill_ed,
404 z80op_ill_ed,
405 z80op_ill_ed,
406 z80op_ill_ed,
407 z80op_ill_ed,
408 z80op_ill_ed,
410 z80op_ill_ed,
411 z80op_ill_ed,
412 z80op_ill_ed,
413 z80op_ill_ed,
414 z80op_ill_ed,
415 z80op_ill_ed,
416 z80op_ill_ed,
417 z80op_ill_ed,
418 z80op_ill_ed,
419 z80op_ill_ed,
420 z80op_ill_ed,
421 z80op_ill_ed,
422 z80op_ill_ed,
423 z80op_ill_ed,
424 z80op_ill_ed,
425 z80op_ill_ed,
427 z80op_ill_ed,
428 z80op_ill_ed,
429 z80op_ill_ed,
430 z80op_ill_ed,
431 z80op_ill_ed,
432 z80op_ill_ed,
433 z80op_ill_ed,
434 z80op_ill_ed,
435 z80op_ill_ed,
436 z80op_ill_ed,
437 z80op_ill_ed,
438 z80op_ill_ed,
439 z80op_ill_ed,
440 z80op_ill_ed,
441 z80op_ill_ed,
442 z80op_ill_ed,
444 z80op_in_b_ic,
445 z80op_out_ic_b,
446 z80op_sbc_hl_bc,
447 z80op_ld_inn_bc,
448 z80op_neg,
449 z80op_retn,
450 z80op_im_0,
451 z80op_ld_i_a,
452 z80op_in_c_ic,
453 z80op_out_ic_c,
454 z80op_adc_hl_bc,
455 z80op_ld_bc_inn,
456 z80op_neg,
457 z80op_reti,
458 z80op_im_0,
459 z80op_ld_r_a,
461 z80op_in_d_ic,
462 z80op_out_ic_d,
463 z80op_sbc_hl_de,
464 z80op_ld_inn_de,
465 z80op_neg,
466 z80op_retn,
467 z80op_im_1,
468 z80op_ld_a_i,
469 z80op_in_e_ic,
470 z80op_out_ic_e,
471 z80op_adc_hl_de,
472 z80op_ld_de_inn,
473 z80op_neg,
474 z80op_retn,
475 z80op_im_2,
476 z80op_ld_a_r,
478 z80op_in_h_ic,
479 z80op_out_ic_h,
480 z80op_sbc_hl_hl,
481 z80op_ld_inn_hl_ed,
482 z80op_neg,
483 z80op_retn,
484 z80op_im_0,
485 z80op_rrd,
486 z80op_in_l_ic,
487 z80op_out_ic_l,
488 z80op_adc_hl_hl,
489 z80op_ld_hl_inn_ed,
490 z80op_neg,
491 z80op_retn,
492 z80op_im_0,
493 z80op_rld,
495 z80op_in_f_ic,
496 z80op_out_ic_0,
497 z80op_sbc_hl_sp,
498 z80op_ld_inn_sp,
499 z80op_neg,
500 z80op_retn,
501 z80op_im_1,
502 z80op_ill_ed,
503 z80op_in_a_ic,
504 z80op_out_ic_a,
505 z80op_adc_hl_sp,
506 z80op_ld_sp_inn,
507 z80op_neg,
508 z80op_retn,
509 z80op_im_2,
510 z80op_ill_ed,
512 z80op_ill_ed,
513 z80op_ill_ed,
514 z80op_ill_ed,
515 z80op_ill_ed,
516 z80op_ill_ed,
517 z80op_ill_ed,
518 z80op_ill_ed,
519 z80op_ill_ed,
520 z80op_ill_ed,
521 z80op_ill_ed,
522 z80op_ill_ed,
523 z80op_ill_ed,
524 z80op_ill_ed,
525 z80op_ill_ed,
526 z80op_ill_ed,
527 z80op_ill_ed,
529 z80op_ill_ed,
530 z80op_ill_ed,
531 z80op_ill_ed,
532 z80op_ill_ed,
533 z80op_ill_ed,
534 z80op_ill_ed,
535 z80op_ill_ed,
536 z80op_ill_ed,
537 z80op_ill_ed,
538 z80op_ill_ed,
539 z80op_ill_ed,
540 z80op_ill_ed,
541 z80op_ill_ed,
542 z80op_ill_ed,
543 z80op_ill_ed,
544 z80op_ill_ed,
546 z80op_ldi,
547 z80op_cpi,
548 z80op_ini,
549 z80op_outi,
550 z80op_ill_ed,
551 z80op_ill_ed,
552 z80op_ill_ed,
553 z80op_ill_ed,
554 z80op_ldd,
555 z80op_cpd,
556 z80op_ind,
557 z80op_outd,
558 z80op_ill_ed,
559 z80op_ill_ed,
560 z80op_ill_ed,
561 z80op_ill_ed,
563 z80op_ldir,
564 z80op_cpir,
565 z80op_inir,
566 z80op_otir,
567 z80op_ill_ed,
568 z80op_ill_ed,
569 z80op_ill_ed,
570 z80op_ill_ed,
571 z80op_lddr,
572 z80op_cpdr,
573 z80op_indr,
574 z80op_otdr,
575 z80op_ill_ed,
576 z80op_ill_ed,
577 z80op_ill_ed,
578 z80op_ill_ed,
580 z80op_ill_ed,
581 z80op_ill_ed,
582 z80op_ill_ed,
583 z80op_ill_ed,
584 z80op_ill_ed,
585 z80op_ill_ed,
586 z80op_ill_ed,
587 z80op_ill_ed,
588 z80op_ill_ed,
589 z80op_ill_ed,
590 z80op_ill_ed,
591 z80op_ill_ed,
592 z80op_ill_ed,
593 z80op_ill_ed,
594 z80op_ill_ed,
595 z80op_ill_ed,
597 z80op_ill_ed,
598 z80op_ill_ed,
599 z80op_ill_ed,
600 z80op_ill_ed,
601 z80op_ill_ed,
602 z80op_ill_ed,
603 z80op_ill_ed,
604 z80op_ill_ed,
605 z80op_ill_ed,
606 z80op_ill_ed,
607 z80op_ill_ed,
608 z80op_ill_ed,
609 z80op_ill_ed,
610 z80op_ill_ed,
611 z80op_ill_ed,
612 z80op_ill_ed,
614 z80op_ill_ed,
615 z80op_ill_ed,
616 z80op_ill_ed,
617 z80op_ill_ed,
618 z80op_ill_ed,
619 z80op_ill_ed,
620 z80op_ill_ed,
621 z80op_ill_ed,
622 z80op_ill_ed,
623 z80op_ill_ed,
624 z80op_ill_ed,
625 z80op_ill_ed,
626 z80op_ill_ed,
627 z80op_ill_ed,
628 z80op_ill_ed,
629 z80op_ill_ed,
631 z80op_ill_ed,
632 z80op_ill_ed,
633 z80op_ill_ed,
634 z80op_ill_ed,
635 z80op_ill_ed,
636 z80op_ill_ed,
637 z80op_ill_ed,
638 z80op_ill_ed,
639 z80op_ill_ed,
640 z80op_ill_ed,
641 z80op_ill_ed,
642 z80op_ill_ed,
643 z80op_ill_ed,
644 z80op_ill_ed,
645 z80op_ill_ed,
646 z80op_ill_ed
649 op_f z80c_op_tab_dd[] = {
650 z80op_nop,
651 z80op_ld_bc_nn,
652 z80op_ld_ibc_a,
653 z80op_inc_bc,
654 z80op_inc_b,
655 z80op_dec_b,
656 z80op_ld_b_n,
657 z80op_rlca,
658 z80op_ex_af_afb,
659 z80op_add_ix_bc,
660 z80op_ld_a_ibc,
661 z80op_dec_bc,
662 z80op_inc_c,
663 z80op_dec_c,
664 z80op_ld_c_n,
665 z80op_rrca,
667 z80op_djnz_e,
668 z80op_ld_de_nn,
669 z80op_ld_ide_a,
670 z80op_inc_de,
671 z80op_inc_d,
672 z80op_dec_d,
673 z80op_ld_d_n,
674 z80op_rla,
675 z80op_jr_e,
676 z80op_add_ix_de,
677 z80op_ld_a_ide,
678 z80op_dec_de,
679 z80op_inc_e,
680 z80op_dec_e,
681 z80op_ld_e_n,
682 z80op_rra,
684 z80op_jr_nz_e,
685 z80op_ld_ix_nn,
686 z80op_ld_inn_ix,
687 z80op_inc_ix,
688 z80op_inc_ixh,
689 z80op_dec_ixh,
690 z80op_ld_ixh_n,
691 z80op_daa,
692 z80op_jr_z_e,
693 z80op_add_ix_ix,
694 z80op_ld_ix_inn,
695 z80op_dec_ix,
696 z80op_inc_ixl,
697 z80op_dec_ixl,
698 z80op_ld_ixl_n,
699 z80op_cpl,
701 z80op_jr_nc_e,
702 z80op_ld_sp_nn,
703 z80op_ld_inn_a,
704 z80op_inc_sp,
705 z80op_inc_iixd,
706 z80op_dec_iixd,
707 z80op_ld_iixd_n,
708 z80op_scf,
709 z80op_jr_c_e,
710 z80op_add_ix_sp,
711 z80op_ld_a_inn,
712 z80op_dec_sp,
713 z80op_inc_a,
714 z80op_dec_a,
715 z80op_ld_a_n,
716 z80op_ccf,
718 z80op_nop,
719 z80op_ld_b_c,
720 z80op_ld_b_d,
721 z80op_ld_b_e,
722 z80op_ld_b_ixh,
723 z80op_ld_b_ixl,
724 z80op_ld_b_iixd,
725 z80op_ld_b_a,
726 z80op_ld_c_b,
727 z80op_nop,
728 z80op_ld_c_d,
729 z80op_ld_c_e,
730 z80op_ld_c_ixh,
731 z80op_ld_c_ixl,
732 z80op_ld_c_iixd,
733 z80op_ld_c_a,
735 z80op_ld_d_b,
736 z80op_ld_d_c,
737 z80op_nop,
738 z80op_ld_d_e,
739 z80op_ld_d_ixh,
740 z80op_ld_d_ixl,
741 z80op_ld_d_iixd,
742 z80op_ld_d_a,
743 z80op_ld_e_b,
744 z80op_ld_e_c,
745 z80op_ld_e_d,
746 z80op_nop,
747 z80op_ld_e_ixh,
748 z80op_ld_e_ixl,
749 z80op_ld_e_iixd,
750 z80op_ld_e_a,
752 z80op_ld_ixh_b,
753 z80op_ld_ixh_c,
754 z80op_ld_ixh_d,
755 z80op_ld_ixh_e,
756 z80op_nop,
757 z80op_ld_ixh_ixl,
758 z80op_ld_h_iixd,
759 z80op_ld_ixh_a,
760 z80op_ld_ixl_b,
761 z80op_ld_ixl_c,
762 z80op_ld_ixl_d,
763 z80op_ld_ixl_e,
764 z80op_ld_ixl_ixh,
765 z80op_nop,
766 z80op_ld_l_iixd,
767 z80op_ld_ixl_a,
769 z80op_ld_iixd_b,
770 z80op_ld_iixd_c,
771 z80op_ld_iixd_d,
772 z80op_ld_iixd_e,
773 z80op_ld_iixd_h,
774 z80op_ld_iixd_l,
775 z80op_halt,
776 z80op_ld_iixd_a,
777 z80op_ld_a_b,
778 z80op_ld_a_c,
779 z80op_ld_a_d,
780 z80op_ld_a_e,
781 z80op_ld_a_ixh,
782 z80op_ld_a_ixl,
783 z80op_ld_a_iixd,
784 z80op_nop,
786 z80op_add_a_b,
787 z80op_add_a_c,
788 z80op_add_a_d,
789 z80op_add_a_e,
790 z80op_add_a_ixh,
791 z80op_add_a_ixl,
792 z80op_add_a_iixd,
793 z80op_add_a_a,
794 z80op_adc_a_b,
795 z80op_adc_a_c,
796 z80op_adc_a_d,
797 z80op_adc_a_e,
798 z80op_adc_a_ixh,
799 z80op_adc_a_ixl,
800 z80op_adc_a_iixd,
801 z80op_adc_a_a,
803 z80op_sub_b,
804 z80op_sub_c,
805 z80op_sub_d,
806 z80op_sub_e,
807 z80op_sub_ixh,
808 z80op_sub_ixl,
809 z80op_sub_iixd,
810 z80op_sub_a,
811 z80op_sbc_a_b,
812 z80op_sbc_a_c,
813 z80op_sbc_a_d,
814 z80op_sbc_a_e,
815 z80op_sbc_a_ixh,
816 z80op_sbc_a_ixl,
817 z80op_sbc_a_iixd,
818 z80op_sbc_a_a,
820 z80op_and_b,
821 z80op_and_c,
822 z80op_and_d,
823 z80op_and_e,
824 z80op_and_ixh,
825 z80op_and_ixl,
826 z80op_and_iixd,
827 z80op_and_a,
828 z80op_xor_b,
829 z80op_xor_c,
830 z80op_xor_d,
831 z80op_xor_e,
832 z80op_xor_ixh,
833 z80op_xor_ixl,
834 z80op_xor_iixd,
835 z80op_xor_a,
837 z80op_or_b,
838 z80op_or_c,
839 z80op_or_d,
840 z80op_or_e,
841 z80op_or_ixh,
842 z80op_or_ixl,
843 z80op_or_iixd,
844 z80op_or_a,
845 z80op_cp_b,
846 z80op_cp_c,
847 z80op_cp_d,
848 z80op_cp_e,
849 z80op_cp_ixh,
850 z80op_cp_ixl,
851 z80op_cp_iixd,
852 z80op_cp_a,
854 z80op_ret_nz,
855 z80op_pop_bc,
856 z80op_jp_nz_nn,
857 z80op_jp_nn,
858 z80op_call_nz_nn,
859 z80op_push_bc,
860 z80op_add_a_n,
861 z80op_rst_00,
862 z80op_ret_z,
863 z80op_ret,
864 z80op_jp_z_nn,
865 z80op_special_dd_cb,
866 z80op_call_z_nn,
867 z80op_call_nn,
868 z80op_adc_a_n,
869 z80op_rst_08,
871 z80op_ret_nc,
872 z80op_pop_de,
873 z80op_jp_nc_nn,
874 z80op_out_in_a,
875 z80op_call_nc_nn,
876 z80op_push_de,
877 z80op_sub_n,
878 z80op_rst_10,
879 z80op_ret_c,
880 z80op_exx,
881 z80op_jp_c_nn,
882 z80op_in_a_in,
883 z80op_call_c_nn,
884 z80op_special_xx,
885 z80op_sbc_a_n,
886 z80op_rst_18,
888 z80op_ret_po,
889 z80op_pop_ix,
890 z80op_jp_po_nn,
891 z80op_ex_isp_ix,
892 z80op_call_po_nn,
893 z80op_push_ix,
894 z80op_and_n,
895 z80op_rst_20,
896 z80op_ret_pe,
897 z80op_jp_ix,
898 z80op_jp_pe_nn,
899 z80op_ex_de_hl,
900 z80op_call_pe_nn,
901 z80op_special_ed,
902 z80op_xor_n,
903 z80op_rst_28,
905 z80op_ret_p,
906 z80op_pop_af,
907 z80op_jp_p_nn,
908 z80op_di,
909 z80op_call_p_nn,
910 z80op_push_af,
911 z80op_or_n,
912 z80op_rst_30,
913 z80op_ret_m,
914 z80op_ld_sp_ix,
915 z80op_jp_m_nn,
916 z80op_ei,
917 z80op_call_m_nn,
918 z80op_special_xx,
919 z80op_cp_n,
920 z80op_rst_38
924 op_f z80c_op_tab_fd[] = {
925 z80op_nop,
926 z80op_ld_bc_nn,
927 z80op_ld_ibc_a,
928 z80op_inc_bc,
929 z80op_inc_b,
930 z80op_dec_b,
931 z80op_ld_b_n,
932 z80op_rlca,
933 z80op_ex_af_afb,
934 z80op_add_iy_bc,
935 z80op_ld_a_ibc,
936 z80op_dec_bc,
937 z80op_inc_c,
938 z80op_dec_c,
939 z80op_ld_c_n,
940 z80op_rrca,
942 z80op_djnz_e,
943 z80op_ld_de_nn,
944 z80op_ld_ide_a,
945 z80op_inc_de,
946 z80op_inc_d,
947 z80op_dec_d,
948 z80op_ld_d_n,
949 z80op_rla,
950 z80op_jr_e,
951 z80op_add_iy_de,
952 z80op_ld_a_ide,
953 z80op_dec_de,
954 z80op_inc_e,
955 z80op_dec_e,
956 z80op_ld_e_n,
957 z80op_rra,
959 z80op_jr_nz_e,
960 z80op_ld_iy_nn,
961 z80op_ld_inn_iy,
962 z80op_inc_iy,
963 z80op_inc_iyh,
964 z80op_dec_iyh,
965 z80op_ld_iyh_n,
966 z80op_daa,
967 z80op_jr_z_e,
968 z80op_add_iy_iy,
969 z80op_ld_iy_inn,
970 z80op_dec_iy,
971 z80op_inc_iyl,
972 z80op_dec_iyl,
973 z80op_ld_iyl_n,
974 z80op_cpl,
976 z80op_jr_nc_e,
977 z80op_ld_sp_nn,
978 z80op_ld_inn_a,
979 z80op_inc_sp,
980 z80op_inc_iiyd,
981 z80op_dec_iiyd,
982 z80op_ld_iiyd_n,
983 z80op_scf,
984 z80op_jr_c_e,
985 z80op_add_iy_sp,
986 z80op_ld_a_inn,
987 z80op_dec_sp,
988 z80op_inc_a,
989 z80op_dec_a,
990 z80op_ld_a_n,
991 z80op_ccf,
993 z80op_nop,
994 z80op_ld_b_c,
995 z80op_ld_b_d,
996 z80op_ld_b_e,
997 z80op_ld_b_iyh,
998 z80op_ld_b_iyl,
999 z80op_ld_b_iiyd,
1000 z80op_ld_b_a,
1001 z80op_ld_c_b,
1002 z80op_nop,
1003 z80op_ld_c_d,
1004 z80op_ld_c_e,
1005 z80op_ld_c_iyh,
1006 z80op_ld_c_iyl,
1007 z80op_ld_c_iiyd,
1008 z80op_ld_c_a,
1010 z80op_ld_d_b,
1011 z80op_ld_d_c,
1012 z80op_nop,
1013 z80op_ld_d_e,
1014 z80op_ld_d_iyh,
1015 z80op_ld_d_iyl,
1016 z80op_ld_d_iiyd,
1017 z80op_ld_d_a,
1018 z80op_ld_e_b,
1019 z80op_ld_e_c,
1020 z80op_ld_e_d,
1021 z80op_nop,
1022 z80op_ld_e_iyh,
1023 z80op_ld_e_iyl,
1024 z80op_ld_e_iiyd,
1025 z80op_ld_e_a,
1027 z80op_ld_iyh_b,
1028 z80op_ld_iyh_c,
1029 z80op_ld_iyh_d,
1030 z80op_ld_iyh_e,
1031 z80op_nop,
1032 z80op_ld_iyh_iyl,
1033 z80op_ld_h_iiyd,
1034 z80op_ld_iyh_a,
1035 z80op_ld_iyl_b,
1036 z80op_ld_iyl_c,
1037 z80op_ld_iyl_d,
1038 z80op_ld_iyl_e,
1039 z80op_ld_iyl_iyh,
1040 z80op_nop,
1041 z80op_ld_l_iiyd,
1042 z80op_ld_iyl_a,
1044 z80op_ld_iiyd_b,
1045 z80op_ld_iiyd_c,
1046 z80op_ld_iiyd_d,
1047 z80op_ld_iiyd_e,
1048 z80op_ld_iiyd_h,
1049 z80op_ld_iiyd_l,
1050 z80op_halt,
1051 z80op_ld_iiyd_a,
1052 z80op_ld_a_b,
1053 z80op_ld_a_c,
1054 z80op_ld_a_d,
1055 z80op_ld_a_e,
1056 z80op_ld_a_iyh,
1057 z80op_ld_a_iyl,
1058 z80op_ld_a_iiyd,
1059 z80op_nop,
1061 z80op_add_a_b,
1062 z80op_add_a_c,
1063 z80op_add_a_d,
1064 z80op_add_a_e,
1065 z80op_add_a_iyh,
1066 z80op_add_a_iyl,
1067 z80op_add_a_iiyd,
1068 z80op_add_a_a,
1069 z80op_adc_a_b,
1070 z80op_adc_a_c,
1071 z80op_adc_a_d,
1072 z80op_adc_a_e,
1073 z80op_adc_a_iyh,
1074 z80op_adc_a_iyl,
1075 z80op_adc_a_iiyd,
1076 z80op_adc_a_a,
1078 z80op_sub_b,
1079 z80op_sub_c,
1080 z80op_sub_d,
1081 z80op_sub_e,
1082 z80op_sub_iyh,
1083 z80op_sub_iyl,
1084 z80op_sub_iiyd,
1085 z80op_sub_a,
1086 z80op_sbc_a_b,
1087 z80op_sbc_a_c,
1088 z80op_sbc_a_d,
1089 z80op_sbc_a_e,
1090 z80op_sbc_a_iyh,
1091 z80op_sbc_a_iyl,
1092 z80op_sbc_a_iiyd,
1093 z80op_sbc_a_a,
1095 z80op_and_b,
1096 z80op_and_c,
1097 z80op_and_d,
1098 z80op_and_e,
1099 z80op_and_iyh,
1100 z80op_and_iyl,
1101 z80op_and_iiyd,
1102 z80op_and_a,
1103 z80op_xor_b,
1104 z80op_xor_c,
1105 z80op_xor_d,
1106 z80op_xor_e,
1107 z80op_xor_iyh,
1108 z80op_xor_iyl,
1109 z80op_xor_iiyd,
1110 z80op_xor_a,
1112 z80op_or_b,
1113 z80op_or_c,
1114 z80op_or_d,
1115 z80op_or_e,
1116 z80op_or_iyh,
1117 z80op_or_iyl,
1118 z80op_or_iiyd,
1119 z80op_or_a,
1120 z80op_cp_b,
1121 z80op_cp_c,
1122 z80op_cp_d,
1123 z80op_cp_e,
1124 z80op_cp_iyh,
1125 z80op_cp_iyl,
1126 z80op_cp_iiyd,
1127 z80op_cp_a,
1129 z80op_ret_nz,
1130 z80op_pop_bc,
1131 z80op_jp_nz_nn,
1132 z80op_jp_nn,
1133 z80op_call_nz_nn,
1134 z80op_push_bc,
1135 z80op_add_a_n,
1136 z80op_rst_00,
1137 z80op_ret_z,
1138 z80op_ret,
1139 z80op_jp_z_nn,
1140 z80op_special_fd_cb,
1141 z80op_call_z_nn,
1142 z80op_call_nn,
1143 z80op_adc_a_n,
1144 z80op_rst_08,
1146 z80op_ret_nc,
1147 z80op_pop_de,
1148 z80op_jp_nc_nn,
1149 z80op_out_in_a,
1150 z80op_call_nc_nn,
1151 z80op_push_de,
1152 z80op_sub_n,
1153 z80op_rst_10,
1154 z80op_ret_c,
1155 z80op_exx,
1156 z80op_jp_c_nn,
1157 z80op_in_a_in,
1158 z80op_call_c_nn,
1159 z80op_special_xx,
1160 z80op_sbc_a_n,
1161 z80op_rst_18,
1163 z80op_ret_po,
1164 z80op_pop_iy,
1165 z80op_jp_po_nn,
1166 z80op_ex_isp_iy,
1167 z80op_call_po_nn,
1168 z80op_push_iy,
1169 z80op_and_n,
1170 z80op_rst_20,
1171 z80op_ret_pe,
1172 z80op_jp_iy,
1173 z80op_jp_pe_nn,
1174 z80op_ex_de_hl,
1175 z80op_call_pe_nn,
1176 z80op_special_ed,
1177 z80op_xor_n,
1178 z80op_rst_28,
1180 z80op_ret_p,
1181 z80op_pop_af,
1182 z80op_jp_p_nn,
1183 z80op_di,
1184 z80op_call_p_nn,
1185 z80op_push_af,
1186 z80op_or_n,
1187 z80op_rst_30,
1188 z80op_ret_m,
1189 z80op_ld_sp_iy,
1190 z80op_jp_m_nn,
1191 z80op_ei,
1192 z80op_call_m_nn,
1193 z80op_special_xx,
1194 z80op_cp_n,
1195 z80op_rst_38
1198 op_f z80c_op_tab_cb[] = {
1199 z80op_rlc_b,
1200 z80op_rlc_c,
1201 z80op_rlc_d,
1202 z80op_rlc_e,
1203 z80op_rlc_h,
1204 z80op_rlc_l,
1205 z80op_rlc_ihl,
1206 z80op_rlc_a,
1207 z80op_rrc_b,
1208 z80op_rrc_c,
1209 z80op_rrc_d,
1210 z80op_rrc_e,
1211 z80op_rrc_h,
1212 z80op_rrc_l,
1213 z80op_rrc_ihl,
1214 z80op_rrc_a,
1216 z80op_rl_b,
1217 z80op_rl_c,
1218 z80op_rl_d,
1219 z80op_rl_e,
1220 z80op_rl_h,
1221 z80op_rl_l,
1222 z80op_rl_ihl,
1223 z80op_rl_a,
1224 z80op_rr_b,
1225 z80op_rr_c,
1226 z80op_rr_d,
1227 z80op_rr_e,
1228 z80op_rr_h,
1229 z80op_rr_l,
1230 z80op_rr_ihl,
1231 z80op_rr_a,
1233 z80op_sla_b,
1234 z80op_sla_c,
1235 z80op_sla_d,
1236 z80op_sla_e,
1237 z80op_sla_h,
1238 z80op_sla_l,
1239 z80op_sla_ihl,
1240 z80op_sla_a,
1241 z80op_sra_b,
1242 z80op_sra_c,
1243 z80op_sra_d,
1244 z80op_sra_e,
1245 z80op_sra_h,
1246 z80op_sra_l,
1247 z80op_sra_ihl,
1248 z80op_sra_a,
1250 z80op_sll_b,
1251 z80op_sll_c,
1252 z80op_sll_d,
1253 z80op_sll_e,
1254 z80op_sll_h,
1255 z80op_sll_l,
1256 z80op_sll_ihl,
1257 z80op_sll_a,
1258 z80op_srl_b,
1259 z80op_srl_c,
1260 z80op_srl_d,
1261 z80op_srl_e,
1262 z80op_srl_h,
1263 z80op_srl_l,
1264 z80op_srl_ihl,
1265 z80op_srl_a,
1267 z80op_bit_0_b,
1268 z80op_bit_0_c,
1269 z80op_bit_0_d,
1270 z80op_bit_0_e,
1271 z80op_bit_0_h,
1272 z80op_bit_0_l,
1273 z80op_bit_0_ihl,
1274 z80op_bit_0_a,
1275 z80op_bit_1_b,
1276 z80op_bit_1_c,
1277 z80op_bit_1_d,
1278 z80op_bit_1_e,
1279 z80op_bit_1_h,
1280 z80op_bit_1_l,
1281 z80op_bit_1_ihl,
1282 z80op_bit_1_a,
1284 z80op_bit_2_b,
1285 z80op_bit_2_c,
1286 z80op_bit_2_d,
1287 z80op_bit_2_e,
1288 z80op_bit_2_h,
1289 z80op_bit_2_l,
1290 z80op_bit_2_ihl,
1291 z80op_bit_2_a,
1292 z80op_bit_3_b,
1293 z80op_bit_3_c,
1294 z80op_bit_3_d,
1295 z80op_bit_3_e,
1296 z80op_bit_3_h,
1297 z80op_bit_3_l,
1298 z80op_bit_3_ihl,
1299 z80op_bit_3_a,
1301 z80op_bit_4_b,
1302 z80op_bit_4_c,
1303 z80op_bit_4_d,
1304 z80op_bit_4_e,
1305 z80op_bit_4_h,
1306 z80op_bit_4_l,
1307 z80op_bit_4_ihl,
1308 z80op_bit_4_a,
1309 z80op_bit_5_b,
1310 z80op_bit_5_c,
1311 z80op_bit_5_d,
1312 z80op_bit_5_e,
1313 z80op_bit_5_h,
1314 z80op_bit_5_l,
1315 z80op_bit_5_ihl,
1316 z80op_bit_5_a,
1318 z80op_bit_6_b,
1319 z80op_bit_6_c,
1320 z80op_bit_6_d,
1321 z80op_bit_6_e,
1322 z80op_bit_6_h,
1323 z80op_bit_6_l,
1324 z80op_bit_6_ihl,
1325 z80op_bit_6_a,
1326 z80op_bit_7_b,
1327 z80op_bit_7_c,
1328 z80op_bit_7_d,
1329 z80op_bit_7_e,
1330 z80op_bit_7_h,
1331 z80op_bit_7_l,
1332 z80op_bit_7_ihl,
1333 z80op_bit_7_a,
1335 z80op_res_0_b,
1336 z80op_res_0_c,
1337 z80op_res_0_d,
1338 z80op_res_0_e,
1339 z80op_res_0_h,
1340 z80op_res_0_l,
1341 z80op_res_0_ihl,
1342 z80op_res_0_a,
1343 z80op_res_1_b,
1344 z80op_res_1_c,
1345 z80op_res_1_d,
1346 z80op_res_1_e,
1347 z80op_res_1_h,
1348 z80op_res_1_l,
1349 z80op_res_1_ihl,
1350 z80op_res_1_a,
1352 z80op_res_2_b,
1353 z80op_res_2_c,
1354 z80op_res_2_d,
1355 z80op_res_2_e,
1356 z80op_res_2_h,
1357 z80op_res_2_l,
1358 z80op_res_2_ihl,
1359 z80op_res_2_a,
1360 z80op_res_3_b,
1361 z80op_res_3_c,
1362 z80op_res_3_d,
1363 z80op_res_3_e,
1364 z80op_res_3_h,
1365 z80op_res_3_l,
1366 z80op_res_3_ihl,
1367 z80op_res_3_a,
1369 z80op_res_4_b,
1370 z80op_res_4_c,
1371 z80op_res_4_d,
1372 z80op_res_4_e,
1373 z80op_res_4_h,
1374 z80op_res_4_l,
1375 z80op_res_4_ihl,
1376 z80op_res_4_a,
1377 z80op_res_5_b,
1378 z80op_res_5_c,
1379 z80op_res_5_d,
1380 z80op_res_5_e,
1381 z80op_res_5_h,
1382 z80op_res_5_l,
1383 z80op_res_5_ihl,
1384 z80op_res_5_a,
1386 z80op_res_6_b,
1387 z80op_res_6_c,
1388 z80op_res_6_d,
1389 z80op_res_6_e,
1390 z80op_res_6_h,
1391 z80op_res_6_l,
1392 z80op_res_6_ihl,
1393 z80op_res_6_a,
1394 z80op_res_7_b,
1395 z80op_res_7_c,
1396 z80op_res_7_d,
1397 z80op_res_7_e,
1398 z80op_res_7_h,
1399 z80op_res_7_l,
1400 z80op_res_7_ihl,
1401 z80op_res_7_a,
1403 z80op_set_0_b,
1404 z80op_set_0_c,
1405 z80op_set_0_d,
1406 z80op_set_0_e,
1407 z80op_set_0_h,
1408 z80op_set_0_l,
1409 z80op_set_0_ihl,
1410 z80op_set_0_a,
1411 z80op_set_1_b,
1412 z80op_set_1_c,
1413 z80op_set_1_d,
1414 z80op_set_1_e,
1415 z80op_set_1_h,
1416 z80op_set_1_l,
1417 z80op_set_1_ihl,
1418 z80op_set_1_a,
1420 z80op_set_2_b,
1421 z80op_set_2_c,
1422 z80op_set_2_d,
1423 z80op_set_2_e,
1424 z80op_set_2_h,
1425 z80op_set_2_l,
1426 z80op_set_2_ihl,
1427 z80op_set_2_a,
1428 z80op_set_3_b,
1429 z80op_set_3_c,
1430 z80op_set_3_d,
1431 z80op_set_3_e,
1432 z80op_set_3_h,
1433 z80op_set_3_l,
1434 z80op_set_3_ihl,
1435 z80op_set_3_a,
1437 z80op_set_4_b,
1438 z80op_set_4_c,
1439 z80op_set_4_d,
1440 z80op_set_4_e,
1441 z80op_set_4_h,
1442 z80op_set_4_l,
1443 z80op_set_4_ihl,
1444 z80op_set_4_a,
1445 z80op_set_5_b,
1446 z80op_set_5_c,
1447 z80op_set_5_d,
1448 z80op_set_5_e,
1449 z80op_set_5_h,
1450 z80op_set_5_l,
1451 z80op_set_5_ihl,
1452 z80op_set_5_a,
1454 z80op_set_6_b,
1455 z80op_set_6_c,
1456 z80op_set_6_d,
1457 z80op_set_6_e,
1458 z80op_set_6_h,
1459 z80op_set_6_l,
1460 z80op_set_6_ihl,
1461 z80op_set_6_a,
1462 z80op_set_7_b,
1463 z80op_set_7_c,
1464 z80op_set_7_d,
1465 z80op_set_7_e,
1466 z80op_set_7_h,
1467 z80op_set_7_l,
1468 z80op_set_7_ihl,
1469 z80op_set_7_a