split out more asm from build, disable is on iOS (for now?)
[picodrive.git] / cpu / fame / famec_opcodes.h
CommitLineData
70357ce5 1
2// ORI
3OPCODE(0x0000)
4{
5 u32 adr, res;
6 u32 src, dst;
7
8 FETCH_BYTE(src);
9 res = DREGu8((Opcode >> 0) & 7);
10 res |= src;
11 flag_C = 0;
12 flag_V = 0;
13 flag_NotZ = res;
14 flag_N = res;
15 DREGu8((Opcode >> 0) & 7) = res;
16RET(8)
17}
18
19// ORI
20OPCODE(0x0010)
21{
22 u32 adr, res;
23 u32 src, dst;
24
25 FETCH_BYTE(src);
26 adr = AREG((Opcode >> 0) & 7);
27 PRE_IO
28 READ_BYTE_F(adr, res)
29 res |= src;
30 flag_C = 0;
31 flag_V = 0;
32 flag_NotZ = res;
33 flag_N = res;
34 WRITE_BYTE_F(adr, res)
35 POST_IO
36RET(16)
37}
38
39// ORI
40OPCODE(0x0018)
41{
42 u32 adr, res;
43 u32 src, dst;
44
45 FETCH_BYTE(src);
46 adr = AREG((Opcode >> 0) & 7);
47 AREG((Opcode >> 0) & 7) += 1;
48 PRE_IO
49 READ_BYTE_F(adr, res)
50 res |= src;
51 flag_C = 0;
52 flag_V = 0;
53 flag_NotZ = res;
54 flag_N = res;
55 WRITE_BYTE_F(adr, res)
56 POST_IO
57RET(16)
58}
59
60// ORI
61OPCODE(0x0020)
62{
63 u32 adr, res;
64 u32 src, dst;
65
66 FETCH_BYTE(src);
67 adr = AREG((Opcode >> 0) & 7) - 1;
68 AREG((Opcode >> 0) & 7) = adr;
69 PRE_IO
70 READ_BYTE_F(adr, res)
71 res |= src;
72 flag_C = 0;
73 flag_V = 0;
74 flag_NotZ = res;
75 flag_N = res;
76 WRITE_BYTE_F(adr, res)
77 POST_IO
78RET(18)
79}
80
81// ORI
82OPCODE(0x0028)
83{
84 u32 adr, res;
85 u32 src, dst;
86
87 FETCH_BYTE(src);
88 FETCH_SWORD(adr);
89 adr += AREG((Opcode >> 0) & 7);
90 PRE_IO
91 READ_BYTE_F(adr, res)
92 res |= src;
93 flag_C = 0;
94 flag_V = 0;
95 flag_NotZ = res;
96 flag_N = res;
97 WRITE_BYTE_F(adr, res)
98 POST_IO
99RET(20)
100}
101
102// ORI
103OPCODE(0x0030)
104{
105 u32 adr, res;
106 u32 src, dst;
107
108 FETCH_BYTE(src);
109 adr = AREG((Opcode >> 0) & 7);
110 DECODE_EXT_WORD
111 PRE_IO
112 READ_BYTE_F(adr, res)
113 res |= src;
114 flag_C = 0;
115 flag_V = 0;
116 flag_NotZ = res;
117 flag_N = res;
118 WRITE_BYTE_F(adr, res)
119 POST_IO
120RET(22)
121}
122
123// ORI
124OPCODE(0x0038)
125{
126 u32 adr, res;
127 u32 src, dst;
128
129 FETCH_BYTE(src);
130 FETCH_SWORD(adr);
131 PRE_IO
132 READ_BYTE_F(adr, res)
133 res |= src;
134 flag_C = 0;
135 flag_V = 0;
136 flag_NotZ = res;
137 flag_N = res;
138 WRITE_BYTE_F(adr, res)
139 POST_IO
140RET(20)
141}
142
143// ORI
144OPCODE(0x0039)
145{
146 u32 adr, res;
147 u32 src, dst;
148
149 FETCH_BYTE(src);
150 FETCH_LONG(adr);
151 PRE_IO
152 READ_BYTE_F(adr, res)
153 res |= src;
154 flag_C = 0;
155 flag_V = 0;
156 flag_NotZ = res;
157 flag_N = res;
158 WRITE_BYTE_F(adr, res)
159 POST_IO
160RET(24)
161}
162
163// ORI
164OPCODE(0x001F)
165{
166 u32 adr, res;
167 u32 src, dst;
168
169 FETCH_BYTE(src);
170 adr = AREG(7);
171 AREG(7) += 2;
172 PRE_IO
173 READ_BYTE_F(adr, res)
174 res |= src;
175 flag_C = 0;
176 flag_V = 0;
177 flag_NotZ = res;
178 flag_N = res;
179 WRITE_BYTE_F(adr, res)
180 POST_IO
181RET(16)
182}
183
184// ORI
185OPCODE(0x0027)
186{
187 u32 adr, res;
188 u32 src, dst;
189
190 FETCH_BYTE(src);
191 adr = AREG(7) - 2;
192 AREG(7) = adr;
193 PRE_IO
194 READ_BYTE_F(adr, res)
195 res |= src;
196 flag_C = 0;
197 flag_V = 0;
198 flag_NotZ = res;
199 flag_N = res;
200 WRITE_BYTE_F(adr, res)
201 POST_IO
202RET(18)
203}
204
205// ORI
206OPCODE(0x0040)
207{
208 u32 adr, res;
209 u32 src, dst;
210
211 FETCH_WORD(src);
212 res = DREGu16((Opcode >> 0) & 7);
213 res |= src;
214 flag_C = 0;
215 flag_V = 0;
216 flag_NotZ = res;
217 flag_N = res >> 8;
218 DREGu16((Opcode >> 0) & 7) = res;
219RET(8)
220}
221
222// ORI
223OPCODE(0x0050)
224{
225 u32 adr, res;
226 u32 src, dst;
227
228 FETCH_WORD(src);
229 adr = AREG((Opcode >> 0) & 7);
230 PRE_IO
231 READ_WORD_F(adr, res)
232 res |= src;
233 flag_C = 0;
234 flag_V = 0;
235 flag_NotZ = res;
236 flag_N = res >> 8;
237 WRITE_WORD_F(adr, res)
238 POST_IO
239RET(16)
240}
241
242// ORI
243OPCODE(0x0058)
244{
245 u32 adr, res;
246 u32 src, dst;
247
248 FETCH_WORD(src);
249 adr = AREG((Opcode >> 0) & 7);
250 AREG((Opcode >> 0) & 7) += 2;
251 PRE_IO
252 READ_WORD_F(adr, res)
253 res |= src;
254 flag_C = 0;
255 flag_V = 0;
256 flag_NotZ = res;
257 flag_N = res >> 8;
258 WRITE_WORD_F(adr, res)
259 POST_IO
260RET(16)
261}
262
263// ORI
264OPCODE(0x0060)
265{
266 u32 adr, res;
267 u32 src, dst;
268
269 FETCH_WORD(src);
270 adr = AREG((Opcode >> 0) & 7) - 2;
271 AREG((Opcode >> 0) & 7) = adr;
272 PRE_IO
273 READ_WORD_F(adr, res)
274 res |= src;
275 flag_C = 0;
276 flag_V = 0;
277 flag_NotZ = res;
278 flag_N = res >> 8;
279 WRITE_WORD_F(adr, res)
280 POST_IO
281RET(18)
282}
283
284// ORI
285OPCODE(0x0068)
286{
287 u32 adr, res;
288 u32 src, dst;
289
290 FETCH_WORD(src);
291 FETCH_SWORD(adr);
292 adr += AREG((Opcode >> 0) & 7);
293 PRE_IO
294 READ_WORD_F(adr, res)
295 res |= src;
296 flag_C = 0;
297 flag_V = 0;
298 flag_NotZ = res;
299 flag_N = res >> 8;
300 WRITE_WORD_F(adr, res)
301 POST_IO
302RET(20)
303}
304
305// ORI
306OPCODE(0x0070)
307{
308 u32 adr, res;
309 u32 src, dst;
310
311 FETCH_WORD(src);
312 adr = AREG((Opcode >> 0) & 7);
313 DECODE_EXT_WORD
314 PRE_IO
315 READ_WORD_F(adr, res)
316 res |= src;
317 flag_C = 0;
318 flag_V = 0;
319 flag_NotZ = res;
320 flag_N = res >> 8;
321 WRITE_WORD_F(adr, res)
322 POST_IO
323RET(22)
324}
325
326// ORI
327OPCODE(0x0078)
328{
329 u32 adr, res;
330 u32 src, dst;
331
332 FETCH_WORD(src);
333 FETCH_SWORD(adr);
334 PRE_IO
335 READ_WORD_F(adr, res)
336 res |= src;
337 flag_C = 0;
338 flag_V = 0;
339 flag_NotZ = res;
340 flag_N = res >> 8;
341 WRITE_WORD_F(adr, res)
342 POST_IO
343RET(20)
344}
345
346// ORI
347OPCODE(0x0079)
348{
349 u32 adr, res;
350 u32 src, dst;
351
352 FETCH_WORD(src);
353 FETCH_LONG(adr);
354 PRE_IO
355 READ_WORD_F(adr, res)
356 res |= src;
357 flag_C = 0;
358 flag_V = 0;
359 flag_NotZ = res;
360 flag_N = res >> 8;
361 WRITE_WORD_F(adr, res)
362 POST_IO
363RET(24)
364}
365
366// ORI
367OPCODE(0x005F)
368{
369 u32 adr, res;
370 u32 src, dst;
371
372 FETCH_WORD(src);
373 adr = AREG(7);
374 AREG(7) += 2;
375 PRE_IO
376 READ_WORD_F(adr, res)
377 res |= src;
378 flag_C = 0;
379 flag_V = 0;
380 flag_NotZ = res;
381 flag_N = res >> 8;
382 WRITE_WORD_F(adr, res)
383 POST_IO
384RET(16)
385}
386
387// ORI
388OPCODE(0x0067)
389{
390 u32 adr, res;
391 u32 src, dst;
392
393 FETCH_WORD(src);
394 adr = AREG(7) - 2;
395 AREG(7) = adr;
396 PRE_IO
397 READ_WORD_F(adr, res)
398 res |= src;
399 flag_C = 0;
400 flag_V = 0;
401 flag_NotZ = res;
402 flag_N = res >> 8;
403 WRITE_WORD_F(adr, res)
404 POST_IO
405RET(18)
406}
407
408// ORI
409OPCODE(0x0080)
410{
411 u32 adr, res;
412 u32 src, dst;
413
414 FETCH_LONG(src);
415 res = DREGu32((Opcode >> 0) & 7);
416 res |= src;
417 flag_C = 0;
418 flag_V = 0;
419 flag_NotZ = res;
420 flag_N = res >> 24;
421 DREGu32((Opcode >> 0) & 7) = res;
422RET(16)
423}
424
425// ORI
426OPCODE(0x0090)
427{
428 u32 adr, res;
429 u32 src, dst;
430
431 FETCH_LONG(src);
432 adr = AREG((Opcode >> 0) & 7);
433 PRE_IO
434 READ_LONG_F(adr, res)
435 res |= src;
436 flag_C = 0;
437 flag_V = 0;
438 flag_NotZ = res;
439 flag_N = res >> 24;
440 WRITE_LONG_F(adr, res)
441 POST_IO
442RET(28)
443}
444
445// ORI
446OPCODE(0x0098)
447{
448 u32 adr, res;
449 u32 src, dst;
450
451 FETCH_LONG(src);
452 adr = AREG((Opcode >> 0) & 7);
453 AREG((Opcode >> 0) & 7) += 4;
454 PRE_IO
455 READ_LONG_F(adr, res)
456 res |= src;
457 flag_C = 0;
458 flag_V = 0;
459 flag_NotZ = res;
460 flag_N = res >> 24;
461 WRITE_LONG_F(adr, res)
462 POST_IO
463RET(28)
464}
465
466// ORI
467OPCODE(0x00A0)
468{
469 u32 adr, res;
470 u32 src, dst;
471
472 FETCH_LONG(src);
473 adr = AREG((Opcode >> 0) & 7) - 4;
474 AREG((Opcode >> 0) & 7) = adr;
475 PRE_IO
476 READ_LONG_F(adr, res)
477 res |= src;
478 flag_C = 0;
479 flag_V = 0;
480 flag_NotZ = res;
481 flag_N = res >> 24;
482 WRITE_LONG_F(adr, res)
483 POST_IO
484RET(30)
485}
486
487// ORI
488OPCODE(0x00A8)
489{
490 u32 adr, res;
491 u32 src, dst;
492
493 FETCH_LONG(src);
494 FETCH_SWORD(adr);
495 adr += AREG((Opcode >> 0) & 7);
496 PRE_IO
497 READ_LONG_F(adr, res)
498 res |= src;
499 flag_C = 0;
500 flag_V = 0;
501 flag_NotZ = res;
502 flag_N = res >> 24;
503 WRITE_LONG_F(adr, res)
504 POST_IO
505RET(32)
506}
507
508// ORI
509OPCODE(0x00B0)
510{
511 u32 adr, res;
512 u32 src, dst;
513
514 FETCH_LONG(src);
515 adr = AREG((Opcode >> 0) & 7);
516 DECODE_EXT_WORD
517 PRE_IO
518 READ_LONG_F(adr, res)
519 res |= src;
520 flag_C = 0;
521 flag_V = 0;
522 flag_NotZ = res;
523 flag_N = res >> 24;
524 WRITE_LONG_F(adr, res)
525 POST_IO
526RET(34)
527}
528
529// ORI
530OPCODE(0x00B8)
531{
532 u32 adr, res;
533 u32 src, dst;
534
535 FETCH_LONG(src);
536 FETCH_SWORD(adr);
537 PRE_IO
538 READ_LONG_F(adr, res)
539 res |= src;
540 flag_C = 0;
541 flag_V = 0;
542 flag_NotZ = res;
543 flag_N = res >> 24;
544 WRITE_LONG_F(adr, res)
545 POST_IO
546RET(32)
547}
548
549// ORI
550OPCODE(0x00B9)
551{
552 u32 adr, res;
553 u32 src, dst;
554
555 FETCH_LONG(src);
556 FETCH_LONG(adr);
557 PRE_IO
558 READ_LONG_F(adr, res)
559 res |= src;
560 flag_C = 0;
561 flag_V = 0;
562 flag_NotZ = res;
563 flag_N = res >> 24;
564 WRITE_LONG_F(adr, res)
565 POST_IO
566RET(36)
567}
568
569// ORI
570OPCODE(0x009F)
571{
572 u32 adr, res;
573 u32 src, dst;
574
575 FETCH_LONG(src);
576 adr = AREG(7);
577 AREG(7) += 4;
578 PRE_IO
579 READ_LONG_F(adr, res)
580 res |= src;
581 flag_C = 0;
582 flag_V = 0;
583 flag_NotZ = res;
584 flag_N = res >> 24;
585 WRITE_LONG_F(adr, res)
586 POST_IO
587RET(28)
588}
589
590// ORI
591OPCODE(0x00A7)
592{
593 u32 adr, res;
594 u32 src, dst;
595
596 FETCH_LONG(src);
597 adr = AREG(7) - 4;
598 AREG(7) = adr;
599 PRE_IO
600 READ_LONG_F(adr, res)
601 res |= src;
602 flag_C = 0;
603 flag_V = 0;
604 flag_NotZ = res;
605 flag_N = res >> 24;
606 WRITE_LONG_F(adr, res)
607 POST_IO
608RET(30)
609}
610
611// ORICCR
612OPCODE(0x003C)
613{
614 u32 adr, res;
615 u32 src, dst;
616
617 FETCH_BYTE(res);
618 res &= M68K_CCR_MASK;
619 res |= GET_CCR;
620 SET_CCR(res)
621RET(20)
622}
623
624// ORISR
625OPCODE(0x007C)
626{
627 u32 adr, res;
628 u32 src, dst;
629
630 if (flag_S)
631 {
632 u32 res;
633 FETCH_WORD(res);
634 res &= M68K_SR_MASK;
635 res |= GET_SR;
636 SET_SR(res)
637 CHECK_INT_TO_JUMP(20)
638 }
639 else
640 {
d0ae0cb4 641 SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
70357ce5 642#ifdef USE_CYCLONE_TIMING
643 RET(0)
644#else
645 RET(4)
646#endif
647 }
648RET(20)
649}
650
651// ANDI
652OPCODE(0x0200)
653{
654 u32 adr, res;
655 u32 src, dst;
656
657 FETCH_BYTE(src);
658 res = DREGu8((Opcode >> 0) & 7);
659 res &= src;
660 flag_C = 0;
661 flag_V = 0;
662 flag_NotZ = res;
663 flag_N = res;
664 DREGu8((Opcode >> 0) & 7) = res;
665RET(8)
666}
667
668// ANDI
669OPCODE(0x0210)
670{
671 u32 adr, res;
672 u32 src, dst;
673
674 FETCH_BYTE(src);
675 adr = AREG((Opcode >> 0) & 7);
676 PRE_IO
677 READ_BYTE_F(adr, res)
678 res &= src;
679 flag_C = 0;
680 flag_V = 0;
681 flag_NotZ = res;
682 flag_N = res;
683 WRITE_BYTE_F(adr, res)
684 POST_IO
685RET(16)
686}
687
688// ANDI
689OPCODE(0x0218)
690{
691 u32 adr, res;
692 u32 src, dst;
693
694 FETCH_BYTE(src);
695 adr = AREG((Opcode >> 0) & 7);
696 AREG((Opcode >> 0) & 7) += 1;
697 PRE_IO
698 READ_BYTE_F(adr, res)
699 res &= src;
700 flag_C = 0;
701 flag_V = 0;
702 flag_NotZ = res;
703 flag_N = res;
704 WRITE_BYTE_F(adr, res)
705 POST_IO
706RET(16)
707}
708
709// ANDI
710OPCODE(0x0220)
711{
712 u32 adr, res;
713 u32 src, dst;
714
715 FETCH_BYTE(src);
716 adr = AREG((Opcode >> 0) & 7) - 1;
717 AREG((Opcode >> 0) & 7) = adr;
718 PRE_IO
719 READ_BYTE_F(adr, res)
720 res &= src;
721 flag_C = 0;
722 flag_V = 0;
723 flag_NotZ = res;
724 flag_N = res;
725 WRITE_BYTE_F(adr, res)
726 POST_IO
727RET(18)
728}
729
730// ANDI
731OPCODE(0x0228)
732{
733 u32 adr, res;
734 u32 src, dst;
735
736 FETCH_BYTE(src);
737 FETCH_SWORD(adr);
738 adr += AREG((Opcode >> 0) & 7);
739 PRE_IO
740 READ_BYTE_F(adr, res)
741 res &= src;
742 flag_C = 0;
743 flag_V = 0;
744 flag_NotZ = res;
745 flag_N = res;
746 WRITE_BYTE_F(adr, res)
747 POST_IO
748RET(20)
749}
750
751// ANDI
752OPCODE(0x0230)
753{
754 u32 adr, res;
755 u32 src, dst;
756
757 FETCH_BYTE(src);
758 adr = AREG((Opcode >> 0) & 7);
759 DECODE_EXT_WORD
760 PRE_IO
761 READ_BYTE_F(adr, res)
762 res &= src;
763 flag_C = 0;
764 flag_V = 0;
765 flag_NotZ = res;
766 flag_N = res;
767 WRITE_BYTE_F(adr, res)
768 POST_IO
769RET(22)
770}
771
772// ANDI
773OPCODE(0x0238)
774{
775 u32 adr, res;
776 u32 src, dst;
777
778 FETCH_BYTE(src);
779 FETCH_SWORD(adr);
780 PRE_IO
781 READ_BYTE_F(adr, res)
782 res &= src;
783 flag_C = 0;
784 flag_V = 0;
785 flag_NotZ = res;
786 flag_N = res;
787 WRITE_BYTE_F(adr, res)
788 POST_IO
789RET(20)
790}
791
792// ANDI
793OPCODE(0x0239)
794{
795 u32 adr, res;
796 u32 src, dst;
797
798 FETCH_BYTE(src);
799 FETCH_LONG(adr);
800 PRE_IO
801 READ_BYTE_F(adr, res)
802 res &= src;
803 flag_C = 0;
804 flag_V = 0;
805 flag_NotZ = res;
806 flag_N = res;
807 WRITE_BYTE_F(adr, res)
808 POST_IO
809RET(24)
810}
811
812// ANDI
813OPCODE(0x021F)
814{
815 u32 adr, res;
816 u32 src, dst;
817
818 FETCH_BYTE(src);
819 adr = AREG(7);
820 AREG(7) += 2;
821 PRE_IO
822 READ_BYTE_F(adr, res)
823 res &= src;
824 flag_C = 0;
825 flag_V = 0;
826 flag_NotZ = res;
827 flag_N = res;
828 WRITE_BYTE_F(adr, res)
829 POST_IO
830RET(16)
831}
832
833// ANDI
834OPCODE(0x0227)
835{
836 u32 adr, res;
837 u32 src, dst;
838
839 FETCH_BYTE(src);
840 adr = AREG(7) - 2;
841 AREG(7) = adr;
842 PRE_IO
843 READ_BYTE_F(adr, res)
844 res &= src;
845 flag_C = 0;
846 flag_V = 0;
847 flag_NotZ = res;
848 flag_N = res;
849 WRITE_BYTE_F(adr, res)
850 POST_IO
851RET(18)
852}
853
854// ANDI
855OPCODE(0x0240)
856{
857 u32 adr, res;
858 u32 src, dst;
859
860 FETCH_WORD(src);
861 res = DREGu16((Opcode >> 0) & 7);
862 res &= src;
863 flag_C = 0;
864 flag_V = 0;
865 flag_NotZ = res;
866 flag_N = res >> 8;
867 DREGu16((Opcode >> 0) & 7) = res;
868RET(8)
869}
870
871// ANDI
872OPCODE(0x0250)
873{
874 u32 adr, res;
875 u32 src, dst;
876
877 FETCH_WORD(src);
878 adr = AREG((Opcode >> 0) & 7);
879 PRE_IO
880 READ_WORD_F(adr, res)
881 res &= src;
882 flag_C = 0;
883 flag_V = 0;
884 flag_NotZ = res;
885 flag_N = res >> 8;
886 WRITE_WORD_F(adr, res)
887 POST_IO
888RET(16)
889}
890
891// ANDI
892OPCODE(0x0258)
893{
894 u32 adr, res;
895 u32 src, dst;
896
897 FETCH_WORD(src);
898 adr = AREG((Opcode >> 0) & 7);
899 AREG((Opcode >> 0) & 7) += 2;
900 PRE_IO
901 READ_WORD_F(adr, res)
902 res &= src;
903 flag_C = 0;
904 flag_V = 0;
905 flag_NotZ = res;
906 flag_N = res >> 8;
907 WRITE_WORD_F(adr, res)
908 POST_IO
909RET(16)
910}
911
912// ANDI
913OPCODE(0x0260)
914{
915 u32 adr, res;
916 u32 src, dst;
917
918 FETCH_WORD(src);
919 adr = AREG((Opcode >> 0) & 7) - 2;
920 AREG((Opcode >> 0) & 7) = adr;
921 PRE_IO
922 READ_WORD_F(adr, res)
923 res &= src;
924 flag_C = 0;
925 flag_V = 0;
926 flag_NotZ = res;
927 flag_N = res >> 8;
928 WRITE_WORD_F(adr, res)
929 POST_IO
930RET(18)
931}
932
933// ANDI
934OPCODE(0x0268)
935{
936 u32 adr, res;
937 u32 src, dst;
938
939 FETCH_WORD(src);
940 FETCH_SWORD(adr);
941 adr += AREG((Opcode >> 0) & 7);
942 PRE_IO
943 READ_WORD_F(adr, res)
944 res &= src;
945 flag_C = 0;
946 flag_V = 0;
947 flag_NotZ = res;
948 flag_N = res >> 8;
949 WRITE_WORD_F(adr, res)
950 POST_IO
951RET(20)
952}
953
954// ANDI
955OPCODE(0x0270)
956{
957 u32 adr, res;
958 u32 src, dst;
959
960 FETCH_WORD(src);
961 adr = AREG((Opcode >> 0) & 7);
962 DECODE_EXT_WORD
963 PRE_IO
964 READ_WORD_F(adr, res)
965 res &= src;
966 flag_C = 0;
967 flag_V = 0;
968 flag_NotZ = res;
969 flag_N = res >> 8;
970 WRITE_WORD_F(adr, res)
971 POST_IO
972RET(22)
973}
974
975// ANDI
976OPCODE(0x0278)
977{
978 u32 adr, res;
979 u32 src, dst;
980
981 FETCH_WORD(src);
982 FETCH_SWORD(adr);
983 PRE_IO
984 READ_WORD_F(adr, res)
985 res &= src;
986 flag_C = 0;
987 flag_V = 0;
988 flag_NotZ = res;
989 flag_N = res >> 8;
990 WRITE_WORD_F(adr, res)
991 POST_IO
992RET(20)
993}
994
995// ANDI
996OPCODE(0x0279)
997{
998 u32 adr, res;
999 u32 src, dst;
1000
1001 FETCH_WORD(src);
1002 FETCH_LONG(adr);
1003 PRE_IO
1004 READ_WORD_F(adr, res)
1005 res &= src;
1006 flag_C = 0;
1007 flag_V = 0;
1008 flag_NotZ = res;
1009 flag_N = res >> 8;
1010 WRITE_WORD_F(adr, res)
1011 POST_IO
1012RET(24)
1013}
1014
1015// ANDI
1016OPCODE(0x025F)
1017{
1018 u32 adr, res;
1019 u32 src, dst;
1020
1021 FETCH_WORD(src);
1022 adr = AREG(7);
1023 AREG(7) += 2;
1024 PRE_IO
1025 READ_WORD_F(adr, res)
1026 res &= src;
1027 flag_C = 0;
1028 flag_V = 0;
1029 flag_NotZ = res;
1030 flag_N = res >> 8;
1031 WRITE_WORD_F(adr, res)
1032 POST_IO
1033RET(16)
1034}
1035
1036// ANDI
1037OPCODE(0x0267)
1038{
1039 u32 adr, res;
1040 u32 src, dst;
1041
1042 FETCH_WORD(src);
1043 adr = AREG(7) - 2;
1044 AREG(7) = adr;
1045 PRE_IO
1046 READ_WORD_F(adr, res)
1047 res &= src;
1048 flag_C = 0;
1049 flag_V = 0;
1050 flag_NotZ = res;
1051 flag_N = res >> 8;
1052 WRITE_WORD_F(adr, res)
1053 POST_IO
1054RET(18)
1055}
1056
1057// ANDI
1058OPCODE(0x0280)
1059{
1060 u32 adr, res;
1061 u32 src, dst;
1062
1063 FETCH_LONG(src);
1064 res = DREGu32((Opcode >> 0) & 7);
1065 res &= src;
1066 flag_C = 0;
1067 flag_V = 0;
1068 flag_NotZ = res;
1069 flag_N = res >> 24;
1070 DREGu32((Opcode >> 0) & 7) = res;
1071#ifdef USE_CYCLONE_TIMING
1072RET(14)
1073#else
1074RET(16)
1075#endif
1076}
1077
1078// ANDI
1079OPCODE(0x0290)
1080{
1081 u32 adr, res;
1082 u32 src, dst;
1083
1084 FETCH_LONG(src);
1085 adr = AREG((Opcode >> 0) & 7);
1086 PRE_IO
1087 READ_LONG_F(adr, res)
1088 res &= src;
1089 flag_C = 0;
1090 flag_V = 0;
1091 flag_NotZ = res;
1092 flag_N = res >> 24;
1093 WRITE_LONG_F(adr, res)
1094 POST_IO
1095RET(28)
1096}
1097
1098// ANDI
1099OPCODE(0x0298)
1100{
1101 u32 adr, res;
1102 u32 src, dst;
1103
1104 FETCH_LONG(src);
1105 adr = AREG((Opcode >> 0) & 7);
1106 AREG((Opcode >> 0) & 7) += 4;
1107 PRE_IO
1108 READ_LONG_F(adr, res)
1109 res &= src;
1110 flag_C = 0;
1111 flag_V = 0;
1112 flag_NotZ = res;
1113 flag_N = res >> 24;
1114 WRITE_LONG_F(adr, res)
1115 POST_IO
1116RET(28)
1117}
1118
1119// ANDI
1120OPCODE(0x02A0)
1121{
1122 u32 adr, res;
1123 u32 src, dst;
1124
1125 FETCH_LONG(src);
1126 adr = AREG((Opcode >> 0) & 7) - 4;
1127 AREG((Opcode >> 0) & 7) = adr;
1128 PRE_IO
1129 READ_LONG_F(adr, res)
1130 res &= src;
1131 flag_C = 0;
1132 flag_V = 0;
1133 flag_NotZ = res;
1134 flag_N = res >> 24;
1135 WRITE_LONG_F(adr, res)
1136 POST_IO
1137RET(30)
1138}
1139
1140// ANDI
1141OPCODE(0x02A8)
1142{
1143 u32 adr, res;
1144 u32 src, dst;
1145
1146 FETCH_LONG(src);
1147 FETCH_SWORD(adr);
1148 adr += AREG((Opcode >> 0) & 7);
1149 PRE_IO
1150 READ_LONG_F(adr, res)
1151 res &= src;
1152 flag_C = 0;
1153 flag_V = 0;
1154 flag_NotZ = res;
1155 flag_N = res >> 24;
1156 WRITE_LONG_F(adr, res)
1157 POST_IO
1158RET(32)
1159}
1160
1161// ANDI
1162OPCODE(0x02B0)
1163{
1164 u32 adr, res;
1165 u32 src, dst;
1166
1167 FETCH_LONG(src);
1168 adr = AREG((Opcode >> 0) & 7);
1169 DECODE_EXT_WORD
1170 PRE_IO
1171 READ_LONG_F(adr, res)
1172 res &= src;
1173 flag_C = 0;
1174 flag_V = 0;
1175 flag_NotZ = res;
1176 flag_N = res >> 24;
1177 WRITE_LONG_F(adr, res)
1178 POST_IO
1179RET(34)
1180}
1181
1182// ANDI
1183OPCODE(0x02B8)
1184{
1185 u32 adr, res;
1186 u32 src, dst;
1187
1188 FETCH_LONG(src);
1189 FETCH_SWORD(adr);
1190 PRE_IO
1191 READ_LONG_F(adr, res)
1192 res &= src;
1193 flag_C = 0;
1194 flag_V = 0;
1195 flag_NotZ = res;
1196 flag_N = res >> 24;
1197 WRITE_LONG_F(adr, res)
1198 POST_IO
1199RET(32)
1200}
1201
1202// ANDI
1203OPCODE(0x02B9)
1204{
1205 u32 adr, res;
1206 u32 src, dst;
1207
1208 FETCH_LONG(src);
1209 FETCH_LONG(adr);
1210 PRE_IO
1211 READ_LONG_F(adr, res)
1212 res &= src;
1213 flag_C = 0;
1214 flag_V = 0;
1215 flag_NotZ = res;
1216 flag_N = res >> 24;
1217 WRITE_LONG_F(adr, res)
1218 POST_IO
1219RET(36)
1220}
1221
1222// ANDI
1223OPCODE(0x029F)
1224{
1225 u32 adr, res;
1226 u32 src, dst;
1227
1228 FETCH_LONG(src);
1229 adr = AREG(7);
1230 AREG(7) += 4;
1231 PRE_IO
1232 READ_LONG_F(adr, res)
1233 res &= src;
1234 flag_C = 0;
1235 flag_V = 0;
1236 flag_NotZ = res;
1237 flag_N = res >> 24;
1238 WRITE_LONG_F(adr, res)
1239 POST_IO
1240RET(28)
1241}
1242
1243// ANDI
1244OPCODE(0x02A7)
1245{
1246 u32 adr, res;
1247 u32 src, dst;
1248
1249 FETCH_LONG(src);
1250 adr = AREG(7) - 4;
1251 AREG(7) = adr;
1252 PRE_IO
1253 READ_LONG_F(adr, res)
1254 res &= src;
1255 flag_C = 0;
1256 flag_V = 0;
1257 flag_NotZ = res;
1258 flag_N = res >> 24;
1259 WRITE_LONG_F(adr, res)
1260 POST_IO
1261RET(30)
1262}
1263
1264// ANDICCR
1265OPCODE(0x023C)
1266{
1267 u32 adr, res;
1268 u32 src, dst;
1269
1270 FETCH_BYTE(res);
1271 res &= M68K_CCR_MASK;
1272 res &= GET_CCR;
1273 SET_CCR(res)
1274RET(20)
1275}
1276
1277// ANDISR
1278OPCODE(0x027C)
1279{
1280 u32 adr, res;
1281 u32 src, dst;
1282
1283 if (flag_S)
1284 {
1285 FETCH_WORD(res);
1286 res &= M68K_SR_MASK;
1287 res &= GET_SR;
1288 SET_SR(res)
1289 if (!flag_S)
1290 {
1291 res = AREG(7);
1292 AREG(7) = ASP;
1293 ASP = res;
1294 }
1295 CHECK_INT_TO_JUMP(20)
1296 }
1297 else
1298 {
d0ae0cb4 1299 SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
70357ce5 1300 RET(4)
1301 }
1302RET(20)
1303}
1304
1305// EORI
1306OPCODE(0x0A00)
1307{
1308 u32 adr, res;
1309 u32 src, dst;
1310
1311 FETCH_BYTE(src);
1312 res = DREGu8((Opcode >> 0) & 7);
1313 res ^= src;
1314 flag_C = 0;
1315 flag_V = 0;
1316 flag_NotZ = res;
1317 flag_N = res;
1318 DREGu8((Opcode >> 0) & 7) = res;
1319RET(8)
1320}
1321
1322// EORI
1323OPCODE(0x0A10)
1324{
1325 u32 adr, res;
1326 u32 src, dst;
1327
1328 FETCH_BYTE(src);
1329 adr = AREG((Opcode >> 0) & 7);
1330 PRE_IO
1331 READ_BYTE_F(adr, res)
1332 res ^= src;
1333 flag_C = 0;
1334 flag_V = 0;
1335 flag_NotZ = res;
1336 flag_N = res;
1337 WRITE_BYTE_F(adr, res)
1338 POST_IO
1339RET(16)
1340}
1341
1342// EORI
1343OPCODE(0x0A18)
1344{
1345 u32 adr, res;
1346 u32 src, dst;
1347
1348 FETCH_BYTE(src);
1349 adr = AREG((Opcode >> 0) & 7);
1350 AREG((Opcode >> 0) & 7) += 1;
1351 PRE_IO
1352 READ_BYTE_F(adr, res)
1353 res ^= src;
1354 flag_C = 0;
1355 flag_V = 0;
1356 flag_NotZ = res;
1357 flag_N = res;
1358 WRITE_BYTE_F(adr, res)
1359 POST_IO
1360RET(16)
1361}
1362
1363// EORI
1364OPCODE(0x0A20)
1365{
1366 u32 adr, res;
1367 u32 src, dst;
1368
1369 FETCH_BYTE(src);
1370 adr = AREG((Opcode >> 0) & 7) - 1;
1371 AREG((Opcode >> 0) & 7) = adr;
1372 PRE_IO
1373 READ_BYTE_F(adr, res)
1374 res ^= src;
1375 flag_C = 0;
1376 flag_V = 0;
1377 flag_NotZ = res;
1378 flag_N = res;
1379 WRITE_BYTE_F(adr, res)
1380 POST_IO
1381RET(18)
1382}
1383
1384// EORI
1385OPCODE(0x0A28)
1386{
1387 u32 adr, res;
1388 u32 src, dst;
1389
1390 FETCH_BYTE(src);
1391 FETCH_SWORD(adr);
1392 adr += AREG((Opcode >> 0) & 7);
1393 PRE_IO
1394 READ_BYTE_F(adr, res)
1395 res ^= src;
1396 flag_C = 0;
1397 flag_V = 0;
1398 flag_NotZ = res;
1399 flag_N = res;
1400 WRITE_BYTE_F(adr, res)
1401 POST_IO
1402RET(20)
1403}
1404
1405// EORI
1406OPCODE(0x0A30)
1407{
1408 u32 adr, res;
1409 u32 src, dst;
1410
1411 FETCH_BYTE(src);
1412 adr = AREG((Opcode >> 0) & 7);
1413 DECODE_EXT_WORD
1414 PRE_IO
1415 READ_BYTE_F(adr, res)
1416 res ^= src;
1417 flag_C = 0;
1418 flag_V = 0;
1419 flag_NotZ = res;
1420 flag_N = res;
1421 WRITE_BYTE_F(adr, res)
1422 POST_IO
1423RET(22)
1424}
1425
1426// EORI
1427OPCODE(0x0A38)
1428{
1429 u32 adr, res;
1430 u32 src, dst;
1431
1432 FETCH_BYTE(src);
1433 FETCH_SWORD(adr);
1434 PRE_IO
1435 READ_BYTE_F(adr, res)
1436 res ^= src;
1437 flag_C = 0;
1438 flag_V = 0;
1439 flag_NotZ = res;
1440 flag_N = res;
1441 WRITE_BYTE_F(adr, res)
1442 POST_IO
1443RET(20)
1444}
1445
1446// EORI
1447OPCODE(0x0A39)
1448{
1449 u32 adr, res;
1450 u32 src, dst;
1451
1452 FETCH_BYTE(src);
1453 FETCH_LONG(adr);
1454 PRE_IO
1455 READ_BYTE_F(adr, res)
1456 res ^= src;
1457 flag_C = 0;
1458 flag_V = 0;
1459 flag_NotZ = res;
1460 flag_N = res;
1461 WRITE_BYTE_F(adr, res)
1462 POST_IO
1463RET(24)
1464}
1465
1466// EORI
1467OPCODE(0x0A1F)
1468{
1469 u32 adr, res;
1470 u32 src, dst;
1471
1472 FETCH_BYTE(src);
1473 adr = AREG(7);
1474 AREG(7) += 2;
1475 PRE_IO
1476 READ_BYTE_F(adr, res)
1477 res ^= src;
1478 flag_C = 0;
1479 flag_V = 0;
1480 flag_NotZ = res;
1481 flag_N = res;
1482 WRITE_BYTE_F(adr, res)
1483 POST_IO
1484RET(16)
1485}
1486
1487// EORI
1488OPCODE(0x0A27)
1489{
1490 u32 adr, res;
1491 u32 src, dst;
1492
1493 FETCH_BYTE(src);
1494 adr = AREG(7) - 2;
1495 AREG(7) = adr;
1496 PRE_IO
1497 READ_BYTE_F(adr, res)
1498 res ^= src;
1499 flag_C = 0;
1500 flag_V = 0;
1501 flag_NotZ = res;
1502 flag_N = res;
1503 WRITE_BYTE_F(adr, res)
1504 POST_IO
1505RET(18)
1506}
1507
1508// EORI
1509OPCODE(0x0A40)
1510{
1511 u32 adr, res;
1512 u32 src, dst;
1513
1514 FETCH_WORD(src);
1515 res = DREGu16((Opcode >> 0) & 7);
1516 res ^= src;
1517 flag_C = 0;
1518 flag_V = 0;
1519 flag_NotZ = res;
1520 flag_N = res >> 8;
1521 DREGu16((Opcode >> 0) & 7) = res;
1522RET(8)
1523}
1524
1525// EORI
1526OPCODE(0x0A50)
1527{
1528 u32 adr, res;
1529 u32 src, dst;
1530
1531 FETCH_WORD(src);
1532 adr = AREG((Opcode >> 0) & 7);
1533 PRE_IO
1534 READ_WORD_F(adr, res)
1535 res ^= src;
1536 flag_C = 0;
1537 flag_V = 0;
1538 flag_NotZ = res;
1539 flag_N = res >> 8;
1540 WRITE_WORD_F(adr, res)
1541 POST_IO
1542RET(16)
1543}
1544
1545// EORI
1546OPCODE(0x0A58)
1547{
1548 u32 adr, res;
1549 u32 src, dst;
1550
1551 FETCH_WORD(src);
1552 adr = AREG((Opcode >> 0) & 7);
1553 AREG((Opcode >> 0) & 7) += 2;
1554 PRE_IO
1555 READ_WORD_F(adr, res)
1556 res ^= src;
1557 flag_C = 0;
1558 flag_V = 0;
1559 flag_NotZ = res;
1560 flag_N = res >> 8;
1561 WRITE_WORD_F(adr, res)
1562 POST_IO
1563RET(16)
1564}
1565
1566// EORI
1567OPCODE(0x0A60)
1568{
1569 u32 adr, res;
1570 u32 src, dst;
1571
1572 FETCH_WORD(src);
1573 adr = AREG((Opcode >> 0) & 7) - 2;
1574 AREG((Opcode >> 0) & 7) = adr;
1575 PRE_IO
1576 READ_WORD_F(adr, res)
1577 res ^= src;
1578 flag_C = 0;
1579 flag_V = 0;
1580 flag_NotZ = res;
1581 flag_N = res >> 8;
1582 WRITE_WORD_F(adr, res)
1583 POST_IO
1584RET(18)
1585}
1586
1587// EORI
1588OPCODE(0x0A68)
1589{
1590 u32 adr, res;
1591 u32 src, dst;
1592
1593 FETCH_WORD(src);
1594 FETCH_SWORD(adr);
1595 adr += AREG((Opcode >> 0) & 7);
1596 PRE_IO
1597 READ_WORD_F(adr, res)
1598 res ^= src;
1599 flag_C = 0;
1600 flag_V = 0;
1601 flag_NotZ = res;
1602 flag_N = res >> 8;
1603 WRITE_WORD_F(adr, res)
1604 POST_IO
1605RET(20)
1606}
1607
1608// EORI
1609OPCODE(0x0A70)
1610{
1611 u32 adr, res;
1612 u32 src, dst;
1613
1614 FETCH_WORD(src);
1615 adr = AREG((Opcode >> 0) & 7);
1616 DECODE_EXT_WORD
1617 PRE_IO
1618 READ_WORD_F(adr, res)
1619 res ^= src;
1620 flag_C = 0;
1621 flag_V = 0;
1622 flag_NotZ = res;
1623 flag_N = res >> 8;
1624 WRITE_WORD_F(adr, res)
1625 POST_IO
1626RET(22)
1627}
1628
1629// EORI
1630OPCODE(0x0A78)
1631{
1632 u32 adr, res;
1633 u32 src, dst;
1634
1635 FETCH_WORD(src);
1636 FETCH_SWORD(adr);
1637 PRE_IO
1638 READ_WORD_F(adr, res)
1639 res ^= src;
1640 flag_C = 0;
1641 flag_V = 0;
1642 flag_NotZ = res;
1643 flag_N = res >> 8;
1644 WRITE_WORD_F(adr, res)
1645 POST_IO
1646RET(20)
1647}
1648
1649// EORI
1650OPCODE(0x0A79)
1651{
1652 u32 adr, res;
1653 u32 src, dst;
1654
1655 FETCH_WORD(src);
1656 FETCH_LONG(adr);
1657 PRE_IO
1658 READ_WORD_F(adr, res)
1659 res ^= src;
1660 flag_C = 0;
1661 flag_V = 0;
1662 flag_NotZ = res;
1663 flag_N = res >> 8;
1664 WRITE_WORD_F(adr, res)
1665 POST_IO
1666RET(24)
1667}
1668
1669// EORI
1670OPCODE(0x0A5F)
1671{
1672 u32 adr, res;
1673 u32 src, dst;
1674
1675 FETCH_WORD(src);
1676 adr = AREG(7);
1677 AREG(7) += 2;
1678 PRE_IO
1679 READ_WORD_F(adr, res)
1680 res ^= src;
1681 flag_C = 0;
1682 flag_V = 0;
1683 flag_NotZ = res;
1684 flag_N = res >> 8;
1685 WRITE_WORD_F(adr, res)
1686 POST_IO
1687RET(16)
1688}
1689
1690// EORI
1691OPCODE(0x0A67)
1692{
1693 u32 adr, res;
1694 u32 src, dst;
1695
1696 FETCH_WORD(src);
1697 adr = AREG(7) - 2;
1698 AREG(7) = adr;
1699 PRE_IO
1700 READ_WORD_F(adr, res)
1701 res ^= src;
1702 flag_C = 0;
1703 flag_V = 0;
1704 flag_NotZ = res;
1705 flag_N = res >> 8;
1706 WRITE_WORD_F(adr, res)
1707 POST_IO
1708RET(18)
1709}
1710
1711// EORI
1712OPCODE(0x0A80)
1713{
1714 u32 adr, res;
1715 u32 src, dst;
1716
1717 FETCH_LONG(src);
1718 res = DREGu32((Opcode >> 0) & 7);
1719 res ^= src;
1720 flag_C = 0;
1721 flag_V = 0;
1722 flag_NotZ = res;
1723 flag_N = res >> 24;
1724 DREGu32((Opcode >> 0) & 7) = res;
1725RET(16)
1726}
1727
1728// EORI
1729OPCODE(0x0A90)
1730{
1731 u32 adr, res;
1732 u32 src, dst;
1733
1734 FETCH_LONG(src);
1735 adr = AREG((Opcode >> 0) & 7);
1736 PRE_IO
1737 READ_LONG_F(adr, res)
1738 res ^= src;
1739 flag_C = 0;
1740 flag_V = 0;
1741 flag_NotZ = res;
1742 flag_N = res >> 24;
1743 WRITE_LONG_F(adr, res)
1744 POST_IO
1745RET(28)
1746}
1747
1748// EORI
1749OPCODE(0x0A98)
1750{
1751 u32 adr, res;
1752 u32 src, dst;
1753
1754 FETCH_LONG(src);
1755 adr = AREG((Opcode >> 0) & 7);
1756 AREG((Opcode >> 0) & 7) += 4;
1757 PRE_IO
1758 READ_LONG_F(adr, res)
1759 res ^= src;
1760 flag_C = 0;
1761 flag_V = 0;
1762 flag_NotZ = res;
1763 flag_N = res >> 24;
1764 WRITE_LONG_F(adr, res)
1765 POST_IO
1766RET(28)
1767}
1768
1769// EORI
1770OPCODE(0x0AA0)
1771{
1772 u32 adr, res;
1773 u32 src, dst;
1774
1775 FETCH_LONG(src);
1776 adr = AREG((Opcode >> 0) & 7) - 4;
1777 AREG((Opcode >> 0) & 7) = adr;
1778 PRE_IO
1779 READ_LONG_F(adr, res)
1780 res ^= src;
1781 flag_C = 0;
1782 flag_V = 0;
1783 flag_NotZ = res;
1784 flag_N = res >> 24;
1785 WRITE_LONG_F(adr, res)
1786 POST_IO
1787RET(30)
1788}
1789
1790// EORI
1791OPCODE(0x0AA8)
1792{
1793 u32 adr, res;
1794 u32 src, dst;
1795
1796 FETCH_LONG(src);
1797 FETCH_SWORD(adr);
1798 adr += AREG((Opcode >> 0) & 7);
1799 PRE_IO
1800 READ_LONG_F(adr, res)
1801 res ^= src;
1802 flag_C = 0;
1803 flag_V = 0;
1804 flag_NotZ = res;
1805 flag_N = res >> 24;
1806 WRITE_LONG_F(adr, res)
1807 POST_IO
1808RET(32)
1809}
1810
1811// EORI
1812OPCODE(0x0AB0)
1813{
1814 u32 adr, res;
1815 u32 src, dst;
1816
1817 FETCH_LONG(src);
1818 adr = AREG((Opcode >> 0) & 7);
1819 DECODE_EXT_WORD
1820 PRE_IO
1821 READ_LONG_F(adr, res)
1822 res ^= src;
1823 flag_C = 0;
1824 flag_V = 0;
1825 flag_NotZ = res;
1826 flag_N = res >> 24;
1827 WRITE_LONG_F(adr, res)
1828 POST_IO
1829RET(34)
1830}
1831
1832// EORI
1833OPCODE(0x0AB8)
1834{
1835 u32 adr, res;
1836 u32 src, dst;
1837
1838 FETCH_LONG(src);
1839 FETCH_SWORD(adr);
1840 PRE_IO
1841 READ_LONG_F(adr, res)
1842 res ^= src;
1843 flag_C = 0;
1844 flag_V = 0;
1845 flag_NotZ = res;
1846 flag_N = res >> 24;
1847 WRITE_LONG_F(adr, res)
1848 POST_IO
1849RET(32)
1850}
1851
1852// EORI
1853OPCODE(0x0AB9)
1854{
1855 u32 adr, res;
1856 u32 src, dst;
1857
1858 FETCH_LONG(src);
1859 FETCH_LONG(adr);
1860 PRE_IO
1861 READ_LONG_F(adr, res)
1862 res ^= src;
1863 flag_C = 0;
1864 flag_V = 0;
1865 flag_NotZ = res;
1866 flag_N = res >> 24;
1867 WRITE_LONG_F(adr, res)
1868 POST_IO
1869RET(36)
1870}
1871
1872// EORI
1873OPCODE(0x0A9F)
1874{
1875 u32 adr, res;
1876 u32 src, dst;
1877
1878 FETCH_LONG(src);
1879 adr = AREG(7);
1880 AREG(7) += 4;
1881 PRE_IO
1882 READ_LONG_F(adr, res)
1883 res ^= src;
1884 flag_C = 0;
1885 flag_V = 0;
1886 flag_NotZ = res;
1887 flag_N = res >> 24;
1888 WRITE_LONG_F(adr, res)
1889 POST_IO
1890RET(28)
1891}
1892
1893// EORI
1894OPCODE(0x0AA7)
1895{
1896 u32 adr, res;
1897 u32 src, dst;
1898
1899 FETCH_LONG(src);
1900 adr = AREG(7) - 4;
1901 AREG(7) = adr;
1902 PRE_IO
1903 READ_LONG_F(adr, res)
1904 res ^= src;
1905 flag_C = 0;
1906 flag_V = 0;
1907 flag_NotZ = res;
1908 flag_N = res >> 24;
1909 WRITE_LONG_F(adr, res)
1910 POST_IO
1911RET(30)
1912}
1913
1914// EORICCR
1915OPCODE(0x0A3C)
1916{
1917 u32 adr, res;
1918 u32 src, dst;
1919
1920 FETCH_BYTE(res);
1921 res &= M68K_CCR_MASK;
1922 res ^= GET_CCR;
1923 SET_CCR(res)
1924RET(20)
1925}
1926
1927// EORISR
1928OPCODE(0x0A7C)
1929{
1930 u32 adr, res;
1931 u32 src, dst;
1932
1933 if (flag_S)
1934 {
1935 FETCH_WORD(res);
1936 res &= M68K_SR_MASK;
1937 res ^= GET_SR;
1938 SET_SR(res)
1939 if (!flag_S)
1940 {
1941 res = AREG(7);
1942 AREG(7) = ASP;
1943 ASP = res;
1944 }
1945 CHECK_INT_TO_JUMP(20)
1946 }
1947 else
1948 {
d0ae0cb4 1949 SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
03e4f2a3 1950 RET(0)
70357ce5 1951 }
1952RET(20)
1953}
1954
1955// SUBI
1956OPCODE(0x0400)
1957{
1958 u32 adr, res;
1959 u32 src, dst;
1960
1961 FETCH_BYTE(src);
1962 dst = DREGu8((Opcode >> 0) & 7);
1963 res = dst - src;
1964 flag_N = flag_X = flag_C = res;
1965 flag_V = (src ^ dst) & (res ^ dst);
1966 flag_NotZ = res & 0xFF;
1967 DREGu8((Opcode >> 0) & 7) = res;
1968RET(8)
1969}
1970
1971// SUBI
1972OPCODE(0x0410)
1973{
1974 u32 adr, res;
1975 u32 src, dst;
1976
1977 FETCH_BYTE(src);
1978 adr = AREG((Opcode >> 0) & 7);
1979 PRE_IO
1980 READ_BYTE_F(adr, dst)
1981 res = dst - src;
1982 flag_N = flag_X = flag_C = res;
1983 flag_V = (src ^ dst) & (res ^ dst);
1984 flag_NotZ = res & 0xFF;
1985 WRITE_BYTE_F(adr, res)
1986 POST_IO
1987RET(16)
1988}
1989
1990// SUBI
1991OPCODE(0x0418)
1992{
1993 u32 adr, res;
1994 u32 src, dst;
1995
1996 FETCH_BYTE(src);
1997 adr = AREG((Opcode >> 0) & 7);
1998 AREG((Opcode >> 0) & 7) += 1;
1999 PRE_IO
2000 READ_BYTE_F(adr, dst)
2001 res = dst - src;
2002 flag_N = flag_X = flag_C = res;
2003 flag_V = (src ^ dst) & (res ^ dst);
2004 flag_NotZ = res & 0xFF;
2005 WRITE_BYTE_F(adr, res)
2006 POST_IO
2007RET(16)
2008}
2009
2010// SUBI
2011OPCODE(0x0420)
2012{
2013 u32 adr, res;
2014 u32 src, dst;
2015
2016 FETCH_BYTE(src);
2017 adr = AREG((Opcode >> 0) & 7) - 1;
2018 AREG((Opcode >> 0) & 7) = adr;
2019 PRE_IO
2020 READ_BYTE_F(adr, dst)
2021 res = dst - src;
2022 flag_N = flag_X = flag_C = res;
2023 flag_V = (src ^ dst) & (res ^ dst);
2024 flag_NotZ = res & 0xFF;
2025 WRITE_BYTE_F(adr, res)
2026 POST_IO
2027RET(18)
2028}
2029
2030// SUBI
2031OPCODE(0x0428)
2032{
2033 u32 adr, res;
2034 u32 src, dst;
2035
2036 FETCH_BYTE(src);
2037 FETCH_SWORD(adr);
2038 adr += AREG((Opcode >> 0) & 7);
2039 PRE_IO
2040 READ_BYTE_F(adr, dst)
2041 res = dst - src;
2042 flag_N = flag_X = flag_C = res;
2043 flag_V = (src ^ dst) & (res ^ dst);
2044 flag_NotZ = res & 0xFF;
2045 WRITE_BYTE_F(adr, res)
2046 POST_IO
2047RET(20)
2048}
2049
2050// SUBI
2051OPCODE(0x0430)
2052{
2053 u32 adr, res;
2054 u32 src, dst;
2055
2056 FETCH_BYTE(src);
2057 adr = AREG((Opcode >> 0) & 7);
2058 DECODE_EXT_WORD
2059 PRE_IO
2060 READ_BYTE_F(adr, dst)
2061 res = dst - src;
2062 flag_N = flag_X = flag_C = res;
2063 flag_V = (src ^ dst) & (res ^ dst);
2064 flag_NotZ = res & 0xFF;
2065 WRITE_BYTE_F(adr, res)
2066 POST_IO
2067RET(22)
2068}
2069
2070// SUBI
2071OPCODE(0x0438)
2072{
2073 u32 adr, res;
2074 u32 src, dst;
2075
2076 FETCH_BYTE(src);
2077 FETCH_SWORD(adr);
2078 PRE_IO
2079 READ_BYTE_F(adr, dst)
2080 res = dst - src;
2081 flag_N = flag_X = flag_C = res;
2082 flag_V = (src ^ dst) & (res ^ dst);
2083 flag_NotZ = res & 0xFF;
2084 WRITE_BYTE_F(adr, res)
2085 POST_IO
2086RET(20)
2087}
2088
2089// SUBI
2090OPCODE(0x0439)
2091{
2092 u32 adr, res;
2093 u32 src, dst;
2094
2095 FETCH_BYTE(src);
2096 FETCH_LONG(adr);
2097 PRE_IO
2098 READ_BYTE_F(adr, dst)
2099 res = dst - src;
2100 flag_N = flag_X = flag_C = res;
2101 flag_V = (src ^ dst) & (res ^ dst);
2102 flag_NotZ = res & 0xFF;
2103 WRITE_BYTE_F(adr, res)
2104 POST_IO
2105RET(24)
2106}
2107
2108// SUBI
2109OPCODE(0x041F)
2110{
2111 u32 adr, res;
2112 u32 src, dst;
2113
2114 FETCH_BYTE(src);
2115 adr = AREG(7);
2116 AREG(7) += 2;
2117 PRE_IO
2118 READ_BYTE_F(adr, dst)
2119 res = dst - src;
2120 flag_N = flag_X = flag_C = res;
2121 flag_V = (src ^ dst) & (res ^ dst);
2122 flag_NotZ = res & 0xFF;
2123 WRITE_BYTE_F(adr, res)
2124 POST_IO
2125RET(16)
2126}
2127
2128// SUBI
2129OPCODE(0x0427)
2130{
2131 u32 adr, res;
2132 u32 src, dst;
2133
2134 FETCH_BYTE(src);
2135 adr = AREG(7) - 2;
2136 AREG(7) = adr;
2137 PRE_IO
2138 READ_BYTE_F(adr, dst)
2139 res = dst - src;
2140 flag_N = flag_X = flag_C = res;
2141 flag_V = (src ^ dst) & (res ^ dst);
2142 flag_NotZ = res & 0xFF;
2143 WRITE_BYTE_F(adr, res)
2144 POST_IO
2145RET(18)
2146}
2147
2148// SUBI
2149OPCODE(0x0440)
2150{
2151 u32 adr, res;
2152 u32 src, dst;
2153
2154 FETCH_WORD(src);
2155 dst = DREGu16((Opcode >> 0) & 7);
2156 res = dst - src;
2157 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
2158 flag_N = flag_X = flag_C = res >> 8;
2159 flag_NotZ = res & 0xFFFF;
2160 DREGu16((Opcode >> 0) & 7) = res;
2161RET(8)
2162}
2163
2164// SUBI
2165OPCODE(0x0450)
2166{
2167 u32 adr, res;
2168 u32 src, dst;
2169
2170 FETCH_WORD(src);
2171 adr = AREG((Opcode >> 0) & 7);
2172 PRE_IO
2173 READ_WORD_F(adr, dst)
2174 res = dst - src;
2175 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
2176 flag_N = flag_X = flag_C = res >> 8;
2177 flag_NotZ = res & 0xFFFF;
2178 WRITE_WORD_F(adr, res)
2179 POST_IO
2180RET(16)
2181}
2182
2183// SUBI
2184OPCODE(0x0458)
2185{
2186 u32 adr, res;
2187 u32 src, dst;
2188
2189 FETCH_WORD(src);
2190 adr = AREG((Opcode >> 0) & 7);
2191 AREG((Opcode >> 0) & 7) += 2;
2192 PRE_IO
2193 READ_WORD_F(adr, dst)
2194 res = dst - src;
2195 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
2196 flag_N = flag_X = flag_C = res >> 8;
2197 flag_NotZ = res & 0xFFFF;
2198 WRITE_WORD_F(adr, res)
2199 POST_IO
2200RET(16)
2201}
2202
2203// SUBI
2204OPCODE(0x0460)
2205{
2206 u32 adr, res;
2207 u32 src, dst;
2208
2209 FETCH_WORD(src);
2210 adr = AREG((Opcode >> 0) & 7) - 2;
2211 AREG((Opcode >> 0) & 7) = adr;
2212 PRE_IO
2213 READ_WORD_F(adr, dst)
2214 res = dst - src;
2215 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
2216 flag_N = flag_X = flag_C = res >> 8;
2217 flag_NotZ = res & 0xFFFF;
2218 WRITE_WORD_F(adr, res)
2219 POST_IO
2220RET(18)
2221}
2222
2223// SUBI
2224OPCODE(0x0468)
2225{
2226 u32 adr, res;
2227 u32 src, dst;
2228
2229 FETCH_WORD(src);
2230 FETCH_SWORD(adr);
2231 adr += AREG((Opcode >> 0) & 7);
2232 PRE_IO
2233 READ_WORD_F(adr, dst)
2234 res = dst - src;
2235 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
2236 flag_N = flag_X = flag_C = res >> 8;
2237 flag_NotZ = res & 0xFFFF;
2238 WRITE_WORD_F(adr, res)
2239 POST_IO
2240RET(20)
2241}
2242
2243// SUBI
2244OPCODE(0x0470)
2245{
2246 u32 adr, res;
2247 u32 src, dst;
2248
2249 FETCH_WORD(src);
2250 adr = AREG((Opcode >> 0) & 7);
2251 DECODE_EXT_WORD
2252 PRE_IO
2253 READ_WORD_F(adr, dst)
2254 res = dst - src;
2255 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
2256 flag_N = flag_X = flag_C = res >> 8;
2257 flag_NotZ = res & 0xFFFF;
2258 WRITE_WORD_F(adr, res)
2259 POST_IO
2260RET(22)
2261}
2262
2263// SUBI
2264OPCODE(0x0478)
2265{
2266 u32 adr, res;
2267 u32 src, dst;
2268
2269 FETCH_WORD(src);
2270 FETCH_SWORD(adr);
2271 PRE_IO
2272 READ_WORD_F(adr, dst)
2273 res = dst - src;
2274 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
2275 flag_N = flag_X = flag_C = res >> 8;
2276 flag_NotZ = res & 0xFFFF;
2277 WRITE_WORD_F(adr, res)
2278 POST_IO
2279RET(20)
2280}
2281
2282// SUBI
2283OPCODE(0x0479)
2284{
2285 u32 adr, res;
2286 u32 src, dst;
2287
2288 FETCH_WORD(src);
2289 FETCH_LONG(adr);
2290 PRE_IO
2291 READ_WORD_F(adr, dst)
2292 res = dst - src;
2293 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
2294 flag_N = flag_X = flag_C = res >> 8;
2295 flag_NotZ = res & 0xFFFF;
2296 WRITE_WORD_F(adr, res)
2297 POST_IO
2298RET(24)
2299}
2300
2301// SUBI
2302OPCODE(0x045F)
2303{
2304 u32 adr, res;
2305 u32 src, dst;
2306
2307 FETCH_WORD(src);
2308 adr = AREG(7);
2309 AREG(7) += 2;
2310 PRE_IO
2311 READ_WORD_F(adr, dst)
2312 res = dst - src;
2313 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
2314 flag_N = flag_X = flag_C = res >> 8;
2315 flag_NotZ = res & 0xFFFF;
2316 WRITE_WORD_F(adr, res)
2317 POST_IO
2318RET(16)
2319}
2320
2321// SUBI
2322OPCODE(0x0467)
2323{
2324 u32 adr, res;
2325 u32 src, dst;
2326
2327 FETCH_WORD(src);
2328 adr = AREG(7) - 2;
2329 AREG(7) = adr;
2330 PRE_IO
2331 READ_WORD_F(adr, dst)
2332 res = dst - src;
2333 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
2334 flag_N = flag_X = flag_C = res >> 8;
2335 flag_NotZ = res & 0xFFFF;
2336 WRITE_WORD_F(adr, res)
2337 POST_IO
2338RET(18)
2339}
2340
2341// SUBI
2342OPCODE(0x0480)
2343{
2344 u32 adr, res;
2345 u32 src, dst;
2346
2347 FETCH_LONG(src);
2348 dst = DREGu32((Opcode >> 0) & 7);
2349 res = dst - src;
2350 flag_NotZ = res;
2351 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
2352 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
2353 flag_N = res >> 24;
2354 DREGu32((Opcode >> 0) & 7) = res;
2355RET(16)
2356}
2357
2358// SUBI
2359OPCODE(0x0490)
2360{
2361 u32 adr, res;
2362 u32 src, dst;
2363
2364 FETCH_LONG(src);
2365 adr = AREG((Opcode >> 0) & 7);
2366 PRE_IO
2367 READ_LONG_F(adr, dst)
2368 res = dst - src;
2369 flag_NotZ = res;
2370 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
2371 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
2372 flag_N = res >> 24;
2373 WRITE_LONG_F(adr, res)
2374 POST_IO
2375RET(28)
2376}
2377
2378// SUBI
2379OPCODE(0x0498)
2380{
2381 u32 adr, res;
2382 u32 src, dst;
2383
2384 FETCH_LONG(src);
2385 adr = AREG((Opcode >> 0) & 7);
2386 AREG((Opcode >> 0) & 7) += 4;
2387 PRE_IO
2388 READ_LONG_F(adr, dst)
2389 res = dst - src;
2390 flag_NotZ = res;
2391 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
2392 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
2393 flag_N = res >> 24;
2394 WRITE_LONG_F(adr, res)
2395 POST_IO
2396RET(28)
2397}
2398
2399// SUBI
2400OPCODE(0x04A0)
2401{
2402 u32 adr, res;
2403 u32 src, dst;
2404
2405 FETCH_LONG(src);
2406 adr = AREG((Opcode >> 0) & 7) - 4;
2407 AREG((Opcode >> 0) & 7) = adr;
2408 PRE_IO
2409 READ_LONG_F(adr, dst)
2410 res = dst - src;
2411 flag_NotZ = res;
2412 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
2413 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
2414 flag_N = res >> 24;
2415 WRITE_LONG_F(adr, res)
2416 POST_IO
2417RET(30)
2418}
2419
2420// SUBI
2421OPCODE(0x04A8)
2422{
2423 u32 adr, res;
2424 u32 src, dst;
2425
2426 FETCH_LONG(src);
2427 FETCH_SWORD(adr);
2428 adr += AREG((Opcode >> 0) & 7);
2429 PRE_IO
2430 READ_LONG_F(adr, dst)
2431 res = dst - src;
2432 flag_NotZ = res;
2433 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
2434 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
2435 flag_N = res >> 24;
2436 WRITE_LONG_F(adr, res)
2437 POST_IO
2438RET(32)
2439}
2440
2441// SUBI
2442OPCODE(0x04B0)
2443{
2444 u32 adr, res;
2445 u32 src, dst;
2446
2447 FETCH_LONG(src);
2448 adr = AREG((Opcode >> 0) & 7);
2449 DECODE_EXT_WORD
2450 PRE_IO
2451 READ_LONG_F(adr, dst)
2452 res = dst - src;
2453 flag_NotZ = res;
2454 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
2455 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
2456 flag_N = res >> 24;
2457 WRITE_LONG_F(adr, res)
2458 POST_IO
2459RET(34)
2460}
2461
2462// SUBI
2463OPCODE(0x04B8)
2464{
2465 u32 adr, res;
2466 u32 src, dst;
2467
2468 FETCH_LONG(src);
2469 FETCH_SWORD(adr);
2470 PRE_IO
2471 READ_LONG_F(adr, dst)
2472 res = dst - src;
2473 flag_NotZ = res;
2474 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
2475 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
2476 flag_N = res >> 24;
2477 WRITE_LONG_F(adr, res)
2478 POST_IO
2479RET(32)
2480}
2481
2482// SUBI
2483OPCODE(0x04B9)
2484{
2485 u32 adr, res;
2486 u32 src, dst;
2487
2488 FETCH_LONG(src);
2489 FETCH_LONG(adr);
2490 PRE_IO
2491 READ_LONG_F(adr, dst)
2492 res = dst - src;
2493 flag_NotZ = res;
2494 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
2495 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
2496 flag_N = res >> 24;
2497 WRITE_LONG_F(adr, res)
2498 POST_IO
2499RET(36)
2500}
2501
2502// SUBI
2503OPCODE(0x049F)
2504{
2505 u32 adr, res;
2506 u32 src, dst;
2507
2508 FETCH_LONG(src);
2509 adr = AREG(7);
2510 AREG(7) += 4;
2511 PRE_IO
2512 READ_LONG_F(adr, dst)
2513 res = dst - src;
2514 flag_NotZ = res;
2515 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
2516 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
2517 flag_N = res >> 24;
2518 WRITE_LONG_F(adr, res)
2519 POST_IO
2520RET(28)
2521}
2522
2523// SUBI
2524OPCODE(0x04A7)
2525{
2526 u32 adr, res;
2527 u32 src, dst;
2528
2529 FETCH_LONG(src);
2530 adr = AREG(7) - 4;
2531 AREG(7) = adr;
2532 PRE_IO
2533 READ_LONG_F(adr, dst)
2534 res = dst - src;
2535 flag_NotZ = res;
2536 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
2537 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
2538 flag_N = res >> 24;
2539 WRITE_LONG_F(adr, res)
2540 POST_IO
2541RET(30)
2542}
2543
2544// ADDI
2545OPCODE(0x0600)
2546{
2547 u32 adr, res;
2548 u32 src, dst;
2549
2550 FETCH_BYTE(src);
2551 dst = DREGu8((Opcode >> 0) & 7);
2552 res = dst + src;
2553 flag_N = flag_X = flag_C = res;
2554 flag_V = (src ^ res) & (dst ^ res);
2555 flag_NotZ = res & 0xFF;
2556 DREGu8((Opcode >> 0) & 7) = res;
2557RET(8)
2558}
2559
2560// ADDI
2561OPCODE(0x0610)
2562{
2563 u32 adr, res;
2564 u32 src, dst;
2565
2566 FETCH_BYTE(src);
2567 adr = AREG((Opcode >> 0) & 7);
2568 PRE_IO
2569 READ_BYTE_F(adr, dst)
2570 res = dst + src;
2571 flag_N = flag_X = flag_C = res;
2572 flag_V = (src ^ res) & (dst ^ res);
2573 flag_NotZ = res & 0xFF;
2574 WRITE_BYTE_F(adr, res)
2575 POST_IO
2576RET(16)
2577}
2578
2579// ADDI
2580OPCODE(0x0618)
2581{
2582 u32 adr, res;
2583 u32 src, dst;
2584
2585 FETCH_BYTE(src);
2586 adr = AREG((Opcode >> 0) & 7);
2587 AREG((Opcode >> 0) & 7) += 1;
2588 PRE_IO
2589 READ_BYTE_F(adr, dst)
2590 res = dst + src;
2591 flag_N = flag_X = flag_C = res;
2592 flag_V = (src ^ res) & (dst ^ res);
2593 flag_NotZ = res & 0xFF;
2594 WRITE_BYTE_F(adr, res)
2595 POST_IO
2596RET(16)
2597}
2598
2599// ADDI
2600OPCODE(0x0620)
2601{
2602 u32 adr, res;
2603 u32 src, dst;
2604
2605 FETCH_BYTE(src);
2606 adr = AREG((Opcode >> 0) & 7) - 1;
2607 AREG((Opcode >> 0) & 7) = adr;
2608 PRE_IO
2609 READ_BYTE_F(adr, dst)
2610 res = dst + src;
2611 flag_N = flag_X = flag_C = res;
2612 flag_V = (src ^ res) & (dst ^ res);
2613 flag_NotZ = res & 0xFF;
2614 WRITE_BYTE_F(adr, res)
2615 POST_IO
2616RET(18)
2617}
2618
2619// ADDI
2620OPCODE(0x0628)
2621{
2622 u32 adr, res;
2623 u32 src, dst;
2624
2625 FETCH_BYTE(src);
2626 FETCH_SWORD(adr);
2627 adr += AREG((Opcode >> 0) & 7);
2628 PRE_IO
2629 READ_BYTE_F(adr, dst)
2630 res = dst + src;
2631 flag_N = flag_X = flag_C = res;
2632 flag_V = (src ^ res) & (dst ^ res);
2633 flag_NotZ = res & 0xFF;
2634 WRITE_BYTE_F(adr, res)
2635 POST_IO
2636RET(20)
2637}
2638
2639// ADDI
2640OPCODE(0x0630)
2641{
2642 u32 adr, res;
2643 u32 src, dst;
2644
2645 FETCH_BYTE(src);
2646 adr = AREG((Opcode >> 0) & 7);
2647 DECODE_EXT_WORD
2648 PRE_IO
2649 READ_BYTE_F(adr, dst)
2650 res = dst + src;
2651 flag_N = flag_X = flag_C = res;
2652 flag_V = (src ^ res) & (dst ^ res);
2653 flag_NotZ = res & 0xFF;
2654 WRITE_BYTE_F(adr, res)
2655 POST_IO
2656RET(22)
2657}
2658
2659// ADDI
2660OPCODE(0x0638)
2661{
2662 u32 adr, res;
2663 u32 src, dst;
2664
2665 FETCH_BYTE(src);
2666 FETCH_SWORD(adr);
2667 PRE_IO
2668 READ_BYTE_F(adr, dst)
2669 res = dst + src;
2670 flag_N = flag_X = flag_C = res;
2671 flag_V = (src ^ res) & (dst ^ res);
2672 flag_NotZ = res & 0xFF;
2673 WRITE_BYTE_F(adr, res)
2674 POST_IO
2675RET(20)
2676}
2677
2678// ADDI
2679OPCODE(0x0639)
2680{
2681 u32 adr, res;
2682 u32 src, dst;
2683
2684 FETCH_BYTE(src);
2685 FETCH_LONG(adr);
2686 PRE_IO
2687 READ_BYTE_F(adr, dst)
2688 res = dst + src;
2689 flag_N = flag_X = flag_C = res;
2690 flag_V = (src ^ res) & (dst ^ res);
2691 flag_NotZ = res & 0xFF;
2692 WRITE_BYTE_F(adr, res)
2693 POST_IO
2694RET(24)
2695}
2696
2697// ADDI
2698OPCODE(0x061F)
2699{
2700 u32 adr, res;
2701 u32 src, dst;
2702
2703 FETCH_BYTE(src);
2704 adr = AREG(7);
2705 AREG(7) += 2;
2706 PRE_IO
2707 READ_BYTE_F(adr, dst)
2708 res = dst + src;
2709 flag_N = flag_X = flag_C = res;
2710 flag_V = (src ^ res) & (dst ^ res);
2711 flag_NotZ = res & 0xFF;
2712 WRITE_BYTE_F(adr, res)
2713 POST_IO
2714RET(16)
2715}
2716
2717// ADDI
2718OPCODE(0x0627)
2719{
2720 u32 adr, res;
2721 u32 src, dst;
2722
2723 FETCH_BYTE(src);
2724 adr = AREG(7) - 2;
2725 AREG(7) = adr;
2726 PRE_IO
2727 READ_BYTE_F(adr, dst)
2728 res = dst + src;
2729 flag_N = flag_X = flag_C = res;
2730 flag_V = (src ^ res) & (dst ^ res);
2731 flag_NotZ = res & 0xFF;
2732 WRITE_BYTE_F(adr, res)
2733 POST_IO
2734RET(18)
2735}
2736
2737// ADDI
2738OPCODE(0x0640)
2739{
2740 u32 adr, res;
2741 u32 src, dst;
2742
2743 FETCH_WORD(src);
2744 dst = DREGu16((Opcode >> 0) & 7);
2745 res = dst + src;
2746 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
2747 flag_N = flag_X = flag_C = res >> 8;
2748 flag_NotZ = res & 0xFFFF;
2749 DREGu16((Opcode >> 0) & 7) = res;
2750RET(8)
2751}
2752
2753// ADDI
2754OPCODE(0x0650)
2755{
2756 u32 adr, res;
2757 u32 src, dst;
2758
2759 FETCH_WORD(src);
2760 adr = AREG((Opcode >> 0) & 7);
2761 PRE_IO
2762 READ_WORD_F(adr, dst)
2763 res = dst + src;
2764 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
2765 flag_N = flag_X = flag_C = res >> 8;
2766 flag_NotZ = res & 0xFFFF;
2767 WRITE_WORD_F(adr, res)
2768 POST_IO
2769RET(16)
2770}
2771
2772// ADDI
2773OPCODE(0x0658)
2774{
2775 u32 adr, res;
2776 u32 src, dst;
2777
2778 FETCH_WORD(src);
2779 adr = AREG((Opcode >> 0) & 7);
2780 AREG((Opcode >> 0) & 7) += 2;
2781 PRE_IO
2782 READ_WORD_F(adr, dst)
2783 res = dst + src;
2784 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
2785 flag_N = flag_X = flag_C = res >> 8;
2786 flag_NotZ = res & 0xFFFF;
2787 WRITE_WORD_F(adr, res)
2788 POST_IO
2789RET(16)
2790}
2791
2792// ADDI
2793OPCODE(0x0660)
2794{
2795 u32 adr, res;
2796 u32 src, dst;
2797
2798 FETCH_WORD(src);
2799 adr = AREG((Opcode >> 0) & 7) - 2;
2800 AREG((Opcode >> 0) & 7) = adr;
2801 PRE_IO
2802 READ_WORD_F(adr, dst)
2803 res = dst + src;
2804 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
2805 flag_N = flag_X = flag_C = res >> 8;
2806 flag_NotZ = res & 0xFFFF;
2807 WRITE_WORD_F(adr, res)
2808 POST_IO
2809RET(18)
2810}
2811
2812// ADDI
2813OPCODE(0x0668)
2814{
2815 u32 adr, res;
2816 u32 src, dst;
2817
2818 FETCH_WORD(src);
2819 FETCH_SWORD(adr);
2820 adr += AREG((Opcode >> 0) & 7);
2821 PRE_IO
2822 READ_WORD_F(adr, dst)
2823 res = dst + src;
2824 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
2825 flag_N = flag_X = flag_C = res >> 8;
2826 flag_NotZ = res & 0xFFFF;
2827 WRITE_WORD_F(adr, res)
2828 POST_IO
2829RET(20)
2830}
2831
2832// ADDI
2833OPCODE(0x0670)
2834{
2835 u32 adr, res;
2836 u32 src, dst;
2837
2838 FETCH_WORD(src);
2839 adr = AREG((Opcode >> 0) & 7);
2840 DECODE_EXT_WORD
2841 PRE_IO
2842 READ_WORD_F(adr, dst)
2843 res = dst + src;
2844 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
2845 flag_N = flag_X = flag_C = res >> 8;
2846 flag_NotZ = res & 0xFFFF;
2847 WRITE_WORD_F(adr, res)
2848 POST_IO
2849RET(22)
2850}
2851
2852// ADDI
2853OPCODE(0x0678)
2854{
2855 u32 adr, res;
2856 u32 src, dst;
2857
2858 FETCH_WORD(src);
2859 FETCH_SWORD(adr);
2860 PRE_IO
2861 READ_WORD_F(adr, dst)
2862 res = dst + src;
2863 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
2864 flag_N = flag_X = flag_C = res >> 8;
2865 flag_NotZ = res & 0xFFFF;
2866 WRITE_WORD_F(adr, res)
2867 POST_IO
2868RET(20)
2869}
2870
2871// ADDI
2872OPCODE(0x0679)
2873{
2874 u32 adr, res;
2875 u32 src, dst;
2876
2877 FETCH_WORD(src);
2878 FETCH_LONG(adr);
2879 PRE_IO
2880 READ_WORD_F(adr, dst)
2881 res = dst + src;
2882 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
2883 flag_N = flag_X = flag_C = res >> 8;
2884 flag_NotZ = res & 0xFFFF;
2885 WRITE_WORD_F(adr, res)
2886 POST_IO
2887RET(24)
2888}
2889
2890// ADDI
2891OPCODE(0x065F)
2892{
2893 u32 adr, res;
2894 u32 src, dst;
2895
2896 FETCH_WORD(src);
2897 adr = AREG(7);
2898 AREG(7) += 2;
2899 PRE_IO
2900 READ_WORD_F(adr, dst)
2901 res = dst + src;
2902 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
2903 flag_N = flag_X = flag_C = res >> 8;
2904 flag_NotZ = res & 0xFFFF;
2905 WRITE_WORD_F(adr, res)
2906 POST_IO
2907RET(16)
2908}
2909
2910// ADDI
2911OPCODE(0x0667)
2912{
2913 u32 adr, res;
2914 u32 src, dst;
2915
2916 FETCH_WORD(src);
2917 adr = AREG(7) - 2;
2918 AREG(7) = adr;
2919 PRE_IO
2920 READ_WORD_F(adr, dst)
2921 res = dst + src;
2922 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
2923 flag_N = flag_X = flag_C = res >> 8;
2924 flag_NotZ = res & 0xFFFF;
2925 WRITE_WORD_F(adr, res)
2926 POST_IO
2927RET(18)
2928}
2929
2930// ADDI
2931OPCODE(0x0680)
2932{
2933 u32 adr, res;
2934 u32 src, dst;
2935
2936 FETCH_LONG(src);
2937 dst = DREGu32((Opcode >> 0) & 7);
2938 res = dst + src;
2939 flag_NotZ = res;
2940 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
2941 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
2942 flag_N = res >> 24;
2943 DREGu32((Opcode >> 0) & 7) = res;
2944RET(16)
2945}
2946
2947// ADDI
2948OPCODE(0x0690)
2949{
2950 u32 adr, res;
2951 u32 src, dst;
2952
2953 FETCH_LONG(src);
2954 adr = AREG((Opcode >> 0) & 7);
2955 PRE_IO
2956 READ_LONG_F(adr, dst)
2957 res = dst + src;
2958 flag_NotZ = res;
2959 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
2960 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
2961 flag_N = res >> 24;
2962 WRITE_LONG_F(adr, res)
2963 POST_IO
2964RET(28)
2965}
2966
2967// ADDI
2968OPCODE(0x0698)
2969{
2970 u32 adr, res;
2971 u32 src, dst;
2972
2973 FETCH_LONG(src);
2974 adr = AREG((Opcode >> 0) & 7);
2975 AREG((Opcode >> 0) & 7) += 4;
2976 PRE_IO
2977 READ_LONG_F(adr, dst)
2978 res = dst + src;
2979 flag_NotZ = res;
2980 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
2981 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
2982 flag_N = res >> 24;
2983 WRITE_LONG_F(adr, res)
2984 POST_IO
2985RET(28)
2986}
2987
2988// ADDI
2989OPCODE(0x06A0)
2990{
2991 u32 adr, res;
2992 u32 src, dst;
2993
2994 FETCH_LONG(src);
2995 adr = AREG((Opcode >> 0) & 7) - 4;
2996 AREG((Opcode >> 0) & 7) = adr;
2997 PRE_IO
2998 READ_LONG_F(adr, dst)
2999 res = dst + src;
3000 flag_NotZ = res;
3001 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
3002 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
3003 flag_N = res >> 24;
3004 WRITE_LONG_F(adr, res)
3005 POST_IO
3006RET(30)
3007}
3008
3009// ADDI
3010OPCODE(0x06A8)
3011{
3012 u32 adr, res;
3013 u32 src, dst;
3014
3015 FETCH_LONG(src);
3016 FETCH_SWORD(adr);
3017 adr += AREG((Opcode >> 0) & 7);
3018 PRE_IO
3019 READ_LONG_F(adr, dst)
3020 res = dst + src;
3021 flag_NotZ = res;
3022 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
3023 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
3024 flag_N = res >> 24;
3025 WRITE_LONG_F(adr, res)
3026 POST_IO
3027RET(32)
3028}
3029
3030// ADDI
3031OPCODE(0x06B0)
3032{
3033 u32 adr, res;
3034 u32 src, dst;
3035
3036 FETCH_LONG(src);
3037 adr = AREG((Opcode >> 0) & 7);
3038 DECODE_EXT_WORD
3039 PRE_IO
3040 READ_LONG_F(adr, dst)
3041 res = dst + src;
3042 flag_NotZ = res;
3043 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
3044 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
3045 flag_N = res >> 24;
3046 WRITE_LONG_F(adr, res)
3047 POST_IO
3048RET(34)
3049}
3050
3051// ADDI
3052OPCODE(0x06B8)
3053{
3054 u32 adr, res;
3055 u32 src, dst;
3056
3057 FETCH_LONG(src);
3058 FETCH_SWORD(adr);
3059 PRE_IO
3060 READ_LONG_F(adr, dst)
3061 res = dst + src;
3062 flag_NotZ = res;
3063 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
3064 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
3065 flag_N = res >> 24;
3066 WRITE_LONG_F(adr, res)
3067 POST_IO
3068RET(32)
3069}
3070
3071// ADDI
3072OPCODE(0x06B9)
3073{
3074 u32 adr, res;
3075 u32 src, dst;
3076
3077 FETCH_LONG(src);
3078 FETCH_LONG(adr);
3079 PRE_IO
3080 READ_LONG_F(adr, dst)
3081 res = dst + src;
3082 flag_NotZ = res;
3083 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
3084 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
3085 flag_N = res >> 24;
3086 WRITE_LONG_F(adr, res)
3087 POST_IO
3088RET(36)
3089}
3090
3091// ADDI
3092OPCODE(0x069F)
3093{
3094 u32 adr, res;
3095 u32 src, dst;
3096
3097 FETCH_LONG(src);
3098 adr = AREG(7);
3099 AREG(7) += 4;
3100 PRE_IO
3101 READ_LONG_F(adr, dst)
3102 res = dst + src;
3103 flag_NotZ = res;
3104 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
3105 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
3106 flag_N = res >> 24;
3107 WRITE_LONG_F(adr, res)
3108 POST_IO
3109RET(28)
3110}
3111
3112// ADDI
3113OPCODE(0x06A7)
3114{
3115 u32 adr, res;
3116 u32 src, dst;
3117
3118 FETCH_LONG(src);
3119 adr = AREG(7) - 4;
3120 AREG(7) = adr;
3121 PRE_IO
3122 READ_LONG_F(adr, dst)
3123 res = dst + src;
3124 flag_NotZ = res;
3125 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
3126 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
3127 flag_N = res >> 24;
3128 WRITE_LONG_F(adr, res)
3129 POST_IO
3130RET(30)
3131}
3132
3133// CMPI
3134OPCODE(0x0C00)
3135{
3136 u32 adr, res;
3137 u32 src, dst;
3138
3139 FETCH_BYTE(src);
3140 dst = DREGu8((Opcode >> 0) & 7);
3141 res = dst - src;
3142 flag_N = flag_C = res;
3143 flag_V = (src ^ dst) & (res ^ dst);
3144 flag_NotZ = res & 0xFF;
3145RET(8)
3146}
3147
3148// CMPI
3149OPCODE(0x0C10)
3150{
3151 u32 adr, res;
3152 u32 src, dst;
3153
3154 FETCH_BYTE(src);
3155 adr = AREG((Opcode >> 0) & 7);
3156 PRE_IO
3157 READ_BYTE_F(adr, dst)
3158 res = dst - src;
3159 flag_N = flag_C = res;
3160 flag_V = (src ^ dst) & (res ^ dst);
3161 flag_NotZ = res & 0xFF;
3162 POST_IO
3163RET(12)
3164}
3165
3166// CMPI
3167OPCODE(0x0C18)
3168{
3169 u32 adr, res;
3170 u32 src, dst;
3171
3172 FETCH_BYTE(src);
3173 adr = AREG((Opcode >> 0) & 7);
3174 AREG((Opcode >> 0) & 7) += 1;
3175 PRE_IO
3176 READ_BYTE_F(adr, dst)
3177 res = dst - src;
3178 flag_N = flag_C = res;
3179 flag_V = (src ^ dst) & (res ^ dst);
3180 flag_NotZ = res & 0xFF;
3181 POST_IO
3182RET(12)
3183}
3184
3185// CMPI
3186OPCODE(0x0C20)
3187{
3188 u32 adr, res;
3189 u32 src, dst;
3190
3191 FETCH_BYTE(src);
3192 adr = AREG((Opcode >> 0) & 7) - 1;
3193 AREG((Opcode >> 0) & 7) = adr;
3194 PRE_IO
3195 READ_BYTE_F(adr, dst)
3196 res = dst - src;
3197 flag_N = flag_C = res;
3198 flag_V = (src ^ dst) & (res ^ dst);
3199 flag_NotZ = res & 0xFF;
3200 POST_IO
3201RET(14)
3202}
3203
3204// CMPI
3205OPCODE(0x0C28)
3206{
3207 u32 adr, res;
3208 u32 src, dst;
3209
3210 FETCH_BYTE(src);
3211 FETCH_SWORD(adr);
3212 adr += AREG((Opcode >> 0) & 7);
3213 PRE_IO
3214 READ_BYTE_F(adr, dst)
3215 res = dst - src;
3216 flag_N = flag_C = res;
3217 flag_V = (src ^ dst) & (res ^ dst);
3218 flag_NotZ = res & 0xFF;
3219 POST_IO
3220RET(16)
3221}
3222
3223// CMPI
3224OPCODE(0x0C30)
3225{
3226 u32 adr, res;
3227 u32 src, dst;
3228
3229 FETCH_BYTE(src);
3230 adr = AREG((Opcode >> 0) & 7);
3231 DECODE_EXT_WORD
3232 PRE_IO
3233 READ_BYTE_F(adr, dst)
3234 res = dst - src;
3235 flag_N = flag_C = res;
3236 flag_V = (src ^ dst) & (res ^ dst);
3237 flag_NotZ = res & 0xFF;
3238 POST_IO
3239RET(18)
3240}
3241
3242// CMPI
3243OPCODE(0x0C38)
3244{
3245 u32 adr, res;
3246 u32 src, dst;
3247
3248 FETCH_BYTE(src);
3249 FETCH_SWORD(adr);
3250 PRE_IO
3251 READ_BYTE_F(adr, dst)
3252 res = dst - src;
3253 flag_N = flag_C = res;
3254 flag_V = (src ^ dst) & (res ^ dst);
3255 flag_NotZ = res & 0xFF;
3256 POST_IO
3257RET(16)
3258}
3259
3260// CMPI
3261OPCODE(0x0C39)
3262{
3263 u32 adr, res;
3264 u32 src, dst;
3265
3266 FETCH_BYTE(src);
3267 FETCH_LONG(adr);
3268 PRE_IO
3269 READ_BYTE_F(adr, dst)
3270 res = dst - src;
3271 flag_N = flag_C = res;
3272 flag_V = (src ^ dst) & (res ^ dst);
3273 flag_NotZ = res & 0xFF;
3274 POST_IO
3275RET(20)
3276}
3277
3278// CMPI
3279OPCODE(0x0C1F)
3280{
3281 u32 adr, res;
3282 u32 src, dst;
3283
3284 FETCH_BYTE(src);
3285 adr = AREG(7);
3286 AREG(7) += 2;
3287 PRE_IO
3288 READ_BYTE_F(adr, dst)
3289 res = dst - src;
3290 flag_N = flag_C = res;
3291 flag_V = (src ^ dst) & (res ^ dst);
3292 flag_NotZ = res & 0xFF;
3293 POST_IO
3294RET(12)
3295}
3296
3297// CMPI
3298OPCODE(0x0C27)
3299{
3300 u32 adr, res;
3301 u32 src, dst;
3302
3303 FETCH_BYTE(src);
3304 adr = AREG(7) - 2;
3305 AREG(7) = adr;
3306 PRE_IO
3307 READ_BYTE_F(adr, dst)
3308 res = dst - src;
3309 flag_N = flag_C = res;
3310 flag_V = (src ^ dst) & (res ^ dst);
3311 flag_NotZ = res & 0xFF;
3312 POST_IO
3313RET(14)
3314}
3315
3316// CMPI
3317OPCODE(0x0C40)
3318{
3319 u32 adr, res;
3320 u32 src, dst;
3321
3322 FETCH_WORD(src);
3323 dst = DREGu16((Opcode >> 0) & 7);
3324 res = dst - src;
3325 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
3326 flag_N = flag_C = res >> 8;
3327 flag_NotZ = res & 0xFFFF;
3328RET(8)
3329}
3330
3331// CMPI
3332OPCODE(0x0C50)
3333{
3334 u32 adr, res;
3335 u32 src, dst;
3336
3337 FETCH_WORD(src);
3338 adr = AREG((Opcode >> 0) & 7);
3339 PRE_IO
3340 READ_WORD_F(adr, dst)
3341 res = dst - src;
3342 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
3343 flag_N = flag_C = res >> 8;
3344 flag_NotZ = res & 0xFFFF;
3345 POST_IO
3346RET(12)
3347}
3348
3349// CMPI
3350OPCODE(0x0C58)
3351{
3352 u32 adr, res;
3353 u32 src, dst;
3354
3355 FETCH_WORD(src);
3356 adr = AREG((Opcode >> 0) & 7);
3357 AREG((Opcode >> 0) & 7) += 2;
3358 PRE_IO
3359 READ_WORD_F(adr, dst)
3360 res = dst - src;
3361 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
3362 flag_N = flag_C = res >> 8;
3363 flag_NotZ = res & 0xFFFF;
3364 POST_IO
3365RET(12)
3366}
3367
3368// CMPI
3369OPCODE(0x0C60)
3370{
3371 u32 adr, res;
3372 u32 src, dst;
3373
3374 FETCH_WORD(src);
3375 adr = AREG((Opcode >> 0) & 7) - 2;
3376 AREG((Opcode >> 0) & 7) = adr;
3377 PRE_IO
3378 READ_WORD_F(adr, dst)
3379 res = dst - src;
3380 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
3381 flag_N = flag_C = res >> 8;
3382 flag_NotZ = res & 0xFFFF;
3383 POST_IO
3384RET(14)
3385}
3386
3387// CMPI
3388OPCODE(0x0C68)
3389{
3390 u32 adr, res;
3391 u32 src, dst;
3392
3393 FETCH_WORD(src);
3394 FETCH_SWORD(adr);
3395 adr += AREG((Opcode >> 0) & 7);
3396 PRE_IO
3397 READ_WORD_F(adr, dst)
3398 res = dst - src;
3399 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
3400 flag_N = flag_C = res >> 8;
3401 flag_NotZ = res & 0xFFFF;
3402 POST_IO
3403RET(16)
3404}
3405
3406// CMPI
3407OPCODE(0x0C70)
3408{
3409 u32 adr, res;
3410 u32 src, dst;
3411
3412 FETCH_WORD(src);
3413 adr = AREG((Opcode >> 0) & 7);
3414 DECODE_EXT_WORD
3415 PRE_IO
3416 READ_WORD_F(adr, dst)
3417 res = dst - src;
3418 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
3419 flag_N = flag_C = res >> 8;
3420 flag_NotZ = res & 0xFFFF;
3421 POST_IO
3422RET(18)
3423}
3424
3425// CMPI
3426OPCODE(0x0C78)
3427{
3428 u32 adr, res;
3429 u32 src, dst;
3430
3431 FETCH_WORD(src);
3432 FETCH_SWORD(adr);
3433 PRE_IO
3434 READ_WORD_F(adr, dst)
3435 res = dst - src;
3436 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
3437 flag_N = flag_C = res >> 8;
3438 flag_NotZ = res & 0xFFFF;
3439 POST_IO
3440RET(16)
3441}
3442
3443// CMPI
3444OPCODE(0x0C79)
3445{
3446 u32 adr, res;
3447 u32 src, dst;
3448
3449 FETCH_WORD(src);
3450 FETCH_LONG(adr);
3451 PRE_IO
3452 READ_WORD_F(adr, dst)
3453 res = dst - src;
3454 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
3455 flag_N = flag_C = res >> 8;
3456 flag_NotZ = res & 0xFFFF;
3457 POST_IO
3458RET(20)
3459}
3460
3461// CMPI
3462OPCODE(0x0C5F)
3463{
3464 u32 adr, res;
3465 u32 src, dst;
3466
3467 FETCH_WORD(src);
3468 adr = AREG(7);
3469 AREG(7) += 2;
3470 PRE_IO
3471 READ_WORD_F(adr, dst)
3472 res = dst - src;
3473 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
3474 flag_N = flag_C = res >> 8;
3475 flag_NotZ = res & 0xFFFF;
3476 POST_IO
3477RET(12)
3478}
3479
3480// CMPI
3481OPCODE(0x0C67)
3482{
3483 u32 adr, res;
3484 u32 src, dst;
3485
3486 FETCH_WORD(src);
3487 adr = AREG(7) - 2;
3488 AREG(7) = adr;
3489 PRE_IO
3490 READ_WORD_F(adr, dst)
3491 res = dst - src;
3492 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
3493 flag_N = flag_C = res >> 8;
3494 flag_NotZ = res & 0xFFFF;
3495 POST_IO
3496RET(14)
3497}
3498
3499// CMPI
3500OPCODE(0x0C80)
3501{
3502 u32 adr, res;
3503 u32 src, dst;
3504
3505 FETCH_LONG(src);
3506 dst = DREGu32((Opcode >> 0) & 7);
3507 res = dst - src;
3508 flag_NotZ = res;
3509 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
3510 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
3511 flag_N = res >> 24;
3512RET(14)
3513}
3514
3515// CMPI
3516OPCODE(0x0C90)
3517{
3518 u32 adr, res;
3519 u32 src, dst;
3520
3521 FETCH_LONG(src);
3522 adr = AREG((Opcode >> 0) & 7);
3523 PRE_IO
3524 READ_LONG_F(adr, dst)
3525 res = dst - src;
3526 flag_NotZ = res;
3527 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
3528 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
3529 flag_N = res >> 24;
3530 POST_IO
3531RET(20)
3532}
3533
3534// CMPI
3535OPCODE(0x0C98)
3536{
3537 u32 adr, res;
3538 u32 src, dst;
3539
3540 FETCH_LONG(src);
3541 adr = AREG((Opcode >> 0) & 7);
3542 AREG((Opcode >> 0) & 7) += 4;
3543 PRE_IO
3544 READ_LONG_F(adr, dst)
3545 res = dst - src;
3546 flag_NotZ = res;
3547 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
3548 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
3549 flag_N = res >> 24;
3550 POST_IO
3551RET(20)
3552}
3553
3554// CMPI
3555OPCODE(0x0CA0)
3556{
3557 u32 adr, res;
3558 u32 src, dst;
3559
3560 FETCH_LONG(src);
3561 adr = AREG((Opcode >> 0) & 7) - 4;
3562 AREG((Opcode >> 0) & 7) = adr;
3563 PRE_IO
3564 READ_LONG_F(adr, dst)
3565 res = dst - src;
3566 flag_NotZ = res;
3567 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
3568 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
3569 flag_N = res >> 24;
3570 POST_IO
3571RET(22)
3572}
3573
3574// CMPI
3575OPCODE(0x0CA8)
3576{
3577 u32 adr, res;
3578 u32 src, dst;
3579
3580 FETCH_LONG(src);
3581 FETCH_SWORD(adr);
3582 adr += AREG((Opcode >> 0) & 7);
3583 PRE_IO
3584 READ_LONG_F(adr, dst)
3585 res = dst - src;
3586 flag_NotZ = res;
3587 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
3588 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
3589 flag_N = res >> 24;
3590 POST_IO
3591RET(24)
3592}
3593
3594// CMPI
3595OPCODE(0x0CB0)
3596{
3597 u32 adr, res;
3598 u32 src, dst;
3599
3600 FETCH_LONG(src);
3601 adr = AREG((Opcode >> 0) & 7);
3602 DECODE_EXT_WORD
3603 PRE_IO
3604 READ_LONG_F(adr, dst)
3605 res = dst - src;
3606 flag_NotZ = res;
3607 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
3608 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
3609 flag_N = res >> 24;
3610 POST_IO
3611RET(26)
3612}
3613
3614// CMPI
3615OPCODE(0x0CB8)
3616{
3617 u32 adr, res;
3618 u32 src, dst;
3619
3620 FETCH_LONG(src);
3621 FETCH_SWORD(adr);
3622 PRE_IO
3623 READ_LONG_F(adr, dst)
3624 res = dst - src;
3625 flag_NotZ = res;
3626 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
3627 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
3628 flag_N = res >> 24;
3629 POST_IO
3630RET(24)
3631}
3632
3633// CMPI
3634OPCODE(0x0CB9)
3635{
3636 u32 adr, res;
3637 u32 src, dst;
3638
3639 FETCH_LONG(src);
3640 FETCH_LONG(adr);
3641 PRE_IO
3642 READ_LONG_F(adr, dst)
3643 res = dst - src;
3644 flag_NotZ = res;
3645 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
3646 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
3647 flag_N = res >> 24;
3648 POST_IO
3649RET(28)
3650}
3651
3652// CMPI
3653OPCODE(0x0C9F)
3654{
3655 u32 adr, res;
3656 u32 src, dst;
3657
3658 FETCH_LONG(src);
3659 adr = AREG(7);
3660 AREG(7) += 4;
3661 PRE_IO
3662 READ_LONG_F(adr, dst)
3663 res = dst - src;
3664 flag_NotZ = res;
3665 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
3666 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
3667 flag_N = res >> 24;
3668 POST_IO
3669RET(20)
3670}
3671
3672// CMPI
3673OPCODE(0x0CA7)
3674{
3675 u32 adr, res;
3676 u32 src, dst;
3677
3678 FETCH_LONG(src);
3679 adr = AREG(7) - 4;
3680 AREG(7) = adr;
3681 PRE_IO
3682 READ_LONG_F(adr, dst)
3683 res = dst - src;
3684 flag_NotZ = res;
3685 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
3686 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
3687 flag_N = res >> 24;
3688 POST_IO
3689RET(22)
3690}
3691
3692// BTSTn
3693OPCODE(0x0800)
3694{
3695 u32 adr, res;
3696 u32 src, dst;
3697
3698 FETCH_BYTE(src);
3699 src = 1 << (src & 31);
3700 res = DREGu32((Opcode >> 0) & 7);
3701 flag_NotZ = res & src;
3702RET(10)
3703}
3704
3705// BTSTn
3706OPCODE(0x0810)
3707{
3708 u32 adr, res;
3709 u32 src, dst;
3710
3711 FETCH_BYTE(src);
3712 src = 1 << (src & 7);
3713 adr = AREG((Opcode >> 0) & 7);
3714 PRE_IO
3715 READ_BYTE_F(adr, res)
3716 flag_NotZ = res & src;
3717 POST_IO
3718RET(12)
3719}
3720
3721// BTSTn
3722OPCODE(0x0818)
3723{
3724 u32 adr, res;
3725 u32 src, dst;
3726
3727 FETCH_BYTE(src);
3728 src = 1 << (src & 7);
3729 adr = AREG((Opcode >> 0) & 7);
3730 AREG((Opcode >> 0) & 7) += 1;
3731 PRE_IO
3732 READ_BYTE_F(adr, res)
3733 flag_NotZ = res & src;
3734 POST_IO
3735RET(12)
3736}
3737
3738// BTSTn
3739OPCODE(0x0820)
3740{
3741 u32 adr, res;
3742 u32 src, dst;
3743
3744 FETCH_BYTE(src);
3745 src = 1 << (src & 7);
3746 adr = AREG((Opcode >> 0) & 7) - 1;
3747 AREG((Opcode >> 0) & 7) = adr;
3748 PRE_IO
3749 READ_BYTE_F(adr, res)
3750 flag_NotZ = res & src;
3751 POST_IO
3752RET(14)
3753}
3754
3755// BTSTn
3756OPCODE(0x0828)
3757{
3758 u32 adr, res;
3759 u32 src, dst;
3760
3761 FETCH_BYTE(src);
3762 src = 1 << (src & 7);
3763 FETCH_SWORD(adr);
3764 adr += AREG((Opcode >> 0) & 7);
3765 PRE_IO
3766 READ_BYTE_F(adr, res)
3767 flag_NotZ = res & src;
3768 POST_IO
3769RET(16)
3770}
3771
3772// BTSTn
3773OPCODE(0x0830)
3774{
3775 u32 adr, res;
3776 u32 src, dst;
3777
3778 FETCH_BYTE(src);
3779 src = 1 << (src & 7);
3780 adr = AREG((Opcode >> 0) & 7);
3781 DECODE_EXT_WORD
3782 PRE_IO
3783 READ_BYTE_F(adr, res)
3784 flag_NotZ = res & src;
3785 POST_IO
3786RET(18)
3787}
3788
3789// BTSTn
3790OPCODE(0x0838)
3791{
3792 u32 adr, res;
3793 u32 src, dst;
3794
3795 FETCH_BYTE(src);
3796 src = 1 << (src & 7);
3797 FETCH_SWORD(adr);
3798 PRE_IO
3799 READ_BYTE_F(adr, res)
3800 flag_NotZ = res & src;
3801 POST_IO
3802RET(16)
3803}
3804
3805// BTSTn
3806OPCODE(0x0839)
3807{
3808 u32 adr, res;
3809 u32 src, dst;
3810
3811 FETCH_BYTE(src);
3812 src = 1 << (src & 7);
3813 FETCH_LONG(adr);
3814 PRE_IO
3815 READ_BYTE_F(adr, res)
3816 flag_NotZ = res & src;
3817 POST_IO
3818RET(20)
3819}
3820
3821// BTSTn
3822OPCODE(0x083A)
3823{
3824 u32 adr, res;
3825 u32 src, dst;
3826
3827 FETCH_BYTE(src);
3828 src = 1 << (src & 7);
be26eb23 3829 adr = GET_SWORD + GET_PC;
70357ce5 3830 PC++;
3831 PRE_IO
3832 READ_BYTE_F(adr, res)
3833 flag_NotZ = res & src;
3834 POST_IO
3835RET(16)
3836}
3837
3838// BTSTn
3839OPCODE(0x083B)
3840{
3841 u32 adr, res;
3842 u32 src, dst;
3843
3844 FETCH_BYTE(src);
3845 src = 1 << (src & 7);
be26eb23 3846 adr = (uptr)(PC) - BasePC;
70357ce5 3847 DECODE_EXT_WORD
3848 PRE_IO
3849 READ_BYTE_F(adr, res)
3850 flag_NotZ = res & src;
3851 POST_IO
3852RET(18)
3853}
3854
3855// BTSTn
3856OPCODE(0x081F)
3857{
3858 u32 adr, res;
3859 u32 src, dst;
3860
3861 FETCH_BYTE(src);
3862 src = 1 << (src & 7);
3863 adr = AREG(7);
3864 AREG(7) += 2;
3865 PRE_IO
3866 READ_BYTE_F(adr, res)
3867 flag_NotZ = res & src;
3868 POST_IO
3869RET(12)
3870}
3871
3872// BTSTn
3873OPCODE(0x0827)
3874{
3875 u32 adr, res;
3876 u32 src, dst;
3877
3878 FETCH_BYTE(src);
3879 src = 1 << (src & 7);
3880 adr = AREG(7) - 2;
3881 AREG(7) = adr;
3882 PRE_IO
3883 READ_BYTE_F(adr, res)
3884 flag_NotZ = res & src;
3885 POST_IO
3886RET(14)
3887}
3888
3889// BCHGn
3890OPCODE(0x0840)
3891{
3892 u32 adr, res;
3893 u32 src, dst;
3894
3895 FETCH_BYTE(src);
3896 src = 1 << (src & 31);
3897 res = DREGu32((Opcode >> 0) & 7);
3898 flag_NotZ = res & src;
3899 res ^= src;
3900 DREGu32((Opcode >> 0) & 7) = res;
3901RET(12)
3902}
3903
3904// BCHGn
3905OPCODE(0x0850)
3906{
3907 u32 adr, res;
3908 u32 src, dst;
3909
3910 FETCH_BYTE(src);
3911 src = 1 << (src & 7);
3912 adr = AREG((Opcode >> 0) & 7);
3913 PRE_IO
3914 READ_BYTE_F(adr, res)
3915 flag_NotZ = res & src;
3916 res ^= src;
3917 WRITE_BYTE_F(adr, res)
3918 POST_IO
3919RET(16)
3920}
3921
3922// BCHGn
3923OPCODE(0x0858)
3924{
3925 u32 adr, res;
3926 u32 src, dst;
3927
3928 FETCH_BYTE(src);
3929 src = 1 << (src & 7);
3930 adr = AREG((Opcode >> 0) & 7);
3931 AREG((Opcode >> 0) & 7) += 1;
3932 PRE_IO
3933 READ_BYTE_F(adr, res)
3934 flag_NotZ = res & src;
3935 res ^= src;
3936 WRITE_BYTE_F(adr, res)
3937 POST_IO
3938RET(16)
3939}
3940
3941// BCHGn
3942OPCODE(0x0860)
3943{
3944 u32 adr, res;
3945 u32 src, dst;
3946
3947 FETCH_BYTE(src);
3948 src = 1 << (src & 7);
3949 adr = AREG((Opcode >> 0) & 7) - 1;
3950 AREG((Opcode >> 0) & 7) = adr;
3951 PRE_IO
3952 READ_BYTE_F(adr, res)
3953 flag_NotZ = res & src;
3954 res ^= src;
3955 WRITE_BYTE_F(adr, res)
3956 POST_IO
3957RET(18)
3958}
3959
3960// BCHGn
3961OPCODE(0x0868)
3962{
3963 u32 adr, res;
3964 u32 src, dst;
3965
3966 FETCH_BYTE(src);
3967 src = 1 << (src & 7);
3968 FETCH_SWORD(adr);
3969 adr += AREG((Opcode >> 0) & 7);
3970 PRE_IO
3971 READ_BYTE_F(adr, res)
3972 flag_NotZ = res & src;
3973 res ^= src;
3974 WRITE_BYTE_F(adr, res)
3975 POST_IO
3976RET(20)
3977}
3978
3979// BCHGn
3980OPCODE(0x0870)
3981{
3982 u32 adr, res;
3983 u32 src, dst;
3984
3985 FETCH_BYTE(src);
3986 src = 1 << (src & 7);
3987 adr = AREG((Opcode >> 0) & 7);
3988 DECODE_EXT_WORD
3989 PRE_IO
3990 READ_BYTE_F(adr, res)
3991 flag_NotZ = res & src;
3992 res ^= src;
3993 WRITE_BYTE_F(adr, res)
3994 POST_IO
3995RET(22)
3996}
3997
3998// BCHGn
3999OPCODE(0x0878)
4000{
4001 u32 adr, res;
4002 u32 src, dst;
4003
4004 FETCH_BYTE(src);
4005 src = 1 << (src & 7);
4006 FETCH_SWORD(adr);
4007 PRE_IO
4008 READ_BYTE_F(adr, res)
4009 flag_NotZ = res & src;
4010 res ^= src;
4011 WRITE_BYTE_F(adr, res)
4012 POST_IO
4013RET(20)
4014}
4015
4016// BCHGn
4017OPCODE(0x0879)
4018{
4019 u32 adr, res;
4020 u32 src, dst;
4021
4022 FETCH_BYTE(src);
4023 src = 1 << (src & 7);
4024 FETCH_LONG(adr);
4025 PRE_IO
4026 READ_BYTE_F(adr, res)
4027 flag_NotZ = res & src;
4028 res ^= src;
4029 WRITE_BYTE_F(adr, res)
4030 POST_IO
4031RET(24)
4032}
4033
4034// BCHGn
4035OPCODE(0x085F)
4036{
4037 u32 adr, res;
4038 u32 src, dst;
4039
4040 FETCH_BYTE(src);
4041 src = 1 << (src & 7);
4042 adr = AREG(7);
4043 AREG(7) += 2;
4044 PRE_IO
4045 READ_BYTE_F(adr, res)
4046 flag_NotZ = res & src;
4047 res ^= src;
4048 WRITE_BYTE_F(adr, res)
4049 POST_IO
4050RET(16)
4051}
4052
4053// BCHGn
4054OPCODE(0x0867)
4055{
4056 u32 adr, res;
4057 u32 src, dst;
4058
4059 FETCH_BYTE(src);
4060 src = 1 << (src & 7);
4061 adr = AREG(7) - 2;
4062 AREG(7) = adr;
4063 PRE_IO
4064 READ_BYTE_F(adr, res)
4065 flag_NotZ = res & src;
4066 res ^= src;
4067 WRITE_BYTE_F(adr, res)
4068 POST_IO
4069RET(18)
4070}
4071
4072// BCLRn
4073OPCODE(0x0880)
4074{
4075 u32 adr, res;
4076 u32 src, dst;
4077
4078 FETCH_BYTE(src);
4079 src = 1 << (src & 31);
4080 res = DREGu32((Opcode >> 0) & 7);
4081 flag_NotZ = res & src;
4082 res &= ~src;
4083 DREGu32((Opcode >> 0) & 7) = res;
4084RET(14)
4085}
4086
4087// BCLRn
4088OPCODE(0x0890)
4089{
4090 u32 adr, res;
4091 u32 src, dst;
4092
4093 FETCH_BYTE(src);
4094 src = 1 << (src & 7);
4095 adr = AREG((Opcode >> 0) & 7);
4096 PRE_IO
4097 READ_BYTE_F(adr, res)
4098 flag_NotZ = res & src;
4099 res &= ~src;
4100 WRITE_BYTE_F(adr, res)
4101 POST_IO
4102RET(16)
4103}
4104
4105// BCLRn
4106OPCODE(0x0898)
4107{
4108 u32 adr, res;
4109 u32 src, dst;
4110
4111 FETCH_BYTE(src);
4112 src = 1 << (src & 7);
4113 adr = AREG((Opcode >> 0) & 7);
4114 AREG((Opcode >> 0) & 7) += 1;
4115 PRE_IO
4116 READ_BYTE_F(adr, res)
4117 flag_NotZ = res & src;
4118 res &= ~src;
4119 WRITE_BYTE_F(adr, res)
4120 POST_IO
4121RET(16)
4122}
4123
4124// BCLRn
4125OPCODE(0x08A0)
4126{
4127 u32 adr, res;
4128 u32 src, dst;
4129
4130 FETCH_BYTE(src);
4131 src = 1 << (src & 7);
4132 adr = AREG((Opcode >> 0) & 7) - 1;
4133 AREG((Opcode >> 0) & 7) = adr;
4134 PRE_IO
4135 READ_BYTE_F(adr, res)
4136 flag_NotZ = res & src;
4137 res &= ~src;
4138 WRITE_BYTE_F(adr, res)
4139 POST_IO
4140RET(18)
4141}
4142
4143// BCLRn
4144OPCODE(0x08A8)
4145{
4146 u32 adr, res;
4147 u32 src, dst;
4148
4149 FETCH_BYTE(src);
4150 src = 1 << (src & 7);
4151 FETCH_SWORD(adr);
4152 adr += AREG((Opcode >> 0) & 7);
4153 PRE_IO
4154 READ_BYTE_F(adr, res)
4155 flag_NotZ = res & src;
4156 res &= ~src;
4157 WRITE_BYTE_F(adr, res)
4158 POST_IO
4159RET(20)
4160}
4161
4162// BCLRn
4163OPCODE(0x08B0)
4164{
4165 u32 adr, res;
4166 u32 src, dst;
4167
4168 FETCH_BYTE(src);
4169 src = 1 << (src & 7);
4170 adr = AREG((Opcode >> 0) & 7);
4171 DECODE_EXT_WORD
4172 PRE_IO
4173 READ_BYTE_F(adr, res)
4174 flag_NotZ = res & src;
4175 res &= ~src;
4176 WRITE_BYTE_F(adr, res)
4177 POST_IO
4178RET(22)
4179}
4180
4181// BCLRn
4182OPCODE(0x08B8)
4183{
4184 u32 adr, res;
4185 u32 src, dst;
4186
4187 FETCH_BYTE(src);
4188 src = 1 << (src & 7);
4189 FETCH_SWORD(adr);
4190 PRE_IO
4191 READ_BYTE_F(adr, res)
4192 flag_NotZ = res & src;
4193 res &= ~src;
4194 WRITE_BYTE_F(adr, res)
4195 POST_IO
4196RET(20)
4197}
4198
4199// BCLRn
4200OPCODE(0x08B9)
4201{
4202 u32 adr, res;
4203 u32 src, dst;
4204
4205 FETCH_BYTE(src);
4206 src = 1 << (src & 7);
4207 FETCH_LONG(adr);
4208 PRE_IO
4209 READ_BYTE_F(adr, res)
4210 flag_NotZ = res & src;
4211 res &= ~src;
4212 WRITE_BYTE_F(adr, res)
4213 POST_IO
4214RET(24)
4215}
4216
4217// BCLRn
4218OPCODE(0x089F)
4219{
4220 u32 adr, res;
4221 u32 src, dst;
4222
4223 FETCH_BYTE(src);
4224 src = 1 << (src & 7);
4225 adr = AREG(7);
4226 AREG(7) += 2;
4227 PRE_IO
4228 READ_BYTE_F(adr, res)
4229 flag_NotZ = res & src;
4230 res &= ~src;
4231 WRITE_BYTE_F(adr, res)
4232 POST_IO
4233RET(16)
4234}
4235
4236// BCLRn
4237OPCODE(0x08A7)
4238{
4239 u32 adr, res;
4240 u32 src, dst;
4241
4242 FETCH_BYTE(src);
4243 src = 1 << (src & 7);
4244 adr = AREG(7) - 2;
4245 AREG(7) = adr;
4246 PRE_IO
4247 READ_BYTE_F(adr, res)
4248 flag_NotZ = res & src;
4249 res &= ~src;
4250 WRITE_BYTE_F(adr, res)
4251 POST_IO
4252RET(18)
4253}
4254
4255// BSETn
4256OPCODE(0x08C0)
4257{
4258 u32 adr, res;
4259 u32 src, dst;
4260
4261 FETCH_BYTE(src);
4262 src = 1 << (src & 31);
4263 res = DREGu32((Opcode >> 0) & 7);
4264 flag_NotZ = res & src;
4265 res |= src;
4266 DREGu32((Opcode >> 0) & 7) = res;
4267RET(12)
4268}
4269
4270// BSETn
4271OPCODE(0x08D0)
4272{
4273 u32 adr, res;
4274 u32 src, dst;
4275
4276 FETCH_BYTE(src);
4277 src = 1 << (src & 7);
4278 adr = AREG((Opcode >> 0) & 7);
4279 PRE_IO
4280 READ_BYTE_F(adr, res)
4281 flag_NotZ = res & src;
4282 res |= src;
4283 WRITE_BYTE_F(adr, res)
4284 POST_IO
4285RET(16)
4286}
4287
4288// BSETn
4289OPCODE(0x08D8)
4290{
4291 u32 adr, res;
4292 u32 src, dst;
4293
4294 FETCH_BYTE(src);
4295 src = 1 << (src & 7);
4296 adr = AREG((Opcode >> 0) & 7);
4297 AREG((Opcode >> 0) & 7) += 1;
4298 PRE_IO
4299 READ_BYTE_F(adr, res)
4300 flag_NotZ = res & src;
4301 res |= src;
4302 WRITE_BYTE_F(adr, res)
4303 POST_IO
4304RET(16)
4305}
4306
4307// BSETn
4308OPCODE(0x08E0)
4309{
4310 u32 adr, res;
4311 u32 src, dst;
4312
4313 FETCH_BYTE(src);
4314 src = 1 << (src & 7);
4315 adr = AREG((Opcode >> 0) & 7) - 1;
4316 AREG((Opcode >> 0) & 7) = adr;
4317 PRE_IO
4318 READ_BYTE_F(adr, res)
4319 flag_NotZ = res & src;
4320 res |= src;
4321 WRITE_BYTE_F(adr, res)
4322 POST_IO
4323RET(18)
4324}
4325
4326// BSETn
4327OPCODE(0x08E8)
4328{
4329 u32 adr, res;
4330 u32 src, dst;
4331
4332 FETCH_BYTE(src);
4333 src = 1 << (src & 7);
4334 FETCH_SWORD(adr);
4335 adr += AREG((Opcode >> 0) & 7);
4336 PRE_IO
4337 READ_BYTE_F(adr, res)
4338 flag_NotZ = res & src;
4339 res |= src;
4340 WRITE_BYTE_F(adr, res)
4341 POST_IO
4342RET(20)
4343}
4344
4345// BSETn
4346OPCODE(0x08F0)
4347{
4348 u32 adr, res;
4349 u32 src, dst;
4350
4351 FETCH_BYTE(src);
4352 src = 1 << (src & 7);
4353 adr = AREG((Opcode >> 0) & 7);
4354 DECODE_EXT_WORD
4355 PRE_IO
4356 READ_BYTE_F(adr, res)
4357 flag_NotZ = res & src;
4358 res |= src;
4359 WRITE_BYTE_F(adr, res)
4360 POST_IO
4361RET(22)
4362}
4363
4364// BSETn
4365OPCODE(0x08F8)
4366{
4367 u32 adr, res;
4368 u32 src, dst;
4369
4370 FETCH_BYTE(src);
4371 src = 1 << (src & 7);
4372 FETCH_SWORD(adr);
4373 PRE_IO
4374 READ_BYTE_F(adr, res)
4375 flag_NotZ = res & src;
4376 res |= src;
4377 WRITE_BYTE_F(adr, res)
4378 POST_IO
4379RET(20)
4380}
4381
4382// BSETn
4383OPCODE(0x08F9)
4384{
4385 u32 adr, res;
4386 u32 src, dst;
4387
4388 FETCH_BYTE(src);
4389 src = 1 << (src & 7);
4390 FETCH_LONG(adr);
4391 PRE_IO
4392 READ_BYTE_F(adr, res)
4393 flag_NotZ = res & src;
4394 res |= src;
4395 WRITE_BYTE_F(adr, res)
4396 POST_IO
4397RET(24)
4398}
4399
4400// BSETn
4401OPCODE(0x08DF)
4402{
4403 u32 adr, res;
4404 u32 src, dst;
4405
4406 FETCH_BYTE(src);
4407 src = 1 << (src & 7);
4408 adr = AREG(7);
4409 AREG(7) += 2;
4410 PRE_IO
4411 READ_BYTE_F(adr, res)
4412 flag_NotZ = res & src;
4413 res |= src;
4414 WRITE_BYTE_F(adr, res)
4415 POST_IO
4416RET(16)
4417}
4418
4419// BSETn
4420OPCODE(0x08E7)
4421{
4422 u32 adr, res;
4423 u32 src, dst;
4424
4425 FETCH_BYTE(src);
4426 src = 1 << (src & 7);
4427 adr = AREG(7) - 2;
4428 AREG(7) = adr;
4429 PRE_IO
4430 READ_BYTE_F(adr, res)
4431 flag_NotZ = res & src;
4432 res |= src;
4433 WRITE_BYTE_F(adr, res)
4434 POST_IO
4435RET(18)
4436}
4437
4438// BTST
4439OPCODE(0x0100)
4440{
4441 u32 adr, res;
4442 u32 src, dst;
4443
4444 src = DREGu32((Opcode >> 9) & 7);
4445 src = 1 << (src & 31);
4446 res = DREGu32((Opcode >> 0) & 7);
4447 flag_NotZ = res & src;
4448RET(6)
4449}
4450
4451// BTST
4452OPCODE(0x0110)
4453{
4454 u32 adr, res;
4455 u32 src, dst;
4456
4457 src = DREGu8((Opcode >> 9) & 7);
4458 src = 1 << (src & 7);
4459 adr = AREG((Opcode >> 0) & 7);
4460 PRE_IO
4461 READ_BYTE_F(adr, res)
4462 flag_NotZ = res & src;
4463 POST_IO
4464RET(8)
4465}
4466
4467// BTST
4468OPCODE(0x0118)
4469{
4470 u32 adr, res;
4471 u32 src, dst;
4472
4473 src = DREGu8((Opcode >> 9) & 7);
4474 src = 1 << (src & 7);
4475 adr = AREG((Opcode >> 0) & 7);
4476 AREG((Opcode >> 0) & 7) += 1;
4477 PRE_IO
4478 READ_BYTE_F(adr, res)
4479 flag_NotZ = res & src;
4480 POST_IO
4481RET(8)
4482}
4483
4484// BTST
4485OPCODE(0x0120)
4486{
4487 u32 adr, res;
4488 u32 src, dst;
4489
4490 src = DREGu8((Opcode >> 9) & 7);
4491 src = 1 << (src & 7);
4492 adr = AREG((Opcode >> 0) & 7) - 1;
4493 AREG((Opcode >> 0) & 7) = adr;
4494 PRE_IO
4495 READ_BYTE_F(adr, res)
4496 flag_NotZ = res & src;
4497 POST_IO
4498RET(10)
4499}
4500
4501// BTST
4502OPCODE(0x0128)
4503{
4504 u32 adr, res;
4505 u32 src, dst;
4506
4507 src = DREGu8((Opcode >> 9) & 7);
4508 src = 1 << (src & 7);
4509 FETCH_SWORD(adr);
4510 adr += AREG((Opcode >> 0) & 7);
4511 PRE_IO
4512 READ_BYTE_F(adr, res)
4513 flag_NotZ = res & src;
4514 POST_IO
4515RET(12)
4516}
4517
4518// BTST
4519OPCODE(0x0130)
4520{
4521 u32 adr, res;
4522 u32 src, dst;
4523
4524 src = DREGu8((Opcode >> 9) & 7);
4525 src = 1 << (src & 7);
4526 adr = AREG((Opcode >> 0) & 7);
4527 DECODE_EXT_WORD
4528 PRE_IO
4529 READ_BYTE_F(adr, res)
4530 flag_NotZ = res & src;
4531 POST_IO
4532RET(14)
4533}
4534
4535// BTST
4536OPCODE(0x0138)
4537{
4538 u32 adr, res;
4539 u32 src, dst;
4540
4541 src = DREGu8((Opcode >> 9) & 7);
4542 src = 1 << (src & 7);
4543 FETCH_SWORD(adr);
4544 PRE_IO
4545 READ_BYTE_F(adr, res)
4546 flag_NotZ = res & src;
4547 POST_IO
4548RET(12)
4549}
4550
4551// BTST
4552OPCODE(0x0139)
4553{
4554 u32 adr, res;
4555 u32 src, dst;
4556
4557 src = DREGu8((Opcode >> 9) & 7);
4558 src = 1 << (src & 7);
4559 FETCH_LONG(adr);
4560 PRE_IO
4561 READ_BYTE_F(adr, res)
4562 flag_NotZ = res & src;
4563 POST_IO
4564RET(16)
4565}
4566
4567// BTST
4568OPCODE(0x013A)
4569{
4570 u32 adr, res;
4571 u32 src, dst;
4572
4573 src = DREGu8((Opcode >> 9) & 7);
4574 src = 1 << (src & 7);
be26eb23 4575 adr = GET_SWORD + GET_PC;
70357ce5 4576 PC++;
4577 PRE_IO
4578 READ_BYTE_F(adr, res)
4579 flag_NotZ = res & src;
4580 POST_IO
4581RET(12)
4582}
4583
4584// BTST
4585OPCODE(0x013B)
4586{
4587 u32 adr, res;
4588 u32 src, dst;
4589
4590 src = DREGu8((Opcode >> 9) & 7);
4591 src = 1 << (src & 7);
be26eb23 4592 adr = (uptr)(PC) - BasePC;
70357ce5 4593 DECODE_EXT_WORD
4594 PRE_IO
4595 READ_BYTE_F(adr, res)
4596 flag_NotZ = res & src;
4597 POST_IO
4598RET(14)
4599}
4600
4601// BTST
4602OPCODE(0x013C)
4603{
4604 u32 adr, res;
4605 u32 src, dst;
4606
4607 src = DREGu8((Opcode >> 9) & 7);
4608 src = 1 << (src & 7);
4609 FETCH_BYTE(res);
4610 flag_NotZ = res & src;
4611RET(8)
4612}
4613
4614// BTST
4615OPCODE(0x011F)
4616{
4617 u32 adr, res;
4618 u32 src, dst;
4619
4620 src = DREGu8((Opcode >> 9) & 7);
4621 src = 1 << (src & 7);
4622 adr = AREG(7);
4623 AREG(7) += 2;
4624 PRE_IO
4625 READ_BYTE_F(adr, res)
4626 flag_NotZ = res & src;
4627 POST_IO
4628RET(8)
4629}
4630
4631// BTST
4632OPCODE(0x0127)
4633{
4634 u32 adr, res;
4635 u32 src, dst;
4636
4637 src = DREGu8((Opcode >> 9) & 7);
4638 src = 1 << (src & 7);
4639 adr = AREG(7) - 2;
4640 AREG(7) = adr;
4641 PRE_IO
4642 READ_BYTE_F(adr, res)
4643 flag_NotZ = res & src;
4644 POST_IO
4645RET(10)
4646}
4647
4648// BCHG
4649OPCODE(0x0140)
4650{
4651 u32 adr, res;
4652 u32 src, dst;
4653
4654 src = DREGu32((Opcode >> 9) & 7);
4655 src = 1 << (src & 31);
4656 res = DREGu32((Opcode >> 0) & 7);
4657 flag_NotZ = res & src;
4658 res ^= src;
4659 DREGu32((Opcode >> 0) & 7) = res;
4660RET(8)
4661}
4662
4663// BCHG
4664OPCODE(0x0150)
4665{
4666 u32 adr, res;
4667 u32 src, dst;
4668
4669 src = DREGu8((Opcode >> 9) & 7);
4670 src = 1 << (src & 7);
4671 adr = AREG((Opcode >> 0) & 7);
4672 PRE_IO
4673 READ_BYTE_F(adr, res)
4674 flag_NotZ = res & src;
4675 res ^= src;
4676 WRITE_BYTE_F(adr, res)
4677 POST_IO
4678RET(12)
4679}
4680
4681// BCHG
4682OPCODE(0x0158)
4683{
4684 u32 adr, res;
4685 u32 src, dst;
4686
4687 src = DREGu8((Opcode >> 9) & 7);
4688 src = 1 << (src & 7);
4689 adr = AREG((Opcode >> 0) & 7);
4690 AREG((Opcode >> 0) & 7) += 1;
4691 PRE_IO
4692 READ_BYTE_F(adr, res)
4693 flag_NotZ = res & src;
4694 res ^= src;
4695 WRITE_BYTE_F(adr, res)
4696 POST_IO
4697RET(12)
4698}
4699
4700// BCHG
4701OPCODE(0x0160)
4702{
4703 u32 adr, res;
4704 u32 src, dst;
4705
4706 src = DREGu8((Opcode >> 9) & 7);
4707 src = 1 << (src & 7);
4708 adr = AREG((Opcode >> 0) & 7) - 1;
4709 AREG((Opcode >> 0) & 7) = adr;
4710 PRE_IO
4711 READ_BYTE_F(adr, res)
4712 flag_NotZ = res & src;
4713 res ^= src;
4714 WRITE_BYTE_F(adr, res)
4715 POST_IO
4716RET(14)
4717}
4718
4719// BCHG
4720OPCODE(0x0168)
4721{
4722 u32 adr, res;
4723 u32 src, dst;
4724
4725 src = DREGu8((Opcode >> 9) & 7);
4726 src = 1 << (src & 7);
4727 FETCH_SWORD(adr);
4728 adr += AREG((Opcode >> 0) & 7);
4729 PRE_IO
4730 READ_BYTE_F(adr, res)
4731 flag_NotZ = res & src;
4732 res ^= src;
4733 WRITE_BYTE_F(adr, res)
4734 POST_IO
4735RET(16)
4736}
4737
4738// BCHG
4739OPCODE(0x0170)
4740{
4741 u32 adr, res;
4742 u32 src, dst;
4743
4744 src = DREGu8((Opcode >> 9) & 7);
4745 src = 1 << (src & 7);
4746 adr = AREG((Opcode >> 0) & 7);
4747 DECODE_EXT_WORD
4748 PRE_IO
4749 READ_BYTE_F(adr, res)
4750 flag_NotZ = res & src;
4751 res ^= src;
4752 WRITE_BYTE_F(adr, res)
4753 POST_IO
4754RET(18)
4755}
4756
4757// BCHG
4758OPCODE(0x0178)
4759{
4760 u32 adr, res;
4761 u32 src, dst;
4762
4763 src = DREGu8((Opcode >> 9) & 7);
4764 src = 1 << (src & 7);
4765 FETCH_SWORD(adr);
4766 PRE_IO
4767 READ_BYTE_F(adr, res)
4768 flag_NotZ = res & src;
4769 res ^= src;
4770 WRITE_BYTE_F(adr, res)
4771 POST_IO
4772RET(16)
4773}
4774
4775// BCHG
4776OPCODE(0x0179)
4777{
4778 u32 adr, res;
4779 u32 src, dst;
4780
4781 src = DREGu8((Opcode >> 9) & 7);
4782 src = 1 << (src & 7);
4783 FETCH_LONG(adr);
4784 PRE_IO
4785 READ_BYTE_F(adr, res)
4786 flag_NotZ = res & src;
4787 res ^= src;
4788 WRITE_BYTE_F(adr, res)
4789 POST_IO
4790RET(20)
4791}
4792
4793// BCHG
4794OPCODE(0x015F)
4795{
4796 u32 adr, res;
4797 u32 src, dst;
4798
4799 src = DREGu8((Opcode >> 9) & 7);
4800 src = 1 << (src & 7);
4801 adr = AREG(7);
4802 AREG(7) += 2;
4803 PRE_IO
4804 READ_BYTE_F(adr, res)
4805 flag_NotZ = res & src;
4806 res ^= src;
4807 WRITE_BYTE_F(adr, res)
4808 POST_IO
4809RET(12)
4810}
4811
4812// BCHG
4813OPCODE(0x0167)
4814{
4815 u32 adr, res;
4816 u32 src, dst;
4817
4818 src = DREGu8((Opcode >> 9) & 7);
4819 src = 1 << (src & 7);
4820 adr = AREG(7) - 2;
4821 AREG(7) = adr;
4822 PRE_IO
4823 READ_BYTE_F(adr, res)
4824 flag_NotZ = res & src;
4825 res ^= src;
4826 WRITE_BYTE_F(adr, res)
4827 POST_IO
4828RET(14)
4829}
4830
4831// BCLR
4832OPCODE(0x0180)
4833{
4834 u32 adr, res;
4835 u32 src, dst;
4836
4837 src = DREGu32((Opcode >> 9) & 7);
4838 src = 1 << (src & 31);
4839 res = DREGu32((Opcode >> 0) & 7);
4840 flag_NotZ = res & src;
4841 res &= ~src;
4842 DREGu32((Opcode >> 0) & 7) = res;
4843RET(10)
4844}
4845
4846// BCLR
4847OPCODE(0x0190)
4848{
4849 u32 adr, res;
4850 u32 src, dst;
4851
4852 src = DREGu8((Opcode >> 9) & 7);
4853 src = 1 << (src & 7);
4854 adr = AREG((Opcode >> 0) & 7);
4855 PRE_IO
4856 READ_BYTE_F(adr, res)
4857 flag_NotZ = res & src;
4858 res &= ~src;
4859 WRITE_BYTE_F(adr, res)
4860 POST_IO
4861RET(12)
4862}
4863
4864// BCLR
4865OPCODE(0x0198)
4866{
4867 u32 adr, res;
4868 u32 src, dst;
4869
4870 src = DREGu8((Opcode >> 9) & 7);
4871 src = 1 << (src & 7);
4872 adr = AREG((Opcode >> 0) & 7);
4873 AREG((Opcode >> 0) & 7) += 1;
4874 PRE_IO
4875 READ_BYTE_F(adr, res)
4876 flag_NotZ = res & src;
4877 res &= ~src;
4878 WRITE_BYTE_F(adr, res)
4879 POST_IO
4880RET(12)
4881}
4882
4883// BCLR
4884OPCODE(0x01A0)
4885{
4886 u32 adr, res;
4887 u32 src, dst;
4888
4889 src = DREGu8((Opcode >> 9) & 7);
4890 src = 1 << (src & 7);
4891 adr = AREG((Opcode >> 0) & 7) - 1;
4892 AREG((Opcode >> 0) & 7) = adr;
4893 PRE_IO
4894 READ_BYTE_F(adr, res)
4895 flag_NotZ = res & src;
4896 res &= ~src;
4897 WRITE_BYTE_F(adr, res)
4898 POST_IO
4899RET(14)
4900}
4901
4902// BCLR
4903OPCODE(0x01A8)
4904{
4905 u32 adr, res;
4906 u32 src, dst;
4907
4908 src = DREGu8((Opcode >> 9) & 7);
4909 src = 1 << (src & 7);
4910 FETCH_SWORD(adr);
4911 adr += AREG((Opcode >> 0) & 7);
4912 PRE_IO
4913 READ_BYTE_F(adr, res)
4914 flag_NotZ = res & src;
4915 res &= ~src;
4916 WRITE_BYTE_F(adr, res)
4917 POST_IO
4918RET(16)
4919}
4920
4921// BCLR
4922OPCODE(0x01B0)
4923{
4924 u32 adr, res;
4925 u32 src, dst;
4926
4927 src = DREGu8((Opcode >> 9) & 7);
4928 src = 1 << (src & 7);
4929 adr = AREG((Opcode >> 0) & 7);
4930 DECODE_EXT_WORD
4931 PRE_IO
4932 READ_BYTE_F(adr, res)
4933 flag_NotZ = res & src;
4934 res &= ~src;
4935 WRITE_BYTE_F(adr, res)
4936 POST_IO
4937RET(18)
4938}
4939
4940// BCLR
4941OPCODE(0x01B8)
4942{
4943 u32 adr, res;
4944 u32 src, dst;
4945
4946 src = DREGu8((Opcode >> 9) & 7);
4947 src = 1 << (src & 7);
4948 FETCH_SWORD(adr);
4949 PRE_IO
4950 READ_BYTE_F(adr, res)
4951 flag_NotZ = res & src;
4952 res &= ~src;
4953 WRITE_BYTE_F(adr, res)
4954 POST_IO
4955RET(16)
4956}
4957
4958// BCLR
4959OPCODE(0x01B9)
4960{
4961 u32 adr, res;
4962 u32 src, dst;
4963
4964 src = DREGu8((Opcode >> 9) & 7);
4965 src = 1 << (src & 7);
4966 FETCH_LONG(adr);
4967 PRE_IO
4968 READ_BYTE_F(adr, res)
4969 flag_NotZ = res & src;
4970 res &= ~src;
4971 WRITE_BYTE_F(adr, res)
4972 POST_IO
4973RET(20)
4974}
4975
4976// BCLR
4977OPCODE(0x019F)
4978{
4979 u32 adr, res;
4980 u32 src, dst;
4981
4982 src = DREGu8((Opcode >> 9) & 7);
4983 src = 1 << (src & 7);
4984 adr = AREG(7);
4985 AREG(7) += 2;
4986 PRE_IO
4987 READ_BYTE_F(adr, res)
4988 flag_NotZ = res & src;
4989 res &= ~src;
4990 WRITE_BYTE_F(adr, res)
4991 POST_IO
4992RET(12)
4993}
4994
4995// BCLR
4996OPCODE(0x01A7)
4997{
4998 u32 adr, res;
4999 u32 src, dst;
5000
5001 src = DREGu8((Opcode >> 9) & 7);
5002 src = 1 << (src & 7);
5003 adr = AREG(7) - 2;
5004 AREG(7) = adr;
5005 PRE_IO
5006 READ_BYTE_F(adr, res)
5007 flag_NotZ = res & src;
5008 res &= ~src;
5009 WRITE_BYTE_F(adr, res)
5010 POST_IO
5011RET(14)
5012}
5013
5014// BSET
5015OPCODE(0x01C0)
5016{
5017 u32 adr, res;
5018 u32 src, dst;
5019
5020 src = DREGu32((Opcode >> 9) & 7);
5021 src = 1 << (src & 31);
5022 res = DREGu32((Opcode >> 0) & 7);
5023 flag_NotZ = res & src;
5024 res |= src;
5025 DREGu32((Opcode >> 0) & 7) = res;
5026RET(8)
5027}
5028
5029// BSET
5030OPCODE(0x01D0)
5031{
5032 u32 adr, res;
5033 u32 src, dst;
5034
5035 src = DREGu8((Opcode >> 9) & 7);
5036 src = 1 << (src & 7);
5037 adr = AREG((Opcode >> 0) & 7);
5038 PRE_IO
5039 READ_BYTE_F(adr, res)
5040 flag_NotZ = res & src;
5041 res |= src;
5042 WRITE_BYTE_F(adr, res)
5043 POST_IO
5044RET(12)
5045}
5046
5047// BSET
5048OPCODE(0x01D8)
5049{
5050 u32 adr, res;
5051 u32 src, dst;
5052
5053 src = DREGu8((Opcode >> 9) & 7);
5054 src = 1 << (src & 7);
5055 adr = AREG((Opcode >> 0) & 7);
5056 AREG((Opcode >> 0) & 7) += 1;
5057 PRE_IO
5058 READ_BYTE_F(adr, res)
5059 flag_NotZ = res & src;
5060 res |= src;
5061 WRITE_BYTE_F(adr, res)
5062 POST_IO
5063RET(12)
5064}
5065
5066// BSET
5067OPCODE(0x01E0)
5068{
5069 u32 adr, res;
5070 u32 src, dst;
5071
5072 src = DREGu8((Opcode >> 9) & 7);
5073 src = 1 << (src & 7);
5074 adr = AREG((Opcode >> 0) & 7) - 1;
5075 AREG((Opcode >> 0) & 7) = adr;
5076 PRE_IO
5077 READ_BYTE_F(adr, res)
5078 flag_NotZ = res & src;
5079 res |= src;
5080 WRITE_BYTE_F(adr, res)
5081 POST_IO
5082RET(14)
5083}
5084
5085// BSET
5086OPCODE(0x01E8)
5087{
5088 u32 adr, res;
5089 u32 src, dst;
5090
5091 src = DREGu8((Opcode >> 9) & 7);
5092 src = 1 << (src & 7);
5093 FETCH_SWORD(adr);
5094 adr += AREG((Opcode >> 0) & 7);
5095 PRE_IO
5096 READ_BYTE_F(adr, res)
5097 flag_NotZ = res & src;
5098 res |= src;
5099 WRITE_BYTE_F(adr, res)
5100 POST_IO
5101RET(16)
5102}
5103
5104// BSET
5105OPCODE(0x01F0)
5106{
5107 u32 adr, res;
5108 u32 src, dst;
5109
5110 src = DREGu8((Opcode >> 9) & 7);
5111 src = 1 << (src & 7);
5112 adr = AREG((Opcode >> 0) & 7);
5113 DECODE_EXT_WORD
5114 PRE_IO
5115 READ_BYTE_F(adr, res)
5116 flag_NotZ = res & src;
5117 res |= src;
5118 WRITE_BYTE_F(adr, res)
5119 POST_IO
5120RET(18)
5121}
5122
5123// BSET
5124OPCODE(0x01F8)
5125{
5126 u32 adr, res;
5127 u32 src, dst;
5128
5129 src = DREGu8((Opcode >> 9) & 7);
5130 src = 1 << (src & 7);
5131 FETCH_SWORD(adr);
5132 PRE_IO
5133 READ_BYTE_F(adr, res)
5134 flag_NotZ = res & src;
5135 res |= src;
5136 WRITE_BYTE_F(adr, res)
5137 POST_IO
5138RET(16)
5139}
5140
5141// BSET
5142OPCODE(0x01F9)
5143{
5144 u32 adr, res;
5145 u32 src, dst;
5146
5147 src = DREGu8((Opcode >> 9) & 7);
5148 src = 1 << (src & 7);
5149 FETCH_LONG(adr);
5150 PRE_IO
5151 READ_BYTE_F(adr, res)
5152 flag_NotZ = res & src;
5153 res |= src;
5154 WRITE_BYTE_F(adr, res)
5155 POST_IO
5156RET(20)
5157}
5158
5159// BSET
5160OPCODE(0x01DF)
5161{
5162 u32 adr, res;
5163 u32 src, dst;
5164
5165 src = DREGu8((Opcode >> 9) & 7);
5166 src = 1 << (src & 7);
5167 adr = AREG(7);
5168 AREG(7) += 2;
5169 PRE_IO
5170 READ_BYTE_F(adr, res)
5171 flag_NotZ = res & src;
5172 res |= src;
5173 WRITE_BYTE_F(adr, res)
5174 POST_IO
5175RET(12)
5176}
5177
5178// BSET
5179OPCODE(0x01E7)
5180{
5181 u32 adr, res;
5182 u32 src, dst;
5183
5184 src = DREGu8((Opcode >> 9) & 7);
5185 src = 1 << (src & 7);
5186 adr = AREG(7) - 2;
5187 AREG(7) = adr;
5188 PRE_IO
5189 READ_BYTE_F(adr, res)
5190 flag_NotZ = res & src;
5191 res |= src;
5192 WRITE_BYTE_F(adr, res)
5193 POST_IO
5194RET(14)
5195}
5196
5197// MOVEPWaD
5198OPCODE(0x0108)
5199{
5200 u32 adr, res;
5201 u32 src, dst;
5202
5203 FETCH_SWORD(adr);
5204 adr += AREG((Opcode >> 0) & 7);
5205 PRE_IO
5206 READ_BYTE_F(adr + 0, res)
5207 READ_BYTE_F(adr + 2, src)
5208 DREGu16((Opcode >> 9) & 7) = (res << 8) | src;
5209 POST_IO
03e4f2a3 5210#ifdef USE_CYCLONE_TIMING
5211RET(16)
5212#else
70357ce5 5213RET(24)
03e4f2a3 5214#endif
70357ce5 5215}
5216
5217// MOVEPLaD
5218OPCODE(0x0148)
5219{
5220 u32 adr, res;
5221 u32 src, dst;
5222
5223 FETCH_SWORD(adr);
5224 adr += AREG((Opcode >> 0) & 7);
5225 PRE_IO
5226 READ_BYTE_F(adr, res)
5227 res <<= 24;
5228 adr += 2;
5229 READ_BYTE_F(adr, src)
5230 res |= src << 16;
5231 adr += 2;
5232 READ_BYTE_F(adr, src)
5233 res |= src << 8;
5234 adr += 2;
5235 READ_BYTE_F(adr, src)
5236 DREG((Opcode >> 9) & 7) = res | src;
5237 POST_IO
03e4f2a3 5238#ifdef USE_CYCLONE_TIMING
5239RET(24)
5240#else
70357ce5 5241RET(32)
03e4f2a3 5242#endif
70357ce5 5243}
5244
5245// MOVEPWDa
5246OPCODE(0x0188)
5247{
5248 u32 adr, res;
5249 u32 src, dst;
5250
5251 res = DREGu32((Opcode >> 9) & 7);
5252 FETCH_SWORD(adr);
5253 adr += AREG((Opcode >> 0) & 7);
5254 PRE_IO
5255 WRITE_BYTE_F(adr + 0, res >> 8)
5256 WRITE_BYTE_F(adr + 2, res >> 0)
5257 POST_IO
03e4f2a3 5258#ifdef USE_CYCLONE_TIMING
5259RET(16)
5260#else
70357ce5 5261RET(24)
03e4f2a3 5262#endif
70357ce5 5263}
5264
5265// MOVEPLDa
5266OPCODE(0x01C8)
5267{
5268 u32 adr, res;
5269 u32 src, dst;
5270
5271 res = DREGu32((Opcode >> 9) & 7);
5272 FETCH_SWORD(adr);
5273 adr += AREG((Opcode >> 0) & 7);
5274 PRE_IO
5275 WRITE_BYTE_F(adr, res >> 24)
5276 adr += 2;
5277 WRITE_BYTE_F(adr, res >> 16)
5278 adr += 2;
5279 WRITE_BYTE_F(adr, res >> 8)
5280 adr += 2;
5281 WRITE_BYTE_F(adr, res >> 0)
5282 POST_IO
03e4f2a3 5283#ifdef USE_CYCLONE_TIMING
5284RET(24)
5285#else
70357ce5 5286RET(32)
03e4f2a3 5287#endif
70357ce5 5288}
5289
5290// MOVEB
5291OPCODE(0x1000)
5292{
5293 u32 adr, res;
5294 u32 src, dst;
5295
5296 res = DREGu8((Opcode >> 0) & 7);
5297 flag_C = 0;
5298 flag_V = 0;
5299 flag_NotZ = res;
5300 flag_N = res;
5301 DREGu8((Opcode >> 9) & 7) = res;
5302RET(4)
5303}
5304
5305// MOVEB
5306OPCODE(0x1080)
5307{
5308 u32 adr, res;
5309 u32 src, dst;
5310
5311 res = DREGu8((Opcode >> 0) & 7);
5312 flag_C = 0;
5313 flag_V = 0;
5314 flag_NotZ = res;
5315 flag_N = res;
5316 adr = AREG((Opcode >> 9) & 7);
5317 PRE_IO
5318 WRITE_BYTE_F(adr, res)
5319 POST_IO
5320RET(8)
5321}
5322
5323// MOVEB
5324OPCODE(0x10C0)
5325{
5326 u32 adr, res;
5327 u32 src, dst;
5328
5329 res = DREGu8((Opcode >> 0) & 7);
5330 flag_C = 0;
5331 flag_V = 0;
5332 flag_NotZ = res;
5333 flag_N = res;
5334 adr = AREG((Opcode >> 9) & 7);
5335 AREG((Opcode >> 9) & 7) += 1;
5336 PRE_IO
5337 WRITE_BYTE_F(adr, res)
5338 POST_IO
5339RET(8)
5340}
5341
5342// MOVEB
5343OPCODE(0x1100)
5344{
5345 u32 adr, res;
5346 u32 src, dst;
5347
5348 res = DREGu8((Opcode >> 0) & 7);
5349 flag_C = 0;
5350 flag_V = 0;
5351 flag_NotZ = res;
5352 flag_N = res;
5353 adr = AREG((Opcode >> 9) & 7) - 1;
5354 AREG((Opcode >> 9) & 7) = adr;
5355 PRE_IO
5356 WRITE_BYTE_F(adr, res)
5357 POST_IO
5358RET(8)
5359}
5360
5361// MOVEB
5362OPCODE(0x1140)
5363{
5364 u32 adr, res;
5365 u32 src, dst;
5366
5367 res = DREGu8((Opcode >> 0) & 7);
5368 flag_C = 0;
5369 flag_V = 0;
5370 flag_NotZ = res;
5371 flag_N = res;
5372 FETCH_SWORD(adr);
5373 adr += AREG((Opcode >> 9) & 7);
5374 PRE_IO
5375 WRITE_BYTE_F(adr, res)
5376 POST_IO
5377RET(12)
5378}
5379
5380// MOVEB
5381OPCODE(0x1180)
5382{
5383 u32 adr, res;
5384 u32 src, dst;
5385
5386 res = DREGu8((Opcode >> 0) & 7);
5387 flag_C = 0;
5388 flag_V = 0;
5389 flag_NotZ = res;
5390 flag_N = res;
5391 adr = AREG((Opcode >> 9) & 7);
5392 DECODE_EXT_WORD
5393 PRE_IO
5394 WRITE_BYTE_F(adr, res)
5395 POST_IO
5396RET(14)
5397}
5398
5399// MOVEB
5400OPCODE(0x11C0)
5401{
5402 u32 adr, res;
5403 u32 src, dst;
5404
5405 res = DREGu8((Opcode >> 0) & 7);
5406 flag_C = 0;
5407 flag_V = 0;
5408 flag_NotZ = res;
5409 flag_N = res;
5410 FETCH_SWORD(adr);
5411 PRE_IO
5412 WRITE_BYTE_F(adr, res)
5413 POST_IO
5414RET(12)
5415}
5416
5417// MOVEB
5418OPCODE(0x13C0)
5419{
5420 u32 adr, res;
5421 u32 src, dst;
5422
5423 res = DREGu8((Opcode >> 0) & 7);
5424 flag_C = 0;
5425 flag_V = 0;
5426 flag_NotZ = res;
5427 flag_N = res;
5428 FETCH_LONG(adr);
5429 PRE_IO
5430 WRITE_BYTE_F(adr, res)
5431 POST_IO
5432RET(16)
5433}
5434
5435// MOVEB
5436OPCODE(0x1EC0)
5437{
5438 u32 adr, res;
5439 u32 src, dst;
5440
5441 res = DREGu8((Opcode >> 0) & 7);
5442 flag_C = 0;
5443 flag_V = 0;
5444 flag_NotZ = res;
5445 flag_N = res;
5446 adr = AREG(7);
5447 AREG(7) += 2;
5448 PRE_IO
5449 WRITE_BYTE_F(adr, res)
5450 POST_IO
5451RET(8)
5452}
5453
5454// MOVEB
5455OPCODE(0x1F00)
5456{
5457 u32 adr, res;
5458 u32 src, dst;
5459
5460 res = DREGu8((Opcode >> 0) & 7);
5461 flag_C = 0;
5462 flag_V = 0;
5463 flag_NotZ = res;
5464 flag_N = res;
5465 adr = AREG(7) - 2;
5466 AREG(7) = adr;
5467 PRE_IO
5468 WRITE_BYTE_F(adr, res)
5469 POST_IO
5470RET(8)
5471}
5472
03e4f2a3 5473#if 0
70357ce5 5474// MOVEB
5475OPCODE(0x1008)
5476{
5477 u32 adr, res;
5478 u32 src, dst;
5479
5480 // can't read byte from Ax registers !
5481 m68kcontext.execinfo |= M68K_FAULTED;
5482 m68kcontext.io_cycle_counter = 0;
5483/*
5484 goto famec_Exec_End;
5485 flag_C = 0;
5486 flag_V = 0;
5487 flag_NotZ = res;
5488 flag_N = res;
5489 DREGu8((Opcode >> 9) & 7) = res;
5490*/
5491RET(4)
5492}
5493
5494// MOVEB
5495OPCODE(0x1088)
5496{
5497 u32 adr, res;
5498 u32 src, dst;
5499
5500 // can't read byte from Ax registers !
5501 m68kcontext.execinfo |= M68K_FAULTED;
5502 m68kcontext.io_cycle_counter = 0;
5503/*
5504 goto famec_Exec_End;
5505 flag_C = 0;
5506 flag_V = 0;
5507 flag_NotZ = res;
5508 flag_N = res;
5509 adr = AREG((Opcode >> 9) & 7);
5510 PRE_IO
5511 WRITE_BYTE_F(adr, res)
5512 POST_IO
5513*/
5514RET(8)
5515}
5516
5517// MOVEB
5518OPCODE(0x10C8)
5519{
5520 u32 adr, res;
5521 u32 src, dst;
5522
5523 // can't read byte from Ax registers !
5524 m68kcontext.execinfo |= M68K_FAULTED;
5525 m68kcontext.io_cycle_counter = 0;
5526/*
5527 goto famec_Exec_End;
5528 flag_C = 0;
5529 flag_V = 0;
5530 flag_NotZ = res;
5531 flag_N = res;
5532 adr = AREG((Opcode >> 9) & 7);
5533 AREG((Opcode >> 9) & 7) += 1;
5534 PRE_IO
5535 WRITE_BYTE_F(adr, res)
5536 POST_IO
5537*/
5538RET(8)
5539}
5540
5541// MOVEB
5542OPCODE(0x1108)
5543{
5544 u32 adr, res;
5545 u32 src, dst;
5546
5547 // can't read byte from Ax registers !
5548 m68kcontext.execinfo |= M68K_FAULTED;
5549 m68kcontext.io_cycle_counter = 0;
5550/*
5551 goto famec_Exec_End;
5552 flag_C = 0;
5553 flag_V = 0;
5554 flag_NotZ = res;
5555 flag_N = res;
5556 adr = AREG((Opcode >> 9) & 7) - 1;
5557 AREG((Opcode >> 9) & 7) = adr;
5558 PRE_IO
5559 WRITE_BYTE_F(adr, res)
5560 POST_IO
5561*/
5562RET(8)
5563}
5564
5565// MOVEB
5566OPCODE(0x1148)
5567{
5568 u32 adr, res;
5569 u32 src, dst;
5570
5571 // can't read byte from Ax registers !
5572 m68kcontext.execinfo |= M68K_FAULTED;
5573 m68kcontext.io_cycle_counter = 0;
5574/*
5575 goto famec_Exec_End;
5576 flag_C = 0;
5577 flag_V = 0;
5578 flag_NotZ = res;
5579 flag_N = res;
5580 FETCH_SWORD(adr);
5581 adr += AREG((Opcode >> 9) & 7);
5582 PRE_IO
5583 WRITE_BYTE_F(adr, res)
5584 POST_IO
5585*/
5586RET(12)
5587}
5588
5589// MOVEB
5590OPCODE(0x1188)
5591{
5592 u32 adr, res;
5593 u32 src, dst;
5594
5595 // can't read byte from Ax registers !
5596 m68kcontext.execinfo |= M68K_FAULTED;
5597 m68kcontext.io_cycle_counter = 0;
5598/*
5599 goto famec_Exec_End;
5600 flag_C = 0;
5601 flag_V = 0;
5602 flag_NotZ = res;
5603 flag_N = res;
5604 adr = AREG((Opcode >> 9) & 7);
5605 DECODE_EXT_WORD
5606 PRE_IO
5607 WRITE_BYTE_F(adr, res)
5608 POST_IO
5609*/
5610RET(14)
5611}
5612
5613// MOVEB
5614OPCODE(0x11C8)
5615{
5616 u32 adr, res;
5617 u32 src, dst;
5618
5619 // can't read byte from Ax registers !
5620 m68kcontext.execinfo |= M68K_FAULTED;
5621 m68kcontext.io_cycle_counter = 0;
5622/*
5623 goto famec_Exec_End;
5624 flag_C = 0;
5625 flag_V = 0;
5626 flag_NotZ = res;
5627 flag_N = res;
5628 FETCH_SWORD(adr);
5629 PRE_IO
5630 WRITE_BYTE_F(adr, res)
5631 POST_IO
5632*/
5633RET(12)
5634}
5635
5636// MOVEB
5637OPCODE(0x13C8)
5638{
5639 u32 adr, res;
5640 u32 src, dst;
5641
5642 // can't read byte from Ax registers !
5643 m68kcontext.execinfo |= M68K_FAULTED;
5644 m68kcontext.io_cycle_counter = 0;
5645/*
5646 goto famec_Exec_End;
5647 flag_C = 0;
5648 flag_V = 0;
5649 flag_NotZ = res;
5650 flag_N = res;
5651 FETCH_LONG(adr);
5652 PRE_IO
5653 WRITE_BYTE_F(adr, res)
5654 POST_IO
5655*/
5656RET(16)
5657}
5658
5659// MOVEB
5660OPCODE(0x1EC8)
5661{
5662 u32 adr, res;
5663 u32 src, dst;
5664
5665 // can't read byte from Ax registers !
5666 m68kcontext.execinfo |= M68K_FAULTED;
5667 m68kcontext.io_cycle_counter = 0;
5668/*
5669 goto famec_Exec_End;
5670 flag_C = 0;
5671 flag_V = 0;
5672 flag_NotZ = res;
5673 flag_N = res;
5674 adr = AREG(7);
5675 AREG(7) += 2;
5676 PRE_IO
5677 WRITE_BYTE_F(adr, res)
5678 POST_IO
5679*/
5680RET(8)
5681}
5682
5683// MOVEB
5684OPCODE(0x1F08)
5685{
5686 u32 adr, res;
5687 u32 src, dst;
5688
5689 // can't read byte from Ax registers !
5690 m68kcontext.execinfo |= M68K_FAULTED;
5691 m68kcontext.io_cycle_counter = 0;
5692/*
5693 goto famec_Exec_End;
5694 flag_C = 0;
5695 flag_V = 0;
5696 flag_NotZ = res;
5697 flag_N = res;
5698 adr = AREG(7) - 2;
5699 AREG(7) = adr;
5700 PRE_IO
5701 WRITE_BYTE_F(adr, res)
5702 POST_IO
5703*/
5704RET(8)
5705}
03e4f2a3 5706#endif
70357ce5 5707
5708// MOVEB
5709OPCODE(0x1010)
5710{
5711 u32 adr, res;
5712 u32 src, dst;
5713
5714 adr = AREG((Opcode >> 0) & 7);
5715 PRE_IO
5716 READ_BYTE_F(adr, res)
5717 flag_C = 0;
5718 flag_V = 0;
5719 flag_NotZ = res;
5720 flag_N = res;
5721 DREGu8((Opcode >> 9) & 7) = res;
5722 POST_IO
5723RET(8)
5724}
5725
5726// MOVEB
5727OPCODE(0x1090)
5728{
5729 u32 adr, res;
5730 u32 src, dst;
5731
5732 adr = AREG((Opcode >> 0) & 7);
5733 PRE_IO
5734 READ_BYTE_F(adr, res)
5735 flag_C = 0;
5736 flag_V = 0;
5737 flag_NotZ = res;
5738 flag_N = res;
5739 adr = AREG((Opcode >> 9) & 7);
5740 WRITE_BYTE_F(adr, res)
5741 POST_IO
5742RET(12)
5743}
5744
5745// MOVEB
5746OPCODE(0x10D0)
5747{
5748 u32 adr, res;
5749 u32 src, dst;
5750
5751 adr = AREG((Opcode >> 0) & 7);
5752 PRE_IO
5753 READ_BYTE_F(adr, res)
5754 flag_C = 0;
5755 flag_V = 0;
5756 flag_NotZ = res;
5757 flag_N = res;
5758 adr = AREG((Opcode >> 9) & 7);
5759 AREG((Opcode >> 9) & 7) += 1;
5760 WRITE_BYTE_F(adr, res)
5761 POST_IO
5762RET(12)
5763}
5764
5765// MOVEB
5766OPCODE(0x1110)
5767{
5768 u32 adr, res;
5769 u32 src, dst;
5770
5771 adr = AREG((Opcode >> 0) & 7);
5772 PRE_IO
5773 READ_BYTE_F(adr, res)
5774 flag_C = 0;
5775 flag_V = 0;
5776 flag_NotZ = res;
5777 flag_N = res;
5778 adr = AREG((Opcode >> 9) & 7) - 1;
5779 AREG((Opcode >> 9) & 7) = adr;
5780 WRITE_BYTE_F(adr, res)
5781 POST_IO
5782RET(12)
5783}
5784
5785// MOVEB
5786OPCODE(0x1150)
5787{
5788 u32 adr, res;
5789 u32 src, dst;
5790
5791 adr = AREG((Opcode >> 0) & 7);
5792 PRE_IO
5793 READ_BYTE_F(adr, res)
5794 flag_C = 0;
5795 flag_V = 0;
5796 flag_NotZ = res;
5797 flag_N = res;
5798 FETCH_SWORD(adr);
5799 adr += AREG((Opcode >> 9) & 7);
5800 WRITE_BYTE_F(adr, res)
5801 POST_IO
5802RET(16)
5803}
5804
5805// MOVEB
5806OPCODE(0x1190)
5807{
5808 u32 adr, res;
5809 u32 src, dst;
5810
5811 adr = AREG((Opcode >> 0) & 7);
5812 PRE_IO
5813 READ_BYTE_F(adr, res)
5814 flag_C = 0;
5815 flag_V = 0;
5816 flag_NotZ = res;
5817 flag_N = res;
5818 adr = AREG((Opcode >> 9) & 7);
5819 DECODE_EXT_WORD
5820 WRITE_BYTE_F(adr, res)
5821 POST_IO
5822RET(18)
5823}
5824
5825// MOVEB
5826OPCODE(0x11D0)
5827{
5828 u32 adr, res;
5829 u32 src, dst;
5830
5831 adr = AREG((Opcode >> 0) & 7);
5832 PRE_IO
5833 READ_BYTE_F(adr, res)
5834 flag_C = 0;
5835 flag_V = 0;
5836 flag_NotZ = res;
5837 flag_N = res;
5838 FETCH_SWORD(adr);
5839 WRITE_BYTE_F(adr, res)
5840 POST_IO
5841RET(16)
5842}
5843
5844// MOVEB
5845OPCODE(0x13D0)
5846{
5847 u32 adr, res;
5848 u32 src, dst;
5849
5850 adr = AREG((Opcode >> 0) & 7);
5851 PRE_IO
5852 READ_BYTE_F(adr, res)
5853 flag_C = 0;
5854 flag_V = 0;
5855 flag_NotZ = res;
5856 flag_N = res;
5857 FETCH_LONG(adr);
5858 WRITE_BYTE_F(adr, res)
5859 POST_IO
5860RET(20)
5861}
5862
5863// MOVEB
5864OPCODE(0x1ED0)
5865{
5866 u32 adr, res;
5867 u32 src, dst;
5868
5869 adr = AREG((Opcode >> 0) & 7);
5870 PRE_IO
5871 READ_BYTE_F(adr, res)
5872 flag_C = 0;
5873 flag_V = 0;
5874 flag_NotZ = res;
5875 flag_N = res;
5876 adr = AREG(7);
5877 AREG(7) += 2;
5878 WRITE_BYTE_F(adr, res)
5879 POST_IO
5880RET(12)
5881}
5882
5883// MOVEB
5884OPCODE(0x1F10)
5885{
5886 u32 adr, res;
5887 u32 src, dst;
5888
5889 adr = AREG((Opcode >> 0) & 7);
5890 PRE_IO
5891 READ_BYTE_F(adr, res)
5892 flag_C = 0;
5893 flag_V = 0;
5894 flag_NotZ = res;
5895 flag_N = res;
5896 adr = AREG(7) - 2;
5897 AREG(7) = adr;
5898 WRITE_BYTE_F(adr, res)
5899 POST_IO
5900RET(12)
5901}
5902
5903// MOVEB
5904OPCODE(0x1018)
5905{
5906 u32 adr, res;
5907 u32 src, dst;
5908
5909 adr = AREG((Opcode >> 0) & 7);
5910 AREG((Opcode >> 0) & 7) += 1;
5911 PRE_IO
5912 READ_BYTE_F(adr, res)
5913 flag_C = 0;
5914 flag_V = 0;
5915 flag_NotZ = res;
5916 flag_N = res;
5917 DREGu8((Opcode >> 9) & 7) = res;
5918 POST_IO
5919RET(8)
5920}
5921
5922// MOVEB
5923OPCODE(0x1098)
5924{
5925 u32 adr, res;
5926 u32 src, dst;
5927
5928 adr = AREG((Opcode >> 0) & 7);
5929 AREG((Opcode >> 0) & 7) += 1;
5930 PRE_IO
5931 READ_BYTE_F(adr, res)
5932 flag_C = 0;
5933 flag_V = 0;
5934 flag_NotZ = res;
5935 flag_N = res;
5936 adr = AREG((Opcode >> 9) & 7);
5937 WRITE_BYTE_F(adr, res)
5938 POST_IO
5939RET(12)
5940}
5941
5942// MOVEB
5943OPCODE(0x10D8)
5944{
5945 u32 adr, res;
5946 u32 src, dst;
5947
5948 adr = AREG((Opcode >> 0) & 7);
5949 AREG((Opcode >> 0) & 7) += 1;
5950 PRE_IO
5951 READ_BYTE_F(adr, res)
5952 flag_C = 0;
5953 flag_V = 0;
5954 flag_NotZ = res;
5955 flag_N = res;
5956 adr = AREG((Opcode >> 9) & 7);
5957 AREG((Opcode >> 9) & 7) += 1;
5958 WRITE_BYTE_F(adr, res)
5959 POST_IO
5960RET(12)
5961}
5962
5963// MOVEB
5964OPCODE(0x1118)
5965{
5966 u32 adr, res;
5967 u32 src, dst;
5968
5969 adr = AREG((Opcode >> 0) & 7);
5970 AREG((Opcode >> 0) & 7) += 1;
5971 PRE_IO
5972 READ_BYTE_F(adr, res)
5973 flag_C = 0;
5974 flag_V = 0;
5975 flag_NotZ = res;
5976 flag_N = res;
5977 adr = AREG((Opcode >> 9) & 7) - 1;
5978 AREG((Opcode >> 9) & 7) = adr;
5979 WRITE_BYTE_F(adr, res)
5980 POST_IO
5981RET(12)
5982}
5983
5984// MOVEB
5985OPCODE(0x1158)
5986{
5987 u32 adr, res;
5988 u32 src, dst;
5989
5990 adr = AREG((Opcode >> 0) & 7);
5991 AREG((Opcode >> 0) & 7) += 1;
5992 PRE_IO
5993 READ_BYTE_F(adr, res)
5994 flag_C = 0;
5995 flag_V = 0;
5996 flag_NotZ = res;
5997 flag_N = res;
5998 FETCH_SWORD(adr);
5999 adr += AREG((Opcode >> 9) & 7);
6000 WRITE_BYTE_F(adr, res)
6001 POST_IO
6002RET(16)
6003}
6004
6005// MOVEB
6006OPCODE(0x1198)
6007{
6008 u32 adr, res;
6009 u32 src, dst;
6010
6011 adr = AREG((Opcode >> 0) & 7);
6012 AREG((Opcode >> 0) & 7) += 1;
6013 PRE_IO
6014 READ_BYTE_F(adr, res)
6015 flag_C = 0;
6016 flag_V = 0;
6017 flag_NotZ = res;
6018 flag_N = res;
6019 adr = AREG((Opcode >> 9) & 7);
6020 DECODE_EXT_WORD
6021 WRITE_BYTE_F(adr, res)
6022 POST_IO
6023RET(18)
6024}
6025
6026// MOVEB
6027OPCODE(0x11D8)
6028{
6029 u32 adr, res;
6030 u32 src, dst;
6031
6032 adr = AREG((Opcode >> 0) & 7);
6033 AREG((Opcode >> 0) & 7) += 1;
6034 PRE_IO
6035 READ_BYTE_F(adr, res)
6036 flag_C = 0;
6037 flag_V = 0;
6038 flag_NotZ = res;
6039 flag_N = res;
6040 FETCH_SWORD(adr);
6041 WRITE_BYTE_F(adr, res)
6042 POST_IO
6043RET(16)
6044}
6045
6046// MOVEB
6047OPCODE(0x13D8)
6048{
6049 u32 adr, res;
6050 u32 src, dst;
6051
6052 adr = AREG((Opcode >> 0) & 7);
6053 AREG((Opcode >> 0) & 7) += 1;
6054 PRE_IO
6055 READ_BYTE_F(adr, res)
6056 flag_C = 0;
6057 flag_V = 0;
6058 flag_NotZ = res;
6059 flag_N = res;
6060 FETCH_LONG(adr);
6061 WRITE_BYTE_F(adr, res)
6062 POST_IO
6063RET(20)
6064}
6065
6066// MOVEB
6067OPCODE(0x1ED8)
6068{
6069 u32 adr, res;
6070 u32 src, dst;
6071
6072 adr = AREG((Opcode >> 0) & 7);
6073 AREG((Opcode >> 0) & 7) += 1;
6074 PRE_IO
6075 READ_BYTE_F(adr, res)
6076 flag_C = 0;
6077 flag_V = 0;
6078 flag_NotZ = res;
6079 flag_N = res;
6080 adr = AREG(7);
6081 AREG(7) += 2;
6082 WRITE_BYTE_F(adr, res)
6083 POST_IO
6084RET(12)
6085}
6086
6087// MOVEB
6088OPCODE(0x1F18)
6089{
6090 u32 adr, res;
6091 u32 src, dst;
6092
6093 adr = AREG((Opcode >> 0) & 7);
6094 AREG((Opcode >> 0) & 7) += 1;
6095 PRE_IO
6096 READ_BYTE_F(adr, res)
6097 flag_C = 0;
6098 flag_V = 0;
6099 flag_NotZ = res;
6100 flag_N = res;
6101 adr = AREG(7) - 2;
6102 AREG(7) = adr;
6103 WRITE_BYTE_F(adr, res)
6104 POST_IO
6105RET(12)
6106}
6107
6108// MOVEB
6109OPCODE(0x1020)
6110{
6111 u32 adr, res;
6112 u32 src, dst;
6113
6114 adr = AREG((Opcode >> 0) & 7) - 1;
6115 AREG((Opcode >> 0) & 7) = adr;
6116 PRE_IO
6117 READ_BYTE_F(adr, res)
6118 flag_C = 0;
6119 flag_V = 0;
6120 flag_NotZ = res;
6121 flag_N = res;
6122 DREGu8((Opcode >> 9) & 7) = res;
6123 POST_IO
6124RET(10)
6125}
6126
6127// MOVEB
6128OPCODE(0x10A0)
6129{
6130 u32 adr, res;
6131 u32 src, dst;
6132
6133 adr = AREG((Opcode >> 0) & 7) - 1;
6134 AREG((Opcode >> 0) & 7) = adr;
6135 PRE_IO
6136 READ_BYTE_F(adr, res)
6137 flag_C = 0;
6138 flag_V = 0;
6139 flag_NotZ = res;
6140 flag_N = res;
6141 adr = AREG((Opcode >> 9) & 7);
6142 WRITE_BYTE_F(adr, res)
6143 POST_IO
6144RET(14)
6145}
6146
6147// MOVEB
6148OPCODE(0x10E0)
6149{
6150 u32 adr, res;
6151 u32 src, dst;
6152
6153 adr = AREG((Opcode >> 0) & 7) - 1;
6154 AREG((Opcode >> 0) & 7) = adr;
6155 PRE_IO
6156 READ_BYTE_F(adr, res)
6157 flag_C = 0;
6158 flag_V = 0;
6159 flag_NotZ = res;
6160 flag_N = res;
6161 adr = AREG((Opcode >> 9) & 7);
6162 AREG((Opcode >> 9) & 7) += 1;
6163 WRITE_BYTE_F(adr, res)
6164 POST_IO
6165RET(14)
6166}
6167
6168// MOVEB
6169OPCODE(0x1120)
6170{
6171 u32 adr, res;
6172 u32 src, dst;
6173
6174 adr = AREG((Opcode >> 0) & 7) - 1;
6175 AREG((Opcode >> 0) & 7) = adr;
6176 PRE_IO
6177 READ_BYTE_F(adr, res)
6178 flag_C = 0;
6179 flag_V = 0;
6180 flag_NotZ = res;
6181 flag_N = res;
6182 adr = AREG((Opcode >> 9) & 7) - 1;
6183 AREG((Opcode >> 9) & 7) = adr;
6184 WRITE_BYTE_F(adr, res)
6185 POST_IO
6186RET(14)
6187}
6188
6189// MOVEB
6190OPCODE(0x1160)
6191{
6192 u32 adr, res;
6193 u32 src, dst;
6194
6195 adr = AREG((Opcode >> 0) & 7) - 1;
6196 AREG((Opcode >> 0) & 7) = adr;
6197 PRE_IO
6198 READ_BYTE_F(adr, res)
6199 flag_C = 0;
6200 flag_V = 0;
6201 flag_NotZ = res;
6202 flag_N = res;
6203 FETCH_SWORD(adr);
6204 adr += AREG((Opcode >> 9) & 7);
6205 WRITE_BYTE_F(adr, res)
6206 POST_IO
6207RET(18)
6208}
6209
6210// MOVEB
6211OPCODE(0x11A0)
6212{
6213 u32 adr, res;
6214 u32 src, dst;
6215
6216 adr = AREG((Opcode >> 0) & 7) - 1;
6217 AREG((Opcode >> 0) & 7) = adr;
6218 PRE_IO
6219 READ_BYTE_F(adr, res)
6220 flag_C = 0;
6221 flag_V = 0;
6222 flag_NotZ = res;
6223 flag_N = res;
6224 adr = AREG((Opcode >> 9) & 7);
6225 DECODE_EXT_WORD
6226 WRITE_BYTE_F(adr, res)
6227 POST_IO
6228RET(20)
6229}
6230
6231// MOVEB
6232OPCODE(0x11E0)
6233{
6234 u32 adr, res;
6235 u32 src, dst;
6236
6237 adr = AREG((Opcode >> 0) & 7) - 1;
6238 AREG((Opcode >> 0) & 7) = adr;
6239 PRE_IO
6240 READ_BYTE_F(adr, res)
6241 flag_C = 0;
6242 flag_V = 0;
6243 flag_NotZ = res;
6244 flag_N = res;
6245 FETCH_SWORD(adr);
6246 WRITE_BYTE_F(adr, res)
6247 POST_IO
6248RET(18)
6249}
6250
6251// MOVEB
6252OPCODE(0x13E0)
6253{
6254 u32 adr, res;
6255 u32 src, dst;
6256
6257 adr = AREG((Opcode >> 0) & 7) - 1;
6258 AREG((Opcode >> 0) & 7) = adr;
6259 PRE_IO
6260 READ_BYTE_F(adr, res)
6261 flag_C = 0;
6262 flag_V = 0;
6263 flag_NotZ = res;
6264 flag_N = res;
6265 FETCH_LONG(adr);
6266 WRITE_BYTE_F(adr, res)
6267 POST_IO
6268RET(22)
6269}
6270
6271// MOVEB
6272OPCODE(0x1EE0)
6273{
6274 u32 adr, res;
6275 u32 src, dst;
6276
6277 adr = AREG((Opcode >> 0) & 7) - 1;
6278 AREG((Opcode >> 0) & 7) = adr;
6279 PRE_IO
6280 READ_BYTE_F(adr, res)
6281 flag_C = 0;
6282 flag_V = 0;
6283 flag_NotZ = res;
6284 flag_N = res;
6285 adr = AREG(7);
6286 AREG(7) += 2;
6287 WRITE_BYTE_F(adr, res)
6288 POST_IO
6289RET(14)
6290}
6291
6292// MOVEB
6293OPCODE(0x1F20)
6294{
6295 u32 adr, res;
6296 u32 src, dst;
6297
6298 adr = AREG((Opcode >> 0) & 7) - 1;
6299 AREG((Opcode >> 0) & 7) = adr;
6300 PRE_IO
6301 READ_BYTE_F(adr, res)
6302 flag_C = 0;
6303 flag_V = 0;
6304 flag_NotZ = res;
6305 flag_N = res;
6306 adr = AREG(7) - 2;
6307 AREG(7) = adr;
6308 WRITE_BYTE_F(adr, res)
6309 POST_IO
6310RET(14)
6311}
6312
6313// MOVEB
6314OPCODE(0x1028)
6315{
6316 u32 adr, res;
6317 u32 src, dst;
6318
6319 FETCH_SWORD(adr);
6320 adr += AREG((Opcode >> 0) & 7);
6321 PRE_IO
6322 READ_BYTE_F(adr, res)
6323 flag_C = 0;
6324 flag_V = 0;
6325 flag_NotZ = res;
6326 flag_N = res;
6327 DREGu8((Opcode >> 9) & 7) = res;
6328 POST_IO
6329RET(12)
6330}
6331
6332// MOVEB
6333OPCODE(0x10A8)
6334{
6335 u32 adr, res;
6336 u32 src, dst;
6337
6338 FETCH_SWORD(adr);
6339 adr += AREG((Opcode >> 0) & 7);
6340 PRE_IO
6341 READ_BYTE_F(adr, res)
6342 flag_C = 0;
6343 flag_V = 0;
6344 flag_NotZ = res;
6345 flag_N = res;
6346 adr = AREG((Opcode >> 9) & 7);
6347 WRITE_BYTE_F(adr, res)
6348 POST_IO
6349RET(16)
6350}
6351
6352// MOVEB
6353OPCODE(0x10E8)
6354{
6355 u32 adr, res;
6356 u32 src, dst;
6357
6358 FETCH_SWORD(adr);
6359 adr += AREG((Opcode >> 0) & 7);
6360 PRE_IO
6361 READ_BYTE_F(adr, res)
6362 flag_C = 0;
6363 flag_V = 0;
6364 flag_NotZ = res;
6365 flag_N = res;
6366 adr = AREG((Opcode >> 9) & 7);
6367 AREG((Opcode >> 9) & 7) += 1;
6368 WRITE_BYTE_F(adr, res)
6369 POST_IO
6370RET(16)
6371}
6372
6373// MOVEB
6374OPCODE(0x1128)
6375{
6376 u32 adr, res;
6377 u32 src, dst;
6378
6379 FETCH_SWORD(adr);
6380 adr += AREG((Opcode >> 0) & 7);
6381 PRE_IO
6382 READ_BYTE_F(adr, res)
6383 flag_C = 0;
6384 flag_V = 0;
6385 flag_NotZ = res;
6386 flag_N = res;
6387 adr = AREG((Opcode >> 9) & 7) - 1;
6388 AREG((Opcode >> 9) & 7) = adr;
6389 WRITE_BYTE_F(adr, res)
6390 POST_IO
6391RET(16)
6392}
6393
6394// MOVEB
6395OPCODE(0x1168)
6396{
6397 u32 adr, res;
6398 u32 src, dst;
6399
6400 FETCH_SWORD(adr);
6401 adr += AREG((Opcode >> 0) & 7);
6402 PRE_IO
6403 READ_BYTE_F(adr, res)
6404 flag_C = 0;
6405 flag_V = 0;
6406 flag_NotZ = res;
6407 flag_N = res;
6408 FETCH_SWORD(adr);
6409 adr += AREG((Opcode >> 9) & 7);
6410 WRITE_BYTE_F(adr, res)
6411 POST_IO
6412RET(20)
6413}
6414
6415// MOVEB
6416OPCODE(0x11A8)
6417{
6418 u32 adr, res;
6419 u32 src, dst;
6420
6421 FETCH_SWORD(adr);
6422 adr += AREG((Opcode >> 0) & 7);
6423 PRE_IO
6424 READ_BYTE_F(adr, res)
6425 flag_C = 0;
6426 flag_V = 0;
6427 flag_NotZ = res;
6428 flag_N = res;
6429 adr = AREG((Opcode >> 9) & 7);
6430 DECODE_EXT_WORD
6431 WRITE_BYTE_F(adr, res)
6432 POST_IO
6433RET(22)
6434}
6435
6436// MOVEB
6437OPCODE(0x11E8)
6438{
6439 u32 adr, res;
6440 u32 src, dst;
6441
6442 FETCH_SWORD(adr);
6443 adr += AREG((Opcode >> 0) & 7);
6444 PRE_IO
6445 READ_BYTE_F(adr, res)
6446 flag_C = 0;
6447 flag_V = 0;
6448 flag_NotZ = res;
6449 flag_N = res;
6450 FETCH_SWORD(adr);
6451 WRITE_BYTE_F(adr, res)
6452 POST_IO
6453RET(20)
6454}
6455
6456// MOVEB
6457OPCODE(0x13E8)
6458{
6459 u32 adr, res;
6460 u32 src, dst;
6461
6462 FETCH_SWORD(adr);
6463 adr += AREG((Opcode >> 0) & 7);
6464 PRE_IO
6465 READ_BYTE_F(adr, res)
6466 flag_C = 0;
6467 flag_V = 0;
6468 flag_NotZ = res;
6469 flag_N = res;
6470 FETCH_LONG(adr);
6471 WRITE_BYTE_F(adr, res)
6472 POST_IO
6473RET(24)
6474}
6475
6476// MOVEB
6477OPCODE(0x1EE8)
6478{
6479 u32 adr, res;
6480 u32 src, dst;
6481
6482 FETCH_SWORD(adr);
6483 adr += AREG((Opcode >> 0) & 7);
6484 PRE_IO
6485 READ_BYTE_F(adr, res)
6486 flag_C = 0;
6487 flag_V = 0;
6488 flag_NotZ = res;
6489 flag_N = res;
6490 adr = AREG(7);
6491 AREG(7) += 2;
6492 WRITE_BYTE_F(adr, res)
6493 POST_IO
6494RET(16)
6495}
6496
6497// MOVEB
6498OPCODE(0x1F28)
6499{
6500 u32 adr, res;
6501 u32 src, dst;
6502
6503 FETCH_SWORD(adr);
6504 adr += AREG((Opcode >> 0) & 7);
6505 PRE_IO
6506 READ_BYTE_F(adr, res)
6507 flag_C = 0;
6508 flag_V = 0;
6509 flag_NotZ = res;
6510 flag_N = res;
6511 adr = AREG(7) - 2;
6512 AREG(7) = adr;
6513 WRITE_BYTE_F(adr, res)
6514 POST_IO
6515RET(16)
6516}
6517
6518// MOVEB
6519OPCODE(0x1030)
6520{
6521 u32 adr, res;
6522 u32 src, dst;
6523
6524 adr = AREG((Opcode >> 0) & 7);
6525 DECODE_EXT_WORD
6526 PRE_IO
6527 READ_BYTE_F(adr, res)
6528 flag_C = 0;
6529 flag_V = 0;
6530 flag_NotZ = res;
6531 flag_N = res;
6532 DREGu8((Opcode >> 9) & 7) = res;
6533 POST_IO
6534RET(14)
6535}
6536
6537// MOVEB
6538OPCODE(0x10B0)
6539{
6540 u32 adr, res;
6541 u32 src, dst;
6542
6543 adr = AREG((Opcode >> 0) & 7);
6544 DECODE_EXT_WORD
6545 PRE_IO
6546 READ_BYTE_F(adr, res)
6547 flag_C = 0;
6548 flag_V = 0;
6549 flag_NotZ = res;
6550 flag_N = res;
6551 adr = AREG((Opcode >> 9) & 7);
6552 WRITE_BYTE_F(adr, res)
6553 POST_IO
6554RET(18)
6555}
6556
6557// MOVEB
6558OPCODE(0x10F0)
6559{
6560 u32 adr, res;
6561 u32 src, dst;
6562
6563 adr = AREG((Opcode >> 0) & 7);
6564 DECODE_EXT_WORD
6565 PRE_IO
6566 READ_BYTE_F(adr, res)
6567 flag_C = 0;
6568 flag_V = 0;
6569 flag_NotZ = res;
6570 flag_N = res;
6571 adr = AREG((Opcode >> 9) & 7);
6572 AREG((Opcode >> 9) & 7) += 1;
6573 WRITE_BYTE_F(adr, res)
6574 POST_IO
6575RET(18)
6576}
6577
6578// MOVEB
6579OPCODE(0x1130)
6580{
6581 u32 adr, res;
6582 u32 src, dst;
6583
6584 adr = AREG((Opcode >> 0) & 7);
6585 DECODE_EXT_WORD
6586 PRE_IO
6587 READ_BYTE_F(adr, res)
6588 flag_C = 0;
6589 flag_V = 0;
6590 flag_NotZ = res;
6591 flag_N = res;
6592 adr = AREG((Opcode >> 9) & 7) - 1;
6593 AREG((Opcode >> 9) & 7) = adr;
6594 WRITE_BYTE_F(adr, res)
6595 POST_IO
6596RET(18)
6597}
6598
6599// MOVEB
6600OPCODE(0x1170)
6601{
6602 u32 adr, res;
6603 u32 src, dst;
6604
6605 adr = AREG((Opcode >> 0) & 7);
6606 DECODE_EXT_WORD
6607 PRE_IO
6608 READ_BYTE_F(adr, res)
6609 flag_C = 0;
6610 flag_V = 0;
6611 flag_NotZ = res;
6612 flag_N = res;
6613 FETCH_SWORD(adr);
6614 adr += AREG((Opcode >> 9) & 7);
6615 WRITE_BYTE_F(adr, res)
6616 POST_IO
6617RET(22)
6618}
6619
6620// MOVEB
6621OPCODE(0x11B0)
6622{
6623 u32 adr, res;
6624 u32 src, dst;
6625
6626 adr = AREG((Opcode >> 0) & 7);
6627 DECODE_EXT_WORD
6628 PRE_IO
6629 READ_BYTE_F(adr, res)
6630 flag_C = 0;
6631 flag_V = 0;
6632 flag_NotZ = res;
6633 flag_N = res;
6634 adr = AREG((Opcode >> 9) & 7);
6635 DECODE_EXT_WORD
6636 WRITE_BYTE_F(adr, res)
6637 POST_IO
6638RET(24)
6639}
6640
6641// MOVEB
6642OPCODE(0x11F0)
6643{
6644 u32 adr, res;
6645 u32 src, dst;
6646
6647 adr = AREG((Opcode >> 0) & 7);
6648 DECODE_EXT_WORD
6649 PRE_IO
6650 READ_BYTE_F(adr, res)
6651 flag_C = 0;
6652 flag_V = 0;
6653 flag_NotZ = res;
6654 flag_N = res;
6655 FETCH_SWORD(adr);
6656 WRITE_BYTE_F(adr, res)
6657 POST_IO
6658RET(22)
6659}
6660
6661// MOVEB
6662OPCODE(0x13F0)
6663{
6664 u32 adr, res;
6665 u32 src, dst;
6666
6667 adr = AREG((Opcode >> 0) & 7);
6668 DECODE_EXT_WORD
6669 PRE_IO
6670 READ_BYTE_F(adr, res)
6671 flag_C = 0;
6672 flag_V = 0;
6673 flag_NotZ = res;
6674 flag_N = res;
6675 FETCH_LONG(adr);
6676 WRITE_BYTE_F(adr, res)
6677 POST_IO
6678RET(26)
6679}
6680
6681// MOVEB
6682OPCODE(0x1EF0)
6683{
6684 u32 adr, res;
6685 u32 src, dst;
6686
6687 adr = AREG((Opcode >> 0) & 7);
6688 DECODE_EXT_WORD
6689 PRE_IO
6690 READ_BYTE_F(adr, res)
6691 flag_C = 0;
6692 flag_V = 0;
6693 flag_NotZ = res;
6694 flag_N = res;
6695 adr = AREG(7);
6696 AREG(7) += 2;
6697 WRITE_BYTE_F(adr, res)
6698 POST_IO
6699RET(18)
6700}
6701
6702// MOVEB
6703OPCODE(0x1F30)
6704{
6705 u32 adr, res;
6706 u32 src, dst;
6707
6708 adr = AREG((Opcode >> 0) & 7);
6709 DECODE_EXT_WORD
6710 PRE_IO
6711 READ_BYTE_F(adr, res)
6712 flag_C = 0;
6713 flag_V = 0;
6714 flag_NotZ = res;
6715 flag_N = res;
6716 adr = AREG(7) - 2;
6717 AREG(7) = adr;
6718 WRITE_BYTE_F(adr, res)
6719 POST_IO
6720RET(18)
6721}
6722
6723// MOVEB
6724OPCODE(0x1038)
6725{
6726 u32 adr, res;
6727 u32 src, dst;
6728
6729 FETCH_SWORD(adr);
6730 PRE_IO
6731 READ_BYTE_F(adr, res)
6732 flag_C = 0;
6733 flag_V = 0;
6734 flag_NotZ = res;
6735 flag_N = res;
6736 DREGu8((Opcode >> 9) & 7) = res;
6737 POST_IO
6738RET(12)
6739}
6740
6741// MOVEB
6742OPCODE(0x10B8)
6743{
6744 u32 adr, res;
6745 u32 src, dst;
6746
6747 FETCH_SWORD(adr);
6748 PRE_IO
6749 READ_BYTE_F(adr, res)
6750 flag_C = 0;
6751 flag_V = 0;
6752 flag_NotZ = res;
6753 flag_N = res;
6754 adr = AREG((Opcode >> 9) & 7);
6755 WRITE_BYTE_F(adr, res)
6756 POST_IO
6757RET(16)
6758}
6759
6760// MOVEB
6761OPCODE(0x10F8)
6762{
6763 u32 adr, res;
6764 u32 src, dst;
6765
6766 FETCH_SWORD(adr);
6767 PRE_IO
6768 READ_BYTE_F(adr, res)
6769 flag_C = 0;
6770 flag_V = 0;
6771 flag_NotZ = res;
6772 flag_N = res;
6773 adr = AREG((Opcode >> 9) & 7);
6774 AREG((Opcode >> 9) & 7) += 1;
6775 WRITE_BYTE_F(adr, res)
6776 POST_IO
6777RET(16)
6778}
6779
6780// MOVEB
6781OPCODE(0x1138)
6782{
6783 u32 adr, res;
6784 u32 src, dst;
6785
6786 FETCH_SWORD(adr);
6787 PRE_IO
6788 READ_BYTE_F(adr, res)
6789 flag_C = 0;
6790 flag_V = 0;
6791 flag_NotZ = res;
6792 flag_N = res;
6793 adr = AREG((Opcode >> 9) & 7) - 1;
6794 AREG((Opcode >> 9) & 7) = adr;
6795 WRITE_BYTE_F(adr, res)
6796 POST_IO
6797RET(16)
6798}
6799
6800// MOVEB
6801OPCODE(0x1178)
6802{
6803 u32 adr, res;
6804 u32 src, dst;
6805
6806 FETCH_SWORD(adr);
6807 PRE_IO
6808 READ_BYTE_F(adr, res)
6809 flag_C = 0;
6810 flag_V = 0;
6811 flag_NotZ = res;
6812 flag_N = res;
6813 FETCH_SWORD(adr);
6814 adr += AREG((Opcode >> 9) & 7);
6815 WRITE_BYTE_F(adr, res)
6816 POST_IO
6817RET(20)
6818}
6819
6820// MOVEB
6821OPCODE(0x11B8)
6822{
6823 u32 adr, res;
6824 u32 src, dst;
6825
6826 FETCH_SWORD(adr);
6827 PRE_IO
6828 READ_BYTE_F(adr, res)
6829 flag_C = 0;
6830 flag_V = 0;
6831 flag_NotZ = res;
6832 flag_N = res;
6833 adr = AREG((Opcode >> 9) & 7);
6834 DECODE_EXT_WORD
6835 WRITE_BYTE_F(adr, res)
6836 POST_IO
6837RET(22)
6838}
6839
6840// MOVEB
6841OPCODE(0x11F8)
6842{
6843 u32 adr, res;
6844 u32 src, dst;
6845
6846 FETCH_SWORD(adr);
6847 PRE_IO
6848 READ_BYTE_F(adr, res)
6849 flag_C = 0;
6850 flag_V = 0;
6851 flag_NotZ = res;
6852 flag_N = res;
6853 FETCH_SWORD(adr);
6854 WRITE_BYTE_F(adr, res)
6855 POST_IO
6856RET(20)
6857}
6858
6859// MOVEB
6860OPCODE(0x13F8)
6861{
6862 u32 adr, res;
6863 u32 src, dst;
6864
6865 FETCH_SWORD(adr);
6866 PRE_IO
6867 READ_BYTE_F(adr, res)
6868 flag_C = 0;
6869 flag_V = 0;
6870 flag_NotZ = res;
6871 flag_N = res;
6872 FETCH_LONG(adr);
6873 WRITE_BYTE_F(adr, res)
6874 POST_IO
6875RET(24)
6876}
6877
6878// MOVEB
6879OPCODE(0x1EF8)
6880{
6881 u32 adr, res;
6882 u32 src, dst;
6883
6884 FETCH_SWORD(adr);
6885 PRE_IO
6886 READ_BYTE_F(adr, res)
6887 flag_C = 0;
6888 flag_V = 0;
6889 flag_NotZ = res;
6890 flag_N = res;
6891 adr = AREG(7);
6892 AREG(7) += 2;
6893 WRITE_BYTE_F(adr, res)
6894 POST_IO
6895RET(16)
6896}
6897
6898// MOVEB
6899OPCODE(0x1F38)
6900{
6901 u32 adr, res;
6902 u32 src, dst;
6903
6904 FETCH_SWORD(adr);
6905 PRE_IO
6906 READ_BYTE_F(adr, res)
6907 flag_C = 0;
6908 flag_V = 0;
6909 flag_NotZ = res;
6910 flag_N = res;
6911 adr = AREG(7) - 2;
6912 AREG(7) = adr;
6913 WRITE_BYTE_F(adr, res)
6914 POST_IO
6915RET(16)
6916}
6917
6918// MOVEB
6919OPCODE(0x1039)
6920{
6921 u32 adr, res;
6922 u32 src, dst;
6923
6924 FETCH_LONG(adr);
6925 PRE_IO
6926 READ_BYTE_F(adr, res)
6927 flag_C = 0;
6928 flag_V = 0;
6929 flag_NotZ = res;
6930 flag_N = res;
6931 DREGu8((Opcode >> 9) & 7) = res;
6932 POST_IO
6933RET(16)
6934}
6935
6936// MOVEB
6937OPCODE(0x10B9)
6938{
6939 u32 adr, res;
6940 u32 src, dst;
6941
6942 FETCH_LONG(adr);
6943 PRE_IO
6944 READ_BYTE_F(adr, res)
6945 flag_C = 0;
6946 flag_V = 0;
6947 flag_NotZ = res;
6948 flag_N = res;
6949 adr = AREG((Opcode >> 9) & 7);
6950 WRITE_BYTE_F(adr, res)
6951 POST_IO
6952RET(20)
6953}
6954
6955// MOVEB
6956OPCODE(0x10F9)
6957{
6958 u32 adr, res;
6959 u32 src, dst;
6960
6961 FETCH_LONG(adr);
6962 PRE_IO
6963 READ_BYTE_F(adr, res)
6964 flag_C = 0;
6965 flag_V = 0;
6966 flag_NotZ = res;
6967 flag_N = res;
6968 adr = AREG((Opcode >> 9) & 7);
6969 AREG((Opcode >> 9) & 7) += 1;
6970 WRITE_BYTE_F(adr, res)
6971 POST_IO
6972RET(20)
6973}
6974
6975// MOVEB
6976OPCODE(0x1139)
6977{
6978 u32 adr, res;
6979 u32 src, dst;
6980
6981 FETCH_LONG(adr);
6982 PRE_IO
6983 READ_BYTE_F(adr, res)
6984 flag_C = 0;
6985 flag_V = 0;
6986 flag_NotZ = res;
6987 flag_N = res;
6988 adr = AREG((Opcode >> 9) & 7) - 1;
6989 AREG((Opcode >> 9) & 7) = adr;
6990 WRITE_BYTE_F(adr, res)
6991 POST_IO
6992RET(20)
6993}
6994
6995// MOVEB
6996OPCODE(0x1179)
6997{
6998 u32 adr, res;
6999 u32 src, dst;
7000
7001 FETCH_LONG(adr);
7002 PRE_IO
7003 READ_BYTE_F(adr, res)
7004 flag_C = 0;
7005 flag_V = 0;
7006 flag_NotZ = res;
7007 flag_N = res;
7008 FETCH_SWORD(adr);
7009 adr += AREG((Opcode >> 9) & 7);
7010 WRITE_BYTE_F(adr, res)
7011 POST_IO
7012RET(24)
7013}
7014
7015// MOVEB
7016OPCODE(0x11B9)
7017{
7018 u32 adr, res;
7019 u32 src, dst;
7020
7021 FETCH_LONG(adr);
7022 PRE_IO
7023 READ_BYTE_F(adr, res)
7024 flag_C = 0;
7025 flag_V = 0;
7026 flag_NotZ = res;
7027 flag_N = res;
7028 adr = AREG((Opcode >> 9) & 7);
7029 DECODE_EXT_WORD
7030 WRITE_BYTE_F(adr, res)
7031 POST_IO
7032RET(26)
7033}
7034
7035// MOVEB
7036OPCODE(0x11F9)
7037{
7038 u32 adr, res;
7039 u32 src, dst;
7040
7041 FETCH_LONG(adr);
7042 PRE_IO
7043 READ_BYTE_F(adr, res)
7044 flag_C = 0;
7045 flag_V = 0;
7046 flag_NotZ = res;
7047 flag_N = res;
7048 FETCH_SWORD(adr);
7049 WRITE_BYTE_F(adr, res)
7050 POST_IO
7051RET(24)
7052}
7053
7054// MOVEB
7055OPCODE(0x13F9)
7056{
7057 u32 adr, res;
7058 u32 src, dst;
7059
7060 FETCH_LONG(adr);
7061 PRE_IO
7062 READ_BYTE_F(adr, res)
7063 flag_C = 0;
7064 flag_V = 0;
7065 flag_NotZ = res;
7066 flag_N = res;
7067 FETCH_LONG(adr);
7068 WRITE_BYTE_F(adr, res)
7069 POST_IO
7070RET(28)
7071}
7072
7073// MOVEB
7074OPCODE(0x1EF9)
7075{
7076 u32 adr, res;
7077 u32 src, dst;
7078
7079 FETCH_LONG(adr);
7080 PRE_IO
7081 READ_BYTE_F(adr, res)
7082 flag_C = 0;
7083 flag_V = 0;
7084 flag_NotZ = res;
7085 flag_N = res;
7086 adr = AREG(7);
7087 AREG(7) += 2;
7088 WRITE_BYTE_F(adr, res)
7089 POST_IO
7090RET(20)
7091}
7092
7093// MOVEB
7094OPCODE(0x1F39)
7095{
7096 u32 adr, res;
7097 u32 src, dst;
7098
7099 FETCH_LONG(adr);
7100 PRE_IO
7101 READ_BYTE_F(adr, res)
7102 flag_C = 0;
7103 flag_V = 0;
7104 flag_NotZ = res;
7105 flag_N = res;
7106 adr = AREG(7) - 2;
7107 AREG(7) = adr;
7108 WRITE_BYTE_F(adr, res)
7109 POST_IO
7110RET(20)
7111}
7112
7113// MOVEB
7114OPCODE(0x103A)
7115{
7116 u32 adr, res;
7117 u32 src, dst;
7118
be26eb23 7119 adr = GET_SWORD + GET_PC;
70357ce5 7120 PC++;
7121 PRE_IO
7122 READ_BYTE_F(adr, res)
7123 flag_C = 0;
7124 flag_V = 0;
7125 flag_NotZ = res;
7126 flag_N = res;
7127 DREGu8((Opcode >> 9) & 7) = res;
7128 POST_IO
7129RET(12)
7130}
7131
7132// MOVEB
7133OPCODE(0x10BA)
7134{
7135 u32 adr, res;
7136 u32 src, dst;
7137
be26eb23 7138 adr = GET_SWORD + GET_PC;
70357ce5 7139 PC++;
7140 PRE_IO
7141 READ_BYTE_F(adr, res)
7142 flag_C = 0;
7143 flag_V = 0;
7144 flag_NotZ = res;
7145 flag_N = res;
7146 adr = AREG((Opcode >> 9) & 7);
7147 WRITE_BYTE_F(adr, res)
7148 POST_IO
7149RET(16)
7150}
7151
7152// MOVEB
7153OPCODE(0x10FA)
7154{
7155 u32 adr, res;
7156 u32 src, dst;
7157
be26eb23 7158 adr = GET_SWORD + GET_PC;
70357ce5 7159 PC++;
7160 PRE_IO
7161 READ_BYTE_F(adr, res)
7162 flag_C = 0;
7163 flag_V = 0;
7164 flag_NotZ = res;
7165 flag_N = res;
7166 adr = AREG((Opcode >> 9) & 7);
7167 AREG((Opcode >> 9) & 7) += 1;
7168 WRITE_BYTE_F(adr, res)
7169 POST_IO
7170RET(16)
7171}
7172
7173// MOVEB
7174OPCODE(0x113A)
7175{
7176 u32 adr, res;
7177 u32 src, dst;
7178
be26eb23 7179 adr = GET_SWORD + GET_PC;
70357ce5 7180 PC++;
7181 PRE_IO
7182 READ_BYTE_F(adr, res)
7183 flag_C = 0;
7184 flag_V = 0;
7185 flag_NotZ = res;
7186 flag_N = res;
7187 adr = AREG((Opcode >> 9) & 7) - 1;
7188 AREG((Opcode >> 9) & 7) = adr;
7189 WRITE_BYTE_F(adr, res)
7190 POST_IO
7191RET(16)
7192}
7193
7194// MOVEB
7195OPCODE(0x117A)
7196{
7197 u32 adr, res;
7198 u32 src, dst;
7199
be26eb23 7200 adr = GET_SWORD + GET_PC;
70357ce5 7201 PC++;
7202 PRE_IO
7203 READ_BYTE_F(adr, res)
7204 flag_C = 0;
7205 flag_V = 0;
7206 flag_NotZ = res;
7207 flag_N = res;
7208 FETCH_SWORD(adr);
7209 adr += AREG((Opcode >> 9) & 7);
7210 WRITE_BYTE_F(adr, res)
7211 POST_IO
7212RET(20)
7213}
7214
7215// MOVEB
7216OPCODE(0x11BA)
7217{
7218 u32 adr, res;
7219 u32 src, dst;
7220
be26eb23 7221 adr = GET_SWORD + GET_PC;
70357ce5 7222 PC++;
7223 PRE_IO
7224 READ_BYTE_F(adr, res)
7225 flag_C = 0;
7226 flag_V = 0;
7227 flag_NotZ = res;
7228 flag_N = res;
7229 adr = AREG((Opcode >> 9) & 7);
7230 DECODE_EXT_WORD
7231 WRITE_BYTE_F(adr, res)
7232 POST_IO
7233RET(22)
7234}
7235
7236// MOVEB
7237OPCODE(0x11FA)
7238{
7239 u32 adr, res;
7240 u32 src, dst;
7241
be26eb23 7242 adr = GET_SWORD + GET_PC;
70357ce5 7243 PC++;
7244 PRE_IO
7245 READ_BYTE_F(adr, res)
7246 flag_C = 0;
7247 flag_V = 0;
7248 flag_NotZ = res;
7249 flag_N = res;
7250 FETCH_SWORD(adr);
7251 WRITE_BYTE_F(adr, res)
7252 POST_IO
7253RET(20)
7254}
7255
7256// MOVEB
7257OPCODE(0x13FA)
7258{
7259 u32 adr, res;
7260 u32 src, dst;
7261
be26eb23 7262 adr = GET_SWORD + GET_PC;
70357ce5 7263 PC++;
7264 PRE_IO
7265 READ_BYTE_F(adr, res)
7266 flag_C = 0;
7267 flag_V = 0;
7268 flag_NotZ = res;
7269 flag_N = res;
7270 FETCH_LONG(adr);
7271 WRITE_BYTE_F(adr, res)
7272 POST_IO
7273RET(24)
7274}
7275
7276// MOVEB
7277OPCODE(0x1EFA)
7278{
7279 u32 adr, res;
7280 u32 src, dst;
7281
be26eb23 7282 adr = GET_SWORD + GET_PC;
70357ce5 7283 PC++;
7284 PRE_IO
7285 READ_BYTE_F(adr, res)
7286 flag_C = 0;
7287 flag_V = 0;
7288 flag_NotZ = res;
7289 flag_N = res;
7290 adr = AREG(7);
7291 AREG(7) += 2;
7292 WRITE_BYTE_F(adr, res)
7293 POST_IO
7294RET(16)
7295}
7296
7297// MOVEB
7298OPCODE(0x1F3A)
7299{
7300 u32 adr, res;
7301 u32 src, dst;
7302
be26eb23 7303 adr = GET_SWORD + GET_PC;
70357ce5 7304 PC++;
7305 PRE_IO
7306 READ_BYTE_F(adr, res)
7307 flag_C = 0;
7308 flag_V = 0;
7309 flag_NotZ = res;
7310 flag_N = res;
7311 adr = AREG(7) - 2;
7312 AREG(7) = adr;
7313 WRITE_BYTE_F(adr, res)
7314 POST_IO
7315RET(16)
7316}
7317
7318// MOVEB
7319OPCODE(0x103B)
7320{
7321 u32 adr, res;
7322 u32 src, dst;
7323
be26eb23 7324 adr = (uptr)(PC) - BasePC;
70357ce5 7325 DECODE_EXT_WORD
7326 PRE_IO
7327 READ_BYTE_F(adr, res)
7328 flag_C = 0;
7329 flag_V = 0;
7330 flag_NotZ = res;
7331 flag_N = res;
7332 DREGu8((Opcode >> 9) & 7) = res;
7333 POST_IO
7334RET(14)
7335}
7336
7337// MOVEB
7338OPCODE(0x10BB)
7339{
7340 u32 adr, res;
7341 u32 src, dst;
7342
be26eb23 7343 adr = (uptr)(PC) - BasePC;
70357ce5 7344 DECODE_EXT_WORD
7345 PRE_IO
7346 READ_BYTE_F(adr, res)
7347 flag_C = 0;
7348 flag_V = 0;
7349 flag_NotZ = res;
7350 flag_N = res;
7351 adr = AREG((Opcode >> 9) & 7);
7352 WRITE_BYTE_F(adr, res)
7353 POST_IO
7354RET(18)
7355}
7356
7357// MOVEB
7358OPCODE(0x10FB)
7359{
7360 u32 adr, res;
7361 u32 src, dst;
7362
be26eb23 7363 adr = (uptr)(PC) - BasePC;
70357ce5 7364 DECODE_EXT_WORD
7365 PRE_IO
7366 READ_BYTE_F(adr, res)
7367 flag_C = 0;
7368 flag_V = 0;
7369 flag_NotZ = res;
7370 flag_N = res;
7371 adr = AREG((Opcode >> 9) & 7);
7372 AREG((Opcode >> 9) & 7) += 1;
7373 WRITE_BYTE_F(adr, res)
7374 POST_IO
7375RET(18)
7376}
7377
7378// MOVEB
7379OPCODE(0x113B)
7380{
7381 u32 adr, res;
7382 u32 src, dst;
7383
be26eb23 7384 adr = (uptr)(PC) - BasePC;
70357ce5 7385 DECODE_EXT_WORD
7386 PRE_IO
7387 READ_BYTE_F(adr, res)
7388 flag_C = 0;
7389 flag_V = 0;
7390 flag_NotZ = res;
7391 flag_N = res;
7392 adr = AREG((Opcode >> 9) & 7) - 1;
7393 AREG((Opcode >> 9) & 7) = adr;
7394 WRITE_BYTE_F(adr, res)
7395 POST_IO
7396RET(18)
7397}
7398
7399// MOVEB
7400OPCODE(0x117B)
7401{
7402 u32 adr, res;
7403 u32 src, dst;
7404
be26eb23 7405 adr = (uptr)(PC) - BasePC;
70357ce5 7406 DECODE_EXT_WORD
7407 PRE_IO
7408 READ_BYTE_F(adr, res)
7409 flag_C = 0;
7410 flag_V = 0;
7411 flag_NotZ = res;
7412 flag_N = res;
7413 FETCH_SWORD(adr);
7414 adr += AREG((Opcode >> 9) & 7);
7415 WRITE_BYTE_F(adr, res)
7416 POST_IO
7417RET(22)
7418}
7419
7420// MOVEB
7421OPCODE(0x11BB)
7422{
7423 u32 adr, res;
7424 u32 src, dst;
7425
be26eb23 7426 adr = (uptr)(PC) - BasePC;
70357ce5 7427 DECODE_EXT_WORD
7428 PRE_IO
7429 READ_BYTE_F(adr, res)
7430 flag_C = 0;
7431 flag_V = 0;
7432 flag_NotZ = res;
7433 flag_N = res;
7434 adr = AREG((Opcode >> 9) & 7);
7435 DECODE_EXT_WORD
7436 WRITE_BYTE_F(adr, res)
7437 POST_IO
7438RET(24)
7439}
7440
7441// MOVEB
7442OPCODE(0x11FB)
7443{
7444 u32 adr, res;
7445 u32 src, dst;
7446
be26eb23 7447 adr = (uptr)(PC) - BasePC;
70357ce5 7448 DECODE_EXT_WORD
7449 PRE_IO
7450 READ_BYTE_F(adr, res)
7451 flag_C = 0;
7452 flag_V = 0;
7453 flag_NotZ = res;
7454 flag_N = res;
7455 FETCH_SWORD(adr);
7456 WRITE_BYTE_F(adr, res)
7457 POST_IO
7458RET(22)
7459}
7460
7461// MOVEB
7462OPCODE(0x13FB)
7463{
7464 u32 adr, res;
7465 u32 src, dst;
7466
be26eb23 7467 adr = (uptr)(PC) - BasePC;
70357ce5 7468 DECODE_EXT_WORD
7469 PRE_IO
7470 READ_BYTE_F(adr, res)
7471 flag_C = 0;
7472 flag_V = 0;
7473 flag_NotZ = res;
7474 flag_N = res;
7475 FETCH_LONG(adr);
7476 WRITE_BYTE_F(adr, res)
7477 POST_IO
7478RET(26)
7479}
7480
7481// MOVEB
7482OPCODE(0x1EFB)
7483{
7484 u32 adr, res;
7485 u32 src, dst;
7486
be26eb23 7487 adr = (uptr)(PC) - BasePC;
70357ce5 7488 DECODE_EXT_WORD
7489 PRE_IO
7490 READ_BYTE_F(adr, res)
7491 flag_C = 0;
7492 flag_V = 0;
7493 flag_NotZ = res;
7494 flag_N = res;
7495 adr = AREG(7);
7496 AREG(7) += 2;
7497 WRITE_BYTE_F(adr, res)
7498 POST_IO
7499RET(18)
7500}
7501
7502// MOVEB
7503OPCODE(0x1F3B)
7504{
7505 u32 adr, res;
7506 u32 src, dst;
7507
be26eb23 7508 adr = (uptr)(PC) - BasePC;
70357ce5 7509 DECODE_EXT_WORD
7510 PRE_IO
7511 READ_BYTE_F(adr, res)
7512 flag_C = 0;
7513 flag_V = 0;
7514 flag_NotZ = res;
7515 flag_N = res;
7516 adr = AREG(7) - 2;
7517 AREG(7) = adr;
7518 WRITE_BYTE_F(adr, res)
7519 POST_IO
7520RET(18)
7521}
7522
7523// MOVEB
7524OPCODE(0x103C)
7525{
7526 u32 adr, res;
7527 u32 src, dst;
7528
7529 FETCH_BYTE(res);
7530 flag_C = 0;
7531 flag_V = 0;
7532 flag_NotZ = res;
7533 flag_N = res;
7534 DREGu8((Opcode >> 9) & 7) = res;
7535RET(8)
7536}
7537
7538// MOVEB
7539OPCODE(0x10BC)
7540{
7541 u32 adr, res;
7542 u32 src, dst;
7543
7544 FETCH_BYTE(res);
7545 flag_C = 0;
7546 flag_V = 0;
7547 flag_NotZ = res;
7548 flag_N = res;
7549 adr = AREG((Opcode >> 9) & 7);
7550 PRE_IO
7551 WRITE_BYTE_F(adr, res)
7552 POST_IO
7553RET(12)
7554}
7555
7556// MOVEB
7557OPCODE(0x10FC)
7558{
7559 u32 adr, res;
7560 u32 src, dst;
7561
7562 FETCH_BYTE(res);
7563 flag_C = 0;
7564 flag_V = 0;
7565 flag_NotZ = res;
7566 flag_N = res;
7567 adr = AREG((Opcode >> 9) & 7);
7568 AREG((Opcode >> 9) & 7) += 1;
7569 PRE_IO
7570 WRITE_BYTE_F(adr, res)
7571 POST_IO
7572RET(12)
7573}
7574
7575// MOVEB
7576OPCODE(0x113C)
7577{
7578 u32 adr, res;
7579 u32 src, dst;
7580
7581 FETCH_BYTE(res);
7582 flag_C = 0;
7583 flag_V = 0;
7584 flag_NotZ = res;
7585 flag_N = res;
7586 adr = AREG((Opcode >> 9) & 7) - 1;
7587 AREG((Opcode >> 9) & 7) = adr;
7588 PRE_IO
7589 WRITE_BYTE_F(adr, res)
7590 POST_IO
7591RET(12)
7592}
7593
7594// MOVEB
7595OPCODE(0x117C)
7596{
7597 u32 adr, res;
7598 u32 src, dst;
7599
7600 FETCH_BYTE(res);
7601 flag_C = 0;
7602 flag_V = 0;
7603 flag_NotZ = res;
7604 flag_N = res;
7605 FETCH_SWORD(adr);
7606 adr += AREG((Opcode >> 9) & 7);
7607 PRE_IO
7608 WRITE_BYTE_F(adr, res)
7609 POST_IO
7610RET(16)
7611}
7612
7613// MOVEB
7614OPCODE(0x11BC)
7615{
7616 u32 adr, res;
7617 u32 src, dst;
7618
7619 FETCH_BYTE(res);
7620 flag_C = 0;
7621 flag_V = 0;
7622 flag_NotZ = res;
7623 flag_N = res;
7624 adr = AREG((Opcode >> 9) & 7);
7625 DECODE_EXT_WORD
7626 PRE_IO
7627 WRITE_BYTE_F(adr, res)
7628 POST_IO
7629RET(18)
7630}
7631
7632// MOVEB
7633OPCODE(0x11FC)
7634{
7635 u32 adr, res;
7636 u32 src, dst;
7637
7638 FETCH_BYTE(res);
7639 flag_C = 0;
7640 flag_V = 0;
7641 flag_NotZ = res;
7642 flag_N = res;
7643 FETCH_SWORD(adr);
7644 PRE_IO
7645 WRITE_BYTE_F(adr, res)
7646 POST_IO
7647RET(16)
7648}
7649
7650// MOVEB
7651OPCODE(0x13FC)
7652{
7653 u32 adr, res;
7654 u32 src, dst;
7655
7656 FETCH_BYTE(res);
7657 flag_C = 0;
7658 flag_V = 0;
7659 flag_NotZ = res;
7660 flag_N = res;
7661 FETCH_LONG(adr);
7662 PRE_IO
7663 WRITE_BYTE_F(adr, res)
7664 POST_IO
7665RET(20)
7666}
7667
7668// MOVEB
7669OPCODE(0x1EFC)
7670{
7671 u32 adr, res;
7672 u32 src, dst;
7673
7674 FETCH_BYTE(res);
7675 flag_C = 0;
7676 flag_V = 0;
7677 flag_NotZ = res;
7678 flag_N = res;
7679 adr = AREG(7);
7680 AREG(7) += 2;
7681 PRE_IO
7682 WRITE_BYTE_F(adr, res)
7683 POST_IO
7684RET(12)
7685}
7686
7687// MOVEB
7688OPCODE(0x1F3C)
7689{
7690 u32 adr, res;
7691 u32 src, dst;
7692
7693 FETCH_BYTE(res);
7694 flag_C = 0;
7695 flag_V = 0;
7696 flag_NotZ = res;
7697 flag_N = res;
7698 adr = AREG(7) - 2;
7699 AREG(7) = adr;
7700 PRE_IO
7701 WRITE_BYTE_F(adr, res)
7702 POST_IO
7703RET(12)
7704}
7705
7706// MOVEB
7707OPCODE(0x101F)
7708{
7709 u32 adr, res;
7710 u32 src, dst;
7711
7712 adr = AREG(7);
7713 AREG(7) += 2;
7714 PRE_IO
7715 READ_BYTE_F(adr, res)
7716 flag_C = 0;
7717 flag_V = 0;
7718 flag_NotZ = res;
7719 flag_N = res;
7720 DREGu8((Opcode >> 9) & 7) = res;
7721 POST_IO
7722RET(8)
7723}
7724
7725// MOVEB
7726OPCODE(0x109F)
7727{
7728 u32 adr, res;
7729 u32 src, dst;
7730
7731 adr = AREG(7);
7732 AREG(7) += 2;
7733 PRE_IO
7734 READ_BYTE_F(adr, res)
7735 flag_C = 0;
7736 flag_V = 0;
7737 flag_NotZ = res;
7738 flag_N = res;
7739 adr = AREG((Opcode >> 9) & 7);
7740 WRITE_BYTE_F(adr, res)
7741 POST_IO
7742RET(12)
7743}
7744
7745// MOVEB
7746OPCODE(0x10DF)
7747{
7748 u32 adr, res;
7749 u32 src, dst;
7750
7751 adr = AREG(7);
7752 AREG(7) += 2;
7753 PRE_IO
7754 READ_BYTE_F(adr, res)
7755 flag_C = 0;
7756 flag_V = 0;
7757 flag_NotZ = res;
7758 flag_N = res;
7759 adr = AREG((Opcode >> 9) & 7);
7760 AREG((Opcode >> 9) & 7) += 1;
7761 WRITE_BYTE_F(adr, res)
7762 POST_IO
7763RET(12)
7764}
7765
7766// MOVEB
7767OPCODE(0x111F)
7768{
7769 u32 adr, res;
7770 u32 src, dst;
7771
7772 adr = AREG(7);
7773 AREG(7) += 2;
7774 PRE_IO
7775 READ_BYTE_F(adr, res)
7776 flag_C = 0;
7777 flag_V = 0;
7778 flag_NotZ = res;
7779 flag_N = res;
7780 adr = AREG((Opcode >> 9) & 7) - 1;
7781 AREG((Opcode >> 9) & 7) = adr;
7782 WRITE_BYTE_F(adr, res)
7783 POST_IO
7784RET(12)
7785}
7786
7787// MOVEB
7788OPCODE(0x115F)
7789{
7790 u32 adr, res;
7791 u32 src, dst;
7792
7793 adr = AREG(7);
7794 AREG(7) += 2;
7795 PRE_IO
7796 READ_BYTE_F(adr, res)
7797 flag_C = 0;
7798 flag_V = 0;
7799 flag_NotZ = res;
7800 flag_N = res;
7801 FETCH_SWORD(adr);
7802 adr += AREG((Opcode >> 9) & 7);
7803 WRITE_BYTE_F(adr, res)
7804 POST_IO
7805RET(16)
7806}
7807
7808// MOVEB
7809OPCODE(0x119F)
7810{
7811 u32 adr, res;
7812 u32 src, dst;
7813
7814 adr = AREG(7);
7815 AREG(7) += 2;
7816 PRE_IO
7817 READ_BYTE_F(adr, res)
7818 flag_C = 0;
7819 flag_V = 0;
7820 flag_NotZ = res;
7821 flag_N = res;
7822 adr = AREG((Opcode >> 9) & 7);
7823 DECODE_EXT_WORD
7824 WRITE_BYTE_F(adr, res)
7825 POST_IO
7826RET(18)
7827}
7828
7829// MOVEB
7830OPCODE(0x11DF)
7831{
7832 u32 adr, res;
7833 u32 src, dst;
7834
7835 adr = AREG(7);
7836 AREG(7) += 2;
7837 PRE_IO
7838 READ_BYTE_F(adr, res)
7839 flag_C = 0;
7840 flag_V = 0;
7841 flag_NotZ = res;
7842 flag_N = res;
7843 FETCH_SWORD(adr);
7844 WRITE_BYTE_F(adr, res)
7845 POST_IO
7846RET(16)
7847}
7848
7849// MOVEB
7850OPCODE(0x13DF)
7851{
7852 u32 adr, res;
7853 u32 src, dst;
7854
7855 adr = AREG(7);
7856 AREG(7) += 2;
7857 PRE_IO
7858 READ_BYTE_F(adr, res)
7859 flag_C = 0;
7860 flag_V = 0;
7861 flag_NotZ = res;
7862 flag_N = res;
7863 FETCH_LONG(adr);
7864 WRITE_BYTE_F(adr, res)
7865 POST_IO
7866RET(20)
7867}
7868
7869// MOVEB
7870OPCODE(0x1EDF)
7871{
7872 u32 adr, res;
7873 u32 src, dst;
7874
7875 adr = AREG(7);
7876 AREG(7) += 2;
7877 PRE_IO
7878 READ_BYTE_F(adr, res)
7879 flag_C = 0;
7880 flag_V = 0;
7881 flag_NotZ = res;
7882 flag_N = res;
7883 adr = AREG(7);
7884 AREG(7) += 2;
7885 WRITE_BYTE_F(adr, res)
7886 POST_IO
7887RET(12)
7888}
7889
7890// MOVEB
7891OPCODE(0x1F1F)
7892{
7893 u32 adr, res;
7894 u32 src, dst;
7895
7896 adr = AREG(7);
7897 AREG(7) += 2;
7898 PRE_IO
7899 READ_BYTE_F(adr, res)
7900 flag_C = 0;
7901 flag_V = 0;
7902 flag_NotZ = res;
7903 flag_N = res;
7904 adr = AREG(7) - 2;
7905 AREG(7) = adr;
7906 WRITE_BYTE_F(adr, res)
7907 POST_IO
7908RET(12)
7909}
7910
7911// MOVEB
7912OPCODE(0x1027)
7913{
7914 u32 adr, res;
7915 u32 src, dst;
7916
7917 adr = AREG(7) - 2;
7918 AREG(7) = adr;
7919 PRE_IO
7920 READ_BYTE_F(adr, res)
7921 flag_C = 0;
7922 flag_V = 0;
7923 flag_NotZ = res;
7924 flag_N = res;
7925 DREGu8((Opcode >> 9) & 7) = res;
7926 POST_IO
7927RET(10)
7928}
7929
7930// MOVEB
7931OPCODE(0x10A7)
7932{
7933 u32 adr, res;
7934 u32 src, dst;
7935
7936 adr = AREG(7) - 2;
7937 AREG(7) = adr;
7938 PRE_IO
7939 READ_BYTE_F(adr, res)
7940 flag_C = 0;
7941 flag_V = 0;
7942 flag_NotZ = res;
7943 flag_N = res;
7944 adr = AREG((Opcode >> 9) & 7);
7945 WRITE_BYTE_F(adr, res)
7946 POST_IO
7947RET(14)
7948}
7949
7950// MOVEB
7951OPCODE(0x10E7)
7952{
7953 u32 adr, res;
7954 u32 src, dst;
7955
7956 adr = AREG(7) - 2;
7957 AREG(7) = adr;
7958 PRE_IO
7959 READ_BYTE_F(adr, res)
7960 flag_C = 0;
7961 flag_V = 0;
7962 flag_NotZ = res;
7963 flag_N = res;
7964 adr = AREG((Opcode >> 9) & 7);
7965 AREG((Opcode >> 9) & 7) += 1;
7966 WRITE_BYTE_F(adr, res)
7967 POST_IO
7968RET(14)
7969}
7970
7971// MOVEB
7972OPCODE(0x1127)
7973{
7974 u32 adr, res;
7975 u32 src, dst;
7976
7977 adr = AREG(7) - 2;
7978 AREG(7) = adr;
7979 PRE_IO
7980 READ_BYTE_F(adr, res)
7981 flag_C = 0;
7982 flag_V = 0;
7983 flag_NotZ = res;
7984 flag_N = res;
7985 adr = AREG((Opcode >> 9) & 7) - 1;
7986 AREG((Opcode >> 9) & 7) = adr;
7987 WRITE_BYTE_F(adr, res)
7988 POST_IO
7989RET(14)
7990}
7991
7992// MOVEB
7993OPCODE(0x1167)
7994{
7995 u32 adr, res;
7996 u32 src, dst;
7997
7998 adr = AREG(7) - 2;
7999 AREG(7) = adr;
8000 PRE_IO
8001 READ_BYTE_F(adr, res)
8002 flag_C = 0;
8003 flag_V = 0;
8004 flag_NotZ = res;
8005 flag_N = res;
8006 FETCH_SWORD(adr);
8007 adr += AREG((Opcode >> 9) & 7);
8008 WRITE_BYTE_F(adr, res)
8009 POST_IO
8010RET(18)
8011}
8012
8013// MOVEB
8014OPCODE(0x11A7)
8015{
8016 u32 adr, res;
8017 u32 src, dst;
8018
8019 adr = AREG(7) - 2;
8020 AREG(7) = adr;
8021 PRE_IO
8022 READ_BYTE_F(adr, res)
8023 flag_C = 0;
8024 flag_V = 0;
8025 flag_NotZ = res;
8026 flag_N = res;
8027 adr = AREG((Opcode >> 9) & 7);
8028 DECODE_EXT_WORD
8029 WRITE_BYTE_F(adr, res)
8030 POST_IO
8031RET(20)
8032}
8033
8034// MOVEB
8035OPCODE(0x11E7)
8036{
8037 u32 adr, res;
8038 u32 src, dst;
8039
8040 adr = AREG(7) - 2;
8041 AREG(7) = adr;
8042 PRE_IO
8043 READ_BYTE_F(adr, res)
8044 flag_C = 0;
8045 flag_V = 0;
8046 flag_NotZ = res;
8047 flag_N = res;
8048 FETCH_SWORD(adr);
8049 WRITE_BYTE_F(adr, res)
8050 POST_IO
8051RET(18)
8052}
8053
8054// MOVEB
8055OPCODE(0x13E7)
8056{
8057 u32 adr, res;
8058 u32 src, dst;
8059
8060 adr = AREG(7) - 2;
8061 AREG(7) = adr;
8062 PRE_IO
8063 READ_BYTE_F(adr, res)
8064 flag_C = 0;
8065 flag_V = 0;
8066 flag_NotZ = res;
8067 flag_N = res;
8068 FETCH_LONG(adr);
8069 WRITE_BYTE_F(adr, res)
8070 POST_IO
8071RET(22)
8072}
8073
8074// MOVEB
8075OPCODE(0x1EE7)
8076{
8077 u32 adr, res;
8078 u32 src, dst;
8079
8080 adr = AREG(7) - 2;
8081 AREG(7) = adr;
8082 PRE_IO
8083 READ_BYTE_F(adr, res)
8084 flag_C = 0;
8085 flag_V = 0;
8086 flag_NotZ = res;
8087 flag_N = res;
8088 adr = AREG(7);
8089 AREG(7) += 2;
8090 WRITE_BYTE_F(adr, res)
8091 POST_IO
8092RET(14)
8093}
8094
8095// MOVEB
8096OPCODE(0x1F27)
8097{
8098 u32 adr, res;
8099 u32 src, dst;
8100
8101 adr = AREG(7) - 2;
8102 AREG(7) = adr;
8103 PRE_IO
8104 READ_BYTE_F(adr, res)
8105 flag_C = 0;
8106 flag_V = 0;
8107 flag_NotZ = res;
8108 flag_N = res;
8109 adr = AREG(7) - 2;
8110 AREG(7) = adr;
8111 WRITE_BYTE_F(adr, res)
8112 POST_IO
8113RET(14)
8114}
8115
8116// MOVEL
8117OPCODE(0x2000)
8118{
8119 u32 adr, res;
8120 u32 src, dst;
8121
8122 res = DREGu32((Opcode >> 0) & 7);
8123 flag_C = 0;
8124 flag_V = 0;
8125 flag_NotZ = res;
8126 flag_N = res >> 24;
8127 DREGu32((Opcode >> 9) & 7) = res;
8128RET(4)
8129}
8130
8131// MOVEL
8132OPCODE(0x2080)
8133{
8134 u32 adr, res;
8135 u32 src, dst;
8136
8137 res = DREGu32((Opcode >> 0) & 7);
8138 flag_C = 0;
8139 flag_V = 0;
8140 flag_NotZ = res;
8141 flag_N = res >> 24;
8142 adr = AREG((Opcode >> 9) & 7);
8143 PRE_IO
8144 WRITE_LONG_F(adr, res)
8145 POST_IO
8146RET(12)
8147}
8148
8149// MOVEL
8150OPCODE(0x20C0)
8151{
8152 u32 adr, res;
8153 u32 src, dst;
8154
8155 res = DREGu32((Opcode >> 0) & 7);
8156 flag_C = 0;
8157 flag_V = 0;
8158 flag_NotZ = res;
8159 flag_N = res >> 24;
8160 adr = AREG((Opcode >> 9) & 7);
8161 AREG((Opcode >> 9) & 7) += 4;
8162 PRE_IO
8163 WRITE_LONG_F(adr, res)
8164 POST_IO
8165RET(12)
8166}
8167
8168// MOVEL
8169OPCODE(0x2100)
8170{
8171 u32 adr, res;
8172 u32 src, dst;
8173
8174 res = DREGu32((Opcode >> 0) & 7);
8175 flag_C = 0;
8176 flag_V = 0;
8177 flag_NotZ = res;
8178 flag_N = res >> 24;
8179 adr = AREG((Opcode >> 9) & 7) - 4;
8180 AREG((Opcode >> 9) & 7) = adr;
8181 PRE_IO
80db4442 8182 WRITE_LONG_DEC_F(adr, res)
70357ce5 8183 POST_IO
8184RET(12)
8185}
8186
8187// MOVEL
8188OPCODE(0x2140)
8189{
8190 u32 adr, res;
8191 u32 src, dst;
8192
8193 res = DREGu32((Opcode >> 0) & 7);
8194 flag_C = 0;
8195 flag_V = 0;
8196 flag_NotZ = res;
8197 flag_N = res >> 24;
8198 FETCH_SWORD(adr);
8199 adr += AREG((Opcode >> 9) & 7);
8200 PRE_IO
8201 WRITE_LONG_F(adr, res)
8202 POST_IO
8203RET(16)
8204}
8205
8206// MOVEL
8207OPCODE(0x2180)
8208{
8209 u32 adr, res;
8210 u32 src, dst;
8211
8212 res = DREGu32((Opcode >> 0) & 7);
8213 flag_C = 0;
8214 flag_V = 0;
8215 flag_NotZ = res;
8216 flag_N = res >> 24;
8217 adr = AREG((Opcode >> 9) & 7);
8218 DECODE_EXT_WORD
8219 PRE_IO
8220 WRITE_LONG_F(adr, res)
8221 POST_IO
8222RET(18)
8223}
8224
8225// MOVEL
8226OPCODE(0x21C0)
8227{
8228 u32 adr, res;
8229 u32 src, dst;
8230
8231 res = DREGu32((Opcode >> 0) & 7);
8232 flag_C = 0;
8233 flag_V = 0;
8234 flag_NotZ = res;
8235 flag_N = res >> 24;
8236 FETCH_SWORD(adr);
8237 PRE_IO
8238 WRITE_LONG_F(adr, res)
8239 POST_IO
8240RET(16)
8241}
8242
8243// MOVEL
8244OPCODE(0x23C0)
8245{
8246 u32 adr, res;
8247 u32 src, dst;
8248
8249 res = DREGu32((Opcode >> 0) & 7);
8250 flag_C = 0;
8251 flag_V = 0;
8252 flag_NotZ = res;
8253 flag_N = res >> 24;
8254 FETCH_LONG(adr);
8255 PRE_IO
8256 WRITE_LONG_F(adr, res)
8257 POST_IO
8258RET(20)
8259}
8260
8261// MOVEL
8262OPCODE(0x2EC0)
8263{
8264 u32 adr, res;
8265 u32 src, dst;
8266
8267 res = DREGu32((Opcode >> 0) & 7);
8268 flag_C = 0;
8269 flag_V = 0;
8270 flag_NotZ = res;
8271 flag_N = res >> 24;
8272 adr = AREG(7);
8273 AREG(7) += 4;
8274 PRE_IO
8275 WRITE_LONG_F(adr, res)
8276 POST_IO
8277RET(12)
8278}
8279
8280// MOVEL
8281OPCODE(0x2F00)
8282{
8283 u32 adr, res;
8284 u32 src, dst;
8285
8286 res = DREGu32((Opcode >> 0) & 7);
8287 flag_C = 0;
8288 flag_V = 0;
8289 flag_NotZ = res;
8290 flag_N = res >> 24;
8291 adr = AREG(7) - 4;
8292 AREG(7) = adr;
8293 PRE_IO
03e4f2a3 8294 WRITE_LONG_DEC_F(adr, res)
70357ce5 8295 POST_IO
8296RET(12)
8297}
8298
8299// MOVEL
8300OPCODE(0x2008)
8301{
8302 u32 adr, res;
8303 u32 src, dst;
8304
8305 res = AREGu32((Opcode >> 0) & 7);
8306 flag_C = 0;
8307 flag_V = 0;
8308 flag_NotZ = res;
8309 flag_N = res >> 24;
8310 DREGu32((Opcode >> 9) & 7) = res;
8311RET(4)
8312}
8313
8314// MOVEL
8315OPCODE(0x2088)
8316{
8317 u32 adr, res;
8318 u32 src, dst;
8319
8320 res = AREGu32((Opcode >> 0) & 7);
8321 flag_C = 0;
8322 flag_V = 0;
8323 flag_NotZ = res;
8324 flag_N = res >> 24;
8325 adr = AREG((Opcode >> 9) & 7);
8326 PRE_IO
8327 WRITE_LONG_F(adr, res)
8328 POST_IO
8329RET(12)
8330}
8331
8332// MOVEL
8333OPCODE(0x20C8)
8334{
8335 u32 adr, res;
8336 u32 src, dst;
8337
8338 res = AREGu32((Opcode >> 0) & 7);
8339 flag_C = 0;
8340 flag_V = 0;
8341 flag_NotZ = res;
8342 flag_N = res >> 24;
8343 adr = AREG((Opcode >> 9) & 7);
8344 AREG((Opcode >> 9) & 7) += 4;
8345 PRE_IO
8346 WRITE_LONG_F(adr, res)
8347 POST_IO
8348RET(12)
8349}
8350
8351// MOVEL
8352OPCODE(0x2108)
8353{
8354 u32 adr, res;
8355 u32 src, dst;
8356
8357 res = AREGu32((Opcode >> 0) & 7);
8358 flag_C = 0;
8359 flag_V = 0;
8360 flag_NotZ = res;
8361 flag_N = res >> 24;
8362 adr = AREG((Opcode >> 9) & 7) - 4;
8363 AREG((Opcode >> 9) & 7) = adr;
8364 PRE_IO
80db4442 8365 WRITE_LONG_DEC_F(adr, res)
70357ce5 8366 POST_IO
8367RET(12)
8368}
8369
8370// MOVEL
8371OPCODE(0x2148)
8372{
8373 u32 adr, res;
8374 u32 src, dst;
8375
8376 res = AREGu32((Opcode >> 0) & 7);
8377 flag_C = 0;
8378 flag_V = 0;
8379 flag_NotZ = res;
8380 flag_N = res >> 24;
8381 FETCH_SWORD(adr);
8382 adr += AREG((Opcode >> 9) & 7);
8383 PRE_IO
8384 WRITE_LONG_F(adr, res)
8385 POST_IO
8386RET(16)
8387}
8388
8389// MOVEL
8390OPCODE(0x2188)
8391{
8392 u32 adr, res;
8393 u32 src, dst;
8394
8395 res = AREGu32((Opcode >> 0) & 7);
8396 flag_C = 0;
8397 flag_V = 0;
8398 flag_NotZ = res;
8399 flag_N = res >> 24;
8400 adr = AREG((Opcode >> 9) & 7);
8401 DECODE_EXT_WORD
8402 PRE_IO
8403 WRITE_LONG_F(adr, res)
8404 POST_IO
8405RET(18)
8406}
8407
8408// MOVEL
8409OPCODE(0x21C8)
8410{
8411 u32 adr, res;
8412 u32 src, dst;
8413
8414 res = AREGu32((Opcode >> 0) & 7);
8415 flag_C = 0;
8416 flag_V = 0;
8417 flag_NotZ = res;
8418 flag_N = res >> 24;
8419 FETCH_SWORD(adr);
8420 PRE_IO
8421 WRITE_LONG_F(adr, res)
8422 POST_IO
8423RET(16)
8424}
8425
8426// MOVEL
8427OPCODE(0x23C8)
8428{
8429 u32 adr, res;
8430 u32 src, dst;
8431
8432 res = AREGu32((Opcode >> 0) & 7);
8433 flag_C = 0;
8434 flag_V = 0;
8435 flag_NotZ = res;
8436 flag_N = res >> 24;
8437 FETCH_LONG(adr);
8438 PRE_IO
8439 WRITE_LONG_F(adr, res)
8440 POST_IO
8441RET(20)
8442}
8443
8444// MOVEL
8445OPCODE(0x2EC8)
8446{
8447 u32 adr, res;
8448 u32 src, dst;
8449
8450 res = AREGu32((Opcode >> 0) & 7);
8451 flag_C = 0;
8452 flag_V = 0;
8453 flag_NotZ = res;
8454 flag_N = res >> 24;
8455 adr = AREG(7);
8456 AREG(7) += 4;
8457 PRE_IO
8458 WRITE_LONG_F(adr, res)
8459 POST_IO
8460RET(12)
8461}
8462
8463// MOVEL
8464OPCODE(0x2F08)
8465{
8466 u32 adr, res;
8467 u32 src, dst;
8468
8469 res = AREGu32((Opcode >> 0) & 7);
8470 flag_C = 0;
8471 flag_V = 0;
8472 flag_NotZ = res;
8473 flag_N = res >> 24;
8474 adr = AREG(7) - 4;
8475 AREG(7) = adr;
8476 PRE_IO
03e4f2a3 8477 WRITE_LONG_DEC_F(adr, res)
70357ce5 8478 POST_IO
8479RET(12)
8480}
8481
8482// MOVEL
8483OPCODE(0x2010)
8484{
8485 u32 adr, res;
8486 u32 src, dst;
8487
8488 adr = AREG((Opcode >> 0) & 7);
8489 PRE_IO
8490 READ_LONG_F(adr, res)
8491 flag_C = 0;
8492 flag_V = 0;
8493 flag_NotZ = res;
8494 flag_N = res >> 24;
8495 DREGu32((Opcode >> 9) & 7) = res;
8496 POST_IO
8497RET(12)
8498}
8499
8500// MOVEL
8501OPCODE(0x2090)
8502{
8503 u32 adr, res;
8504 u32 src, dst;
8505
8506 adr = AREG((Opcode >> 0) & 7);
8507 PRE_IO
8508 READ_LONG_F(adr, res)
8509 flag_C = 0;
8510 flag_V = 0;
8511 flag_NotZ = res;
8512 flag_N = res >> 24;
8513 adr = AREG((Opcode >> 9) & 7);
8514 WRITE_LONG_F(adr, res)
8515 POST_IO
8516RET(20)
8517}
8518
8519// MOVEL
8520OPCODE(0x20D0)
8521{
8522 u32 adr, res;
8523 u32 src, dst;
8524
8525 adr = AREG((Opcode >> 0) & 7);
8526 PRE_IO
8527 READ_LONG_F(adr, res)
8528 flag_C = 0;
8529 flag_V = 0;
8530 flag_NotZ = res;
8531 flag_N = res >> 24;
8532 adr = AREG((Opcode >> 9) & 7);
8533 AREG((Opcode >> 9) & 7) += 4;
8534 WRITE_LONG_F(adr, res)
8535 POST_IO
8536RET(20)
8537}
8538
8539// MOVEL
8540OPCODE(0x2110)
8541{
8542 u32 adr, res;
8543 u32 src, dst;
8544
8545 adr = AREG((Opcode >> 0) & 7);
8546 PRE_IO
8547 READ_LONG_F(adr, res)
8548 flag_C = 0;
8549 flag_V = 0;
8550 flag_NotZ = res;
8551 flag_N = res >> 24;
8552 adr = AREG((Opcode >> 9) & 7) - 4;
8553 AREG((Opcode >> 9) & 7) = adr;
80db4442 8554 WRITE_LONG_DEC_F(adr, res)
70357ce5 8555 POST_IO
8556RET(20)
8557}
8558
8559// MOVEL
8560OPCODE(0x2150)
8561{
8562 u32 adr, res;
8563 u32 src, dst;
8564
8565 adr = AREG((Opcode >> 0) & 7);
8566 PRE_IO
8567 READ_LONG_F(adr, res)
8568 flag_C = 0;
8569 flag_V = 0;
8570 flag_NotZ = res;
8571 flag_N = res >> 24;
8572 FETCH_SWORD(adr);
8573 adr += AREG((Opcode >> 9) & 7);
8574 WRITE_LONG_F(adr, res)
8575 POST_IO
8576RET(24)
8577}
8578
8579// MOVEL
8580OPCODE(0x2190)
8581{
8582 u32 adr, res;
8583 u32 src, dst;
8584
8585 adr = AREG((Opcode >> 0) & 7);
8586 PRE_IO
8587 READ_LONG_F(adr, res)
8588 flag_C = 0;
8589 flag_V = 0;
8590 flag_NotZ = res;
8591 flag_N = res >> 24;
8592 adr = AREG((Opcode >> 9) & 7);
8593 DECODE_EXT_WORD
8594 WRITE_LONG_F(adr, res)
8595 POST_IO
8596RET(26)
8597}
8598
8599// MOVEL
8600OPCODE(0x21D0)
8601{
8602 u32 adr, res;
8603 u32 src, dst;
8604
8605 adr = AREG((Opcode >> 0) & 7);
8606 PRE_IO
8607 READ_LONG_F(adr, res)
8608 flag_C = 0;
8609 flag_V = 0;
8610 flag_NotZ = res;
8611 flag_N = res >> 24;
8612 FETCH_SWORD(adr);
8613 WRITE_LONG_F(adr, res)
8614 POST_IO
8615RET(24)
8616}
8617
8618// MOVEL
8619OPCODE(0x23D0)
8620{
8621 u32 adr, res;
8622 u32 src, dst;
8623
8624 adr = AREG((Opcode >> 0) & 7);
8625 PRE_IO
8626 READ_LONG_F(adr, res)
8627 flag_C = 0;
8628 flag_V = 0;
8629 flag_NotZ = res;
8630 flag_N = res >> 24;
8631 FETCH_LONG(adr);
8632 WRITE_LONG_F(adr, res)
8633 POST_IO
8634RET(28)
8635}
8636
8637// MOVEL
8638OPCODE(0x2ED0)
8639{
8640 u32 adr, res;
8641 u32 src, dst;
8642
8643 adr = AREG((Opcode >> 0) & 7);
8644 PRE_IO
8645 READ_LONG_F(adr, res)
8646 flag_C = 0;
8647 flag_V = 0;
8648 flag_NotZ = res;
8649 flag_N = res >> 24;
8650 adr = AREG(7);
8651 AREG(7) += 4;
8652 WRITE_LONG_F(adr, res)
8653 POST_IO
8654RET(20)
8655}
8656
8657// MOVEL
8658OPCODE(0x2F10)
8659{
8660 u32 adr, res;
8661 u32 src, dst;
8662
8663 adr = AREG((Opcode >> 0) & 7);
8664 PRE_IO
8665 READ_LONG_F(adr, res)
8666 flag_C = 0;
8667 flag_V = 0;
8668 flag_NotZ = res;
8669 flag_N = res >> 24;
8670 adr = AREG(7) - 4;
8671 AREG(7) = adr;
03e4f2a3 8672 WRITE_LONG_DEC_F(adr, res)
70357ce5 8673 POST_IO
8674RET(20)
8675}
8676
8677// MOVEL
8678OPCODE(0x2018)
8679{
8680 u32 adr, res;
8681 u32 src, dst;
8682
8683 adr = AREG((Opcode >> 0) & 7);
8684 AREG((Opcode >> 0) & 7) += 4;
8685 PRE_IO
8686 READ_LONG_F(adr, res)
8687 flag_C = 0;
8688 flag_V = 0;
8689 flag_NotZ = res;
8690 flag_N = res >> 24;
8691 DREGu32((Opcode >> 9) & 7) = res;
8692 POST_IO
8693RET(12)
8694}
8695
8696// MOVEL
8697OPCODE(0x2098)
8698{
8699 u32 adr, res;
8700 u32 src, dst;
8701
8702 adr = AREG((Opcode >> 0) & 7);
8703 AREG((Opcode >> 0) & 7) += 4;
8704 PRE_IO
8705 READ_LONG_F(adr, res)
8706 flag_C = 0;
8707 flag_V = 0;
8708 flag_NotZ = res;
8709 flag_N = res >> 24;
8710 adr = AREG((Opcode >> 9) & 7);
8711 WRITE_LONG_F(adr, res)
8712 POST_IO
8713RET(20)
8714}
8715
8716// MOVEL
8717OPCODE(0x20D8)
8718{
8719 u32 adr, res;
8720 u32 src, dst;
8721
8722 adr = AREG((Opcode >> 0) & 7);
8723 AREG((Opcode >> 0) & 7) += 4;
8724 PRE_IO
8725 READ_LONG_F(adr, res)
8726 flag_C = 0;
8727 flag_V = 0;
8728 flag_NotZ = res;
8729 flag_N = res >> 24;
8730 adr = AREG((Opcode >> 9) & 7);
8731 AREG((Opcode >> 9) & 7) += 4;
8732 WRITE_LONG_F(adr, res)
8733 POST_IO
8734RET(20)
8735}
8736
8737// MOVEL
8738OPCODE(0x2118)
8739{
8740 u32 adr, res;
8741 u32 src, dst;
8742
8743 adr = AREG((Opcode >> 0) & 7);
8744 AREG((Opcode >> 0) & 7) += 4;
8745 PRE_IO
8746 READ_LONG_F(adr, res)
8747 flag_C = 0;
8748 flag_V = 0;
8749 flag_NotZ = res;
8750 flag_N = res >> 24;
8751 adr = AREG((Opcode >> 9) & 7) - 4;
8752 AREG((Opcode >> 9) & 7) = adr;
80db4442 8753 WRITE_LONG_DEC_F(adr, res)
70357ce5 8754 POST_IO
8755RET(20)
8756}
8757
8758// MOVEL
8759OPCODE(0x2158)
8760{
8761 u32 adr, res;
8762 u32 src, dst;
8763
8764 adr = AREG((Opcode >> 0) & 7);
8765 AREG((Opcode >> 0) & 7) += 4;
8766 PRE_IO
8767 READ_LONG_F(adr, res)
8768 flag_C = 0;
8769 flag_V = 0;
8770 flag_NotZ = res;
8771 flag_N = res >> 24;
8772 FETCH_SWORD(adr);
8773 adr += AREG((Opcode >> 9) & 7);
8774 WRITE_LONG_F(adr, res)
8775 POST_IO
8776RET(24)
8777}
8778
8779// MOVEL
8780OPCODE(0x2198)
8781{
8782 u32 adr, res;
8783 u32 src, dst;
8784
8785 adr = AREG((Opcode >> 0) & 7);
8786 AREG((Opcode >> 0) & 7) += 4;
8787 PRE_IO
8788 READ_LONG_F(adr, res)
8789 flag_C = 0;
8790 flag_V = 0;
8791 flag_NotZ = res;
8792 flag_N = res >> 24;
8793 adr = AREG((Opcode >> 9) & 7);
8794 DECODE_EXT_WORD
8795 WRITE_LONG_F(adr, res)
8796 POST_IO
8797RET(26)
8798}
8799
8800// MOVEL
8801OPCODE(0x21D8)
8802{
8803 u32 adr, res;
8804 u32 src, dst;
8805
8806 adr = AREG((Opcode >> 0) & 7);
8807 AREG((Opcode >> 0) & 7) += 4;
8808 PRE_IO
8809 READ_LONG_F(adr, res)
8810 flag_C = 0;
8811 flag_V = 0;
8812 flag_NotZ = res;
8813 flag_N = res >> 24;
8814 FETCH_SWORD(adr);
8815 WRITE_LONG_F(adr, res)
8816 POST_IO
8817RET(24)
8818}
8819
8820// MOVEL
8821OPCODE(0x23D8)
8822{
8823 u32 adr, res;
8824 u32 src, dst;
8825
8826 adr = AREG((Opcode >> 0) & 7);
8827 AREG((Opcode >> 0) & 7) += 4;
8828 PRE_IO
8829 READ_LONG_F(adr, res)
8830 flag_C = 0;
8831 flag_V = 0;
8832 flag_NotZ = res;
8833 flag_N = res >> 24;
8834 FETCH_LONG(adr);
8835 WRITE_LONG_F(adr, res)
8836 POST_IO
8837RET(28)
8838}
8839
8840// MOVEL
8841OPCODE(0x2ED8)
8842{
8843 u32 adr, res;
8844 u32 src, dst;
8845
8846 adr = AREG((Opcode >> 0) & 7);
8847 AREG((Opcode >> 0) & 7) += 4;
8848 PRE_IO
8849 READ_LONG_F(adr, res)
8850 flag_C = 0;
8851 flag_V = 0;
8852 flag_NotZ = res;
8853 flag_N = res >> 24;
8854 adr = AREG(7);
8855 AREG(7) += 4;
8856 WRITE_LONG_F(adr, res)
8857 POST_IO
8858RET(20)
8859}
8860
8861// MOVEL
8862OPCODE(0x2F18)
8863{
8864 u32 adr, res;
8865 u32 src, dst;
8866
8867 adr = AREG((Opcode >> 0) & 7);
8868 AREG((Opcode >> 0) & 7) += 4;
8869 PRE_IO
8870 READ_LONG_F(adr, res)
8871 flag_C = 0;
8872 flag_V = 0;
8873 flag_NotZ = res;
8874 flag_N = res >> 24;
8875 adr = AREG(7) - 4;
8876 AREG(7) = adr;
03e4f2a3 8877 WRITE_LONG_DEC_F(adr, res)
70357ce5 8878 POST_IO
8879RET(20)
8880}
8881
8882// MOVEL
8883OPCODE(0x2020)
8884{
8885 u32 adr, res;
8886 u32 src, dst;
8887
8888 adr = AREG((Opcode >> 0) & 7) - 4;
8889 AREG((Opcode >> 0) & 7) = adr;
8890 PRE_IO
8891 READ_LONG_F(adr, res)
8892 flag_C = 0;
8893 flag_V = 0;
8894 flag_NotZ = res;
8895 flag_N = res >> 24;
8896 DREGu32((Opcode >> 9) & 7) = res;
8897 POST_IO
8898RET(14)
8899}
8900
8901// MOVEL
8902OPCODE(0x20A0)
8903{
8904 u32 adr, res;
8905 u32 src, dst;
8906
8907 adr = AREG((Opcode >> 0) & 7) - 4;
8908 AREG((Opcode >> 0) & 7) = adr;
8909 PRE_IO
8910 READ_LONG_F(adr, res)
8911 flag_C = 0;
8912 flag_V = 0;
8913 flag_NotZ = res;
8914 flag_N = res >> 24;
8915 adr = AREG((Opcode >> 9) & 7);
8916 WRITE_LONG_F(adr, res)
8917 POST_IO
8918RET(22)
8919}
8920
8921// MOVEL
8922OPCODE(0x20E0)
8923{
8924 u32 adr, res;
8925 u32 src, dst;
8926
8927 adr = AREG((Opcode >> 0) & 7) - 4;
8928 AREG((Opcode >> 0) & 7) = adr;
8929 PRE_IO
8930 READ_LONG_F(adr, res)
8931 flag_C = 0;
8932 flag_V = 0;
8933 flag_NotZ = res;
8934 flag_N = res >> 24;
8935 adr = AREG((Opcode >> 9) & 7);
8936 AREG((Opcode >> 9) & 7) += 4;
8937 WRITE_LONG_F(adr, res)
8938 POST_IO
8939RET(22)
8940}
8941
8942// MOVEL
8943OPCODE(0x2120)
8944{
8945 u32 adr, res;
8946 u32 src, dst;
8947
8948 adr = AREG((Opcode >> 0) & 7) - 4;
8949 AREG((Opcode >> 0) & 7) = adr;
8950 PRE_IO
8951 READ_LONG_F(adr, res)
8952 flag_C = 0;
8953 flag_V = 0;
8954 flag_NotZ = res;
8955 flag_N = res >> 24;
8956 adr = AREG((Opcode >> 9) & 7) - 4;
8957 AREG((Opcode >> 9) & 7) = adr;
80db4442 8958 WRITE_LONG_DEC_F(adr, res)
70357ce5 8959 POST_IO
8960RET(22)
8961}
8962
8963// MOVEL
8964OPCODE(0x2160)
8965{
8966 u32 adr, res;
8967 u32 src, dst;
8968
8969 adr = AREG((Opcode >> 0) & 7) - 4;
8970 AREG((Opcode >> 0) & 7) = adr;
8971 PRE_IO
8972 READ_LONG_F(adr, res)
8973 flag_C = 0;
8974 flag_V = 0;
8975 flag_NotZ = res;
8976 flag_N = res >> 24;
8977 FETCH_SWORD(adr);
8978 adr += AREG((Opcode >> 9) & 7);
8979 WRITE_LONG_F(adr, res)
8980 POST_IO
8981RET(26)
8982}
8983
8984// MOVEL
8985OPCODE(0x21A0)
8986{
8987 u32 adr, res;
8988 u32 src, dst;
8989
8990 adr = AREG((Opcode >> 0) & 7) - 4;
8991 AREG((Opcode >> 0) & 7) = adr;
8992 PRE_IO
8993 READ_LONG_F(adr, res)
8994 flag_C = 0;
8995 flag_V = 0;
8996 flag_NotZ = res;
8997 flag_N = res >> 24;
8998 adr = AREG((Opcode >> 9) & 7);
8999 DECODE_EXT_WORD
9000 WRITE_LONG_F(adr, res)
9001 POST_IO
9002RET(28)
9003}
9004
9005// MOVEL
9006OPCODE(0x21E0)
9007{
9008 u32 adr, res;
9009 u32 src, dst;
9010
9011 adr = AREG((Opcode >> 0) & 7) - 4;
9012 AREG((Opcode >> 0) & 7) = adr;
9013 PRE_IO
9014 READ_LONG_F(adr, res)
9015 flag_C = 0;
9016 flag_V = 0;
9017 flag_NotZ = res;
9018 flag_N = res >> 24;
9019 FETCH_SWORD(adr);
9020 WRITE_LONG_F(adr, res)
9021 POST_IO
9022RET(26)
9023}
9024
9025// MOVEL
9026OPCODE(0x23E0)
9027{
9028 u32 adr, res;
9029 u32 src, dst;
9030
9031 adr = AREG((Opcode >> 0) & 7) - 4;
9032 AREG((Opcode >> 0) & 7) = adr;
9033 PRE_IO
9034 READ_LONG_F(adr, res)
9035 flag_C = 0;
9036 flag_V = 0;
9037 flag_NotZ = res;
9038 flag_N = res >> 24;
9039 FETCH_LONG(adr);
9040 WRITE_LONG_F(adr, res)
9041 POST_IO
9042RET(30)
9043}
9044
9045// MOVEL
9046OPCODE(0x2EE0)
9047{
9048 u32 adr, res;
9049 u32 src, dst;
9050
9051 adr = AREG((Opcode >> 0) & 7) - 4;
9052 AREG((Opcode >> 0) & 7) = adr;
9053 PRE_IO
9054 READ_LONG_F(adr, res)
9055 flag_C = 0;
9056 flag_V = 0;
9057 flag_NotZ = res;
9058 flag_N = res >> 24;
9059 adr = AREG(7);
9060 AREG(7) += 4;
9061 WRITE_LONG_F(adr, res)
9062 POST_IO
9063RET(22)
9064}
9065
9066// MOVEL
9067OPCODE(0x2F20)
9068{
9069 u32 adr, res;
9070 u32 src, dst;
9071
9072 adr = AREG((Opcode >> 0) & 7) - 4;
9073 AREG((Opcode >> 0) & 7) = adr;
9074 PRE_IO
9075 READ_LONG_F(adr, res)
9076 flag_C = 0;
9077 flag_V = 0;
9078 flag_NotZ = res;
9079 flag_N = res >> 24;
9080 adr = AREG(7) - 4;
9081 AREG(7) = adr;
03e4f2a3 9082 WRITE_LONG_DEC_F(adr, res)
70357ce5 9083 POST_IO
9084RET(22)
9085}
9086
9087// MOVEL
9088OPCODE(0x2028)
9089{
9090 u32 adr, res;
9091 u32 src, dst;
9092
9093 FETCH_SWORD(adr);
9094 adr += AREG((Opcode >> 0) & 7);
9095 PRE_IO
9096 READ_LONG_F(adr, res)
9097 flag_C = 0;
9098 flag_V = 0;
9099 flag_NotZ = res;
9100 flag_N = res >> 24;
9101 DREGu32((Opcode >> 9) & 7) = res;
9102 POST_IO
9103RET(16)
9104}
9105
9106// MOVEL
9107OPCODE(0x20A8)
9108{
9109 u32 adr, res;
9110 u32 src, dst;
9111
9112 FETCH_SWORD(adr);
9113 adr += AREG((Opcode >> 0) & 7);
9114 PRE_IO
9115 READ_LONG_F(adr, res)
9116 flag_C = 0;
9117 flag_V = 0;
9118 flag_NotZ = res;
9119 flag_N = res >> 24;
9120 adr = AREG((Opcode >> 9) & 7);
9121 WRITE_LONG_F(adr, res)
9122 POST_IO
9123RET(24)
9124}
9125
9126// MOVEL
9127OPCODE(0x20E8)
9128{
9129 u32 adr, res;
9130 u32 src, dst;
9131
9132 FETCH_SWORD(adr);
9133 adr += AREG((Opcode >> 0) & 7);
9134 PRE_IO
9135 READ_LONG_F(adr, res)
9136 flag_C = 0;
9137 flag_V = 0;
9138 flag_NotZ = res;
9139 flag_N = res >> 24;
9140 adr = AREG((Opcode >> 9) & 7);
9141 AREG((Opcode >> 9) & 7) += 4;
9142 WRITE_LONG_F(adr, res)
9143 POST_IO
9144RET(24)
9145}
9146
9147// MOVEL
9148OPCODE(0x2128)
9149{
9150 u32 adr, res;
9151 u32 src, dst;
9152
9153 FETCH_SWORD(adr);
9154 adr += AREG((Opcode >> 0) & 7);
9155 PRE_IO
9156 READ_LONG_F(adr, res)
9157 flag_C = 0;
9158 flag_V = 0;
9159 flag_NotZ = res;
9160 flag_N = res >> 24;
9161 adr = AREG((Opcode >> 9) & 7) - 4;
9162 AREG((Opcode >> 9) & 7) = adr;
80db4442 9163 WRITE_LONG_DEC_F(adr, res)
70357ce5 9164 POST_IO
9165RET(24)
9166}
9167
9168// MOVEL
9169OPCODE(0x2168)
9170{
9171 u32 adr, res;
9172 u32 src, dst;
9173
9174 FETCH_SWORD(adr);
9175 adr += AREG((Opcode >> 0) & 7);
9176 PRE_IO
9177 READ_LONG_F(adr, res)
9178 flag_C = 0;
9179 flag_V = 0;
9180 flag_NotZ = res;
9181 flag_N = res >> 24;
9182 FETCH_SWORD(adr);
9183 adr += AREG((Opcode >> 9) & 7);
9184 WRITE_LONG_F(adr, res)
9185 POST_IO
9186RET(28)
9187}
9188
9189// MOVEL
9190OPCODE(0x21A8)
9191{
9192 u32 adr, res;
9193 u32 src, dst;
9194
9195 FETCH_SWORD(adr);
9196 adr += AREG((Opcode >> 0) & 7);
9197 PRE_IO
9198 READ_LONG_F(adr, res)
9199 flag_C = 0;
9200 flag_V = 0;
9201 flag_NotZ = res;
9202 flag_N = res >> 24;
9203 adr = AREG((Opcode >> 9) & 7);
9204 DECODE_EXT_WORD
9205 WRITE_LONG_F(adr, res)
9206 POST_IO
9207RET(30)
9208}
9209
9210// MOVEL
9211OPCODE(0x21E8)
9212{
9213 u32 adr, res;
9214 u32 src, dst;
9215
9216 FETCH_SWORD(adr);
9217 adr += AREG((Opcode >> 0) & 7);
9218 PRE_IO
9219 READ_LONG_F(adr, res)
9220 flag_C = 0;
9221 flag_V = 0;
9222 flag_NotZ = res;
9223 flag_N = res >> 24;
9224 FETCH_SWORD(adr);
9225 WRITE_LONG_F(adr, res)
9226 POST_IO
9227RET(28)
9228}
9229
9230// MOVEL
9231OPCODE(0x23E8)
9232{
9233 u32 adr, res;
9234 u32 src, dst;
9235
9236 FETCH_SWORD(adr);
9237 adr += AREG((Opcode >> 0) & 7);
9238 PRE_IO
9239 READ_LONG_F(adr, res)
9240 flag_C = 0;
9241 flag_V = 0;
9242 flag_NotZ = res;
9243 flag_N = res >> 24;
9244 FETCH_LONG(adr);
9245 WRITE_LONG_F(adr, res)
9246 POST_IO
9247RET(32)
9248}
9249
9250// MOVEL
9251OPCODE(0x2EE8)
9252{
9253 u32 adr, res;
9254 u32 src, dst;
9255
9256 FETCH_SWORD(adr);
9257 adr += AREG((Opcode >> 0) & 7);
9258 PRE_IO
9259 READ_LONG_F(adr, res)
9260 flag_C = 0;
9261 flag_V = 0;
9262 flag_NotZ = res;
9263 flag_N = res >> 24;
9264 adr = AREG(7);
9265 AREG(7) += 4;
9266 WRITE_LONG_F(adr, res)
9267 POST_IO
9268RET(24)
9269}
9270
9271// MOVEL
9272OPCODE(0x2F28)
9273{
9274 u32 adr, res;
9275 u32 src, dst;
9276
9277 FETCH_SWORD(adr);
9278 adr += AREG((Opcode >> 0) & 7);
9279 PRE_IO
9280 READ_LONG_F(adr, res)
9281 flag_C = 0;
9282 flag_V = 0;
9283 flag_NotZ = res;
9284 flag_N = res >> 24;
9285 adr = AREG(7) - 4;
9286 AREG(7) = adr;
03e4f2a3 9287 WRITE_LONG_DEC_F(adr, res)
70357ce5 9288 POST_IO
9289RET(24)
9290}
9291
9292// MOVEL
9293OPCODE(0x2030)
9294{
9295 u32 adr, res;
9296 u32 src, dst;
9297
9298 adr = AREG((Opcode >> 0) & 7);
9299 DECODE_EXT_WORD
9300 PRE_IO
9301 READ_LONG_F(adr, res)
9302 flag_C = 0;
9303 flag_V = 0;
9304 flag_NotZ = res;
9305 flag_N = res >> 24;
9306 DREGu32((Opcode >> 9) & 7) = res;
9307 POST_IO
9308RET(18)
9309}
9310
9311// MOVEL
9312OPCODE(0x20B0)
9313{
9314 u32 adr, res;
9315 u32 src, dst;
9316
9317 adr = AREG((Opcode >> 0) & 7);
9318 DECODE_EXT_WORD
9319 PRE_IO
9320 READ_LONG_F(adr, res)
9321 flag_C = 0;
9322 flag_V = 0;
9323 flag_NotZ = res;
9324 flag_N = res >> 24;
9325 adr = AREG((Opcode >> 9) & 7);
9326 WRITE_LONG_F(adr, res)
9327 POST_IO
9328RET(26)
9329}
9330
9331// MOVEL
9332OPCODE(0x20F0)
9333{
9334 u32 adr, res;
9335 u32 src, dst;
9336
9337 adr = AREG((Opcode >> 0) & 7);
9338 DECODE_EXT_WORD
9339 PRE_IO
9340 READ_LONG_F(adr, res)
9341 flag_C = 0;
9342 flag_V = 0;
9343 flag_NotZ = res;
9344 flag_N = res >> 24;
9345 adr = AREG((Opcode >> 9) & 7);
9346 AREG((Opcode >> 9) & 7) += 4;
9347 WRITE_LONG_F(adr, res)
9348 POST_IO
9349RET(26)
9350}
9351
9352// MOVEL
9353OPCODE(0x2130)
9354{
9355 u32 adr, res;
9356 u32 src, dst;
9357
9358 adr = AREG((Opcode >> 0) & 7);
9359 DECODE_EXT_WORD
9360 PRE_IO
9361 READ_LONG_F(adr, res)
9362 flag_C = 0;
9363 flag_V = 0;
9364 flag_NotZ = res;
9365 flag_N = res >> 24;
9366 adr = AREG((Opcode >> 9) & 7) - 4;
9367 AREG((Opcode >> 9) & 7) = adr;
80db4442 9368 WRITE_LONG_DEC_F(adr, res)
70357ce5 9369 POST_IO
9370RET(26)
9371}
9372
9373// MOVEL
9374OPCODE(0x2170)
9375{
9376 u32 adr, res;
9377 u32 src, dst;
9378
9379 adr = AREG((Opcode >> 0) & 7);
9380 DECODE_EXT_WORD
9381 PRE_IO
9382 READ_LONG_F(adr, res)
9383 flag_C = 0;
9384 flag_V = 0;
9385 flag_NotZ = res;
9386 flag_N = res >> 24;
9387 FETCH_SWORD(adr);
9388 adr += AREG((Opcode >> 9) & 7);
9389 WRITE_LONG_F(adr, res)
9390 POST_IO
9391RET(30)
9392}
9393
9394// MOVEL
9395OPCODE(0x21B0)
9396{
9397 u32 adr, res;
9398 u32 src, dst;
9399
9400 adr = AREG((Opcode >> 0) & 7);
9401 DECODE_EXT_WORD
9402 PRE_IO
9403 READ_LONG_F(adr, res)
9404 flag_C = 0;
9405 flag_V = 0;
9406 flag_NotZ = res;
9407 flag_N = res >> 24;
9408 adr = AREG((Opcode >> 9) & 7);
9409 DECODE_EXT_WORD
9410 WRITE_LONG_F(adr, res)
9411 POST_IO
9412RET(32)
9413}
9414
9415// MOVEL
9416OPCODE(0x21F0)
9417{
9418 u32 adr, res;
9419 u32 src, dst;
9420
9421 adr = AREG((Opcode >> 0) & 7);
9422 DECODE_EXT_WORD
9423 PRE_IO
9424 READ_LONG_F(adr, res)
9425 flag_C = 0;
9426 flag_V = 0;
9427 flag_NotZ = res;
9428 flag_N = res >> 24;
9429 FETCH_SWORD(adr);
9430 WRITE_LONG_F(adr, res)
9431 POST_IO
9432RET(30)
9433}
9434
9435// MOVEL
9436OPCODE(0x23F0)
9437{
9438 u32 adr, res;
9439 u32 src, dst;
9440
9441 adr = AREG((Opcode >> 0) & 7);
9442 DECODE_EXT_WORD
9443 PRE_IO
9444 READ_LONG_F(adr, res)
9445 flag_C = 0;
9446 flag_V = 0;
9447 flag_NotZ = res;
9448 flag_N = res >> 24;
9449 FETCH_LONG(adr);
9450 WRITE_LONG_F(adr, res)
9451 POST_IO
9452RET(34)
9453}
9454
9455// MOVEL
9456OPCODE(0x2EF0)
9457{
9458 u32 adr, res;
9459 u32 src, dst;
9460
9461 adr = AREG((Opcode >> 0) & 7);
9462 DECODE_EXT_WORD
9463 PRE_IO
9464 READ_LONG_F(adr, res)
9465 flag_C = 0;
9466 flag_V = 0;
9467 flag_NotZ = res;
9468 flag_N = res >> 24;
9469 adr = AREG(7);
9470 AREG(7) += 4;
9471 WRITE_LONG_F(adr, res)
9472 POST_IO
9473RET(26)
9474}
9475
9476// MOVEL
9477OPCODE(0x2F30)
9478{
9479 u32 adr, res;
9480 u32 src, dst;
9481
9482 adr = AREG((Opcode >> 0) & 7);
9483 DECODE_EXT_WORD
9484 PRE_IO
9485 READ_LONG_F(adr, res)
9486 flag_C = 0;
9487 flag_V = 0;
9488 flag_NotZ = res;
9489 flag_N = res >> 24;
9490 adr = AREG(7) - 4;
9491 AREG(7) = adr;
03e4f2a3 9492 WRITE_LONG_DEC_F(adr, res)
70357ce5 9493 POST_IO
9494RET(26)
9495}
9496
9497// MOVEL
9498OPCODE(0x2038)
9499{
9500 u32 adr, res;
9501 u32 src, dst;
9502
9503 FETCH_SWORD(adr);
9504 PRE_IO
9505 READ_LONG_F(adr, res)
9506 flag_C = 0;
9507 flag_V = 0;
9508 flag_NotZ = res;
9509 flag_N = res >> 24;
9510 DREGu32((Opcode >> 9) & 7) = res;
9511 POST_IO
9512RET(16)
9513}
9514
9515// MOVEL
9516OPCODE(0x20B8)
9517{
9518 u32 adr, res;
9519 u32 src, dst;
9520
9521 FETCH_SWORD(adr);
9522 PRE_IO
9523 READ_LONG_F(adr, res)
9524 flag_C = 0;
9525 flag_V = 0;
9526 flag_NotZ = res;
9527 flag_N = res >> 24;
9528 adr = AREG((Opcode >> 9) & 7);
9529 WRITE_LONG_F(adr, res)
9530 POST_IO
9531RET(24)
9532}
9533
9534// MOVEL
9535OPCODE(0x20F8)
9536{
9537 u32 adr, res;
9538 u32 src, dst;
9539
9540 FETCH_SWORD(adr);
9541 PRE_IO
9542 READ_LONG_F(adr, res)
9543 flag_C = 0;
9544 flag_V = 0;
9545 flag_NotZ = res;
9546 flag_N = res >> 24;
9547 adr = AREG((Opcode >> 9) & 7);
9548 AREG((Opcode >> 9) & 7) += 4;
9549 WRITE_LONG_F(adr, res)
9550 POST_IO
9551RET(24)
9552}
9553
9554// MOVEL
9555OPCODE(0x2138)
9556{
9557 u32 adr, res;
9558 u32 src, dst;
9559
9560 FETCH_SWORD(adr);
9561 PRE_IO
9562 READ_LONG_F(adr, res)
9563 flag_C = 0;
9564 flag_V = 0;
9565 flag_NotZ = res;
9566 flag_N = res >> 24;
9567 adr = AREG((Opcode >> 9) & 7) - 4;
9568 AREG((Opcode >> 9) & 7) = adr;
80db4442 9569 WRITE_LONG_DEC_F(adr, res)
70357ce5 9570 POST_IO
9571RET(24)
9572}
9573
9574// MOVEL
9575OPCODE(0x2178)
9576{
9577 u32 adr, res;
9578 u32 src, dst;
9579
9580 FETCH_SWORD(adr);
9581 PRE_IO
9582 READ_LONG_F(adr, res)
9583 flag_C = 0;
9584 flag_V = 0;
9585 flag_NotZ = res;
9586 flag_N = res >> 24;
9587 FETCH_SWORD(adr);
9588 adr += AREG((Opcode >> 9) & 7);
9589 WRITE_LONG_F(adr, res)
9590 POST_IO
9591RET(28)
9592}
9593
9594// MOVEL
9595OPCODE(0x21B8)
9596{
9597 u32 adr, res;
9598 u32 src, dst;
9599
9600 FETCH_SWORD(adr);
9601 PRE_IO
9602 READ_LONG_F(adr, res)
9603 flag_C = 0;
9604 flag_V = 0;
9605 flag_NotZ = res;
9606 flag_N = res >> 24;
9607 adr = AREG((Opcode >> 9) & 7);
9608 DECODE_EXT_WORD
9609 WRITE_LONG_F(adr, res)
9610 POST_IO
9611RET(30)
9612}
9613
9614// MOVEL
9615OPCODE(0x21F8)
9616{
9617 u32 adr, res;
9618 u32 src, dst;
9619
9620 FETCH_SWORD(adr);
9621 PRE_IO
9622 READ_LONG_F(adr, res)
9623 flag_C = 0;
9624 flag_V = 0;
9625 flag_NotZ = res;
9626 flag_N = res >> 24;
9627 FETCH_SWORD(adr);
9628 WRITE_LONG_F(adr, res)
9629 POST_IO
9630RET(28)
9631}
9632
9633// MOVEL
9634OPCODE(0x23F8)
9635{
9636 u32 adr, res;
9637 u32 src, dst;
9638
9639 FETCH_SWORD(adr);
9640 PRE_IO
9641 READ_LONG_F(adr, res)
9642 flag_C = 0;
9643 flag_V = 0;
9644 flag_NotZ = res;
9645 flag_N = res >> 24;
9646 FETCH_LONG(adr);
9647 WRITE_LONG_F(adr, res)
9648 POST_IO
9649RET(32)
9650}
9651
9652// MOVEL
9653OPCODE(0x2EF8)
9654{
9655 u32 adr, res;
9656 u32 src, dst;
9657
9658 FETCH_SWORD(adr);
9659 PRE_IO
9660 READ_LONG_F(adr, res)
9661 flag_C = 0;
9662 flag_V = 0;
9663 flag_NotZ = res;
9664 flag_N = res >> 24;
9665 adr = AREG(7);
9666 AREG(7) += 4;
9667 WRITE_LONG_F(adr, res)
9668 POST_IO
9669RET(24)
9670}
9671
9672// MOVEL
9673OPCODE(0x2F38)
9674{
9675 u32 adr, res;
9676 u32 src, dst;
9677
9678 FETCH_SWORD(adr);
9679 PRE_IO
9680 READ_LONG_F(adr, res)
9681 flag_C = 0;
9682 flag_V = 0;
9683 flag_NotZ = res;
9684 flag_N = res >> 24;
9685 adr = AREG(7) - 4;
9686 AREG(7) = adr;
03e4f2a3 9687 WRITE_LONG_DEC_F(adr, res)
70357ce5 9688 POST_IO
9689RET(24)
9690}
9691
9692// MOVEL
9693OPCODE(0x2039)
9694{
9695 u32 adr, res;
9696 u32 src, dst;
9697
9698 FETCH_LONG(adr);
9699 PRE_IO
9700 READ_LONG_F(adr, res)
9701 flag_C = 0;
9702 flag_V = 0;
9703 flag_NotZ = res;
9704 flag_N = res >> 24;
9705 DREGu32((Opcode >> 9) & 7) = res;
9706 POST_IO
9707RET(20)
9708}
9709
9710// MOVEL
9711OPCODE(0x20B9)
9712{
9713 u32 adr, res;
9714 u32 src, dst;
9715
9716 FETCH_LONG(adr);
9717 PRE_IO
9718 READ_LONG_F(adr, res)
9719 flag_C = 0;
9720 flag_V = 0;
9721 flag_NotZ = res;
9722 flag_N = res >> 24;
9723 adr = AREG((Opcode >> 9) & 7);
9724 WRITE_LONG_F(adr, res)
9725 POST_IO
9726RET(28)
9727}
9728
9729// MOVEL
9730OPCODE(0x20F9)
9731{
9732 u32 adr, res;
9733 u32 src, dst;
9734
9735 FETCH_LONG(adr);
9736 PRE_IO
9737 READ_LONG_F(adr, res)
9738 flag_C = 0;
9739 flag_V = 0;
9740 flag_NotZ = res;
9741 flag_N = res >> 24;
9742 adr = AREG((Opcode >> 9) & 7);
9743 AREG((Opcode >> 9) & 7) += 4;
9744 WRITE_LONG_F(adr, res)
9745 POST_IO
9746RET(28)
9747}
9748
9749// MOVEL
9750OPCODE(0x2139)
9751{
9752 u32 adr, res;
9753 u32 src, dst;
9754
9755 FETCH_LONG(adr);
9756 PRE_IO
9757 READ_LONG_F(adr, res)
9758 flag_C = 0;
9759 flag_V = 0;
9760 flag_NotZ = res;
9761 flag_N = res >> 24;
9762 adr = AREG((Opcode >> 9) & 7) - 4;
9763 AREG((Opcode >> 9) & 7) = adr;
80db4442 9764 WRITE_LONG_DEC_F(adr, res)
70357ce5 9765 POST_IO
9766RET(28)
9767}
9768
9769// MOVEL
9770OPCODE(0x2179)
9771{
9772 u32 adr, res;
9773 u32 src, dst;
9774
9775 FETCH_LONG(adr);
9776 PRE_IO
9777 READ_LONG_F(adr, res)
9778 flag_C = 0;
9779 flag_V = 0;
9780 flag_NotZ = res;
9781 flag_N = res >> 24;
9782 FETCH_SWORD(adr);
9783 adr += AREG((Opcode >> 9) & 7);
9784 WRITE_LONG_F(adr, res)
9785 POST_IO
9786RET(32)
9787}
9788
9789// MOVEL
9790OPCODE(0x21B9)
9791{
9792 u32 adr, res;
9793 u32 src, dst;
9794
9795 FETCH_LONG(adr);
9796 PRE_IO
9797 READ_LONG_F(adr, res)
9798 flag_C = 0;
9799 flag_V = 0;
9800 flag_NotZ = res;
9801 flag_N = res >> 24;
9802 adr = AREG((Opcode >> 9) & 7);
9803 DECODE_EXT_WORD
9804 WRITE_LONG_F(adr, res)
9805 POST_IO
9806RET(34)
9807}
9808
9809// MOVEL
9810OPCODE(0x21F9)
9811{
9812 u32 adr, res;
9813 u32 src, dst;
9814
9815 FETCH_LONG(adr);
9816 PRE_IO
9817 READ_LONG_F(adr, res)
9818 flag_C = 0;
9819 flag_V = 0;
9820 flag_NotZ = res;
9821 flag_N = res >> 24;
9822 FETCH_SWORD(adr);
9823 WRITE_LONG_F(adr, res)
9824 POST_IO
9825RET(32)
9826}
9827
9828// MOVEL
9829OPCODE(0x23F9)
9830{
9831 u32 adr, res;
9832 u32 src, dst;
9833
9834 FETCH_LONG(adr);
9835 PRE_IO
9836 READ_LONG_F(adr, res)
9837 flag_C = 0;
9838 flag_V = 0;
9839 flag_NotZ = res;
9840 flag_N = res >> 24;
9841 FETCH_LONG(adr);
9842 WRITE_LONG_F(adr, res)
9843 POST_IO
9844RET(36)
9845}
9846
9847// MOVEL
9848OPCODE(0x2EF9)
9849{
9850 u32 adr, res;
9851 u32 src, dst;
9852
9853 FETCH_LONG(adr);
9854 PRE_IO
9855 READ_LONG_F(adr, res)
9856 flag_C = 0;
9857 flag_V = 0;
9858 flag_NotZ = res;
9859 flag_N = res >> 24;
9860 adr = AREG(7);
9861 AREG(7) += 4;
9862 WRITE_LONG_F(adr, res)
9863 POST_IO
9864RET(28)
9865}
9866
9867// MOVEL
9868OPCODE(0x2F39)
9869{
9870 u32 adr, res;
9871 u32 src, dst;
9872
9873 FETCH_LONG(adr);
9874 PRE_IO
9875 READ_LONG_F(adr, res)
9876 flag_C = 0;
9877 flag_V = 0;
9878 flag_NotZ = res;
9879 flag_N = res >> 24;
9880 adr = AREG(7) - 4;
9881 AREG(7) = adr;
03e4f2a3 9882 WRITE_LONG_DEC_F(adr, res)
70357ce5 9883 POST_IO
9884RET(28)
9885}
9886
9887// MOVEL
9888OPCODE(0x203A)
9889{
9890 u32 adr, res;
9891 u32 src, dst;
9892
be26eb23 9893 adr = GET_SWORD + GET_PC;
70357ce5 9894 PC++;
9895 PRE_IO
9896 READ_LONG_F(adr, res)
9897 flag_C = 0;
9898 flag_V = 0;
9899 flag_NotZ = res;
9900 flag_N = res >> 24;
9901 DREGu32((Opcode >> 9) & 7) = res;
9902 POST_IO
9903RET(16)
9904}
9905
9906// MOVEL
9907OPCODE(0x20BA)
9908{
9909 u32 adr, res;
9910 u32 src, dst;
9911
be26eb23 9912 adr = GET_SWORD + GET_PC;
70357ce5 9913 PC++;
9914 PRE_IO
9915 READ_LONG_F(adr, res)
9916 flag_C = 0;
9917 flag_V = 0;
9918 flag_NotZ = res;
9919 flag_N = res >> 24;
9920 adr = AREG((Opcode >> 9) & 7);
9921 WRITE_LONG_F(adr, res)
9922 POST_IO
9923RET(24)
9924}
9925
9926// MOVEL
9927OPCODE(0x20FA)
9928{
9929 u32 adr, res;
9930 u32 src, dst;
9931
be26eb23 9932 adr = GET_SWORD + GET_PC;
70357ce5 9933 PC++;
9934 PRE_IO
9935 READ_LONG_F(adr, res)
9936 flag_C = 0;
9937 flag_V = 0;
9938 flag_NotZ = res;
9939 flag_N = res >> 24;
9940 adr = AREG((Opcode >> 9) & 7);
9941 AREG((Opcode >> 9) & 7) += 4;
9942 WRITE_LONG_F(adr, res)
9943 POST_IO
9944RET(24)
9945}
9946
9947// MOVEL
9948OPCODE(0x213A)
9949{
9950 u32 adr, res;
9951 u32 src, dst;
9952
be26eb23 9953 adr = GET_SWORD + GET_PC;
70357ce5 9954 PC++;
9955 PRE_IO
9956 READ_LONG_F(adr, res)
9957 flag_C = 0;
9958 flag_V = 0;
9959 flag_NotZ = res;
9960 flag_N = res >> 24;
9961 adr = AREG((Opcode >> 9) & 7) - 4;
9962 AREG((Opcode >> 9) & 7) = adr;
80db4442 9963 WRITE_LONG_DEC_F(adr, res)
70357ce5 9964 POST_IO
9965RET(24)
9966}
9967
9968// MOVEL
9969OPCODE(0x217A)
9970{
9971 u32 adr, res;
9972 u32 src, dst;
9973
be26eb23 9974 adr = GET_SWORD + GET_PC;
70357ce5 9975 PC++;
9976 PRE_IO
9977 READ_LONG_F(adr, res)
9978 flag_C = 0;
9979 flag_V = 0;
9980 flag_NotZ = res;
9981 flag_N = res >> 24;
9982 FETCH_SWORD(adr);
9983 adr += AREG((Opcode >> 9) & 7);
9984 WRITE_LONG_F(adr, res)
9985 POST_IO
9986RET(28)
9987}
9988
9989// MOVEL
9990OPCODE(0x21BA)
9991{
9992 u32 adr, res;
9993 u32 src, dst;
9994
be26eb23 9995 adr = GET_SWORD + GET_PC;
70357ce5 9996 PC++;
9997 PRE_IO
9998 READ_LONG_F(adr, res)
9999 flag_C = 0;
10000 flag_V = 0;
10001 flag_NotZ = res;
10002 flag_N = res >> 24;
10003 adr = AREG((Opcode >> 9) & 7);
10004 DECODE_EXT_WORD
10005 WRITE_LONG_F(adr, res)
10006 POST_IO
10007RET(30)
10008}
10009
10010// MOVEL
10011OPCODE(0x21FA)
10012{
10013 u32 adr, res;
10014 u32 src, dst;
10015
be26eb23 10016 adr = GET_SWORD + GET_PC;
70357ce5 10017 PC++;
10018 PRE_IO
10019 READ_LONG_F(adr, res)
10020 flag_C = 0;
10021 flag_V = 0;
10022 flag_NotZ = res;
10023 flag_N = res >> 24;
10024 FETCH_SWORD(adr);
10025 WRITE_LONG_F(adr, res)
10026 POST_IO
10027RET(28)
10028}
10029
10030// MOVEL
10031OPCODE(0x23FA)
10032{
10033 u32 adr, res;
10034 u32 src, dst;
10035
be26eb23 10036 adr = GET_SWORD + GET_PC;
70357ce5 10037 PC++;
10038 PRE_IO
10039 READ_LONG_F(adr, res)
10040 flag_C = 0;
10041 flag_V = 0;
10042 flag_NotZ = res;
10043 flag_N = res >> 24;
10044 FETCH_LONG(adr);
10045 WRITE_LONG_F(adr, res)
10046 POST_IO
10047RET(32)
10048}
10049
10050// MOVEL
10051OPCODE(0x2EFA)
10052{
10053 u32 adr, res;
10054 u32 src, dst;
10055
be26eb23 10056 adr = GET_SWORD + GET_PC;
70357ce5 10057 PC++;
10058 PRE_IO
10059 READ_LONG_F(adr, res)
10060 flag_C = 0;
10061 flag_V = 0;
10062 flag_NotZ = res;
10063 flag_N = res >> 24;
10064 adr = AREG(7);
10065 AREG(7) += 4;
10066 WRITE_LONG_F(adr, res)
10067 POST_IO
10068RET(24)
10069}
10070
10071// MOVEL
10072OPCODE(0x2F3A)
10073{
10074 u32 adr, res;
10075 u32 src, dst;
10076
be26eb23 10077 adr = GET_SWORD + GET_PC;
70357ce5 10078 PC++;
10079 PRE_IO
10080 READ_LONG_F(adr, res)
10081 flag_C = 0;
10082 flag_V = 0;
10083 flag_NotZ = res;
10084 flag_N = res >> 24;
10085 adr = AREG(7) - 4;
10086 AREG(7) = adr;
03e4f2a3 10087 WRITE_LONG_DEC_F(adr, res)
70357ce5 10088 POST_IO
10089RET(24)
10090}
10091
10092// MOVEL
10093OPCODE(0x203B)
10094{
10095 u32 adr, res;
10096 u32 src, dst;
10097
be26eb23 10098 adr = GET_PC;
70357ce5 10099 DECODE_EXT_WORD
10100 PRE_IO
10101 READ_LONG_F(adr, res)
10102 flag_C = 0;
10103 flag_V = 0;
10104 flag_NotZ = res;
10105 flag_N = res >> 24;
10106 DREGu32((Opcode >> 9) & 7) = res;
10107 POST_IO
10108RET(18)
10109}
10110
10111// MOVEL
10112OPCODE(0x20BB)
10113{
10114 u32 adr, res;
10115 u32 src, dst;
10116
be26eb23 10117 adr = GET_PC;
70357ce5 10118 DECODE_EXT_WORD
10119 PRE_IO
10120 READ_LONG_F(adr, res)
10121 flag_C = 0;
10122 flag_V = 0;
10123 flag_NotZ = res;
10124 flag_N = res >> 24;
10125 adr = AREG((Opcode >> 9) & 7);
10126 WRITE_LONG_F(adr, res)
10127 POST_IO
10128RET(26)
10129}
10130
10131// MOVEL
10132OPCODE(0x20FB)
10133{
10134 u32 adr, res;
10135 u32 src, dst;
10136
be26eb23 10137 adr = GET_PC;
70357ce5 10138 DECODE_EXT_WORD
10139 PRE_IO
10140 READ_LONG_F(adr, res)
10141 flag_C = 0;
10142 flag_V = 0;
10143 flag_NotZ = res;
10144 flag_N = res >> 24;
10145 adr = AREG((Opcode >> 9) & 7);
10146 AREG((Opcode >> 9) & 7) += 4;
10147 WRITE_LONG_F(adr, res)
10148 POST_IO
10149RET(26)
10150}
10151
10152// MOVEL
10153OPCODE(0x213B)
10154{
10155 u32 adr, res;
10156 u32 src, dst;
10157
be26eb23 10158 adr = GET_PC;
70357ce5 10159 DECODE_EXT_WORD
10160 PRE_IO
10161 READ_LONG_F(adr, res)
10162 flag_C = 0;
10163 flag_V = 0;
10164 flag_NotZ = res;
10165 flag_N = res >> 24;
10166 adr = AREG((Opcode >> 9) & 7) - 4;
10167 AREG((Opcode >> 9) & 7) = adr;
80db4442 10168 WRITE_LONG_DEC_F(adr, res)
70357ce5 10169 POST_IO
10170RET(26)
10171}
10172
10173// MOVEL
10174OPCODE(0x217B)
10175{
10176 u32 adr, res;
10177 u32 src, dst;
10178
be26eb23 10179 adr = GET_PC;
70357ce5 10180 DECODE_EXT_WORD
10181 PRE_IO
10182 READ_LONG_F(adr, res)
10183 flag_C = 0;
10184 flag_V = 0;
10185 flag_NotZ = res;
10186 flag_N = res >> 24;
10187 FETCH_SWORD(adr);
10188 adr += AREG((Opcode >> 9) & 7);
10189 WRITE_LONG_F(adr, res)
10190 POST_IO
10191RET(30)
10192}
10193
10194// MOVEL
10195OPCODE(0x21BB)
10196{
10197 u32 adr, res;
10198 u32 src, dst;
10199
be26eb23 10200 adr = GET_PC;
70357ce5 10201 DECODE_EXT_WORD
10202 PRE_IO
10203 READ_LONG_F(adr, res)
10204 flag_C = 0;
10205 flag_V = 0;
10206 flag_NotZ = res;
10207 flag_N = res >> 24;
10208 adr = AREG((Opcode >> 9) & 7);
10209 DECODE_EXT_WORD
10210 WRITE_LONG_F(adr, res)
10211 POST_IO
10212RET(32)
10213}
10214
10215// MOVEL
10216OPCODE(0x21FB)
10217{
10218 u32 adr, res;
10219 u32 src, dst;
10220
be26eb23 10221 adr = GET_PC;
70357ce5 10222 DECODE_EXT_WORD
10223 PRE_IO
10224 READ_LONG_F(adr, res)
10225 flag_C = 0;
10226 flag_V = 0;
10227 flag_NotZ = res;
10228 flag_N = res >> 24;
10229 FETCH_SWORD(adr);
10230 WRITE_LONG_F(adr, res)
10231 POST_IO
10232RET(30)
10233}
10234
10235// MOVEL
10236OPCODE(0x23FB)
10237{
10238 u32 adr, res;
10239 u32 src, dst;
10240
be26eb23 10241 adr = GET_PC;
70357ce5 10242 DECODE_EXT_WORD
10243 PRE_IO
10244 READ_LONG_F(adr, res)
10245 flag_C = 0;
10246 flag_V = 0;
10247 flag_NotZ = res;
10248 flag_N = res >> 24;
10249 FETCH_LONG(adr);
10250 WRITE_LONG_F(adr, res)
10251 POST_IO
10252RET(34)
10253}
10254
10255// MOVEL
10256OPCODE(0x2EFB)
10257{
10258 u32 adr, res;
10259 u32 src, dst;
10260
be26eb23 10261 adr = GET_PC;
70357ce5 10262 DECODE_EXT_WORD
10263 PRE_IO
10264 READ_LONG_F(adr, res)
10265 flag_C = 0;
10266 flag_V = 0;
10267 flag_NotZ = res;
10268 flag_N = res >> 24;
10269 adr = AREG(7);
10270 AREG(7) += 4;
10271 WRITE_LONG_F(adr, res)
10272 POST_IO
10273RET(26)
10274}
10275
10276// MOVEL
10277OPCODE(0x2F3B)
10278{
10279 u32 adr, res;
10280 u32 src, dst;
10281
be26eb23 10282 adr = GET_PC;
70357ce5 10283 DECODE_EXT_WORD
10284 PRE_IO
10285 READ_LONG_F(adr, res)
10286 flag_C = 0;
10287 flag_V = 0;
10288 flag_NotZ = res;
10289 flag_N = res >> 24;
10290 adr = AREG(7) - 4;
10291 AREG(7) = adr;
03e4f2a3 10292 WRITE_LONG_DEC_F(adr, res)
70357ce5 10293 POST_IO
10294RET(26)
10295}
10296
10297// MOVEL
10298OPCODE(0x203C)
10299{
10300 u32 adr, res;
10301 u32 src, dst;
10302
10303 FETCH_LONG(res);
10304 flag_C = 0;
10305 flag_V = 0;
10306 flag_NotZ = res;
10307 flag_N = res >> 24;
10308 DREGu32((Opcode >> 9) & 7) = res;
10309RET(12)
10310}
10311
10312// MOVEL
10313OPCODE(0x20BC)
10314{
10315 u32 adr, res;
10316 u32 src, dst;
10317
10318 FETCH_LONG(res);
10319 flag_C = 0;
10320 flag_V = 0;
10321 flag_NotZ = res;
10322 flag_N = res >> 24;
10323 adr = AREG((Opcode >> 9) & 7);
10324 PRE_IO
10325 WRITE_LONG_F(adr, res)
10326 POST_IO
10327RET(20)
10328}
10329
10330// MOVEL
10331OPCODE(0x20FC)
10332{
10333 u32 adr, res;
10334 u32 src, dst;
10335
10336 FETCH_LONG(res);
10337 flag_C = 0;
10338 flag_V = 0;
10339 flag_NotZ = res;
10340 flag_N = res >> 24;
10341 adr = AREG((Opcode >> 9) & 7);
10342 AREG((Opcode >> 9) & 7) += 4;
10343 PRE_IO
10344 WRITE_LONG_F(adr, res)
10345 POST_IO
10346RET(20)
10347}
10348
10349// MOVEL
10350OPCODE(0x213C)
10351{
10352 u32 adr, res;
10353 u32 src, dst;
10354
10355 FETCH_LONG(res);
10356 flag_C = 0;
10357 flag_V = 0;
10358 flag_NotZ = res;
10359 flag_N = res >> 24;
10360 adr = AREG((Opcode >> 9) & 7) - 4;
10361 AREG((Opcode >> 9) & 7) = adr;
10362 PRE_IO
80db4442 10363 WRITE_LONG_DEC_F(adr, res)
70357ce5 10364 POST_IO
10365RET(20)
10366}
10367
10368// MOVEL
10369OPCODE(0x217C)
10370{
10371 u32 adr, res;
10372 u32 src, dst;
10373
10374 FETCH_LONG(res);
10375 flag_C = 0;
10376 flag_V = 0;
10377 flag_NotZ = res;
10378 flag_N = res >> 24;
10379 FETCH_SWORD(adr);
10380 adr += AREG((Opcode >> 9) & 7);
10381 PRE_IO
10382 WRITE_LONG_F(adr, res)
10383 POST_IO
10384RET(24)
10385}
10386
10387// MOVEL
10388OPCODE(0x21BC)
10389{
10390 u32 adr, res;
10391 u32 src, dst;
10392
10393 FETCH_LONG(res);
10394 flag_C = 0;
10395 flag_V = 0;
10396 flag_NotZ = res;
10397 flag_N = res >> 24;
10398 adr = AREG((Opcode >> 9) & 7);
10399 DECODE_EXT_WORD
10400 PRE_IO
10401 WRITE_LONG_F(adr, res)
10402 POST_IO
10403RET(26)
10404}
10405
10406// MOVEL
10407OPCODE(0x21FC)
10408{
10409 u32 adr, res;
10410 u32 src, dst;
10411
10412 FETCH_LONG(res);
10413 flag_C = 0;
10414 flag_V = 0;
10415 flag_NotZ = res;
10416 flag_N = res >> 24;
10417 FETCH_SWORD(adr);
10418 PRE_IO
10419 WRITE_LONG_F(adr, res)
10420 POST_IO
10421RET(24)
10422}
10423
10424// MOVEL
10425OPCODE(0x23FC)
10426{
10427 u32 adr, res;
10428 u32 src, dst;
10429
10430 FETCH_LONG(res);
10431 flag_C = 0;
10432 flag_V = 0;
10433 flag_NotZ = res;
10434 flag_N = res >> 24;
10435 FETCH_LONG(adr);
10436 PRE_IO
10437 WRITE_LONG_F(adr, res)
10438 POST_IO
10439RET(28)
10440}
10441
10442// MOVEL
10443OPCODE(0x2EFC)
10444{
10445 u32 adr, res;
10446 u32 src, dst;
10447
10448 FETCH_LONG(res);
10449 flag_C = 0;
10450 flag_V = 0;
10451 flag_NotZ = res;
10452 flag_N = res >> 24;
10453 adr = AREG(7);
10454 AREG(7) += 4;
10455 PRE_IO
10456 WRITE_LONG_F(adr, res)
10457 POST_IO
10458RET(20)
10459}
10460
10461// MOVEL
10462OPCODE(0x2F3C)
10463{
10464 u32 adr, res;
10465 u32 src, dst;
10466
10467 FETCH_LONG(res);
10468 flag_C = 0;
10469 flag_V = 0;
10470 flag_NotZ = res;
10471 flag_N = res >> 24;
10472 adr = AREG(7) - 4;
10473 AREG(7) = adr;
10474 PRE_IO
03e4f2a3 10475 WRITE_LONG_DEC_F(adr, res)
70357ce5 10476 POST_IO
10477RET(20)
10478}
10479
10480// MOVEL
10481OPCODE(0x201F)
10482{
10483 u32 adr, res;
10484 u32 src, dst;
10485
10486 adr = AREG(7);
10487 AREG(7) += 4;
10488 PRE_IO
10489 READ_LONG_F(adr, res)
10490 flag_C = 0;
10491 flag_V = 0;
10492 flag_NotZ = res;
10493 flag_N = res >> 24;
10494 DREGu32((Opcode >> 9) & 7) = res;
10495 POST_IO
10496RET(12)
10497}
10498
10499// MOVEL
10500OPCODE(0x209F)
10501{
10502 u32 adr, res;
10503 u32 src, dst;
10504
10505 adr = AREG(7);
10506 AREG(7) += 4;
10507 PRE_IO
10508 READ_LONG_F(adr, res)
10509 flag_C = 0;
10510 flag_V = 0;
10511 flag_NotZ = res;
10512 flag_N = res >> 24;
10513 adr = AREG((Opcode >> 9) & 7);
10514 WRITE_LONG_F(adr, res)
10515 POST_IO
10516RET(20)
10517}
10518
10519// MOVEL
10520OPCODE(0x20DF)
10521{
10522 u32 adr, res;
10523 u32 src, dst;
10524
10525 adr = AREG(7);
10526 AREG(7) += 4;
10527 PRE_IO
10528 READ_LONG_F(adr, res)
10529 flag_C = 0;
10530 flag_V = 0;
10531 flag_NotZ = res;
10532 flag_N = res >> 24;
10533 adr = AREG((Opcode >> 9) & 7);
10534 AREG((Opcode >> 9) & 7) += 4;
10535 WRITE_LONG_F(adr, res)
10536 POST_IO
10537RET(20)
10538}
10539
10540// MOVEL
10541OPCODE(0x211F)
10542{
10543 u32 adr, res;
10544 u32 src, dst;
10545
10546 adr = AREG(7);
10547 AREG(7) += 4;
10548 PRE_IO
10549 READ_LONG_F(adr, res)
10550 flag_C = 0;
10551 flag_V = 0;
10552 flag_NotZ = res;
10553 flag_N = res >> 24;
10554 adr = AREG((Opcode >> 9) & 7) - 4;
10555 AREG((Opcode >> 9) & 7) = adr;
80db4442 10556 WRITE_LONG_DEC_F(adr, res)
70357ce5 10557 POST_IO
10558RET(20)
10559}
10560
10561// MOVEL
10562OPCODE(0x215F)
10563{
10564 u32 adr, res;
10565 u32 src, dst;
10566
10567 adr = AREG(7);
10568 AREG(7) += 4;
10569 PRE_IO
10570 READ_LONG_F(adr, res)
10571 flag_C = 0;
10572 flag_V = 0;
10573 flag_NotZ = res;
10574 flag_N = res >> 24;
10575 FETCH_SWORD(adr);
10576 adr += AREG((Opcode >> 9) & 7);
10577 WRITE_LONG_F(adr, res)
10578 POST_IO
10579RET(24)
10580}
10581
10582// MOVEL
10583OPCODE(0x219F)
10584{
10585 u32 adr, res;
10586 u32 src, dst;
10587
10588 adr = AREG(7);
10589 AREG(7) += 4;
10590 PRE_IO
10591 READ_LONG_F(adr, res)
10592 flag_C = 0;
10593 flag_V = 0;
10594 flag_NotZ = res;
10595 flag_N = res >> 24;
10596 adr = AREG((Opcode >> 9) & 7);
10597 DECODE_EXT_WORD
10598 WRITE_LONG_F(adr, res)
10599 POST_IO
10600RET(26)
10601}
10602
10603// MOVEL
10604OPCODE(0x21DF)
10605{
10606 u32 adr, res;
10607 u32 src, dst;
10608
10609 adr = AREG(7);
10610 AREG(7) += 4;
10611 PRE_IO
10612 READ_LONG_F(adr, res)
10613 flag_C = 0;
10614 flag_V = 0;
10615 flag_NotZ = res;
10616 flag_N = res >> 24;
10617 FETCH_SWORD(adr);
10618 WRITE_LONG_F(adr, res)
10619 POST_IO
10620RET(24)
10621}
10622
10623// MOVEL
10624OPCODE(0x23DF)
10625{
10626 u32 adr, res;
10627 u32 src, dst;
10628
10629 adr = AREG(7);
10630 AREG(7) += 4;
10631 PRE_IO
10632 READ_LONG_F(adr, res)
10633 flag_C = 0;
10634 flag_V = 0;
10635 flag_NotZ = res;
10636 flag_N = res >> 24;
10637 FETCH_LONG(adr);
10638 WRITE_LONG_F(adr, res)
10639 POST_IO
10640RET(28)
10641}
10642
10643// MOVEL
10644OPCODE(0x2EDF)
10645{
10646 u32 adr, res;
10647 u32 src, dst;
10648
10649 adr = AREG(7);
10650 AREG(7) += 4;
10651 PRE_IO
10652 READ_LONG_F(adr, res)
10653 flag_C = 0;
10654 flag_V = 0;
10655 flag_NotZ = res;
10656 flag_N = res >> 24;
10657 adr = AREG(7);
10658 AREG(7) += 4;
10659 WRITE_LONG_F(adr, res)
10660 POST_IO
10661RET(20)
10662}
10663
10664// MOVEL
10665OPCODE(0x2F1F)
10666{
10667 u32 adr, res;
10668 u32 src, dst;
10669
10670 adr = AREG(7);
10671 AREG(7) += 4;
10672 PRE_IO
10673 READ_LONG_F(adr, res)
10674 flag_C = 0;
10675 flag_V = 0;
10676 flag_NotZ = res;
10677 flag_N = res >> 24;
10678 adr = AREG(7) - 4;
10679 AREG(7) = adr;
03e4f2a3 10680 WRITE_LONG_DEC_F(adr, res)
70357ce5 10681 POST_IO
10682RET(20)
10683}
10684
10685// MOVEL
10686OPCODE(0x2027)
10687{
10688 u32 adr, res;
10689 u32 src, dst;
10690
10691 adr = AREG(7) - 4;
10692 AREG(7) = adr;
10693 PRE_IO
10694 READ_LONG_F(adr, res)
10695 flag_C = 0;
10696 flag_V = 0;
10697 flag_NotZ = res;
10698 flag_N = res >> 24;
10699 DREGu32((Opcode >> 9) & 7) = res;
10700 POST_IO
10701RET(14)
10702}
10703
10704// MOVEL
10705OPCODE(0x20A7)
10706{
10707 u32 adr, res;
10708 u32 src, dst;
10709
10710 adr = AREG(7) - 4;
10711 AREG(7) = adr;
10712 PRE_IO
10713 READ_LONG_F(adr, res)
10714 flag_C = 0;
10715 flag_V = 0;
10716 flag_NotZ = res;
10717 flag_N = res >> 24;
10718 adr = AREG((Opcode >> 9) & 7);
10719 WRITE_LONG_F(adr, res)
10720 POST_IO
10721RET(22)
10722}
10723
10724// MOVEL
10725OPCODE(0x20E7)
10726{
10727 u32 adr, res;
10728 u32 src, dst;
10729
10730 adr = AREG(7) - 4;
10731 AREG(7) = adr;
10732 PRE_IO
10733 READ_LONG_F(adr, res)
10734 flag_C = 0;
10735 flag_V = 0;
10736 flag_NotZ = res;
10737 flag_N = res >> 24;
10738 adr = AREG((Opcode >> 9) & 7);
10739 AREG((Opcode >> 9) & 7) += 4;
10740 WRITE_LONG_F(adr, res)
10741 POST_IO
10742RET(22)
10743}
10744
10745// MOVEL
10746OPCODE(0x2127)
10747{
10748 u32 adr, res;
10749 u32 src, dst;
10750
10751 adr = AREG(7) - 4;
10752 AREG(7) = adr;
10753 PRE_IO
10754 READ_LONG_F(adr, res)
10755 flag_C = 0;
10756 flag_V = 0;
10757 flag_NotZ = res;
10758 flag_N = res >> 24;
10759 adr = AREG((Opcode >> 9) & 7) - 4;
10760 AREG((Opcode >> 9) & 7) = adr;
80db4442 10761 WRITE_LONG_DEC_F(adr, res)
70357ce5 10762 POST_IO
10763RET(22)
10764}
10765
10766// MOVEL
10767OPCODE(0x2167)
10768{
10769 u32 adr, res;
10770 u32 src, dst;
10771
10772 adr = AREG(7) - 4;
10773 AREG(7) = adr;
10774 PRE_IO
10775 READ_LONG_F(adr, res)
10776 flag_C = 0;
10777 flag_V = 0;
10778 flag_NotZ = res;
10779 flag_N = res >> 24;
10780 FETCH_SWORD(adr);
10781 adr += AREG((Opcode >> 9) & 7);
10782 WRITE_LONG_F(adr, res)
10783 POST_IO
10784RET(26)
10785}
10786
10787// MOVEL
10788OPCODE(0x21A7)
10789{
10790 u32 adr, res;
10791 u32 src, dst;
10792
10793 adr = AREG(7) - 4;
10794 AREG(7) = adr;
10795 PRE_IO
10796 READ_LONG_F(adr, res)
10797 flag_C = 0;
10798 flag_V = 0;
10799 flag_NotZ = res;
10800 flag_N = res >> 24;
10801 adr = AREG((Opcode >> 9) & 7);
10802 DECODE_EXT_WORD
10803 WRITE_LONG_F(adr, res)
10804 POST_IO
10805RET(28)
10806}
10807
10808// MOVEL
10809OPCODE(0x21E7)
10810{
10811 u32 adr, res;
10812 u32 src, dst;
10813
10814 adr = AREG(7) - 4;
10815 AREG(7) = adr;
10816 PRE_IO
10817 READ_LONG_F(adr, res)
10818 flag_C = 0;
10819 flag_V = 0;
10820 flag_NotZ = res;
10821 flag_N = res >> 24;
10822 FETCH_SWORD(adr);
10823 WRITE_LONG_F(adr, res)
10824 POST_IO
10825RET(26)
10826}
10827
10828// MOVEL
10829OPCODE(0x23E7)
10830{
10831 u32 adr, res;
10832 u32 src, dst;
10833
10834 adr = AREG(7) - 4;
10835 AREG(7) = adr;
10836 PRE_IO
10837 READ_LONG_F(adr, res)
10838 flag_C = 0;
10839 flag_V = 0;
10840 flag_NotZ = res;
10841 flag_N = res >> 24;
10842 FETCH_LONG(adr);
10843 WRITE_LONG_F(adr, res)
10844 POST_IO
10845RET(30)
10846}
10847
10848// MOVEL
10849OPCODE(0x2EE7)
10850{
10851 u32 adr, res;
10852 u32 src, dst;
10853
10854 adr = AREG(7) - 4;
10855 AREG(7) = adr;
10856 PRE_IO
10857 READ_LONG_F(adr, res)
10858 flag_C = 0;
10859 flag_V = 0;
10860 flag_NotZ = res;
10861 flag_N = res >> 24;
10862 adr = AREG(7);
10863 AREG(7) += 4;
10864 WRITE_LONG_F(adr, res)
10865 POST_IO
10866RET(22)
10867}
10868
10869// MOVEL
10870OPCODE(0x2F27)
10871{
10872 u32 adr, res;
10873 u32 src, dst;
10874
10875 adr = AREG(7) - 4;
10876 AREG(7) = adr;
10877 PRE_IO
10878 READ_LONG_F(adr, res)
10879 flag_C = 0;
10880 flag_V = 0;
10881 flag_NotZ = res;
10882 flag_N = res >> 24;
10883 adr = AREG(7) - 4;
10884 AREG(7) = adr;
03e4f2a3 10885 WRITE_LONG_DEC_F(adr, res)
70357ce5 10886 POST_IO
10887RET(22)
10888}
10889
10890// MOVEAL
10891OPCODE(0x2040)
10892{
10893 u32 adr, res;
10894 u32 src, dst;
10895
10896 res = (s32)DREGs32((Opcode >> 0) & 7);
10897 AREG((Opcode >> 9) & 7) = res;
10898RET(4)
10899}
10900
10901// MOVEAL
10902OPCODE(0x2048)
10903{
10904 u32 adr, res;
10905 u32 src, dst;
10906
10907 res = (s32)AREGs32((Opcode >> 0) & 7);
10908 AREG((Opcode >> 9) & 7) = res;
10909RET(4)
10910}
10911
10912// MOVEAL
10913OPCODE(0x2050)
10914{
10915 u32 adr, res;
10916 u32 src, dst;
10917
10918 adr = AREG((Opcode >> 0) & 7);
10919 PRE_IO
10920 READSX_LONG_F(adr, res)
10921 AREG((Opcode >> 9) & 7) = res;
10922 POST_IO
10923RET(12)
10924}
10925
10926// MOVEAL
10927OPCODE(0x2058)
10928{
10929 u32 adr, res;
10930 u32 src, dst;
10931
10932 adr = AREG((Opcode >> 0) & 7);
10933 AREG((Opcode >> 0) & 7) += 4;
10934 PRE_IO
10935 READSX_LONG_F(adr, res)
10936 AREG((Opcode >> 9) & 7) = res;
10937 POST_IO
10938RET(12)
10939}
10940
10941// MOVEAL
10942OPCODE(0x2060)
10943{
10944 u32 adr, res;
10945 u32 src, dst;
10946
10947 adr = AREG((Opcode >> 0) & 7) - 4;
10948 AREG((Opcode >> 0) & 7) = adr;
10949 PRE_IO
10950 READSX_LONG_F(adr, res)
10951 AREG((Opcode >> 9) & 7) = res;
10952 POST_IO
10953RET(14)
10954}
10955
10956// MOVEAL
10957OPCODE(0x2068)
10958{
10959 u32 adr, res;
10960 u32 src, dst;
10961
10962 FETCH_SWORD(adr);
10963 adr += AREG((Opcode >> 0) & 7);
10964 PRE_IO
10965 READSX_LONG_F(adr, res)
10966 AREG((Opcode >> 9) & 7) = res;
10967 POST_IO
10968RET(16)
10969}
10970
10971// MOVEAL
10972OPCODE(0x2070)
10973{
10974 u32 adr, res;
10975 u32 src, dst;
10976
10977 adr = AREG((Opcode >> 0) & 7);
10978 DECODE_EXT_WORD
10979 PRE_IO
10980 READSX_LONG_F(adr, res)
10981 AREG((Opcode >> 9) & 7) = res;
10982 POST_IO
10983RET(18)
10984}
10985
10986// MOVEAL
10987OPCODE(0x2078)
10988{
10989 u32 adr, res;
10990 u32 src, dst;
10991
10992 FETCH_SWORD(adr);
10993 PRE_IO
10994 READSX_LONG_F(adr, res)
10995 AREG((Opcode >> 9) & 7) = res;
10996 POST_IO
10997RET(16)
10998}
10999
11000// MOVEAL
11001OPCODE(0x2079)
11002{
11003 u32 adr, res;
11004 u32 src, dst;
11005
11006 FETCH_LONG(adr);
11007 PRE_IO
11008 READSX_LONG_F(adr, res)
11009 AREG((Opcode >> 9) & 7) = res;
11010 POST_IO
11011RET(20)
11012}
11013
11014// MOVEAL
11015OPCODE(0x207A)
11016{
11017 u32 adr, res;
11018 u32 src, dst;
11019
be26eb23 11020 adr = GET_SWORD + GET_PC;
70357ce5 11021 PC++;
11022 PRE_IO
11023 READSX_LONG_F(adr, res)
11024 AREG((Opcode >> 9) & 7) = res;
11025 POST_IO
11026RET(16)
11027}
11028
11029// MOVEAL
11030OPCODE(0x207B)
11031{
11032 u32 adr, res;
11033 u32 src, dst;
11034
be26eb23 11035 adr = GET_PC;
70357ce5 11036 DECODE_EXT_WORD
11037 PRE_IO
11038 READSX_LONG_F(adr, res)
11039 AREG((Opcode >> 9) & 7) = res;
11040 POST_IO
11041RET(18)
11042}
11043
11044// MOVEAL
11045OPCODE(0x207C)
11046{
11047 u32 adr, res;
11048 u32 src, dst;
11049
11050 FETCH_LONG(res);
11051 AREG((Opcode >> 9) & 7) = res;
11052RET(12)
11053}
11054
11055// MOVEAL
11056OPCODE(0x205F)
11057{
11058 u32 adr, res;
11059 u32 src, dst;
11060
11061 adr = AREG(7);
11062 AREG(7) += 4;
11063 PRE_IO
11064 READSX_LONG_F(adr, res)
11065 AREG((Opcode >> 9) & 7) = res;
11066 POST_IO
11067RET(12)
11068}
11069
11070// MOVEAL
11071OPCODE(0x2067)
11072{
11073 u32 adr, res;
11074 u32 src, dst;
11075
11076 adr = AREG(7) - 4;
11077 AREG(7) = adr;
11078 PRE_IO
11079 READSX_LONG_F(adr, res)
11080 AREG((Opcode >> 9) & 7) = res;
11081 POST_IO
11082RET(14)
11083}
11084
11085// MOVEW
11086OPCODE(0x3000)
11087{
11088 u32 adr, res;
11089 u32 src, dst;
11090
11091 res = DREGu16((Opcode >> 0) & 7);
11092 flag_C = 0;
11093 flag_V = 0;
11094 flag_NotZ = res;
11095 flag_N = res >> 8;
11096 DREGu16((Opcode >> 9) & 7) = res;
11097RET(4)
11098}
11099
11100// MOVEW
11101OPCODE(0x3080)
11102{
11103 u32 adr, res;
11104 u32 src, dst;
11105
11106 res = DREGu16((Opcode >> 0) & 7);
11107 flag_C = 0;
11108 flag_V = 0;
11109 flag_NotZ = res;
11110 flag_N = res >> 8;
11111 adr = AREG((Opcode >> 9) & 7);
11112 PRE_IO
11113 WRITE_WORD_F(adr, res)
11114 POST_IO
11115RET(8)
11116}
11117
11118// MOVEW
11119OPCODE(0x30C0)
11120{
11121 u32 adr, res;
11122 u32 src, dst;
11123
11124 res = DREGu16((Opcode >> 0) & 7);
11125 flag_C = 0;
11126 flag_V = 0;
11127 flag_NotZ = res;
11128 flag_N = res >> 8;
11129 adr = AREG((Opcode >> 9) & 7);
11130 AREG((Opcode >> 9) & 7) += 2;
11131 PRE_IO
11132 WRITE_WORD_F(adr, res)
11133 POST_IO
11134RET(8)
11135}
11136
11137// MOVEW
11138OPCODE(0x3100)
11139{
11140 u32 adr, res;
11141 u32 src, dst;
11142
11143 res = DREGu16((Opcode >> 0) & 7);
11144 flag_C = 0;
11145 flag_V = 0;
11146 flag_NotZ = res;
11147 flag_N = res >> 8;
11148 adr = AREG((Opcode >> 9) & 7) - 2;
11149 AREG((Opcode >> 9) & 7) = adr;
11150 PRE_IO
11151 WRITE_WORD_F(adr, res)
11152 POST_IO
11153RET(8)
11154}
11155
11156// MOVEW
11157OPCODE(0x3140)
11158{
11159 u32 adr, res;
11160 u32 src, dst;
11161
11162 res = DREGu16((Opcode >> 0) & 7);
11163 flag_C = 0;
11164 flag_V = 0;
11165 flag_NotZ = res;
11166 flag_N = res >> 8;
11167 FETCH_SWORD(adr);
11168 adr += AREG((Opcode >> 9) & 7);
11169 PRE_IO
11170 WRITE_WORD_F(adr, res)
11171 POST_IO
11172RET(12)
11173}
11174
11175// MOVEW
11176OPCODE(0x3180)
11177{
11178 u32 adr, res;
11179 u32 src, dst;
11180
11181 res = DREGu16((Opcode >> 0) & 7);
11182 flag_C = 0;
11183 flag_V = 0;
11184 flag_NotZ = res;
11185 flag_N = res >> 8;
11186 adr = AREG((Opcode >> 9) & 7);
11187 DECODE_EXT_WORD
11188 PRE_IO
11189 WRITE_WORD_F(adr, res)
11190 POST_IO
11191RET(14)
11192}
11193
11194// MOVEW
11195OPCODE(0x31C0)
11196{
11197 u32 adr, res;
11198 u32 src, dst;
11199
11200 res = DREGu16((Opcode >> 0) & 7);
11201 flag_C = 0;
11202 flag_V = 0;
11203 flag_NotZ = res;
11204 flag_N = res >> 8;
11205 FETCH_SWORD(adr);
11206 PRE_IO
11207 WRITE_WORD_F(adr, res)
11208 POST_IO
11209RET(12)
11210}
11211
11212// MOVEW
11213OPCODE(0x33C0)
11214{
11215 u32 adr, res;
11216 u32 src, dst;
11217
11218 res = DREGu16((Opcode >> 0) & 7);
11219 flag_C = 0;
11220 flag_V = 0;
11221 flag_NotZ = res;
11222 flag_N = res >> 8;
11223 FETCH_LONG(adr);
11224 PRE_IO
11225 WRITE_WORD_F(adr, res)
11226 POST_IO
11227RET(16)
11228}
11229
11230// MOVEW
11231OPCODE(0x3EC0)
11232{
11233 u32 adr, res;
11234 u32 src, dst;
11235
11236 res = DREGu16((Opcode >> 0) & 7);
11237 flag_C = 0;
11238 flag_V = 0;
11239 flag_NotZ = res;
11240 flag_N = res >> 8;
11241 adr = AREG(7);
11242 AREG(7) += 2;
11243 PRE_IO
11244 WRITE_WORD_F(adr, res)
11245 POST_IO
11246RET(8)
11247}
11248
11249// MOVEW
11250OPCODE(0x3F00)
11251{
11252 u32 adr, res;
11253 u32 src, dst;
11254
11255 res = DREGu16((Opcode >> 0) & 7);
11256 flag_C = 0;
11257 flag_V = 0;
11258 flag_NotZ = res;
11259 flag_N = res >> 8;
11260 adr = AREG(7) - 2;
11261 AREG(7) = adr;
11262 PRE_IO
11263 WRITE_WORD_F(adr, res)
11264 POST_IO
11265RET(8)
11266}
11267
11268// MOVEW
11269OPCODE(0x3008)
11270{
11271 u32 adr, res;
11272 u32 src, dst;
11273
11274 res = AREGu16((Opcode >> 0) & 7);
11275 flag_C = 0;
11276 flag_V = 0;
11277 flag_NotZ = res;
11278 flag_N = res >> 8;
11279 DREGu16((Opcode >> 9) & 7) = res;
11280RET(4)
11281}
11282
11283// MOVEW
11284OPCODE(0x3088)
11285{
11286 u32 adr, res;
11287 u32 src, dst;
11288
11289 res = AREGu16((Opcode >> 0) & 7);
11290 flag_C = 0;
11291 flag_V = 0;
11292 flag_NotZ = res;
11293 flag_N = res >> 8;
11294 adr = AREG((Opcode >> 9) & 7);
11295 PRE_IO
11296 WRITE_WORD_F(adr, res)
11297 POST_IO
11298RET(8)
11299}
11300
11301// MOVEW
11302OPCODE(0x30C8)
11303{
11304 u32 adr, res;
11305 u32 src, dst;
11306
11307 res = AREGu16((Opcode >> 0) & 7);
11308 flag_C = 0;
11309 flag_V = 0;
11310 flag_NotZ = res;
11311 flag_N = res >> 8;
11312 adr = AREG((Opcode >> 9) & 7);
11313 AREG((Opcode >> 9) & 7) += 2;
11314 PRE_IO
11315 WRITE_WORD_F(adr, res)
11316 POST_IO
11317RET(8)
11318}
11319
11320// MOVEW
11321OPCODE(0x3108)
11322{
11323 u32 adr, res;
11324 u32 src, dst;
11325
11326 res = AREGu16((Opcode >> 0) & 7);
11327 flag_C = 0;
11328 flag_V = 0;
11329 flag_NotZ = res;
11330 flag_N = res >> 8;
11331 adr = AREG((Opcode >> 9) & 7) - 2;
11332 AREG((Opcode >> 9) & 7) = adr;
11333 PRE_IO
11334 WRITE_WORD_F(adr, res)
11335 POST_IO
11336RET(8)
11337}
11338
11339// MOVEW
11340OPCODE(0x3148)
11341{
11342 u32 adr, res;
11343 u32 src, dst;
11344
11345 res = AREGu16((Opcode >> 0) & 7);
11346 flag_C = 0;
11347 flag_V = 0;
11348 flag_NotZ = res;
11349 flag_N = res >> 8;
11350 FETCH_SWORD(adr);
11351 adr += AREG((Opcode >> 9) & 7);
11352 PRE_IO
11353 WRITE_WORD_F(adr, res)
11354 POST_IO
11355RET(12)
11356}
11357
11358// MOVEW
11359OPCODE(0x3188)
11360{
11361 u32 adr, res;
11362 u32 src, dst;
11363
11364 res = AREGu16((Opcode >> 0) & 7);
11365 flag_C = 0;
11366 flag_V = 0;
11367 flag_NotZ = res;
11368 flag_N = res >> 8;
11369 adr = AREG((Opcode >> 9) & 7);
11370 DECODE_EXT_WORD
11371 PRE_IO
11372 WRITE_WORD_F(adr, res)
11373 POST_IO
11374RET(14)
11375}
11376
11377// MOVEW
11378OPCODE(0x31C8)
11379{
11380 u32 adr, res;
11381 u32 src, dst;
11382
11383 res = AREGu16((Opcode >> 0) & 7);
11384 flag_C = 0;
11385 flag_V = 0;
11386 flag_NotZ = res;
11387 flag_N = res >> 8;
11388 FETCH_SWORD(adr);
11389 PRE_IO
11390 WRITE_WORD_F(adr, res)
11391 POST_IO
11392RET(12)
11393}
11394
11395// MOVEW
11396OPCODE(0x33C8)
11397{
11398 u32 adr, res;
11399 u32 src, dst;
11400
11401 res = AREGu16((Opcode >> 0) & 7);
11402 flag_C = 0;
11403 flag_V = 0;
11404 flag_NotZ = res;
11405 flag_N = res >> 8;
11406 FETCH_LONG(adr);
11407 PRE_IO
11408 WRITE_WORD_F(adr, res)
11409 POST_IO
11410RET(16)
11411}
11412
11413// MOVEW
11414OPCODE(0x3EC8)
11415{
11416 u32 adr, res;
11417 u32 src, dst;
11418
11419 res = AREGu16((Opcode >> 0) & 7);
11420 flag_C = 0;
11421 flag_V = 0;
11422 flag_NotZ = res;
11423 flag_N = res >> 8;
11424 adr = AREG(7);
11425 AREG(7) += 2;
11426 PRE_IO
11427 WRITE_WORD_F(adr, res)
11428 POST_IO
11429RET(8)
11430}
11431
11432// MOVEW
11433OPCODE(0x3F08)
11434{
11435 u32 adr, res;
11436 u32 src, dst;
11437
11438 res = AREGu16((Opcode >> 0) & 7);
11439 flag_C = 0;
11440 flag_V = 0;
11441 flag_NotZ = res;
11442 flag_N = res >> 8;
11443 adr = AREG(7) - 2;
11444 AREG(7) = adr;
11445 PRE_IO
11446 WRITE_WORD_F(adr, res)
11447 POST_IO
11448RET(8)
11449}
11450
11451// MOVEW
11452OPCODE(0x3010)
11453{
11454 u32 adr, res;
11455 u32 src, dst;
11456
11457 adr = AREG((Opcode >> 0) & 7);
11458 PRE_IO
11459 READ_WORD_F(adr, res)
11460 flag_C = 0;
11461 flag_V = 0;
11462 flag_NotZ = res;
11463 flag_N = res >> 8;
11464 DREGu16((Opcode >> 9) & 7) = res;
11465 POST_IO
11466RET(8)
11467}
11468
11469// MOVEW
11470OPCODE(0x3090)
11471{
11472 u32 adr, res;
11473 u32 src, dst;
11474
11475 adr = AREG((Opcode >> 0) & 7);
11476 PRE_IO
11477 READ_WORD_F(adr, res)
11478 flag_C = 0;
11479 flag_V = 0;
11480 flag_NotZ = res;
11481 flag_N = res >> 8;
11482 adr = AREG((Opcode >> 9) & 7);
11483 WRITE_WORD_F(adr, res)
11484 POST_IO
11485RET(12)
11486}
11487
11488// MOVEW
11489OPCODE(0x30D0)
11490{
11491 u32 adr, res;
11492 u32 src, dst;
11493
11494 adr = AREG((Opcode >> 0) & 7);
11495 PRE_IO
11496 READ_WORD_F(adr, res)
11497 flag_C = 0;
11498 flag_V = 0;
11499 flag_NotZ = res;
11500 flag_N = res >> 8;
11501 adr = AREG((Opcode >> 9) & 7);
11502 AREG((Opcode >> 9) & 7) += 2;
11503 WRITE_WORD_F(adr, res)
11504 POST_IO
11505RET(12)
11506}
11507
11508// MOVEW
11509OPCODE(0x3110)
11510{
11511 u32 adr, res;
11512 u32 src, dst;
11513
11514 adr = AREG((Opcode >> 0) & 7);
11515 PRE_IO
11516 READ_WORD_F(adr, res)
11517 flag_C = 0;
11518 flag_V = 0;
11519 flag_NotZ = res;
11520 flag_N = res >> 8;
11521 adr = AREG((Opcode >> 9) & 7) - 2;
11522 AREG((Opcode >> 9) & 7) = adr;
11523 WRITE_WORD_F(adr, res)
11524 POST_IO
11525RET(12)
11526}
11527
11528// MOVEW
11529OPCODE(0x3150)
11530{
11531 u32 adr, res;
11532 u32 src, dst;
11533
11534 adr = AREG((Opcode >> 0) & 7);
11535 PRE_IO
11536 READ_WORD_F(adr, res)
11537 flag_C = 0;
11538 flag_V = 0;
11539 flag_NotZ = res;
11540 flag_N = res >> 8;
11541 FETCH_SWORD(adr);
11542 adr += AREG((Opcode >> 9) & 7);
11543 WRITE_WORD_F(adr, res)
11544 POST_IO
11545RET(16)
11546}
11547
11548// MOVEW
11549OPCODE(0x3190)
11550{
11551 u32 adr, res;
11552 u32 src, dst;
11553
11554 adr = AREG((Opcode >> 0) & 7);
11555 PRE_IO
11556 READ_WORD_F(adr, res)
11557 flag_C = 0;
11558 flag_V = 0;
11559 flag_NotZ = res;
11560 flag_N = res >> 8;
11561 adr = AREG((Opcode >> 9) & 7);
11562 DECODE_EXT_WORD
11563 WRITE_WORD_F(adr, res)
11564 POST_IO
11565RET(18)
11566}
11567
11568// MOVEW
11569OPCODE(0x31D0)
11570{
11571 u32 adr, res;
11572 u32 src, dst;
11573
11574 adr = AREG((Opcode >> 0) & 7);
11575 PRE_IO
11576 READ_WORD_F(adr, res)
11577 flag_C = 0;
11578 flag_V = 0;
11579 flag_NotZ = res;
11580 flag_N = res >> 8;
11581 FETCH_SWORD(adr);
11582 WRITE_WORD_F(adr, res)
11583 POST_IO
11584RET(16)
11585}
11586
11587// MOVEW
11588OPCODE(0x33D0)
11589{
11590 u32 adr, res;
11591 u32 src, dst;
11592
11593 adr = AREG((Opcode >> 0) & 7);
11594 PRE_IO
11595 READ_WORD_F(adr, res)
11596 flag_C = 0;
11597 flag_V = 0;
11598 flag_NotZ = res;
11599 flag_N = res >> 8;
11600 FETCH_LONG(adr);
11601 WRITE_WORD_F(adr, res)
11602 POST_IO
11603RET(20)
11604}
11605
11606// MOVEW
11607OPCODE(0x3ED0)
11608{
11609 u32 adr, res;
11610 u32 src, dst;
11611
11612 adr = AREG((Opcode >> 0) & 7);
11613 PRE_IO
11614 READ_WORD_F(adr, res)
11615 flag_C = 0;
11616 flag_V = 0;
11617 flag_NotZ = res;
11618 flag_N = res >> 8;
11619 adr = AREG(7);
11620 AREG(7) += 2;
11621 WRITE_WORD_F(adr, res)
11622 POST_IO
11623RET(12)
11624}
11625
11626// MOVEW
11627OPCODE(0x3F10)
11628{
11629 u32 adr, res;
11630 u32 src, dst;
11631
11632 adr = AREG((Opcode >> 0) & 7);
11633 PRE_IO
11634 READ_WORD_F(adr, res)
11635 flag_C = 0;
11636 flag_V = 0;
11637 flag_NotZ = res;
11638 flag_N = res >> 8;
11639 adr = AREG(7) - 2;
11640 AREG(7) = adr;
11641 WRITE_WORD_F(adr, res)
11642 POST_IO
11643RET(12)
11644}
11645
11646// MOVEW
11647OPCODE(0x3018)
11648{
11649 u32 adr, res;
11650 u32 src, dst;
11651
11652 adr = AREG((Opcode >> 0) & 7);
11653 AREG((Opcode >> 0) & 7) += 2;
11654 PRE_IO
11655 READ_WORD_F(adr, res)
11656 flag_C = 0;
11657 flag_V = 0;
11658 flag_NotZ = res;
11659 flag_N = res >> 8;
11660 DREGu16((Opcode >> 9) & 7) = res;
11661 POST_IO
11662RET(8)
11663}
11664
11665// MOVEW
11666OPCODE(0x3098)
11667{
11668 u32 adr, res;
11669 u32 src, dst;
11670
11671 adr = AREG((Opcode >> 0) & 7);
11672 AREG((Opcode >> 0) & 7) += 2;
11673 PRE_IO
11674 READ_WORD_F(adr, res)
11675 flag_C = 0;
11676 flag_V = 0;
11677 flag_NotZ = res;
11678 flag_N = res >> 8;
11679 adr = AREG((Opcode >> 9) & 7);
11680 WRITE_WORD_F(adr, res)
11681 POST_IO
11682RET(12)
11683}
11684
11685// MOVEW
11686OPCODE(0x30D8)
11687{
11688 u32 adr, res;
11689 u32 src, dst;
11690
11691 adr = AREG((Opcode >> 0) & 7);
11692 AREG((Opcode >> 0) & 7) += 2;
11693 PRE_IO
11694 READ_WORD_F(adr, res)
11695 flag_C = 0;
11696 flag_V = 0;
11697 flag_NotZ = res;
11698 flag_N = res >> 8;
11699 adr = AREG((Opcode >> 9) & 7);
11700 AREG((Opcode >> 9) & 7) += 2;
11701 WRITE_WORD_F(adr, res)
11702 POST_IO
11703RET(12)
11704}
11705
11706// MOVEW
11707OPCODE(0x3118)
11708{
11709 u32 adr, res;
11710 u32 src, dst;
11711
11712 adr = AREG((Opcode >> 0) & 7);
11713 AREG((Opcode >> 0) & 7) += 2;
11714 PRE_IO
11715 READ_WORD_F(adr, res)
11716 flag_C = 0;
11717 flag_V = 0;
11718 flag_NotZ = res;
11719 flag_N = res >> 8;
11720 adr = AREG((Opcode >> 9) & 7) - 2;
11721 AREG((Opcode >> 9) & 7) = adr;
11722 WRITE_WORD_F(adr, res)
11723 POST_IO
11724RET(12)
11725}
11726
11727// MOVEW
11728OPCODE(0x3158)
11729{
11730 u32 adr, res;
11731 u32 src, dst;
11732
11733 adr = AREG((Opcode >> 0) & 7);
11734 AREG((Opcode >> 0) & 7) += 2;
11735 PRE_IO
11736 READ_WORD_F(adr, res)
11737 flag_C = 0;
11738 flag_V = 0;
11739 flag_NotZ = res;
11740 flag_N = res >> 8;
11741 FETCH_SWORD(adr);
11742 adr += AREG((Opcode >> 9) & 7);
11743 WRITE_WORD_F(adr, res)
11744 POST_IO
11745RET(16)
11746}
11747
11748// MOVEW
11749OPCODE(0x3198)
11750{
11751 u32 adr, res;
11752 u32 src, dst;
11753
11754 adr = AREG((Opcode >> 0) & 7);
11755 AREG((Opcode >> 0) & 7) += 2;
11756 PRE_IO
11757 READ_WORD_F(adr, res)
11758 flag_C = 0;
11759 flag_V = 0;
11760 flag_NotZ = res;
11761 flag_N = res >> 8;
11762 adr = AREG((Opcode >> 9) & 7);
11763 DECODE_EXT_WORD
11764 WRITE_WORD_F(adr, res)
11765 POST_IO
11766RET(18)
11767}
11768
11769// MOVEW
11770OPCODE(0x31D8)
11771{
11772 u32 adr, res;
11773 u32 src, dst;
11774
11775 adr = AREG((Opcode >> 0) & 7);
11776 AREG((Opcode >> 0) & 7) += 2;
11777 PRE_IO
11778 READ_WORD_F(adr, res)
11779 flag_C = 0;
11780 flag_V = 0;
11781 flag_NotZ = res;
11782 flag_N = res >> 8;
11783 FETCH_SWORD(adr);
11784 WRITE_WORD_F(adr, res)
11785 POST_IO
11786RET(16)
11787}
11788
11789// MOVEW
11790OPCODE(0x33D8)
11791{
11792 u32 adr, res;
11793 u32 src, dst;
11794
11795 adr = AREG((Opcode >> 0) & 7);
11796 AREG((Opcode >> 0) & 7) += 2;
11797 PRE_IO
11798 READ_WORD_F(adr, res)
11799 flag_C = 0;
11800 flag_V = 0;
11801 flag_NotZ = res;
11802 flag_N = res >> 8;
11803 FETCH_LONG(adr);
11804 WRITE_WORD_F(adr, res)
11805 POST_IO
11806RET(20)
11807}
11808
11809// MOVEW
11810OPCODE(0x3ED8)
11811{
11812 u32 adr, res;
11813 u32 src, dst;
11814
11815 adr = AREG((Opcode >> 0) & 7);
11816 AREG((Opcode >> 0) & 7) += 2;
11817 PRE_IO
11818 READ_WORD_F(adr, res)
11819 flag_C = 0;
11820 flag_V = 0;
11821 flag_NotZ = res;
11822 flag_N = res >> 8;
11823 adr = AREG(7);
11824 AREG(7) += 2;
11825 WRITE_WORD_F(adr, res)
11826 POST_IO
11827RET(12)
11828}
11829
11830// MOVEW
11831OPCODE(0x3F18)
11832{
11833 u32 adr, res;
11834 u32 src, dst;
11835
11836 adr = AREG((Opcode >> 0) & 7);
11837 AREG((Opcode >> 0) & 7) += 2;
11838 PRE_IO
11839 READ_WORD_F(adr, res)
11840 flag_C = 0;
11841 flag_V = 0;
11842 flag_NotZ = res;
11843 flag_N = res >> 8;
11844 adr = AREG(7) - 2;
11845 AREG(7) = adr;
11846 WRITE_WORD_F(adr, res)
11847 POST_IO
11848RET(12)
11849}
11850
11851// MOVEW
11852OPCODE(0x3020)
11853{
11854 u32 adr, res;
11855 u32 src, dst;
11856
11857 adr = AREG((Opcode >> 0) & 7) - 2;
11858 AREG((Opcode >> 0) & 7) = adr;
11859 PRE_IO
11860 READ_WORD_F(adr, res)
11861 flag_C = 0;
11862 flag_V = 0;
11863 flag_NotZ = res;
11864 flag_N = res >> 8;
11865 DREGu16((Opcode >> 9) & 7) = res;
11866 POST_IO
11867RET(10)
11868}
11869
11870// MOVEW
11871OPCODE(0x30A0)
11872{
11873 u32 adr, res;
11874 u32 src, dst;
11875
11876 adr = AREG((Opcode >> 0) & 7) - 2;
11877 AREG((Opcode >> 0) & 7) = adr;
11878 PRE_IO
11879 READ_WORD_F(adr, res)
11880 flag_C = 0;
11881 flag_V = 0;
11882 flag_NotZ = res;
11883 flag_N = res >> 8;
11884 adr = AREG((Opcode >> 9) & 7);
11885 WRITE_WORD_F(adr, res)
11886 POST_IO
11887RET(14)
11888}
11889
11890// MOVEW
11891OPCODE(0x30E0)
11892{
11893 u32 adr, res;
11894 u32 src, dst;
11895
11896 adr = AREG((Opcode >> 0) & 7) - 2;
11897 AREG((Opcode >> 0) & 7) = adr;
11898 PRE_IO
11899 READ_WORD_F(adr, res)
11900 flag_C = 0;
11901 flag_V = 0;
11902 flag_NotZ = res;
11903 flag_N = res >> 8;
11904 adr = AREG((Opcode >> 9) & 7);
11905 AREG((Opcode >> 9) & 7) += 2;
11906 WRITE_WORD_F(adr, res)
11907 POST_IO
11908RET(14)
11909}
11910
11911// MOVEW
11912OPCODE(0x3120)
11913{
11914 u32 adr, res;
11915 u32 src, dst;
11916
11917 adr = AREG((Opcode >> 0) & 7) - 2;
11918 AREG((Opcode >> 0) & 7) = adr;
11919 PRE_IO
11920 READ_WORD_F(adr, res)
11921 flag_C = 0;
11922 flag_V = 0;
11923 flag_NotZ = res;
11924 flag_N = res >> 8;
11925 adr = AREG((Opcode >> 9) & 7) - 2;
11926 AREG((Opcode >> 9) & 7) = adr;
11927 WRITE_WORD_F(adr, res)
11928 POST_IO
11929RET(14)
11930}
11931
11932// MOVEW
11933OPCODE(0x3160)
11934{
11935 u32 adr, res;
11936 u32 src, dst;
11937
11938 adr = AREG((Opcode >> 0) & 7) - 2;
11939 AREG((Opcode >> 0) & 7) = adr;
11940 PRE_IO
11941 READ_WORD_F(adr, res)
11942 flag_C = 0;
11943 flag_V = 0;
11944 flag_NotZ = res;
11945 flag_N = res >> 8;
11946 FETCH_SWORD(adr);
11947 adr += AREG((Opcode >> 9) & 7);
11948 WRITE_WORD_F(adr, res)
11949 POST_IO
11950RET(18)
11951}
11952
11953// MOVEW
11954OPCODE(0x31A0)
11955{
11956 u32 adr, res;
11957 u32 src, dst;
11958
11959 adr = AREG((Opcode >> 0) & 7) - 2;
11960 AREG((Opcode >> 0) & 7) = adr;
11961 PRE_IO
11962 READ_WORD_F(adr, res)
11963 flag_C = 0;
11964 flag_V = 0;
11965 flag_NotZ = res;
11966 flag_N = res >> 8;
11967 adr = AREG((Opcode >> 9) & 7);
11968 DECODE_EXT_WORD
11969 WRITE_WORD_F(adr, res)
11970 POST_IO
11971RET(20)
11972}
11973
11974// MOVEW
11975OPCODE(0x31E0)
11976{
11977 u32 adr, res;
11978 u32 src, dst;
11979
11980 adr = AREG((Opcode >> 0) & 7) - 2;
11981 AREG((Opcode >> 0) & 7) = adr;
11982 PRE_IO
11983 READ_WORD_F(adr, res)
11984 flag_C = 0;
11985 flag_V = 0;
11986 flag_NotZ = res;
11987 flag_N = res >> 8;
11988 FETCH_SWORD(adr);
11989 WRITE_WORD_F(adr, res)
11990 POST_IO
11991RET(18)
11992}
11993
11994// MOVEW
11995OPCODE(0x33E0)
11996{
11997 u32 adr, res;
11998 u32 src, dst;
11999
12000 adr = AREG((Opcode >> 0) & 7) - 2;
12001 AREG((Opcode >> 0) & 7) = adr;
12002 PRE_IO
12003 READ_WORD_F(adr, res)
12004 flag_C = 0;
12005 flag_V = 0;
12006 flag_NotZ = res;
12007 flag_N = res >> 8;
12008 FETCH_LONG(adr);
12009 WRITE_WORD_F(adr, res)
12010 POST_IO
12011RET(22)
12012}
12013
12014// MOVEW
12015OPCODE(0x3EE0)
12016{
12017 u32 adr, res;
12018 u32 src, dst;
12019
12020 adr = AREG((Opcode >> 0) & 7) - 2;
12021 AREG((Opcode >> 0) & 7) = adr;
12022 PRE_IO
12023 READ_WORD_F(adr, res)
12024 flag_C = 0;
12025 flag_V = 0;
12026 flag_NotZ = res;
12027 flag_N = res >> 8;
12028 adr = AREG(7);
12029 AREG(7) += 2;
12030 WRITE_WORD_F(adr, res)
12031 POST_IO
12032RET(14)
12033}
12034
12035// MOVEW
12036OPCODE(0x3F20)
12037{
12038 u32 adr, res;
12039 u32 src, dst;
12040
12041 adr = AREG((Opcode >> 0) & 7) - 2;
12042 AREG((Opcode >> 0) & 7) = adr;
12043 PRE_IO
12044 READ_WORD_F(adr, res)
12045 flag_C = 0;
12046 flag_V = 0;
12047 flag_NotZ = res;
12048 flag_N = res >> 8;
12049 adr = AREG(7) - 2;
12050 AREG(7) = adr;
12051 WRITE_WORD_F(adr, res)
12052 POST_IO
12053RET(14)
12054}
12055
12056// MOVEW
12057OPCODE(0x3028)
12058{
12059 u32 adr, res;
12060 u32 src, dst;
12061
12062 FETCH_SWORD(adr);
12063 adr += AREG((Opcode >> 0) & 7);
12064 PRE_IO
12065 READ_WORD_F(adr, res)
12066 flag_C = 0;
12067 flag_V = 0;
12068 flag_NotZ = res;
12069 flag_N = res >> 8;
12070 DREGu16((Opcode >> 9) & 7) = res;
12071 POST_IO
12072RET(12)
12073}
12074
12075// MOVEW
12076OPCODE(0x30A8)
12077{
12078 u32 adr, res;
12079 u32 src, dst;
12080
12081 FETCH_SWORD(adr);
12082 adr += AREG((Opcode >> 0) & 7);
12083 PRE_IO
12084 READ_WORD_F(adr, res)
12085 flag_C = 0;
12086 flag_V = 0;
12087 flag_NotZ = res;
12088 flag_N = res >> 8;
12089 adr = AREG((Opcode >> 9) & 7);
12090 WRITE_WORD_F(adr, res)
12091 POST_IO
12092RET(16)
12093}
12094
12095// MOVEW
12096OPCODE(0x30E8)
12097{
12098 u32 adr, res;
12099 u32 src, dst;
12100
12101 FETCH_SWORD(adr);
12102 adr += AREG((Opcode >> 0) & 7);
12103 PRE_IO
12104 READ_WORD_F(adr, res)
12105 flag_C = 0;
12106 flag_V = 0;
12107 flag_NotZ = res;
12108 flag_N = res >> 8;
12109 adr = AREG((Opcode >> 9) & 7);
12110 AREG((Opcode >> 9) & 7) += 2;
12111 WRITE_WORD_F(adr, res)
12112 POST_IO
12113RET(16)
12114}
12115
12116// MOVEW
12117OPCODE(0x3128)
12118{
12119 u32 adr, res;
12120 u32 src, dst;
12121
12122 FETCH_SWORD(adr);
12123 adr += AREG((Opcode >> 0) & 7);
12124 PRE_IO
12125 READ_WORD_F(adr, res)
12126 flag_C = 0;
12127 flag_V = 0;
12128 flag_NotZ = res;
12129 flag_N = res >> 8;
12130 adr = AREG((Opcode >> 9) & 7) - 2;
12131 AREG((Opcode >> 9) & 7) = adr;
12132 WRITE_WORD_F(adr, res)
12133 POST_IO
12134RET(16)
12135}
12136
12137// MOVEW
12138OPCODE(0x3168)
12139{
12140 u32 adr, res;
12141 u32 src, dst;
12142
12143 FETCH_SWORD(adr);
12144 adr += AREG((Opcode >> 0) & 7);
12145 PRE_IO
12146 READ_WORD_F(adr, res)
12147 flag_C = 0;
12148 flag_V = 0;
12149 flag_NotZ = res;
12150 flag_N = res >> 8;
12151 FETCH_SWORD(adr);
12152 adr += AREG((Opcode >> 9) & 7);
12153 WRITE_WORD_F(adr, res)
12154 POST_IO
12155RET(20)
12156}
12157
12158// MOVEW
12159OPCODE(0x31A8)
12160{
12161 u32 adr, res;
12162 u32 src, dst;
12163
12164 FETCH_SWORD(adr);
12165 adr += AREG((Opcode >> 0) & 7);
12166 PRE_IO
12167 READ_WORD_F(adr, res)
12168 flag_C = 0;
12169 flag_V = 0;
12170 flag_NotZ = res;
12171 flag_N = res >> 8;
12172 adr = AREG((Opcode >> 9) & 7);
12173 DECODE_EXT_WORD
12174 WRITE_WORD_F(adr, res)
12175 POST_IO
12176RET(22)
12177}
12178
12179// MOVEW
12180OPCODE(0x31E8)
12181{
12182 u32 adr, res;
12183 u32 src, dst;
12184
12185 FETCH_SWORD(adr);
12186 adr += AREG((Opcode >> 0) & 7);
12187 PRE_IO
12188 READ_WORD_F(adr, res)
12189 flag_C = 0;
12190 flag_V = 0;
12191 flag_NotZ = res;
12192 flag_N = res >> 8;
12193 FETCH_SWORD(adr);
12194 WRITE_WORD_F(adr, res)
12195 POST_IO
12196RET(20)
12197}
12198
12199// MOVEW
12200OPCODE(0x33E8)
12201{
12202 u32 adr, res;
12203 u32 src, dst;
12204
12205 FETCH_SWORD(adr);
12206 adr += AREG((Opcode >> 0) & 7);
12207 PRE_IO
12208 READ_WORD_F(adr, res)
12209 flag_C = 0;
12210 flag_V = 0;
12211 flag_NotZ = res;
12212 flag_N = res >> 8;
12213 FETCH_LONG(adr);
12214 WRITE_WORD_F(adr, res)
12215 POST_IO
12216RET(24)
12217}
12218
12219// MOVEW
12220OPCODE(0x3EE8)
12221{
12222 u32 adr, res;
12223 u32 src, dst;
12224
12225 FETCH_SWORD(adr);
12226 adr += AREG((Opcode >> 0) & 7);
12227 PRE_IO
12228 READ_WORD_F(adr, res)
12229 flag_C = 0;
12230 flag_V = 0;
12231 flag_NotZ = res;
12232 flag_N = res >> 8;
12233 adr = AREG(7);
12234 AREG(7) += 2;
12235 WRITE_WORD_F(adr, res)
12236 POST_IO
12237RET(16)
12238}
12239
12240// MOVEW
12241OPCODE(0x3F28)
12242{
12243 u32 adr, res;
12244 u32 src, dst;
12245
12246 FETCH_SWORD(adr);
12247 adr += AREG((Opcode >> 0) & 7);
12248 PRE_IO
12249 READ_WORD_F(adr, res)
12250 flag_C = 0;
12251 flag_V = 0;
12252 flag_NotZ = res;
12253 flag_N = res >> 8;
12254 adr = AREG(7) - 2;
12255 AREG(7) = adr;
12256 WRITE_WORD_F(adr, res)
12257 POST_IO
12258RET(16)
12259}
12260
12261// MOVEW
12262OPCODE(0x3030)
12263{
12264 u32 adr, res;
12265 u32 src, dst;
12266
12267 adr = AREG((Opcode >> 0) & 7);
12268 DECODE_EXT_WORD
12269 PRE_IO
12270 READ_WORD_F(adr, res)
12271 flag_C = 0;
12272 flag_V = 0;
12273 flag_NotZ = res;
12274 flag_N = res >> 8;
12275 DREGu16((Opcode >> 9) & 7) = res;
12276 POST_IO
12277RET(14)
12278}
12279
12280// MOVEW
12281OPCODE(0x30B0)
12282{
12283 u32 adr, res;
12284 u32 src, dst;
12285
12286 adr = AREG((Opcode >> 0) & 7);
12287 DECODE_EXT_WORD
12288 PRE_IO
12289 READ_WORD_F(adr, res)
12290 flag_C = 0;
12291 flag_V = 0;
12292 flag_NotZ = res;
12293 flag_N = res >> 8;
12294 adr = AREG((Opcode >> 9) & 7);
12295 WRITE_WORD_F(adr, res)
12296 POST_IO
12297RET(18)
12298}
12299
12300// MOVEW
12301OPCODE(0x30F0)
12302{
12303 u32 adr, res;
12304 u32 src, dst;
12305
12306 adr = AREG((Opcode >> 0) & 7);
12307 DECODE_EXT_WORD
12308 PRE_IO
12309 READ_WORD_F(adr, res)
12310 flag_C = 0;
12311 flag_V = 0;
12312 flag_NotZ = res;
12313 flag_N = res >> 8;
12314 adr = AREG((Opcode >> 9) & 7);
12315 AREG((Opcode >> 9) & 7) += 2;
12316 WRITE_WORD_F(adr, res)
12317 POST_IO
12318RET(18)
12319}
12320
12321// MOVEW
12322OPCODE(0x3130)
12323{
12324 u32 adr, res;
12325 u32 src, dst;
12326
12327 adr = AREG((Opcode >> 0) & 7);
12328 DECODE_EXT_WORD
12329 PRE_IO
12330 READ_WORD_F(adr, res)
12331 flag_C = 0;
12332 flag_V = 0;
12333 flag_NotZ = res;
12334 flag_N = res >> 8;
12335 adr = AREG((Opcode >> 9) & 7) - 2;
12336 AREG((Opcode >> 9) & 7) = adr;
12337 WRITE_WORD_F(adr, res)
12338 POST_IO
12339RET(18)
12340}
12341
12342// MOVEW
12343OPCODE(0x3170)
12344{
12345 u32 adr, res;
12346 u32 src, dst;
12347
12348 adr = AREG((Opcode >> 0) & 7);
12349 DECODE_EXT_WORD
12350 PRE_IO
12351 READ_WORD_F(adr, res)
12352 flag_C = 0;
12353 flag_V = 0;
12354 flag_NotZ = res;
12355 flag_N = res >> 8;
12356 FETCH_SWORD(adr);
12357 adr += AREG((Opcode >> 9) & 7);
12358 WRITE_WORD_F(adr, res)
12359 POST_IO
12360RET(22)
12361}
12362
12363// MOVEW
12364OPCODE(0x31B0)
12365{
12366 u32 adr, res;
12367 u32 src, dst;
12368
12369 adr = AREG((Opcode >> 0) & 7);
12370 DECODE_EXT_WORD
12371 PRE_IO
12372 READ_WORD_F(adr, res)
12373 flag_C = 0;
12374 flag_V = 0;
12375 flag_NotZ = res;
12376 flag_N = res >> 8;
12377 adr = AREG((Opcode >> 9) & 7);
12378 DECODE_EXT_WORD
12379 WRITE_WORD_F(adr, res)
12380 POST_IO
12381RET(24)
12382}
12383
12384// MOVEW
12385OPCODE(0x31F0)
12386{
12387 u32 adr, res;
12388 u32 src, dst;
12389
12390 adr = AREG((Opcode >> 0) & 7);
12391 DECODE_EXT_WORD
12392 PRE_IO
12393 READ_WORD_F(adr, res)
12394 flag_C = 0;
12395 flag_V = 0;
12396 flag_NotZ = res;
12397 flag_N = res >> 8;
12398 FETCH_SWORD(adr);
12399 WRITE_WORD_F(adr, res)
12400 POST_IO
12401RET(22)
12402}
12403
12404// MOVEW
12405OPCODE(0x33F0)
12406{
12407 u32 adr, res;
12408 u32 src, dst;
12409
12410 adr = AREG((Opcode >> 0) & 7);
12411 DECODE_EXT_WORD
12412 PRE_IO
12413 READ_WORD_F(adr, res)
12414 flag_C = 0;
12415 flag_V = 0;
12416 flag_NotZ = res;
12417 flag_N = res >> 8;
12418 FETCH_LONG(adr);
12419 WRITE_WORD_F(adr, res)
12420 POST_IO
12421RET(26)
12422}
12423
12424// MOVEW
12425OPCODE(0x3EF0)
12426{
12427 u32 adr, res;
12428 u32 src, dst;
12429
12430 adr = AREG((Opcode >> 0) & 7);
12431 DECODE_EXT_WORD
12432 PRE_IO
12433 READ_WORD_F(adr, res)
12434 flag_C = 0;
12435 flag_V = 0;
12436 flag_NotZ = res;
12437 flag_N = res >> 8;
12438 adr = AREG(7);
12439 AREG(7) += 2;
12440 WRITE_WORD_F(adr, res)
12441 POST_IO
12442RET(18)
12443}
12444
12445// MOVEW
12446OPCODE(0x3F30)
12447{
12448 u32 adr, res;
12449 u32 src, dst;
12450
12451 adr = AREG((Opcode >> 0) & 7);
12452 DECODE_EXT_WORD
12453 PRE_IO
12454 READ_WORD_F(adr, res)
12455 flag_C = 0;
12456 flag_V = 0;
12457 flag_NotZ = res;
12458 flag_N = res >> 8;
12459 adr = AREG(7) - 2;
12460 AREG(7) = adr;
12461 WRITE_WORD_F(adr, res)
12462 POST_IO
12463RET(18)
12464}
12465
12466// MOVEW
12467OPCODE(0x3038)
12468{
12469 u32 adr, res;
12470 u32 src, dst;
12471
12472 FETCH_SWORD(adr);
12473 PRE_IO
12474 READ_WORD_F(adr, res)
12475 flag_C = 0;
12476 flag_V = 0;
12477 flag_NotZ = res;
12478 flag_N = res >> 8;
12479 DREGu16((Opcode >> 9) & 7) = res;
12480 POST_IO
12481RET(12)
12482}
12483
12484// MOVEW
12485OPCODE(0x30B8)
12486{
12487 u32 adr, res;
12488 u32 src, dst;
12489
12490 FETCH_SWORD(adr);
12491 PRE_IO
12492 READ_WORD_F(adr, res)
12493 flag_C = 0;
12494 flag_V = 0;
12495 flag_NotZ = res;
12496 flag_N = res >> 8;
12497 adr = AREG((Opcode >> 9) & 7);
12498 WRITE_WORD_F(adr, res)
12499 POST_IO
12500RET(16)
12501}
12502
12503// MOVEW
12504OPCODE(0x30F8)
12505{
12506 u32 adr, res;
12507 u32 src, dst;
12508
12509 FETCH_SWORD(adr);
12510 PRE_IO
12511 READ_WORD_F(adr, res)
12512 flag_C = 0;
12513 flag_V = 0;
12514 flag_NotZ = res;
12515 flag_N = res >> 8;
12516 adr = AREG((Opcode >> 9) & 7);
12517 AREG((Opcode >> 9) & 7) += 2;
12518 WRITE_WORD_F(adr, res)
12519 POST_IO
12520RET(16)
12521}
12522
12523// MOVEW
12524OPCODE(0x3138)
12525{
12526 u32 adr, res;
12527 u32 src, dst;
12528
12529 FETCH_SWORD(adr);
12530 PRE_IO
12531 READ_WORD_F(adr, res)
12532 flag_C = 0;
12533 flag_V = 0;
12534 flag_NotZ = res;
12535 flag_N = res >> 8;
12536 adr = AREG((Opcode >> 9) & 7) - 2;
12537 AREG((Opcode >> 9) & 7) = adr;
12538 WRITE_WORD_F(adr, res)
12539 POST_IO
12540RET(16)
12541}
12542
12543// MOVEW
12544OPCODE(0x3178)
12545{
12546 u32 adr, res;
12547 u32 src, dst;
12548
12549 FETCH_SWORD(adr);
12550 PRE_IO
12551 READ_WORD_F(adr, res)
12552 flag_C = 0;
12553 flag_V = 0;
12554 flag_NotZ = res;
12555 flag_N = res >> 8;
12556 FETCH_SWORD(adr);
12557 adr += AREG((Opcode >> 9) & 7);
12558 WRITE_WORD_F(adr, res)
12559 POST_IO
12560RET(20)
12561}
12562
12563// MOVEW
12564OPCODE(0x31B8)
12565{
12566 u32 adr, res;
12567 u32 src, dst;
12568
12569 FETCH_SWORD(adr);
12570 PRE_IO
12571 READ_WORD_F(adr, res)
12572 flag_C = 0;
12573 flag_V = 0;
12574 flag_NotZ = res;
12575 flag_N = res >> 8;
12576 adr = AREG((Opcode >> 9) & 7);
12577 DECODE_EXT_WORD
12578 WRITE_WORD_F(adr, res)
12579 POST_IO
12580RET(22)
12581}
12582
12583// MOVEW
12584OPCODE(0x31F8)
12585{
12586 u32 adr, res;
12587 u32 src, dst;
12588
12589 FETCH_SWORD(adr);
12590 PRE_IO
12591 READ_WORD_F(adr, res)
12592 flag_C = 0;
12593 flag_V = 0;
12594 flag_NotZ = res;
12595 flag_N = res >> 8;
12596 FETCH_SWORD(adr);
12597 WRITE_WORD_F(adr, res)
12598 POST_IO
12599RET(20)
12600}
12601
12602// MOVEW
12603OPCODE(0x33F8)
12604{
12605 u32 adr, res;
12606 u32 src, dst;
12607
12608 FETCH_SWORD(adr);
12609 PRE_IO
12610 READ_WORD_F(adr, res)
12611 flag_C = 0;
12612 flag_V = 0;
12613 flag_NotZ = res;
12614 flag_N = res >> 8;
12615 FETCH_LONG(adr);
12616 WRITE_WORD_F(adr, res)
12617 POST_IO
12618RET(24)
12619}
12620
12621// MOVEW
12622OPCODE(0x3EF8)
12623{
12624 u32 adr, res;
12625 u32 src, dst;
12626
12627 FETCH_SWORD(adr);
12628 PRE_IO
12629 READ_WORD_F(adr, res)
12630 flag_C = 0;
12631 flag_V = 0;
12632 flag_NotZ = res;
12633 flag_N = res >> 8;
12634 adr = AREG(7);
12635 AREG(7) += 2;
12636 WRITE_WORD_F(adr, res)
12637 POST_IO
12638RET(16)
12639}
12640
12641// MOVEW
12642OPCODE(0x3F38)
12643{
12644 u32 adr, res;
12645 u32 src, dst;
12646
12647 FETCH_SWORD(adr);
12648 PRE_IO
12649 READ_WORD_F(adr, res)
12650 flag_C = 0;
12651 flag_V = 0;
12652 flag_NotZ = res;
12653 flag_N = res >> 8;
12654 adr = AREG(7) - 2;
12655 AREG(7) = adr;
12656 WRITE_WORD_F(adr, res)
12657 POST_IO
12658RET(16)
12659}
12660
12661// MOVEW
12662OPCODE(0x3039)
12663{
12664 u32 adr, res;
12665 u32 src, dst;
12666
12667 FETCH_LONG(adr);
12668 PRE_IO
12669 READ_WORD_F(adr, res)
12670 flag_C = 0;
12671 flag_V = 0;
12672 flag_NotZ = res;
12673 flag_N = res >> 8;
12674 DREGu16((Opcode >> 9) & 7) = res;
12675 POST_IO
12676RET(16)
12677}
12678
12679// MOVEW
12680OPCODE(0x30B9)
12681{
12682 u32 adr, res;
12683 u32 src, dst;
12684
12685 FETCH_LONG(adr);
12686 PRE_IO
12687 READ_WORD_F(adr, res)
12688 flag_C = 0;
12689 flag_V = 0;
12690 flag_NotZ = res;
12691 flag_N = res >> 8;
12692 adr = AREG((Opcode >> 9) & 7);
12693 WRITE_WORD_F(adr, res)
12694 POST_IO
12695RET(20)
12696}
12697
12698// MOVEW
12699OPCODE(0x30F9)
12700{
12701 u32 adr, res;
12702 u32 src, dst;
12703
12704 FETCH_LONG(adr);
12705 PRE_IO
12706 READ_WORD_F(adr, res)
12707 flag_C = 0;
12708 flag_V = 0;
12709 flag_NotZ = res;
12710 flag_N = res >> 8;
12711 adr = AREG((Opcode >> 9) & 7);
12712 AREG((Opcode >> 9) & 7) += 2;
12713 WRITE_WORD_F(adr, res)
12714 POST_IO
12715RET(20)
12716}
12717
12718// MOVEW
12719OPCODE(0x3139)
12720{
12721 u32 adr, res;
12722 u32 src, dst;
12723
12724 FETCH_LONG(adr);
12725 PRE_IO
12726 READ_WORD_F(adr, res)
12727 flag_C = 0;
12728 flag_V = 0;
12729 flag_NotZ = res;
12730 flag_N = res >> 8;
12731 adr = AREG((Opcode >> 9) & 7) - 2;
12732 AREG((Opcode >> 9) & 7) = adr;
12733 WRITE_WORD_F(adr, res)
12734 POST_IO
12735RET(20)
12736}
12737
12738// MOVEW
12739OPCODE(0x3179)
12740{
12741 u32 adr, res;
12742 u32 src, dst;
12743
12744 FETCH_LONG(adr);
12745 PRE_IO
12746 READ_WORD_F(adr, res)
12747 flag_C = 0;
12748 flag_V = 0;
12749 flag_NotZ = res;
12750 flag_N = res >> 8;
12751 FETCH_SWORD(adr);
12752 adr += AREG((Opcode >> 9) & 7);
12753 WRITE_WORD_F(adr, res)
12754 POST_IO
12755RET(24)
12756}
12757
12758// MOVEW
12759OPCODE(0x31B9)
12760{
12761 u32 adr, res;
12762 u32 src, dst;
12763
12764 FETCH_LONG(adr);
12765 PRE_IO
12766 READ_WORD_F(adr, res)
12767 flag_C = 0;
12768 flag_V = 0;
12769 flag_NotZ = res;
12770 flag_N = res >> 8;
12771 adr = AREG((Opcode >> 9) & 7);
12772 DECODE_EXT_WORD
12773 WRITE_WORD_F(adr, res)
12774 POST_IO
12775RET(26)
12776}
12777
12778// MOVEW
12779OPCODE(0x31F9)
12780{
12781 u32 adr, res;
12782 u32 src, dst;
12783
12784 FETCH_LONG(adr);
12785 PRE_IO
12786 READ_WORD_F(adr, res)
12787 flag_C = 0;
12788 flag_V = 0;
12789 flag_NotZ = res;
12790 flag_N = res >> 8;
12791 FETCH_SWORD(adr);
12792 WRITE_WORD_F(adr, res)
12793 POST_IO
12794RET(24)
12795}
12796
12797// MOVEW
12798OPCODE(0x33F9)
12799{
12800 u32 adr, res;
12801 u32 src, dst;
12802
12803 FETCH_LONG(adr);
12804 PRE_IO
12805 READ_WORD_F(adr, res)
12806 flag_C = 0;
12807 flag_V = 0;
12808 flag_NotZ = res;
12809 flag_N = res >> 8;
12810 FETCH_LONG(adr);
12811 WRITE_WORD_F(adr, res)
12812 POST_IO
12813RET(28)
12814}
12815
12816// MOVEW
12817OPCODE(0x3EF9)
12818{
12819 u32 adr, res;
12820 u32 src, dst;
12821
12822 FETCH_LONG(adr);
12823 PRE_IO
12824 READ_WORD_F(adr, res)
12825 flag_C = 0;
12826 flag_V = 0;
12827 flag_NotZ = res;
12828 flag_N = res >> 8;
12829 adr = AREG(7);
12830 AREG(7) += 2;
12831 WRITE_WORD_F(adr, res)
12832 POST_IO
12833RET(20)
12834}
12835
12836// MOVEW
12837OPCODE(0x3F39)
12838{
12839 u32 adr, res;
12840 u32 src, dst;
12841
12842 FETCH_LONG(adr);
12843 PRE_IO
12844 READ_WORD_F(adr, res)
12845 flag_C = 0;
12846 flag_V = 0;
12847 flag_NotZ = res;
12848 flag_N = res >> 8;
12849 adr = AREG(7) - 2;
12850 AREG(7) = adr;
12851 WRITE_WORD_F(adr, res)
12852 POST_IO
12853RET(20)
12854}
12855
12856// MOVEW
12857OPCODE(0x303A)
12858{
12859 u32 adr, res;
12860 u32 src, dst;
12861
be26eb23 12862 adr = GET_SWORD + GET_PC;
70357ce5 12863 PC++;
12864 PRE_IO
12865 READ_WORD_F(adr, res)
12866 flag_C = 0;
12867 flag_V = 0;
12868 flag_NotZ = res;
12869 flag_N = res >> 8;
12870 DREGu16((Opcode >> 9) & 7) = res;
12871 POST_IO
12872RET(12)
12873}
12874
12875// MOVEW
12876OPCODE(0x30BA)
12877{
12878 u32 adr, res;
12879 u32 src, dst;
12880
be26eb23 12881 adr = GET_SWORD + GET_PC;
70357ce5 12882 PC++;
12883 PRE_IO
12884 READ_WORD_F(adr, res)
12885 flag_C = 0;
12886 flag_V = 0;
12887 flag_NotZ = res;
12888 flag_N = res >> 8;
12889 adr = AREG((Opcode >> 9) & 7);
12890 WRITE_WORD_F(adr, res)
12891 POST_IO
12892RET(16)
12893}
12894
12895// MOVEW
12896OPCODE(0x30FA)
12897{
12898 u32 adr, res;
12899 u32 src, dst;
12900
be26eb23 12901 adr = GET_SWORD + GET_PC;
70357ce5 12902 PC++;
12903 PRE_IO
12904 READ_WORD_F(adr, res)
12905 flag_C = 0;
12906 flag_V = 0;
12907 flag_NotZ = res;
12908 flag_N = res >> 8;
12909 adr = AREG((Opcode >> 9) & 7);
12910 AREG((Opcode >> 9) & 7) += 2;
12911 WRITE_WORD_F(adr, res)
12912 POST_IO
12913RET(16)
12914}
12915
12916// MOVEW
12917OPCODE(0x313A)
12918{
12919 u32 adr, res;
12920 u32 src, dst;
12921
be26eb23 12922 adr = GET_SWORD + GET_PC;
70357ce5 12923 PC++;
12924 PRE_IO
12925 READ_WORD_F(adr, res)
12926 flag_C = 0;
12927 flag_V = 0;
12928 flag_NotZ = res;
12929 flag_N = res >> 8;
12930 adr = AREG((Opcode >> 9) & 7) - 2;
12931 AREG((Opcode >> 9) & 7) = adr;
12932 WRITE_WORD_F(adr, res)
12933 POST_IO
12934RET(16)
12935}
12936
12937// MOVEW
12938OPCODE(0x317A)
12939{
12940 u32 adr, res;
12941 u32 src, dst;
12942
be26eb23 12943 adr = GET_SWORD + GET_PC;
70357ce5 12944 PC++;
12945 PRE_IO
12946 READ_WORD_F(adr, res)
12947 flag_C = 0;
12948 flag_V = 0;
12949 flag_NotZ = res;
12950 flag_N = res >> 8;
12951 FETCH_SWORD(adr);
12952 adr += AREG((Opcode >> 9) & 7);
12953 WRITE_WORD_F(adr, res)
12954 POST_IO
12955RET(20)
12956}
12957
12958// MOVEW
12959OPCODE(0x31BA)
12960{
12961 u32 adr, res;
12962 u32 src, dst;
12963
be26eb23 12964 adr = GET_SWORD + GET_PC;
70357ce5 12965 PC++;
12966 PRE_IO
12967 READ_WORD_F(adr, res)
12968 flag_C = 0;
12969 flag_V = 0;
12970 flag_NotZ = res;
12971 flag_N = res >> 8;
12972 adr = AREG((Opcode >> 9) & 7);
12973 DECODE_EXT_WORD
12974 WRITE_WORD_F(adr, res)
12975 POST_IO
12976RET(22)
12977}
12978
12979// MOVEW
12980OPCODE(0x31FA)
12981{
12982 u32 adr, res;
12983 u32 src, dst;
12984
be26eb23 12985 adr = GET_SWORD + GET_PC;
70357ce5 12986 PC++;
12987 PRE_IO
12988 READ_WORD_F(adr, res)
12989 flag_C = 0;
12990 flag_V = 0;
12991 flag_NotZ = res;
12992 flag_N = res >> 8;
12993 FETCH_SWORD(adr);
12994 WRITE_WORD_F(adr, res)
12995 POST_IO
12996RET(20)
12997}
12998
12999// MOVEW
13000OPCODE(0x33FA)
13001{
13002 u32 adr, res;
13003 u32 src, dst;
13004
be26eb23 13005 adr = GET_SWORD + GET_PC;
70357ce5 13006 PC++;
13007 PRE_IO
13008 READ_WORD_F(adr, res)
13009 flag_C = 0;
13010 flag_V = 0;
13011 flag_NotZ = res;
13012 flag_N = res >> 8;
13013 FETCH_LONG(adr);
13014 WRITE_WORD_F(adr, res)
13015 POST_IO
13016RET(24)
13017}
13018
13019// MOVEW
13020OPCODE(0x3EFA)
13021{
13022 u32 adr, res;
13023 u32 src, dst;
13024
be26eb23 13025 adr = GET_SWORD + GET_PC;
70357ce5 13026 PC++;
13027 PRE_IO
13028 READ_WORD_F(adr, res)
13029 flag_C = 0;
13030 flag_V = 0;
13031 flag_NotZ = res;
13032 flag_N = res >> 8;
13033 adr = AREG(7);
13034 AREG(7) += 2;
13035 WRITE_WORD_F(adr, res)
13036 POST_IO
13037RET(16)
13038}
13039
13040// MOVEW
13041OPCODE(0x3F3A)
13042{
13043 u32 adr, res;
13044 u32 src, dst;
13045
be26eb23 13046 adr = GET_SWORD + GET_PC;
70357ce5 13047 PC++;
13048 PRE_IO
13049 READ_WORD_F(adr, res)
13050 flag_C = 0;
13051 flag_V = 0;
13052 flag_NotZ = res;
13053 flag_N = res >> 8;
13054 adr = AREG(7) - 2;
13055 AREG(7) = adr;
13056 WRITE_WORD_F(adr, res)
13057 POST_IO
13058RET(16)
13059}
13060
13061// MOVEW
13062OPCODE(0x303B)
13063{
13064 u32 adr, res;
13065 u32 src, dst;
13066
be26eb23 13067 adr = GET_PC;
70357ce5 13068 DECODE_EXT_WORD
13069 PRE_IO
13070 READ_WORD_F(adr, res)
13071 flag_C = 0;
13072 flag_V = 0;
13073 flag_NotZ = res;
13074 flag_N = res >> 8;
13075 DREGu16((Opcode >> 9) & 7) = res;
13076 POST_IO
13077RET(14)
13078}
13079
13080// MOVEW
13081OPCODE(0x30BB)
13082{
13083 u32 adr, res;
13084 u32 src, dst;
13085
be26eb23 13086 adr = GET_PC;
70357ce5 13087 DECODE_EXT_WORD
13088 PRE_IO
13089 READ_WORD_F(adr, res)
13090 flag_C = 0;
13091 flag_V = 0;
13092 flag_NotZ = res;
13093 flag_N = res >> 8;
13094 adr = AREG((Opcode >> 9) & 7);
13095 WRITE_WORD_F(adr, res)
13096 POST_IO
13097RET(18)
13098}
13099
13100// MOVEW
13101OPCODE(0x30FB)
13102{
13103 u32 adr, res;
13104 u32 src, dst;
13105
be26eb23 13106 adr = GET_PC;
70357ce5 13107 DECODE_EXT_WORD
13108 PRE_IO
13109 READ_WORD_F(adr, res)
13110 flag_C = 0;
13111 flag_V = 0;
13112 flag_NotZ = res;
13113 flag_N = res >> 8;
13114 adr = AREG((Opcode >> 9) & 7);
13115 AREG((Opcode >> 9) & 7) += 2;
13116 WRITE_WORD_F(adr, res)
13117 POST_IO
13118RET(18)
13119}
13120
13121// MOVEW
13122OPCODE(0x313B)
13123{
13124 u32 adr, res;
13125 u32 src, dst;
13126
be26eb23 13127 adr = GET_PC;
70357ce5 13128 DECODE_EXT_WORD
13129 PRE_IO
13130 READ_WORD_F(adr, res)
13131 flag_C = 0;
13132 flag_V = 0;
13133 flag_NotZ = res;
13134 flag_N = res >> 8;
13135 adr = AREG((Opcode >> 9) & 7) - 2;
13136 AREG((Opcode >> 9) & 7) = adr;
13137 WRITE_WORD_F(adr, res)
13138 POST_IO
13139RET(18)
13140}
13141
13142// MOVEW
13143OPCODE(0x317B)
13144{
13145 u32 adr, res;
13146 u32 src, dst;
13147
be26eb23 13148 adr = GET_PC;
70357ce5 13149 DECODE_EXT_WORD
13150 PRE_IO
13151 READ_WORD_F(adr, res)
13152 flag_C = 0;
13153 flag_V = 0;
13154 flag_NotZ = res;
13155 flag_N = res >> 8;
13156 FETCH_SWORD(adr);
13157 adr += AREG((Opcode >> 9) & 7);
13158 WRITE_WORD_F(adr, res)
13159 POST_IO
13160RET(22)
13161}
13162
13163// MOVEW
13164OPCODE(0x31BB)
13165{
13166 u32 adr, res;
13167 u32 src, dst;
13168
be26eb23 13169 adr = GET_PC;
70357ce5 13170 DECODE_EXT_WORD
13171 PRE_IO
13172 READ_WORD_F(adr, res)
13173 flag_C = 0;
13174 flag_V = 0;
13175 flag_NotZ = res;
13176 flag_N = res >> 8;
13177 adr = AREG((Opcode >> 9) & 7);
13178 DECODE_EXT_WORD
13179 WRITE_WORD_F(adr, res)
13180 POST_IO
13181RET(24)
13182}
13183
13184// MOVEW
13185OPCODE(0x31FB)
13186{
13187 u32 adr, res;
13188 u32 src, dst;
13189
be26eb23 13190 adr = GET_PC;
70357ce5 13191 DECODE_EXT_WORD
13192 PRE_IO
13193 READ_WORD_F(adr, res)
13194 flag_C = 0;
13195 flag_V = 0;
13196 flag_NotZ = res;
13197 flag_N = res >> 8;
13198 FETCH_SWORD(adr);
13199 WRITE_WORD_F(adr, res)
13200 POST_IO
13201RET(22)
13202}
13203
13204// MOVEW
13205OPCODE(0x33FB)
13206{
13207 u32 adr, res;
13208 u32 src, dst;
13209
be26eb23 13210 adr = GET_PC;
70357ce5 13211 DECODE_EXT_WORD
13212 PRE_IO
13213 READ_WORD_F(adr, res)
13214 flag_C = 0;
13215 flag_V = 0;
13216 flag_NotZ = res;
13217 flag_N = res >> 8;
13218 FETCH_LONG(adr);
13219 WRITE_WORD_F(adr, res)
13220 POST_IO
13221RET(26)
13222}
13223
13224// MOVEW
13225OPCODE(0x3EFB)
13226{
13227 u32 adr, res;
13228 u32 src, dst;
13229
be26eb23 13230 adr = GET_PC;
70357ce5 13231 DECODE_EXT_WORD
13232 PRE_IO
13233 READ_WORD_F(adr, res)
13234 flag_C = 0;
13235 flag_V = 0;
13236 flag_NotZ = res;
13237 flag_N = res >> 8;
13238 adr = AREG(7);
13239 AREG(7) += 2;
13240 WRITE_WORD_F(adr, res)
13241 POST_IO
13242RET(18)
13243}
13244
13245// MOVEW
13246OPCODE(0x3F3B)
13247{
13248 u32 adr, res;
13249 u32 src, dst;
13250
be26eb23 13251 adr = GET_PC;
70357ce5 13252 DECODE_EXT_WORD
13253 PRE_IO
13254 READ_WORD_F(adr, res)
13255 flag_C = 0;
13256 flag_V = 0;
13257 flag_NotZ = res;
13258 flag_N = res >> 8;
13259 adr = AREG(7) - 2;
13260 AREG(7) = adr;
13261 WRITE_WORD_F(adr, res)
13262 POST_IO
13263RET(18)
13264}
13265
13266// MOVEW
13267OPCODE(0x303C)
13268{
13269 u32 adr, res;
13270 u32 src, dst;
13271
13272 FETCH_WORD(res);
13273 flag_C = 0;
13274 flag_V = 0;
13275 flag_NotZ = res;
13276 flag_N = res >> 8;
13277 DREGu16((Opcode >> 9) & 7) = res;
13278RET(8)
13279}
13280
13281// MOVEW
13282OPCODE(0x30BC)
13283{
13284 u32 adr, res;
13285 u32 src, dst;
13286
13287 FETCH_WORD(res);
13288 flag_C = 0;
13289 flag_V = 0;
13290 flag_NotZ = res;
13291 flag_N = res >> 8;
13292 adr = AREG((Opcode >> 9) & 7);
13293 PRE_IO
13294 WRITE_WORD_F(adr, res)
13295 POST_IO
13296RET(12)
13297}
13298
13299// MOVEW
13300OPCODE(0x30FC)
13301{
13302 u32 adr, res;
13303 u32 src, dst;
13304
13305 FETCH_WORD(res);
13306 flag_C = 0;
13307 flag_V = 0;
13308 flag_NotZ = res;
13309 flag_N = res >> 8;
13310 adr = AREG((Opcode >> 9) & 7);
13311 AREG((Opcode >> 9) & 7) += 2;
13312 PRE_IO
13313 WRITE_WORD_F(adr, res)
13314 POST_IO
13315RET(12)
13316}
13317
13318// MOVEW
13319OPCODE(0x313C)
13320{
13321 u32 adr, res;
13322 u32 src, dst;
13323
13324 FETCH_WORD(res);
13325 flag_C = 0;
13326 flag_V = 0;
13327 flag_NotZ = res;
13328 flag_N = res >> 8;
13329 adr = AREG((Opcode >> 9) & 7) - 2;
13330 AREG((Opcode >> 9) & 7) = adr;
13331 PRE_IO
13332 WRITE_WORD_F(adr, res)
13333 POST_IO
13334RET(12)
13335}
13336
13337// MOVEW
13338OPCODE(0x317C)
13339{
13340 u32 adr, res;
13341 u32 src, dst;
13342
13343 FETCH_WORD(res);
13344 flag_C = 0;
13345 flag_V = 0;
13346 flag_NotZ = res;
13347 flag_N = res >> 8;
13348 FETCH_SWORD(adr);
13349 adr += AREG((Opcode >> 9) & 7);
13350 PRE_IO
13351 WRITE_WORD_F(adr, res)
13352 POST_IO
13353RET(16)
13354}
13355
13356// MOVEW
13357OPCODE(0x31BC)
13358{
13359 u32 adr, res;
13360 u32 src, dst;
13361
13362 FETCH_WORD(res);
13363 flag_C = 0;
13364 flag_V = 0;
13365 flag_NotZ = res;
13366 flag_N = res >> 8;
13367 adr = AREG((Opcode >> 9) & 7);
13368 DECODE_EXT_WORD
13369 PRE_IO
13370 WRITE_WORD_F(adr, res)
13371 POST_IO
13372RET(18)
13373}
13374
13375// MOVEW
13376OPCODE(0x31FC)
13377{
13378 u32 adr, res;
13379 u32 src, dst;
13380
13381 FETCH_WORD(res);
13382 flag_C = 0;
13383 flag_V = 0;
13384 flag_NotZ = res;
13385 flag_N = res >> 8;
13386 FETCH_SWORD(adr);
13387 PRE_IO
13388 WRITE_WORD_F(adr, res)
13389 POST_IO
13390RET(16)
13391}
13392
13393// MOVEW
13394OPCODE(0x33FC)
13395{
13396 u32 adr, res;
13397 u32 src, dst;
13398
13399 FETCH_WORD(res);
13400 flag_C = 0;
13401 flag_V = 0;
13402 flag_NotZ = res;
13403 flag_N = res >> 8;
13404 FETCH_LONG(adr);
13405 PRE_IO
13406 WRITE_WORD_F(adr, res)
13407 POST_IO
13408RET(20)
13409}
13410
13411// MOVEW
13412OPCODE(0x3EFC)
13413{
13414 u32 adr, res;
13415 u32 src, dst;
13416
13417 FETCH_WORD(res);
13418 flag_C = 0;
13419 flag_V = 0;
13420 flag_NotZ = res;
13421 flag_N = res >> 8;
13422 adr = AREG(7);
13423 AREG(7) += 2;
13424 PRE_IO
13425 WRITE_WORD_F(adr, res)
13426 POST_IO
13427RET(12)
13428}
13429
13430// MOVEW
13431OPCODE(0x3F3C)
13432{
13433 u32 adr, res;
13434 u32 src, dst;
13435
13436 FETCH_WORD(res);
13437 flag_C = 0;
13438 flag_V = 0;
13439 flag_NotZ = res;
13440 flag_N = res >> 8;
13441 adr = AREG(7) - 2;
13442 AREG(7) = adr;
13443 PRE_IO
13444 WRITE_WORD_F(adr, res)
13445 POST_IO
13446RET(12)
13447}
13448
13449// MOVEW
13450OPCODE(0x301F)
13451{
13452 u32 adr, res;
13453 u32 src, dst;
13454
13455 adr = AREG(7);
13456 AREG(7) += 2;
13457 PRE_IO
13458 READ_WORD_F(adr, res)
13459 flag_C = 0;
13460 flag_V = 0;
13461 flag_NotZ = res;
13462 flag_N = res >> 8;
13463 DREGu16((Opcode >> 9) & 7) = res;
13464 POST_IO
13465RET(8)
13466}
13467
13468// MOVEW
13469OPCODE(0x309F)
13470{
13471 u32 adr, res;
13472 u32 src, dst;
13473
13474 adr = AREG(7);
13475 AREG(7) += 2;
13476 PRE_IO
13477 READ_WORD_F(adr, res)
13478 flag_C = 0;
13479 flag_V = 0;
13480 flag_NotZ = res;
13481 flag_N = res >> 8;
13482 adr = AREG((Opcode >> 9) & 7);
13483 WRITE_WORD_F(adr, res)
13484 POST_IO
13485RET(12)
13486}
13487
13488// MOVEW
13489OPCODE(0x30DF)
13490{
13491 u32 adr, res;
13492 u32 src, dst;
13493
13494 adr = AREG(7);
13495 AREG(7) += 2;
13496 PRE_IO
13497 READ_WORD_F(adr, res)
13498 flag_C = 0;
13499 flag_V = 0;
13500 flag_NotZ = res;
13501 flag_N = res >> 8;
13502 adr = AREG((Opcode >> 9) & 7);
13503 AREG((Opcode >> 9) & 7) += 2;
13504 WRITE_WORD_F(adr, res)
13505 POST_IO
13506RET(12)
13507}
13508
13509// MOVEW
13510OPCODE(0x311F)
13511{
13512 u32 adr, res;
13513 u32 src, dst;
13514
13515 adr = AREG(7);
13516 AREG(7) += 2;
13517 PRE_IO
13518 READ_WORD_F(adr, res)
13519 flag_C = 0;
13520 flag_V = 0;
13521 flag_NotZ = res;
13522 flag_N = res >> 8;
13523 adr = AREG((Opcode >> 9) & 7) - 2;
13524 AREG((Opcode >> 9) & 7) = adr;
13525 WRITE_WORD_F(adr, res)
13526 POST_IO
13527RET(12)
13528}
13529
13530// MOVEW
13531OPCODE(0x315F)
13532{
13533 u32 adr, res;
13534 u32 src, dst;
13535
13536 adr = AREG(7);
13537 AREG(7) += 2;
13538 PRE_IO
13539 READ_WORD_F(adr, res)
13540 flag_C = 0;
13541 flag_V = 0;
13542 flag_NotZ = res;
13543 flag_N = res >> 8;
13544 FETCH_SWORD(adr);
13545 adr += AREG((Opcode >> 9) & 7);
13546 WRITE_WORD_F(adr, res)
13547 POST_IO
13548RET(16)
13549}
13550
13551// MOVEW
13552OPCODE(0x319F)
13553{
13554 u32 adr, res;
13555 u32 src, dst;
13556
13557 adr = AREG(7);
13558 AREG(7) += 2;
13559 PRE_IO
13560 READ_WORD_F(adr, res)
13561 flag_C = 0;
13562 flag_V = 0;
13563 flag_NotZ = res;
13564 flag_N = res >> 8;
13565 adr = AREG((Opcode >> 9) & 7);
13566 DECODE_EXT_WORD
13567 WRITE_WORD_F(adr, res)
13568 POST_IO
13569RET(18)
13570}
13571
13572// MOVEW
13573OPCODE(0x31DF)
13574{
13575 u32 adr, res;
13576 u32 src, dst;
13577
13578 adr = AREG(7);
13579 AREG(7) += 2;
13580 PRE_IO
13581 READ_WORD_F(adr, res)
13582 flag_C = 0;
13583 flag_V = 0;
13584 flag_NotZ = res;
13585 flag_N = res >> 8;
13586 FETCH_SWORD(adr);
13587 WRITE_WORD_F(adr, res)
13588 POST_IO
13589RET(16)
13590}
13591
13592// MOVEW
13593OPCODE(0x33DF)
13594{
13595 u32 adr, res;
13596 u32 src, dst;
13597
13598 adr = AREG(7);
13599 AREG(7) += 2;
13600 PRE_IO
13601 READ_WORD_F(adr, res)
13602 flag_C = 0;
13603 flag_V = 0;
13604 flag_NotZ = res;
13605 flag_N = res >> 8;
13606 FETCH_LONG(adr);
13607 WRITE_WORD_F(adr, res)
13608 POST_IO
13609RET(20)
13610}
13611
13612// MOVEW
13613OPCODE(0x3EDF)
13614{
13615 u32 adr, res;
13616 u32 src, dst;
13617
13618 adr = AREG(7);
13619 AREG(7) += 2;
13620 PRE_IO
13621 READ_WORD_F(adr, res)
13622 flag_C = 0;
13623 flag_V = 0;
13624 flag_NotZ = res;
13625 flag_N = res >> 8;
13626 adr = AREG(7);
13627 AREG(7) += 2;
13628 WRITE_WORD_F(adr, res)
13629 POST_IO
13630RET(12)
13631}
13632
13633// MOVEW
13634OPCODE(0x3F1F)
13635{
13636 u32 adr, res;
13637 u32 src, dst;
13638
13639 adr = AREG(7);
13640 AREG(7) += 2;
13641 PRE_IO
13642 READ_WORD_F(adr, res)
13643 flag_C = 0;
13644 flag_V = 0;
13645 flag_NotZ = res;
13646 flag_N = res >> 8;
13647 adr = AREG(7) - 2;
13648 AREG(7) = adr;
13649 WRITE_WORD_F(adr, res)
13650 POST_IO
13651RET(12)
13652}
13653
13654// MOVEW
13655OPCODE(0x3027)
13656{
13657 u32 adr, res;
13658 u32 src, dst;
13659
13660 adr = AREG(7) - 2;
13661 AREG(7) = adr;
13662 PRE_IO
13663 READ_WORD_F(adr, res)
13664 flag_C = 0;
13665 flag_V = 0;
13666 flag_NotZ = res;
13667 flag_N = res >> 8;
13668 DREGu16((Opcode >> 9) & 7) = res;
13669 POST_IO
13670RET(10)
13671}
13672
13673// MOVEW
13674OPCODE(0x30A7)
13675{
13676 u32 adr, res;
13677 u32 src, dst;
13678
13679 adr = AREG(7) - 2;
13680 AREG(7) = adr;
13681 PRE_IO
13682 READ_WORD_F(adr, res)
13683 flag_C = 0;
13684 flag_V = 0;
13685 flag_NotZ = res;
13686 flag_N = res >> 8;
13687 adr = AREG((Opcode >> 9) & 7);
13688 WRITE_WORD_F(adr, res)
13689 POST_IO
13690RET(14)
13691}
13692
13693// MOVEW
13694OPCODE(0x30E7)
13695{
13696 u32 adr, res;
13697 u32 src, dst;
13698
13699 adr = AREG(7) - 2;
13700 AREG(7) = adr;
13701 PRE_IO
13702 READ_WORD_F(adr, res)
13703 flag_C = 0;
13704 flag_V = 0;
13705 flag_NotZ = res;
13706 flag_N = res >> 8;
13707 adr = AREG((Opcode >> 9) & 7);
13708 AREG((Opcode >> 9) & 7) += 2;
13709 WRITE_WORD_F(adr, res)
13710 POST_IO
13711RET(14)
13712}
13713
13714// MOVEW
13715OPCODE(0x3127)
13716{
13717 u32 adr, res;
13718 u32 src, dst;
13719
13720 adr = AREG(7) - 2;
13721 AREG(7) = adr;
13722 PRE_IO
13723 READ_WORD_F(adr, res)
13724 flag_C = 0;
13725 flag_V = 0;
13726 flag_NotZ = res;
13727 flag_N = res >> 8;
13728 adr = AREG((Opcode >> 9) & 7) - 2;
13729 AREG((Opcode >> 9) & 7) = adr;
13730 WRITE_WORD_F(adr, res)
13731 POST_IO
13732RET(14)
13733}
13734
13735// MOVEW
13736OPCODE(0x3167)
13737{
13738 u32 adr, res;
13739 u32 src, dst;
13740
13741 adr = AREG(7) - 2;
13742 AREG(7) = adr;
13743 PRE_IO
13744 READ_WORD_F(adr, res)
13745 flag_C = 0;
13746 flag_V = 0;
13747 flag_NotZ = res;
13748 flag_N = res >> 8;
13749 FETCH_SWORD(adr);
13750 adr += AREG((Opcode >> 9) & 7);
13751 WRITE_WORD_F(adr, res)
13752 POST_IO
13753RET(18)
13754}
13755
13756// MOVEW
13757OPCODE(0x31A7)
13758{
13759 u32 adr, res;
13760 u32 src, dst;
13761
13762 adr = AREG(7) - 2;
13763 AREG(7) = adr;
13764 PRE_IO
13765 READ_WORD_F(adr, res)
13766 flag_C = 0;
13767 flag_V = 0;
13768 flag_NotZ = res;
13769 flag_N = res >> 8;
13770 adr = AREG((Opcode >> 9) & 7);
13771 DECODE_EXT_WORD
13772 WRITE_WORD_F(adr, res)
13773 POST_IO
13774RET(20)
13775}
13776
13777// MOVEW
13778OPCODE(0x31E7)
13779{
13780 u32 adr, res;
13781 u32 src, dst;
13782
13783 adr = AREG(7) - 2;
13784 AREG(7) = adr;
13785 PRE_IO
13786 READ_WORD_F(adr, res)
13787 flag_C = 0;
13788 flag_V = 0;
13789 flag_NotZ = res;
13790 flag_N = res >> 8;
13791 FETCH_SWORD(adr);
13792 WRITE_WORD_F(adr, res)
13793 POST_IO
13794RET(18)
13795}
13796
13797// MOVEW
13798OPCODE(0x33E7)
13799{
13800 u32 adr, res;
13801 u32 src, dst;
13802
13803 adr = AREG(7) - 2;
13804 AREG(7) = adr;
13805 PRE_IO
13806 READ_WORD_F(adr, res)
13807 flag_C = 0;
13808 flag_V = 0;
13809 flag_NotZ = res;
13810 flag_N = res >> 8;
13811 FETCH_LONG(adr);
13812 WRITE_WORD_F(adr, res)
13813 POST_IO
13814RET(22)
13815}
13816
13817// MOVEW
13818OPCODE(0x3EE7)
13819{
13820 u32 adr, res;
13821 u32 src, dst;
13822
13823 adr = AREG(7) - 2;
13824 AREG(7) = adr;
13825 PRE_IO
13826 READ_WORD_F(adr, res)
13827 flag_C = 0;
13828 flag_V = 0;
13829 flag_NotZ = res;
13830 flag_N = res >> 8;
13831 adr = AREG(7);
13832 AREG(7) += 2;
13833 WRITE_WORD_F(adr, res)
13834 POST_IO
13835RET(14)
13836}
13837
13838// MOVEW
13839OPCODE(0x3F27)
13840{
13841 u32 adr, res;
13842 u32 src, dst;
13843
13844 adr = AREG(7) - 2;
13845 AREG(7) = adr;
13846 PRE_IO
13847 READ_WORD_F(adr, res)
13848 flag_C = 0;
13849 flag_V = 0;
13850 flag_NotZ = res;
13851 flag_N = res >> 8;
13852 adr = AREG(7) - 2;
13853 AREG(7) = adr;
13854 WRITE_WORD_F(adr, res)
13855 POST_IO
13856RET(14)
13857}
13858
13859// MOVEAW
13860OPCODE(0x3040)
13861{
13862 u32 adr, res;
13863 u32 src, dst;
13864
13865 res = (s32)DREGs16((Opcode >> 0) & 7);
13866 AREG((Opcode >> 9) & 7) = res;
13867RET(4)
13868}
13869
13870// MOVEAW
13871OPCODE(0x3048)
13872{
13873 u32 adr, res;
13874 u32 src, dst;
13875
13876 res = (s32)AREGs16((Opcode >> 0) & 7);
13877 AREG((Opcode >> 9) & 7) = res;
13878RET(4)
13879}
13880
13881// MOVEAW
13882OPCODE(0x3050)
13883{
13884 u32 adr, res;
13885 u32 src, dst;
13886
13887 adr = AREG((Opcode >> 0) & 7);
13888 PRE_IO
13889 READSX_WORD_F(adr, res)
13890 AREG((Opcode >> 9) & 7) = res;
13891 POST_IO
13892RET(8)
13893}
13894
13895// MOVEAW
13896OPCODE(0x3058)
13897{
13898 u32 adr, res;
13899 u32 src, dst;
13900
13901 adr = AREG((Opcode >> 0) & 7);
13902 AREG((Opcode >> 0) & 7) += 2;
13903 PRE_IO
13904 READSX_WORD_F(adr, res)
13905 AREG((Opcode >> 9) & 7) = res;
13906 POST_IO
13907RET(8)
13908}
13909
13910// MOVEAW
13911OPCODE(0x3060)
13912{
13913 u32 adr, res;
13914 u32 src, dst;
13915
13916 adr = AREG((Opcode >> 0) & 7) - 2;
13917 AREG((Opcode >> 0) & 7) = adr;
13918 PRE_IO
13919 READSX_WORD_F(adr, res)
13920 AREG((Opcode >> 9) & 7) = res;
13921 POST_IO
13922RET(10)
13923}
13924
13925// MOVEAW
13926OPCODE(0x3068)
13927{
13928 u32 adr, res;
13929 u32 src, dst;
13930
13931 FETCH_SWORD(adr);
13932 adr += AREG((Opcode >> 0) & 7);
13933 PRE_IO
13934 READSX_WORD_F(adr, res)
13935 AREG((Opcode >> 9) & 7) = res;
13936 POST_IO
13937RET(12)
13938}
13939
13940// MOVEAW
13941OPCODE(0x3070)
13942{
13943 u32 adr, res;
13944 u32 src, dst;
13945
13946 adr = AREG((Opcode >> 0) & 7);
13947 DECODE_EXT_WORD
13948 PRE_IO
13949 READSX_WORD_F(adr, res)
13950 AREG((Opcode >> 9) & 7) = res;
13951 POST_IO
13952RET(14)
13953}
13954
13955// MOVEAW
13956OPCODE(0x3078)
13957{
13958 u32 adr, res;
13959 u32 src, dst;
13960
13961 FETCH_SWORD(adr);
13962 PRE_IO
13963 READSX_WORD_F(adr, res)
13964 AREG((Opcode >> 9) & 7) = res;
13965 POST_IO
13966RET(12)
13967}
13968
13969// MOVEAW
13970OPCODE(0x3079)
13971{
13972 u32 adr, res;
13973 u32 src, dst;
13974
13975 FETCH_LONG(adr);
13976 PRE_IO
13977 READSX_WORD_F(adr, res)
13978 AREG((Opcode >> 9) & 7) = res;
13979 POST_IO
13980RET(16)
13981}
13982
13983// MOVEAW
13984OPCODE(0x307A)
13985{
13986 u32 adr, res;
13987 u32 src, dst;
13988
be26eb23 13989 adr = GET_SWORD + GET_PC;
70357ce5 13990 PC++;
13991 PRE_IO
13992 READSX_WORD_F(adr, res)
13993 AREG((Opcode >> 9) & 7) = res;
13994 POST_IO
13995RET(12)
13996}
13997
13998// MOVEAW
13999OPCODE(0x307B)
14000{
14001 u32 adr, res;
14002 u32 src, dst;
14003
be26eb23 14004 adr = GET_PC;
70357ce5 14005 DECODE_EXT_WORD
14006 PRE_IO
14007 READSX_WORD_F(adr, res)
14008 AREG((Opcode >> 9) & 7) = res;
14009 POST_IO
14010RET(14)
14011}
14012
14013// MOVEAW
14014OPCODE(0x307C)
14015{
14016 u32 adr, res;
14017 u32 src, dst;
14018
14019 FETCH_SWORD(res);
14020 AREG((Opcode >> 9) & 7) = res;
14021RET(8)
14022}
14023
14024// MOVEAW
14025OPCODE(0x305F)
14026{
14027 u32 adr, res;
14028 u32 src, dst;
14029
14030 adr = AREG(7);
14031 AREG(7) += 2;
14032 PRE_IO
14033 READSX_WORD_F(adr, res)
14034 AREG((Opcode >> 9) & 7) = res;
14035 POST_IO
14036RET(8)
14037}
14038
14039// MOVEAW
14040OPCODE(0x3067)
14041{
14042 u32 adr, res;
14043 u32 src, dst;
14044
14045 adr = AREG(7) - 2;
14046 AREG(7) = adr;
14047 PRE_IO
14048 READSX_WORD_F(adr, res)
14049 AREG((Opcode >> 9) & 7) = res;
14050 POST_IO
14051RET(10)
14052}
14053
14054// NEGX
14055OPCODE(0x4000)
14056{
14057 u32 adr, res;
14058 u32 src, dst;
14059
14060 src = DREGu8((Opcode >> 0) & 7);
14061 res = -src - ((flag_X >> 8) & 1);
14062 flag_V = res & src;
14063 flag_N = flag_X = flag_C = res;
14064 flag_NotZ |= res & 0xFF;
14065 DREGu8((Opcode >> 0) & 7) = res;
14066RET(4)
14067}
14068
14069// NEGX
14070OPCODE(0x4010)
14071{
14072 u32 adr, res;
14073 u32 src, dst;
14074
14075 adr = AREG((Opcode >> 0) & 7);
14076 PRE_IO
14077 READ_BYTE_F(adr, src)
14078 res = -src - ((flag_X >> 8) & 1);
14079 flag_V = res & src;
14080 flag_N = flag_X = flag_C = res;
14081 flag_NotZ |= res & 0xFF;
14082 WRITE_BYTE_F(adr, res)
14083 POST_IO
14084RET(12)
14085}
14086
14087// NEGX
14088OPCODE(0x4018)
14089{
14090 u32 adr, res;
14091 u32 src, dst;
14092
14093 adr = AREG((Opcode >> 0) & 7);
14094 AREG((Opcode >> 0) & 7) += 1;
14095 PRE_IO
14096 READ_BYTE_F(adr, src)
14097 res = -src - ((flag_X >> 8) & 1);
14098 flag_V = res & src;
14099 flag_N = flag_X = flag_C = res;
14100 flag_NotZ |= res & 0xFF;
14101 WRITE_BYTE_F(adr, res)
14102 POST_IO
14103RET(12)
14104}
14105
14106// NEGX
14107OPCODE(0x4020)
14108{
14109 u32 adr, res;
14110 u32 src, dst;
14111
14112 adr = AREG((Opcode >> 0) & 7) - 1;
14113 AREG((Opcode >> 0) & 7) = adr;
14114 PRE_IO
14115 READ_BYTE_F(adr, src)
14116 res = -src - ((flag_X >> 8) & 1);
14117 flag_V = res & src;
14118 flag_N = flag_X = flag_C = res;
14119 flag_NotZ |= res & 0xFF;
14120 WRITE_BYTE_F(adr, res)
14121 POST_IO
14122RET(14)
14123}
14124
14125// NEGX
14126OPCODE(0x4028)
14127{
14128 u32 adr, res;
14129 u32 src, dst;
14130
14131 FETCH_SWORD(adr);
14132 adr += AREG((Opcode >> 0) & 7);
14133 PRE_IO
14134 READ_BYTE_F(adr, src)
14135 res = -src - ((flag_X >> 8) & 1);
14136 flag_V = res & src;
14137 flag_N = flag_X = flag_C = res;
14138 flag_NotZ |= res & 0xFF;
14139 WRITE_BYTE_F(adr, res)
14140 POST_IO
14141RET(16)
14142}
14143
14144// NEGX
14145OPCODE(0x4030)
14146{
14147 u32 adr, res;
14148 u32 src, dst;
14149
14150 adr = AREG((Opcode >> 0) & 7);
14151 DECODE_EXT_WORD
14152 PRE_IO
14153 READ_BYTE_F(adr, src)
14154 res = -src - ((flag_X >> 8) & 1);
14155 flag_V = res & src;
14156 flag_N = flag_X = flag_C = res;
14157 flag_NotZ |= res & 0xFF;
14158 WRITE_BYTE_F(adr, res)
14159 POST_IO
14160RET(18)
14161}
14162
14163// NEGX
14164OPCODE(0x4038)
14165{
14166 u32 adr, res;
14167 u32 src, dst;
14168
14169 FETCH_SWORD(adr);
14170 PRE_IO
14171 READ_BYTE_F(adr, src)
14172 res = -src - ((flag_X >> 8) & 1);
14173 flag_V = res & src;
14174 flag_N = flag_X = flag_C = res;
14175 flag_NotZ |= res & 0xFF;
14176 WRITE_BYTE_F(adr, res)
14177 POST_IO
14178RET(16)
14179}
14180
14181// NEGX
14182OPCODE(0x4039)
14183{
14184 u32 adr, res;
14185 u32 src, dst;
14186
14187 FETCH_LONG(adr);
14188 PRE_IO
14189 READ_BYTE_F(adr, src)
14190 res = -src - ((flag_X >> 8) & 1);
14191 flag_V = res & src;
14192 flag_N = flag_X = flag_C = res;
14193 flag_NotZ |= res & 0xFF;
14194 WRITE_BYTE_F(adr, res)
14195 POST_IO
14196RET(20)
14197}
14198
14199// NEGX
14200OPCODE(0x401F)
14201{
14202 u32 adr, res;
14203 u32 src, dst;
14204
14205 adr = AREG(7);
14206 AREG(7) += 2;
14207 PRE_IO
14208 READ_BYTE_F(adr, src)
14209 res = -src - ((flag_X >> 8) & 1);
14210 flag_V = res & src;
14211 flag_N = flag_X = flag_C = res;
14212 flag_NotZ |= res & 0xFF;
14213 WRITE_BYTE_F(adr, res)
14214 POST_IO
14215RET(12)
14216}
14217
14218// NEGX
14219OPCODE(0x4027)
14220{
14221 u32 adr, res;
14222 u32 src, dst;
14223
14224 adr = AREG(7) - 2;
14225 AREG(7) = adr;
14226 PRE_IO
14227 READ_BYTE_F(adr, src)
14228 res = -src - ((flag_X >> 8) & 1);
14229 flag_V = res & src;
14230 flag_N = flag_X = flag_C = res;
14231 flag_NotZ |= res & 0xFF;
14232 WRITE_BYTE_F(adr, res)
14233 POST_IO
14234RET(14)
14235}
14236
14237// NEGX
14238OPCODE(0x4040)
14239{
14240 u32 adr, res;
14241 u32 src, dst;
14242
14243 src = DREGu16((Opcode >> 0) & 7);
14244 res = -src - ((flag_X >> 8) & 1);
14245 flag_V = (res & src) >> 8;
14246 flag_N = flag_X = flag_C = res >> 8;
14247 flag_NotZ |= res & 0xFFFF;
14248 DREGu16((Opcode >> 0) & 7) = res;
14249RET(4)
14250}
14251
14252// NEGX
14253OPCODE(0x4050)
14254{
14255 u32 adr, res;
14256 u32 src, dst;
14257
14258 adr = AREG((Opcode >> 0) & 7);
14259 PRE_IO
14260 READ_WORD_F(adr, src)
14261 res = -src - ((flag_X >> 8) & 1);
14262 flag_V = (res & src) >> 8;
14263 flag_N = flag_X = flag_C = res >> 8;
14264 flag_NotZ |= res & 0xFFFF;
14265 WRITE_WORD_F(adr, res)
14266 POST_IO
14267RET(12)
14268}
14269
14270// NEGX
14271OPCODE(0x4058)
14272{
14273 u32 adr, res;
14274 u32 src, dst;
14275
14276 adr = AREG((Opcode >> 0) & 7);
14277 AREG((Opcode >> 0) & 7) += 2;
14278 PRE_IO
14279 READ_WORD_F(adr, src)
14280 res = -src - ((flag_X >> 8) & 1);
14281 flag_V = (res & src) >> 8;
14282 flag_N = flag_X = flag_C = res >> 8;
14283 flag_NotZ |= res & 0xFFFF;
14284 WRITE_WORD_F(adr, res)
14285 POST_IO
14286RET(12)
14287}
14288
14289// NEGX
14290OPCODE(0x4060)
14291{
14292 u32 adr, res;
14293 u32 src, dst;
14294
14295 adr = AREG((Opcode >> 0) & 7) - 2;
14296 AREG((Opcode >> 0) & 7) = adr;
14297 PRE_IO
14298 READ_WORD_F(adr, src)
14299 res = -src - ((flag_X >> 8) & 1);
14300 flag_V = (res & src) >> 8;
14301 flag_N = flag_X = flag_C = res >> 8;
14302 flag_NotZ |= res & 0xFFFF;
14303 WRITE_WORD_F(adr, res)
14304 POST_IO
14305RET(14)
14306}
14307
14308// NEGX
14309OPCODE(0x4068)
14310{
14311 u32 adr, res;
14312 u32 src, dst;
14313
14314 FETCH_SWORD(adr);
14315 adr += AREG((Opcode >> 0) & 7);
14316 PRE_IO
14317 READ_WORD_F(adr, src)
14318 res = -src - ((flag_X >> 8) & 1);
14319 flag_V = (res & src) >> 8;
14320 flag_N = flag_X = flag_C = res >> 8;
14321 flag_NotZ |= res & 0xFFFF;
14322 WRITE_WORD_F(adr, res)
14323 POST_IO
14324RET(16)
14325}
14326
14327// NEGX
14328OPCODE(0x4070)
14329{
14330 u32 adr, res;
14331 u32 src, dst;
14332
14333 adr = AREG((Opcode >> 0) & 7);
14334 DECODE_EXT_WORD
14335 PRE_IO
14336 READ_WORD_F(adr, src)
14337 res = -src - ((flag_X >> 8) & 1);
14338 flag_V = (res & src) >> 8;
14339 flag_N = flag_X = flag_C = res >> 8;
14340 flag_NotZ |= res & 0xFFFF;
14341 WRITE_WORD_F(adr, res)
14342 POST_IO
14343RET(18)
14344}
14345
14346// NEGX
14347OPCODE(0x4078)
14348{
14349 u32 adr, res;
14350 u32 src, dst;
14351
14352 FETCH_SWORD(adr);
14353 PRE_IO
14354 READ_WORD_F(adr, src)
14355 res = -src - ((flag_X >> 8) & 1);
14356 flag_V = (res & src) >> 8;
14357 flag_N = flag_X = flag_C = res >> 8;
14358 flag_NotZ |= res & 0xFFFF;
14359 WRITE_WORD_F(adr, res)
14360 POST_IO
14361RET(16)
14362}
14363
14364// NEGX
14365OPCODE(0x4079)
14366{
14367 u32 adr, res;
14368 u32 src, dst;
14369
14370 FETCH_LONG(adr);
14371 PRE_IO
14372 READ_WORD_F(adr, src)
14373 res = -src - ((flag_X >> 8) & 1);
14374 flag_V = (res & src) >> 8;
14375 flag_N = flag_X = flag_C = res >> 8;
14376 flag_NotZ |= res & 0xFFFF;
14377 WRITE_WORD_F(adr, res)
14378 POST_IO
14379RET(20)
14380}
14381
14382// NEGX
14383OPCODE(0x405F)
14384{
14385 u32 adr, res;
14386 u32 src, dst;
14387
14388 adr = AREG(7);
14389 AREG(7) += 2;
14390 PRE_IO
14391 READ_WORD_F(adr, src)
14392 res = -src - ((flag_X >> 8) & 1);
14393 flag_V = (res & src) >> 8;
14394 flag_N = flag_X = flag_C = res >> 8;
14395 flag_NotZ |= res & 0xFFFF;
14396 WRITE_WORD_F(adr, res)
14397 POST_IO
14398RET(12)
14399}
14400
14401// NEGX
14402OPCODE(0x4067)
14403{
14404 u32 adr, res;
14405 u32 src, dst;
14406
14407 adr = AREG(7) - 2;
14408 AREG(7) = adr;
14409 PRE_IO
14410 READ_WORD_F(adr, src)
14411 res = -src - ((flag_X >> 8) & 1);
14412 flag_V = (res & src) >> 8;
14413 flag_N = flag_X = flag_C = res >> 8;
14414 flag_NotZ |= res & 0xFFFF;
14415 WRITE_WORD_F(adr, res)
14416 POST_IO
14417RET(14)
14418}
14419
14420// NEGX
14421OPCODE(0x4080)
14422{
14423 u32 adr, res;
14424 u32 src, dst;
14425
14426 src = DREGu32((Opcode >> 0) & 7);
14427 res = -src - ((flag_X >> 8) & 1);
14428 flag_NotZ |= res;
14429 flag_V = (res & src) >> 24;
14430flag_X = flag_C = (res?1:0)<<8;
14431// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
14432 flag_N = res >> 24;
14433 DREGu32((Opcode >> 0) & 7) = res;
14434RET(6)
14435}
14436
14437// NEGX
14438OPCODE(0x4090)
14439{
14440 u32 adr, res;
14441 u32 src, dst;
14442
14443 adr = AREG((Opcode >> 0) & 7);
14444 PRE_IO
14445 READ_LONG_F(adr, src)
14446 res = -src - ((flag_X >> 8) & 1);
14447 flag_NotZ |= res;
14448 flag_V = (res & src) >> 24;
14449flag_X = flag_C = (res?1:0)<<8;
14450// flag_X = flag_C = ((src & res & 1) | (src >> 1) | (res >> 1)) >> 23;
14451 flag_N = res >> 24;
14452 WRITE_LONG_F(adr, res)
14453 POST_IO
14454RET(20)
14455}
14456
14457// NEGX
14458OPCODE(0x4098)
14459{
14460 u32 adr, res;
14461 u32 src, dst;
14462
14463 adr = AREG((Opcode >> 0) & 7);
14464 AREG((Opcode >> 0) & 7) += 4;
14465 PRE_IO
14466 READ_LONG_F(adr, src)
14467 res = -src - ((flag_X >> 8) & 1);
14468 flag_NotZ |= res;
14469 flag_V = (res & src) >> 24;
14470flag_X = flag_C = (res?1:0)<<8;
14471// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
14472 flag_N = res >> 24;
14473 WRITE_LONG_F(adr, res)
14474 POST_IO
14475RET(20)
14476}
14477
14478// NEGX
14479OPCODE(0x40A0)
14480{
14481 u32 adr, res;
14482 u32 src, dst;
14483
14484 adr = AREG((Opcode >> 0) & 7) - 4;
14485 AREG((Opcode >> 0) & 7) = adr;
14486 PRE_IO
14487 READ_LONG_F(adr, src)
14488 res = -src - ((flag_X >> 8) & 1);
14489 flag_NotZ |= res;
14490 flag_V = (res & src) >> 24;
14491flag_X = flag_C = (res?1:0)<<8;
14492// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
14493 flag_N = res >> 24;
14494 WRITE_LONG_F(adr, res)
14495 POST_IO
14496RET(22)
14497}
14498
14499// NEGX
14500OPCODE(0x40A8)
14501{
14502 u32 adr, res;
14503 u32 src, dst;
14504
14505 FETCH_SWORD(adr);
14506 adr += AREG((Opcode >> 0) & 7);
14507 PRE_IO
14508 READ_LONG_F(adr, src)
14509 res = -src - ((flag_X >> 8) & 1);
14510 flag_NotZ |= res;
14511 flag_V = (res & src) >> 24;
14512flag_X = flag_C = (res?1:0)<<8;
14513// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
14514 flag_N = res >> 24;
14515 WRITE_LONG_F(adr, res)
14516 POST_IO
14517RET(24)
14518}
14519
14520// NEGX
14521OPCODE(0x40B0)
14522{
14523 u32 adr, res;
14524 u32 src, dst;
14525
14526 adr = AREG((Opcode >> 0) & 7);
14527 DECODE_EXT_WORD
14528 PRE_IO
14529 READ_LONG_F(adr, src)
14530 res = -src - ((flag_X >> 8) & 1);
14531 flag_NotZ |= res;
14532 flag_V = (res & src) >> 24;
14533flag_X = flag_C = (res?1:0)<<8;
14534// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
14535 flag_N = res >> 24;
14536 WRITE_LONG_F(adr, res)
14537 POST_IO
14538RET(26)
14539}
14540
14541// NEGX
14542OPCODE(0x40B8)
14543{
14544 u32 adr, res;
14545 u32 src, dst;
14546
14547 FETCH_SWORD(adr);
14548 PRE_IO
14549 READ_LONG_F(adr, src)
14550 res = -src - ((flag_X >> 8) & 1);
14551 flag_NotZ |= res;
14552 flag_V = (res & src) >> 24;
14553flag_X = flag_C = (res?1:0)<<8;
14554// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
14555 flag_N = res >> 24;
14556 WRITE_LONG_F(adr, res)
14557 POST_IO
14558RET(24)
14559}
14560
14561// NEGX
14562OPCODE(0x40B9)
14563{
14564 u32 adr, res;
14565 u32 src, dst;
14566
14567 FETCH_LONG(adr);
14568 PRE_IO
14569 READ_LONG_F(adr, src)
14570 res = -src - ((flag_X >> 8) & 1);
14571 flag_NotZ |= res;
14572 flag_V = (res & src) >> 24;
14573flag_X = flag_C = (res?1:0)<<8;
14574// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
14575 flag_N = res >> 24;
14576 WRITE_LONG_F(adr, res)
14577 POST_IO
14578RET(28)
14579}
14580
14581// NEGX
14582OPCODE(0x409F)
14583{
14584 u32 adr, res;
14585 u32 src, dst;
14586
14587 adr = AREG(7);
14588 AREG(7) += 4;
14589 PRE_IO
14590 READ_LONG_F(adr, src)
14591 res = -src - ((flag_X >> 8) & 1);
14592 flag_NotZ |= res;
14593 flag_V = (res & src) >> 24;
14594flag_X = flag_C = (res?1:0)<<8;
14595// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
14596 flag_N = res >> 24;
14597 WRITE_LONG_F(adr, res)
14598 POST_IO
14599RET(20)
14600}
14601
14602// NEGX
14603OPCODE(0x40A7)
14604{
14605 u32 adr, res;
14606 u32 src, dst;
14607
14608 adr = AREG(7) - 4;
14609 AREG(7) = adr;
14610 PRE_IO
14611 READ_LONG_F(adr, src)
14612 res = -src - ((flag_X >> 8) & 1);
14613 flag_NotZ |= res;
14614 flag_V = (res & src) >> 24;
14615flag_X = flag_C = (res?1:0)<<8;
14616// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
14617 flag_N = res >> 24;
14618 WRITE_LONG_F(adr, res)
14619 POST_IO
14620RET(22)
14621}
14622
14623// CLR
14624OPCODE(0x4200)
14625{
14626 u32 adr, res;
14627 u32 src, dst;
14628
14629 res = 0;
14630 flag_N = flag_NotZ = flag_V = flag_C = 0;
14631 DREGu8((Opcode >> 0) & 7) = res;
14632RET(4)
14633}
14634
14635// CLR
14636OPCODE(0x4210)
14637{
14638 u32 adr, res;
14639 u32 src, dst;
14640
14641 adr = AREG((Opcode >> 0) & 7);
14642 res = 0;
14643 flag_N = flag_NotZ = flag_V = flag_C = 0;
14644 PRE_IO
14645 WRITE_BYTE_F(adr, res)
14646 POST_IO
14647RET(12)
14648}
14649
14650// CLR
14651OPCODE(0x4218)
14652{
14653 u32 adr, res;
14654 u32 src, dst;
14655
14656 adr = AREG((Opcode >> 0) & 7);
14657 AREG((Opcode >> 0) & 7) += 1;
14658 res = 0;
14659 flag_N = flag_NotZ = flag_V = flag_C = 0;
14660 PRE_IO
14661 WRITE_BYTE_F(adr, res)
14662 POST_IO
14663RET(12)
14664}
14665
14666// CLR
14667OPCODE(0x4220)
14668{
14669 u32 adr, res;
14670 u32 src, dst;
14671
14672 adr = AREG((Opcode >> 0) & 7) - 1;
14673 AREG((Opcode >> 0) & 7) = adr;
14674 res = 0;
14675 flag_N = flag_NotZ = flag_V = flag_C = 0;
14676 PRE_IO
14677 WRITE_BYTE_F(adr, res)
14678 POST_IO
14679RET(14)
14680}
14681
14682// CLR
14683OPCODE(0x4228)
14684{
14685 u32 adr, res;
14686 u32 src, dst;
14687
14688 FETCH_SWORD(adr);
14689 adr += AREG((Opcode >> 0) & 7);
14690 res = 0;
14691 flag_N = flag_NotZ = flag_V = flag_C = 0;
14692 PRE_IO
14693 WRITE_BYTE_F(adr, res)
14694 POST_IO
14695RET(16)
14696}
14697
14698// CLR
14699OPCODE(0x4230)
14700{
14701 u32 adr, res;
14702 u32 src, dst;
14703
14704 adr = AREG((Opcode >> 0) & 7);
14705 DECODE_EXT_WORD
14706 res = 0;
14707 flag_N = flag_NotZ = flag_V = flag_C = 0;
14708 PRE_IO
14709 WRITE_BYTE_F(adr, res)
14710 POST_IO
14711RET(18)
14712}
14713
14714// CLR
14715OPCODE(0x4238)
14716{
14717 u32 adr, res;
14718 u32 src, dst;
14719
14720 FETCH_SWORD(adr);
14721 res = 0;
14722 flag_N = flag_NotZ = flag_V = flag_C = 0;
14723 PRE_IO
14724 WRITE_BYTE_F(adr, res)
14725 POST_IO
14726RET(16)
14727}
14728
14729// CLR
14730OPCODE(0x4239)
14731{
14732 u32 adr, res;
14733 u32 src, dst;
14734
14735 FETCH_LONG(adr);
14736 res = 0;
14737 flag_N = flag_NotZ = flag_V = flag_C = 0;
14738 PRE_IO
14739 WRITE_BYTE_F(adr, res)
14740 POST_IO
14741RET(20)
14742}
14743
14744// CLR
14745OPCODE(0x421F)
14746{
14747 u32 adr, res;
14748 u32 src, dst;
14749
14750 adr = AREG(7);
14751 AREG(7) += 2;
14752 res = 0;
14753 flag_N = flag_NotZ = flag_V = flag_C = 0;
14754 PRE_IO
14755 WRITE_BYTE_F(adr, res)
14756 POST_IO
14757RET(12)
14758}
14759
14760// CLR
14761OPCODE(0x4227)
14762{
14763 u32 adr, res;
14764 u32 src, dst;
14765
14766 adr = AREG(7) - 2;
14767 AREG(7) = adr;
14768 res = 0;
14769 flag_N = flag_NotZ = flag_V = flag_C = 0;
14770 PRE_IO
14771 WRITE_BYTE_F(adr, res)
14772 POST_IO
14773RET(14)
14774}
14775
14776// CLR
14777OPCODE(0x4240)
14778{
14779 u32 adr, res;
14780 u32 src, dst;
14781
14782 res = 0;
14783 flag_N = flag_NotZ = flag_V = flag_C = 0;
14784 DREGu16((Opcode >> 0) & 7) = res;
14785RET(4)
14786}
14787
14788// CLR
14789OPCODE(0x4250)
14790{
14791 u32 adr, res;
14792 u32 src, dst;
14793
14794 adr = AREG((Opcode >> 0) & 7);
14795 res = 0;
14796 flag_N = flag_NotZ = flag_V = flag_C = 0;
14797 PRE_IO
14798 WRITE_WORD_F(adr, res)
14799 POST_IO
14800RET(12)
14801}
14802
14803// CLR
14804OPCODE(0x4258)
14805{
14806 u32 adr, res;
14807 u32 src, dst;
14808
14809 adr = AREG((Opcode >> 0) & 7);
14810 AREG((Opcode >> 0) & 7) += 2;
14811 res = 0;
14812 flag_N = flag_NotZ = flag_V = flag_C = 0;
14813 PRE_IO
14814 WRITE_WORD_F(adr, res)
14815 POST_IO
14816RET(12)
14817}
14818
14819// CLR
14820OPCODE(0x4260)
14821{
14822 u32 adr, res;
14823 u32 src, dst;
14824
14825 adr = AREG((Opcode >> 0) & 7) - 2;
14826 AREG((Opcode >> 0) & 7) = adr;
14827 res = 0;
14828 flag_N = flag_NotZ = flag_V = flag_C = 0;
14829 PRE_IO
14830 WRITE_WORD_F(adr, res)
14831 POST_IO
14832RET(14)
14833}
14834
14835// CLR
14836OPCODE(0x4268)
14837{
14838 u32 adr, res;
14839 u32 src, dst;
14840
14841 FETCH_SWORD(adr);
14842 adr += AREG((Opcode >> 0) & 7);
14843 res = 0;
14844 flag_N = flag_NotZ = flag_V = flag_C = 0;
14845 PRE_IO
14846 WRITE_WORD_F(adr, res)
14847 POST_IO
14848RET(16)
14849}
14850
14851// CLR
14852OPCODE(0x4270)
14853{
14854 u32 adr, res;
14855 u32 src, dst;
14856
14857 adr = AREG((Opcode >> 0) & 7);
14858 DECODE_EXT_WORD
14859 res = 0;
14860 flag_N = flag_NotZ = flag_V = flag_C = 0;
14861 PRE_IO
14862 WRITE_WORD_F(adr, res)
14863 POST_IO
14864RET(18)
14865}
14866
14867// CLR
14868OPCODE(0x4278)
14869{
14870 u32 adr, res;
14871 u32 src, dst;
14872
14873 FETCH_SWORD(adr);
14874 res = 0;
14875 flag_N = flag_NotZ = flag_V = flag_C = 0;
14876 PRE_IO
14877 WRITE_WORD_F(adr, res)
14878 POST_IO
14879RET(16)
14880}
14881
14882// CLR
14883OPCODE(0x4279)
14884{
14885 u32 adr, res;
14886 u32 src, dst;
14887
14888 FETCH_LONG(adr);
14889 res = 0;
14890 flag_N = flag_NotZ = flag_V = flag_C = 0;
14891 PRE_IO
14892 WRITE_WORD_F(adr, res)
14893 POST_IO
14894RET(20)
14895}
14896
14897// CLR
14898OPCODE(0x425F)
14899{
14900 u32 adr, res;
14901 u32 src, dst;
14902
14903 adr = AREG(7);
14904 AREG(7) += 2;
14905 res = 0;
14906 flag_N = flag_NotZ = flag_V = flag_C = 0;
14907 PRE_IO
14908 WRITE_WORD_F(adr, res)
14909 POST_IO
14910RET(12)
14911}
14912
14913// CLR
14914OPCODE(0x4267)
14915{
14916 u32 adr, res;
14917 u32 src, dst;
14918
14919 adr = AREG(7) - 2;
14920 AREG(7) = adr;
14921 res = 0;
14922 flag_N = flag_NotZ = flag_V = flag_C = 0;
14923 PRE_IO
14924 WRITE_WORD_F(adr, res)
14925 POST_IO
14926RET(14)
14927}
14928
14929// CLR
14930OPCODE(0x4280)
14931{
14932 u32 adr, res;
14933 u32 src, dst;
14934
14935 res = 0;
14936 flag_N = flag_NotZ = flag_V = flag_C = 0;
14937 DREGu32((Opcode >> 0) & 7) = res;
14938RET(6)
14939}
14940
14941// CLR
14942OPCODE(0x4290)
14943{
14944 u32 adr, res;
14945 u32 src, dst;
14946
14947 adr = AREG((Opcode >> 0) & 7);
14948 res = 0;
14949 flag_N = flag_NotZ = flag_V = flag_C = 0;
14950 PRE_IO
14951 WRITE_LONG_F(adr, res)
14952 POST_IO
14953RET(20)
14954}
14955
14956// CLR
14957OPCODE(0x4298)
14958{
14959 u32 adr, res;
14960 u32 src, dst;
14961
14962 adr = AREG((Opcode >> 0) & 7);
14963 AREG((Opcode >> 0) & 7) += 4;
14964 res = 0;
14965 flag_N = flag_NotZ = flag_V = flag_C = 0;
14966 PRE_IO
14967 WRITE_LONG_F(adr, res)
14968 POST_IO
14969RET(20)
14970}
14971
14972// CLR
14973OPCODE(0x42A0)
14974{
14975 u32 adr, res;
14976 u32 src, dst;
14977
14978 adr = AREG((Opcode >> 0) & 7) - 4;
14979 AREG((Opcode >> 0) & 7) = adr;
14980 res = 0;
14981 flag_N = flag_NotZ = flag_V = flag_C = 0;
14982 PRE_IO
14983 WRITE_LONG_F(adr, res)
14984 POST_IO
14985RET(22)
14986}
14987
14988// CLR
14989OPCODE(0x42A8)
14990{
14991 u32 adr, res;
14992 u32 src, dst;
14993
14994 FETCH_SWORD(adr);
14995 adr += AREG((Opcode >> 0) & 7);
14996 res = 0;
14997 flag_N = flag_NotZ = flag_V = flag_C = 0;
14998 PRE_IO
14999 WRITE_LONG_F(adr, res)
15000 POST_IO
15001RET(24)
15002}
15003
15004// CLR
15005OPCODE(0x42B0)
15006{
15007 u32 adr, res;
15008 u32 src, dst;
15009
15010 adr = AREG((Opcode >> 0) & 7);
15011 DECODE_EXT_WORD
15012 res = 0;
15013 flag_N = flag_NotZ = flag_V = flag_C = 0;
15014 PRE_IO
15015 WRITE_LONG_F(adr, res)
15016 POST_IO
15017RET(26)
15018}
15019
15020// CLR
15021OPCODE(0x42B8)
15022{
15023 u32 adr, res;
15024 u32 src, dst;
15025
15026 FETCH_SWORD(adr);
15027 res = 0;
15028 flag_N = flag_NotZ = flag_V = flag_C = 0;
15029 PRE_IO
15030 WRITE_LONG_F(adr, res)
15031 POST_IO
15032RET(24)
15033}
15034
15035// CLR
15036OPCODE(0x42B9)
15037{
15038 u32 adr, res;
15039 u32 src, dst;
15040
15041 FETCH_LONG(adr);
15042 res = 0;
15043 flag_N = flag_NotZ = flag_V = flag_C = 0;
15044 PRE_IO
15045 WRITE_LONG_F(adr, res)
15046 POST_IO
15047RET(28)
15048}
15049
15050// CLR
15051OPCODE(0x429F)
15052{
15053 u32 adr, res;
15054 u32 src, dst;
15055
15056 adr = AREG(7);
15057 AREG(7) += 4;
15058 res = 0;
15059 flag_N = flag_NotZ = flag_V = flag_C = 0;
15060 PRE_IO
15061 WRITE_LONG_F(adr, res)
15062 POST_IO
15063RET(20)
15064}
15065
15066// CLR
15067OPCODE(0x42A7)
15068{
15069 u32 adr, res;
15070 u32 src, dst;
15071
15072 adr = AREG(7) - 4;
15073 AREG(7) = adr;
15074 res = 0;
15075 flag_N = flag_NotZ = flag_V = flag_C = 0;
15076 PRE_IO
15077 WRITE_LONG_F(adr, res)
15078 POST_IO
15079RET(22)
15080}
15081
15082// NEG
15083OPCODE(0x4400)
15084{
15085 u32 adr, res;
15086 u32 src, dst;
15087
15088 src = DREGu8((Opcode >> 0) & 7);
15089 res = -src;
15090 flag_V = res & src;
15091 flag_N = flag_X = flag_C = res;
15092 flag_NotZ = res & 0xFF;
15093 DREGu8((Opcode >> 0) & 7) = res;
15094RET(4)
15095}
15096
15097// NEG
15098OPCODE(0x4410)
15099{
15100 u32 adr, res;
15101 u32 src, dst;
15102
15103 adr = AREG((Opcode >> 0) & 7);
15104 PRE_IO
15105 READ_BYTE_F(adr, src)
15106 res = -src;
15107 flag_V = res & src;
15108 flag_N = flag_X = flag_C = res;
15109 flag_NotZ = res & 0xFF;
15110 WRITE_BYTE_F(adr, res)
15111 POST_IO
15112RET(12)
15113}
15114
15115// NEG
15116OPCODE(0x4418)
15117{
15118 u32 adr, res;
15119 u32 src, dst;
15120
15121 adr = AREG((Opcode >> 0) & 7);
15122 AREG((Opcode >> 0) & 7) += 1;
15123 PRE_IO
15124 READ_BYTE_F(adr, src)
15125 res = -src;
15126 flag_V = res & src;
15127 flag_N = flag_X = flag_C = res;
15128 flag_NotZ = res & 0xFF;
15129 WRITE_BYTE_F(adr, res)
15130 POST_IO
15131RET(12)
15132}
15133
15134// NEG
15135OPCODE(0x4420)
15136{
15137 u32 adr, res;
15138 u32 src, dst;
15139
15140 adr = AREG((Opcode >> 0) & 7) - 1;
15141 AREG((Opcode >> 0) & 7) = adr;
15142 PRE_IO
15143 READ_BYTE_F(adr, src)
15144 res = -src;
15145 flag_V = res & src;
15146 flag_N = flag_X = flag_C = res;
15147 flag_NotZ = res & 0xFF;
15148 WRITE_BYTE_F(adr, res)
15149 POST_IO
15150RET(14)
15151}
15152
15153// NEG
15154OPCODE(0x4428)
15155{
15156 u32 adr, res;
15157 u32 src, dst;
15158
15159 FETCH_SWORD(adr);
15160 adr += AREG((Opcode >> 0) & 7);
15161 PRE_IO
15162 READ_BYTE_F(adr, src)
15163 res = -src;
15164 flag_V = res & src;
15165 flag_N = flag_X = flag_C = res;
15166 flag_NotZ = res & 0xFF;
15167 WRITE_BYTE_F(adr, res)
15168 POST_IO
15169RET(16)
15170}
15171
15172// NEG
15173OPCODE(0x4430)
15174{
15175 u32 adr, res;
15176 u32 src, dst;
15177
15178 adr = AREG((Opcode >> 0) & 7);
15179 DECODE_EXT_WORD
15180 PRE_IO
15181 READ_BYTE_F(adr, src)
15182 res = -src;
15183 flag_V = res & src;
15184 flag_N = flag_X = flag_C = res;
15185 flag_NotZ = res & 0xFF;
15186 WRITE_BYTE_F(adr, res)
15187 POST_IO
15188RET(18)
15189}
15190
15191// NEG
15192OPCODE(0x4438)
15193{
15194 u32 adr, res;
15195 u32 src, dst;
15196
15197 FETCH_SWORD(adr);
15198 PRE_IO
15199 READ_BYTE_F(adr, src)
15200 res = -src;
15201 flag_V = res & src;
15202 flag_N = flag_X = flag_C = res;
15203 flag_NotZ = res & 0xFF;
15204 WRITE_BYTE_F(adr, res)
15205 POST_IO
15206RET(16)
15207}
15208
15209// NEG
15210OPCODE(0x4439)
15211{
15212 u32 adr, res;
15213 u32 src, dst;
15214
15215 FETCH_LONG(adr);
15216 PRE_IO
15217 READ_BYTE_F(adr, src)
15218 res = -src;
15219 flag_V = res & src;
15220 flag_N = flag_X = flag_C = res;
15221 flag_NotZ = res & 0xFF;
15222 WRITE_BYTE_F(adr, res)
15223 POST_IO
15224RET(20)
15225}
15226
15227// NEG
15228OPCODE(0x441F)
15229{
15230 u32 adr, res;
15231 u32 src, dst;
15232
15233 adr = AREG(7);
15234 AREG(7) += 2;
15235 PRE_IO
15236 READ_BYTE_F(adr, src)
15237 res = -src;
15238 flag_V = res & src;
15239 flag_N = flag_X = flag_C = res;
15240 flag_NotZ = res & 0xFF;
15241 WRITE_BYTE_F(adr, res)
15242 POST_IO
15243RET(12)
15244}
15245
15246// NEG
15247OPCODE(0x4427)
15248{
15249 u32 adr, res;
15250 u32 src, dst;
15251
15252 adr = AREG(7) - 2;
15253 AREG(7) = adr;
15254 PRE_IO
15255 READ_BYTE_F(adr, src)
15256 res = -src;
15257 flag_V = res & src;
15258 flag_N = flag_X = flag_C = res;
15259 flag_NotZ = res & 0xFF;
15260 WRITE_BYTE_F(adr, res)
15261 POST_IO
15262RET(14)
15263}
15264
15265// NEG
15266OPCODE(0x4440)
15267{
15268 u32 adr, res;
15269 u32 src, dst;
15270
15271 src = DREGu16((Opcode >> 0) & 7);
15272 res = -src;
15273 flag_V = (res & src) >> 8;
15274 flag_N = flag_X = flag_C = res >> 8;
15275 flag_NotZ = res & 0xFFFF;
15276 DREGu16((Opcode >> 0) & 7) = res;
15277RET(4)
15278}
15279
15280// NEG
15281OPCODE(0x4450)
15282{
15283 u32 adr, res;
15284 u32 src, dst;
15285
15286 adr = AREG((Opcode >> 0) & 7);
15287 PRE_IO
15288 READ_WORD_F(adr, src)
15289 res = -src;
15290 flag_V = (res & src) >> 8;
15291 flag_N = flag_X = flag_C = res >> 8;
15292 flag_NotZ = res & 0xFFFF;
15293 WRITE_WORD_F(adr, res)
15294 POST_IO
15295RET(12)
15296}
15297
15298// NEG
15299OPCODE(0x4458)
15300{
15301 u32 adr, res;
15302 u32 src, dst;
15303
15304 adr = AREG((Opcode >> 0) & 7);
15305 AREG((Opcode >> 0) & 7) += 2;
15306 PRE_IO
15307 READ_WORD_F(adr, src)
15308 res = -src;
15309 flag_V = (res & src) >> 8;
15310 flag_N = flag_X = flag_C = res >> 8;
15311 flag_NotZ = res & 0xFFFF;
15312 WRITE_WORD_F(adr, res)
15313 POST_IO
15314RET(12)
15315}
15316
15317// NEG
15318OPCODE(0x4460)
15319{
15320 u32 adr, res;
15321 u32 src, dst;
15322
15323 adr = AREG((Opcode >> 0) & 7) - 2;
15324 AREG((Opcode >> 0) & 7) = adr;
15325 PRE_IO
15326 READ_WORD_F(adr, src)
15327 res = -src;
15328 flag_V = (res & src) >> 8;
15329 flag_N = flag_X = flag_C = res >> 8;
15330 flag_NotZ = res & 0xFFFF;
15331 WRITE_WORD_F(adr, res)
15332 POST_IO
15333RET(14)
15334}
15335
15336// NEG
15337OPCODE(0x4468)
15338{
15339 u32 adr, res;
15340 u32 src, dst;
15341
15342 FETCH_SWORD(adr);
15343 adr += AREG((Opcode >> 0) & 7);
15344 PRE_IO
15345 READ_WORD_F(adr, src)
15346 res = -src;
15347 flag_V = (res & src) >> 8;
15348 flag_N = flag_X = flag_C = res >> 8;
15349 flag_NotZ = res & 0xFFFF;
15350 WRITE_WORD_F(adr, res)
15351 POST_IO
15352RET(16)
15353}
15354
15355// NEG
15356OPCODE(0x4470)
15357{
15358 u32 adr, res;
15359 u32 src, dst;
15360
15361 adr = AREG((Opcode >> 0) & 7);
15362 DECODE_EXT_WORD
15363 PRE_IO
15364 READ_WORD_F(adr, src)
15365 res = -src;
15366 flag_V = (res & src) >> 8;
15367 flag_N = flag_X = flag_C = res >> 8;
15368 flag_NotZ = res & 0xFFFF;
15369 WRITE_WORD_F(adr, res)
15370 POST_IO
15371RET(18)
15372}
15373
15374// NEG
15375OPCODE(0x4478)
15376{
15377 u32 adr, res;
15378 u32 src, dst;
15379
15380 FETCH_SWORD(adr);
15381 PRE_IO
15382 READ_WORD_F(adr, src)
15383 res = -src;
15384 flag_V = (res & src) >> 8;
15385 flag_N = flag_X = flag_C = res >> 8;
15386 flag_NotZ = res & 0xFFFF;
15387 WRITE_WORD_F(adr, res)
15388 POST_IO
15389RET(16)
15390}
15391
15392// NEG
15393OPCODE(0x4479)
15394{
15395 u32 adr, res;
15396 u32 src, dst;
15397
15398 FETCH_LONG(adr);
15399 PRE_IO
15400 READ_WORD_F(adr, src)
15401 res = -src;
15402 flag_V = (res & src) >> 8;
15403 flag_N = flag_X = flag_C = res >> 8;
15404 flag_NotZ = res & 0xFFFF;
15405 WRITE_WORD_F(adr, res)
15406 POST_IO
15407RET(20)
15408}
15409
15410// NEG
15411OPCODE(0x445F)
15412{
15413 u32 adr, res;
15414 u32 src, dst;
15415
15416 adr = AREG(7);
15417 AREG(7) += 2;
15418 PRE_IO
15419 READ_WORD_F(adr, src)
15420 res = -src;
15421 flag_V = (res & src) >> 8;
15422 flag_N = flag_X = flag_C = res >> 8;
15423 flag_NotZ = res & 0xFFFF;
15424 WRITE_WORD_F(adr, res)
15425 POST_IO
15426RET(12)
15427}
15428
15429// NEG
15430OPCODE(0x4467)
15431{
15432 u32 adr, res;
15433 u32 src, dst;
15434
15435 adr = AREG(7) - 2;
15436 AREG(7) = adr;
15437 PRE_IO
15438 READ_WORD_F(adr, src)
15439 res = -src;
15440 flag_V = (res & src) >> 8;
15441 flag_N = flag_X = flag_C = res >> 8;
15442 flag_NotZ = res & 0xFFFF;
15443 WRITE_WORD_F(adr, res)
15444 POST_IO
15445RET(14)
15446}
15447
15448// NEG
15449OPCODE(0x4480)
15450{
15451 u32 adr, res;
15452 u32 src, dst;
15453
15454 src = DREGu32((Opcode >> 0) & 7);
15455 res = -src;
15456 flag_NotZ = res;
15457 flag_V = (res & src) >> 24;
15458 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
15459 flag_N = res >> 24;
15460 DREGu32((Opcode >> 0) & 7) = res;
15461RET(6)
15462}
15463
15464// NEG
15465OPCODE(0x4490)
15466{
15467 u32 adr, res;
15468 u32 src, dst;
15469
15470 adr = AREG((Opcode >> 0) & 7);
15471 PRE_IO
15472 READ_LONG_F(adr, src)
15473 res = -src;
15474 flag_NotZ = res;
15475 flag_V = (res & src) >> 24;
15476 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
15477 flag_N = res >> 24;
15478 WRITE_LONG_F(adr, res)
15479 POST_IO
15480RET(20)
15481}
15482
15483// NEG
15484OPCODE(0x4498)
15485{
15486 u32 adr, res;
15487 u32 src, dst;
15488
15489 adr = AREG((Opcode >> 0) & 7);
15490 AREG((Opcode >> 0) & 7) += 4;
15491 PRE_IO
15492 READ_LONG_F(adr, src)
15493 res = -src;
15494 flag_NotZ = res;
15495 flag_V = (res & src) >> 24;
15496 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
15497 flag_N = res >> 24;
15498 WRITE_LONG_F(adr, res)
15499 POST_IO
15500RET(20)
15501}
15502
15503// NEG
15504OPCODE(0x44A0)
15505{
15506 u32 adr, res;
15507 u32 src, dst;
15508
15509 adr = AREG((Opcode >> 0) & 7) - 4;
15510 AREG((Opcode >> 0) & 7) = adr;
15511 PRE_IO
15512 READ_LONG_F(adr, src)
15513 res = -src;
15514 flag_NotZ = res;
15515 flag_V = (res & src) >> 24;
15516 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
15517 flag_N = res >> 24;
15518 WRITE_LONG_F(adr, res)
15519 POST_IO
15520RET(22)
15521}
15522
15523// NEG
15524OPCODE(0x44A8)
15525{
15526 u32 adr, res;
15527 u32 src, dst;
15528
15529 FETCH_SWORD(adr);
15530 adr += AREG((Opcode >> 0) & 7);
15531 PRE_IO
15532 READ_LONG_F(adr, src)
15533 res = -src;
15534 flag_NotZ = res;
15535 flag_V = (res & src) >> 24;
15536 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
15537 flag_N = res >> 24;
15538 WRITE_LONG_F(adr, res)
15539 POST_IO
15540RET(24)
15541}
15542
15543// NEG
15544OPCODE(0x44B0)
15545{
15546 u32 adr, res;
15547 u32 src, dst;
15548
15549 adr = AREG((Opcode >> 0) & 7);
15550 DECODE_EXT_WORD
15551 PRE_IO
15552 READ_LONG_F(adr, src)
15553 res = -src;
15554 flag_NotZ = res;
15555 flag_V = (res & src) >> 24;
15556 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
15557 flag_N = res >> 24;
15558 WRITE_LONG_F(adr, res)
15559 POST_IO
15560RET(26)
15561}
15562
15563// NEG
15564OPCODE(0x44B8)
15565{
15566 u32 adr, res;
15567 u32 src, dst;
15568
15569 FETCH_SWORD(adr);
15570 PRE_IO
15571 READ_LONG_F(adr, src)
15572 res = -src;
15573 flag_NotZ = res;
15574 flag_V = (res & src) >> 24;
15575 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
15576 flag_N = res >> 24;
15577 WRITE_LONG_F(adr, res)
15578 POST_IO
15579RET(24)
15580}
15581
15582// NEG
15583OPCODE(0x44B9)
15584{
15585 u32 adr, res;
15586 u32 src, dst;
15587
15588 FETCH_LONG(adr);
15589 PRE_IO
15590 READ_LONG_F(adr, src)
15591 res = -src;
15592 flag_NotZ = res;
15593 flag_V = (res & src) >> 24;
15594 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
15595 flag_N = res >> 24;
15596 WRITE_LONG_F(adr, res)
15597 POST_IO
15598RET(28)
15599}
15600
15601// NEG
15602OPCODE(0x449F)
15603{
15604 u32 adr, res;
15605 u32 src, dst;
15606
15607 adr = AREG(7);
15608 AREG(7) += 4;
15609 PRE_IO
15610 READ_LONG_F(adr, src)
15611 res = -src;
15612 flag_NotZ = res;
15613 flag_V = (res & src) >> 24;
15614 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
15615 flag_N = res >> 24;
15616 WRITE_LONG_F(adr, res)
15617 POST_IO
15618RET(20)
15619}
15620
15621// NEG
15622OPCODE(0x44A7)
15623{
15624 u32 adr, res;
15625 u32 src, dst;
15626
15627 adr = AREG(7) - 4;
15628 AREG(7) = adr;
15629 PRE_IO
15630 READ_LONG_F(adr, src)
15631 res = -src;
15632 flag_NotZ = res;
15633 flag_V = (res & src) >> 24;
15634 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
15635 flag_N = res >> 24;
15636 WRITE_LONG_F(adr, res)
15637 POST_IO
15638RET(22)
15639}
15640
15641// NOT
15642OPCODE(0x4600)
15643{
15644 u32 adr, res;
15645 u32 src, dst;
15646
15647 src = DREGu8((Opcode >> 0) & 7);
15648 res = ~src;
15649 flag_C = 0;
15650 flag_V = 0;
15651 flag_N = res;
15652 flag_NotZ = res & 0xFF;
15653 DREGu8((Opcode >> 0) & 7) = res;
15654RET(4)
15655}
15656
15657// NOT
15658OPCODE(0x4610)
15659{
15660 u32 adr, res;
15661 u32 src, dst;
15662
15663 adr = AREG((Opcode >> 0) & 7);
15664 PRE_IO
15665 READ_BYTE_F(adr, src)
15666 res = ~src;
15667 flag_C = 0;
15668 flag_V = 0;
15669 flag_N = res;
15670 flag_NotZ = res & 0xFF;
15671 WRITE_BYTE_F(adr, res)
15672 POST_IO
15673RET(12)
15674}
15675
15676// NOT
15677OPCODE(0x4618)
15678{
15679 u32 adr, res;
15680 u32 src, dst;
15681
15682 adr = AREG((Opcode >> 0) & 7);
15683 AREG((Opcode >> 0) & 7) += 1;
15684 PRE_IO
15685 READ_BYTE_F(adr, src)
15686 res = ~src;
15687 flag_C = 0;
15688 flag_V = 0;
15689 flag_N = res;
15690 flag_NotZ = res & 0xFF;
15691 WRITE_BYTE_F(adr, res)
15692 POST_IO
15693RET(12)
15694}
15695
15696// NOT
15697OPCODE(0x4620)
15698{
15699 u32 adr, res;
15700 u32 src, dst;
15701
15702 adr = AREG((Opcode >> 0) & 7) - 1;
15703 AREG((Opcode >> 0) & 7) = adr;
15704 PRE_IO
15705 READ_BYTE_F(adr, src)
15706 res = ~src;
15707 flag_C = 0;
15708 flag_V = 0;
15709 flag_N = res;
15710 flag_NotZ = res & 0xFF;
15711 WRITE_BYTE_F(adr, res)
15712 POST_IO
15713RET(14)
15714}
15715
15716// NOT
15717OPCODE(0x4628)
15718{
15719 u32 adr, res;
15720 u32 src, dst;
15721
15722 FETCH_SWORD(adr);
15723 adr += AREG((Opcode >> 0) & 7);
15724 PRE_IO
15725 READ_BYTE_F(adr, src)
15726 res = ~src;
15727 flag_C = 0;
15728 flag_V = 0;
15729 flag_N = res;
15730 flag_NotZ = res & 0xFF;
15731 WRITE_BYTE_F(adr, res)
15732 POST_IO
15733RET(16)
15734}
15735
15736// NOT
15737OPCODE(0x4630)
15738{
15739 u32 adr, res;
15740 u32 src, dst;
15741
15742 adr = AREG((Opcode >> 0) & 7);
15743 DECODE_EXT_WORD
15744 PRE_IO
15745 READ_BYTE_F(adr, src)
15746 res = ~src;
15747 flag_C = 0;
15748 flag_V = 0;
15749 flag_N = res;
15750 flag_NotZ = res & 0xFF;
15751 WRITE_BYTE_F(adr, res)
15752 POST_IO
15753RET(18)
15754}
15755
15756// NOT
15757OPCODE(0x4638)
15758{
15759 u32 adr, res;
15760 u32 src, dst;
15761
15762 FETCH_SWORD(adr);
15763 PRE_IO
15764 READ_BYTE_F(adr, src)
15765 res = ~src;
15766 flag_C = 0;
15767 flag_V = 0;
15768 flag_N = res;
15769 flag_NotZ = res & 0xFF;
15770 WRITE_BYTE_F(adr, res)
15771 POST_IO
15772RET(16)
15773}
15774
15775// NOT
15776OPCODE(0x4639)
15777{
15778 u32 adr, res;
15779 u32 src, dst;
15780
15781 FETCH_LONG(adr);
15782 PRE_IO
15783 READ_BYTE_F(adr, src)
15784 res = ~src;
15785 flag_C = 0;
15786 flag_V = 0;
15787 flag_N = res;
15788 flag_NotZ = res & 0xFF;
15789 WRITE_BYTE_F(adr, res)
15790 POST_IO
15791RET(20)
15792}
15793
15794// NOT
15795OPCODE(0x461F)
15796{
15797 u32 adr, res;
15798 u32 src, dst;
15799
15800 adr = AREG(7);
15801 AREG(7) += 2;
15802 PRE_IO
15803 READ_BYTE_F(adr, src)
15804 res = ~src;
15805 flag_C = 0;
15806 flag_V = 0;
15807 flag_N = res;
15808 flag_NotZ = res & 0xFF;
15809 WRITE_BYTE_F(adr, res)
15810 POST_IO
15811RET(12)
15812}
15813
15814// NOT
15815OPCODE(0x4627)
15816{
15817 u32 adr, res;
15818 u32 src, dst;
15819
15820 adr = AREG(7) - 2;
15821 AREG(7) = adr;
15822 PRE_IO
15823 READ_BYTE_F(adr, src)
15824 res = ~src;
15825 flag_C = 0;
15826 flag_V = 0;
15827 flag_N = res;
15828 flag_NotZ = res & 0xFF;
15829 WRITE_BYTE_F(adr, res)
15830 POST_IO
15831RET(14)
15832}
15833
15834// NOT
15835OPCODE(0x4640)
15836{
15837 u32 adr, res;
15838 u32 src, dst;
15839
15840 src = DREGu16((Opcode >> 0) & 7);
15841 res = ~src;
15842 flag_C = 0;
15843 flag_V = 0;
15844 flag_NotZ = res & 0xFFFF;
15845 flag_N = res >> 8;
15846 DREGu16((Opcode >> 0) & 7) = res;
15847RET(4)
15848}
15849
15850// NOT
15851OPCODE(0x4650)
15852{
15853 u32 adr, res;
15854 u32 src, dst;
15855
15856 adr = AREG((Opcode >> 0) & 7);
15857 PRE_IO
15858 READ_WORD_F(adr, src)
15859 res = ~src;
15860 flag_C = 0;
15861 flag_V = 0;
15862 flag_NotZ = res & 0xFFFF;
15863 flag_N = res >> 8;
15864 WRITE_WORD_F(adr, res)
15865 POST_IO
15866RET(12)
15867}
15868
15869// NOT
15870OPCODE(0x4658)
15871{
15872 u32 adr, res;
15873 u32 src, dst;
15874
15875 adr = AREG((Opcode >> 0) & 7);
15876 AREG((Opcode >> 0) & 7) += 2;
15877 PRE_IO
15878 READ_WORD_F(adr, src)
15879 res = ~src;
15880 flag_C = 0;
15881 flag_V = 0;
15882 flag_NotZ = res & 0xFFFF;
15883 flag_N = res >> 8;
15884 WRITE_WORD_F(adr, res)
15885 POST_IO
15886RET(12)
15887}
15888
15889// NOT
15890OPCODE(0x4660)
15891{
15892 u32 adr, res;
15893 u32 src, dst;
15894
15895 adr = AREG((Opcode >> 0) & 7) - 2;
15896 AREG((Opcode >> 0) & 7) = adr;
15897 PRE_IO
15898 READ_WORD_F(adr, src)
15899 res = ~src;
15900 flag_C = 0;
15901 flag_V = 0;
15902 flag_NotZ = res & 0xFFFF;
15903 flag_N = res >> 8;
15904 WRITE_WORD_F(adr, res)
15905 POST_IO
15906RET(14)
15907}
15908
15909// NOT
15910OPCODE(0x4668)
15911{
15912 u32 adr, res;
15913 u32 src, dst;
15914
15915 FETCH_SWORD(adr);
15916 adr += AREG((Opcode >> 0) & 7);
15917 PRE_IO
15918 READ_WORD_F(adr, src)
15919 res = ~src;
15920 flag_C = 0;
15921 flag_V = 0;
15922 flag_NotZ = res & 0xFFFF;
15923 flag_N = res >> 8;
15924 WRITE_WORD_F(adr, res)
15925 POST_IO
15926RET(16)
15927}
15928
15929// NOT
15930OPCODE(0x4670)
15931{
15932 u32 adr, res;
15933 u32 src, dst;
15934
15935 adr = AREG((Opcode >> 0) & 7);
15936 DECODE_EXT_WORD
15937 PRE_IO
15938 READ_WORD_F(adr, src)
15939 res = ~src;
15940 flag_C = 0;
15941 flag_V = 0;
15942 flag_NotZ = res & 0xFFFF;
15943 flag_N = res >> 8;
15944 WRITE_WORD_F(adr, res)
15945 POST_IO
15946RET(18)
15947}
15948
15949// NOT
15950OPCODE(0x4678)
15951{
15952 u32 adr, res;
15953 u32 src, dst;
15954
15955 FETCH_SWORD(adr);
15956 PRE_IO
15957 READ_WORD_F(adr, src)
15958 res = ~src;
15959 flag_C = 0;
15960 flag_V = 0;
15961 flag_NotZ = res & 0xFFFF;
15962 flag_N = res >> 8;
15963 WRITE_WORD_F(adr, res)
15964 POST_IO
15965RET(16)
15966}
15967
15968// NOT
15969OPCODE(0x4679)
15970{
15971 u32 adr, res;
15972 u32 src, dst;
15973
15974 FETCH_LONG(adr);
15975 PRE_IO
15976 READ_WORD_F(adr, src)
15977 res = ~src;
15978 flag_C = 0;
15979 flag_V = 0;
15980 flag_NotZ = res & 0xFFFF;
15981 flag_N = res >> 8;
15982 WRITE_WORD_F(adr, res)
15983 POST_IO
15984RET(20)
15985}
15986
15987// NOT
15988OPCODE(0x465F)
15989{
15990 u32 adr, res;
15991 u32 src, dst;
15992
15993 adr = AREG(7);
15994 AREG(7) += 2;
15995 PRE_IO
15996 READ_WORD_F(adr, src)
15997 res = ~src;
15998 flag_C = 0;
15999 flag_V = 0;
16000 flag_NotZ = res & 0xFFFF;
16001 flag_N = res >> 8;
16002 WRITE_WORD_F(adr, res)
16003 POST_IO
16004RET(12)
16005}
16006
16007// NOT
16008OPCODE(0x4667)
16009{
16010 u32 adr, res;
16011 u32 src, dst;
16012
16013 adr = AREG(7) - 2;
16014 AREG(7) = adr;
16015 PRE_IO
16016 READ_WORD_F(adr, src)
16017 res = ~src;
16018 flag_C = 0;
16019 flag_V = 0;
16020 flag_NotZ = res & 0xFFFF;
16021 flag_N = res >> 8;
16022 WRITE_WORD_F(adr, res)
16023 POST_IO
16024RET(14)
16025}
16026
16027// NOT
16028OPCODE(0x4680)
16029{
16030 u32 adr, res;
16031 u32 src, dst;
16032
16033 src = DREGu32((Opcode >> 0) & 7);
16034 res = ~src;
16035 flag_C = 0;
16036 flag_V = 0;
16037 flag_NotZ = res;
16038 flag_N = res >> 24;
16039 DREGu32((Opcode >> 0) & 7) = res;
16040RET(6)
16041}
16042
16043// NOT
16044OPCODE(0x4690)
16045{
16046 u32 adr, res;
16047 u32 src, dst;
16048
16049 adr = AREG((Opcode >> 0) & 7);
16050 PRE_IO
16051 READ_LONG_F(adr, src)
16052 res = ~src;
16053 flag_C = 0;
16054 flag_V = 0;
16055 flag_NotZ = res;
16056 flag_N = res >> 24;
16057 WRITE_LONG_F(adr, res)
16058 POST_IO
16059RET(20)
16060}
16061
16062// NOT
16063OPCODE(0x4698)
16064{
16065 u32 adr, res;
16066 u32 src, dst;
16067
16068 adr = AREG((Opcode >> 0) & 7);
16069 AREG((Opcode >> 0) & 7) += 4;
16070 PRE_IO
16071 READ_LONG_F(adr, src)
16072 res = ~src;
16073 flag_C = 0;
16074 flag_V = 0;
16075 flag_NotZ = res;
16076 flag_N = res >> 24;
16077 WRITE_LONG_F(adr, res)
16078 POST_IO
16079RET(20)
16080}
16081
16082// NOT
16083OPCODE(0x46A0)
16084{
16085 u32 adr, res;
16086 u32 src, dst;
16087
16088 adr = AREG((Opcode >> 0) & 7) - 4;
16089 AREG((Opcode >> 0) & 7) = adr;
16090 PRE_IO
16091 READ_LONG_F(adr, src)
16092 res = ~src;
16093 flag_C = 0;
16094 flag_V = 0;
16095 flag_NotZ = res;
16096 flag_N = res >> 24;
16097 WRITE_LONG_F(adr, res)
16098 POST_IO
16099RET(22)
16100}
16101
16102// NOT
16103OPCODE(0x46A8)
16104{
16105 u32 adr, res;
16106 u32 src, dst;
16107
16108 FETCH_SWORD(adr);
16109 adr += AREG((Opcode >> 0) & 7);
16110 PRE_IO
16111 READ_LONG_F(adr, src)
16112 res = ~src;
16113 flag_C = 0;
16114 flag_V = 0;
16115 flag_NotZ = res;
16116 flag_N = res >> 24;
16117 WRITE_LONG_F(adr, res)
16118 POST_IO
16119RET(24)
16120}
16121
16122// NOT
16123OPCODE(0x46B0)
16124{
16125 u32 adr, res;
16126 u32 src, dst;
16127
16128 adr = AREG((Opcode >> 0) & 7);
16129 DECODE_EXT_WORD
16130 PRE_IO
16131 READ_LONG_F(adr, src)
16132 res = ~src;
16133 flag_C = 0;
16134 flag_V = 0;
16135 flag_NotZ = res;
16136 flag_N = res >> 24;
16137 WRITE_LONG_F(adr, res)
16138 POST_IO
16139RET(26)
16140}
16141
16142// NOT
16143OPCODE(0x46B8)
16144{
16145 u32 adr, res;
16146 u32 src, dst;
16147
16148 FETCH_SWORD(adr);
16149 PRE_IO
16150 READ_LONG_F(adr, src)
16151 res = ~src;
16152 flag_C = 0;
16153 flag_V = 0;
16154 flag_NotZ = res;
16155 flag_N = res >> 24;
16156 WRITE_LONG_F(adr, res)
16157 POST_IO
16158RET(24)
16159}
16160
16161// NOT
16162OPCODE(0x46B9)
16163{
16164 u32 adr, res;
16165 u32 src, dst;
16166
16167 FETCH_LONG(adr);
16168 PRE_IO
16169 READ_LONG_F(adr, src)
16170 res = ~src;
16171 flag_C = 0;
16172 flag_V = 0;
16173 flag_NotZ = res;
16174 flag_N = res >> 24;
16175 WRITE_LONG_F(adr, res)
16176 POST_IO
16177RET(28)
16178}
16179
16180// NOT
16181OPCODE(0x469F)
16182{
16183 u32 adr, res;
16184 u32 src, dst;
16185
16186 adr = AREG(7);
16187 AREG(7) += 4;
16188 PRE_IO
16189 READ_LONG_F(adr, src)
16190 res = ~src;
16191 flag_C = 0;
16192 flag_V = 0;
16193 flag_NotZ = res;
16194 flag_N = res >> 24;
16195 WRITE_LONG_F(adr, res)
16196 POST_IO
16197RET(20)
16198}
16199
16200// NOT
16201OPCODE(0x46A7)
16202{
16203 u32 adr, res;
16204 u32 src, dst;
16205
16206 adr = AREG(7) - 4;
16207 AREG(7) = adr;
16208 PRE_IO
16209 READ_LONG_F(adr, src)
16210 res = ~src;
16211 flag_C = 0;
16212 flag_V = 0;
16213 flag_NotZ = res;
16214 flag_N = res >> 24;
16215 WRITE_LONG_F(adr, res)
16216 POST_IO
16217RET(22)
16218}
16219
16220// MOVESRa
16221OPCODE(0x40C0)
16222{
16223 u32 adr, res;
16224 u32 src, dst;
16225
16226 res = GET_SR;
16227 DREGu16((Opcode >> 0) & 7) = res;
16228RET(6)
16229}
16230
16231// MOVESRa
16232OPCODE(0x40D0)
16233{
16234 u32 adr, res;
16235 u32 src, dst;
16236
16237 res = GET_SR;
16238 adr = AREG((Opcode >> 0) & 7);
16239 PRE_IO
16240 WRITE_WORD_F(adr, res)
16241 POST_IO
16242RET(12)
16243}
16244
16245// MOVESRa
16246OPCODE(0x40D8)
16247{
16248 u32 adr, res;
16249 u32 src, dst;
16250
16251 res = GET_SR;
16252 adr = AREG((Opcode >> 0) & 7);
16253 AREG((Opcode >> 0) & 7) += 2;
16254 PRE_IO
16255 WRITE_WORD_F(adr, res)
16256 POST_IO
16257RET(12)
16258}
16259
16260// MOVESRa
16261OPCODE(0x40E0)
16262{
16263 u32 adr, res;
16264 u32 src, dst;
16265
16266 res = GET_SR;
16267 adr = AREG((Opcode >> 0) & 7) - 2;
16268 AREG((Opcode >> 0) & 7) = adr;
16269 PRE_IO
16270 WRITE_WORD_F(adr, res)
16271 POST_IO
16272RET(14)
16273}
16274
16275// MOVESRa
16276OPCODE(0x40E8)
16277{
16278 u32 adr, res;
16279 u32 src, dst;
16280
16281 res = GET_SR;
16282 FETCH_SWORD(adr);
16283 adr += AREG((Opcode >> 0) & 7);
16284 PRE_IO
16285 WRITE_WORD_F(adr, res)
16286 POST_IO
16287RET(16)
16288}
16289
16290// MOVESRa
16291OPCODE(0x40F0)
16292{
16293 u32 adr, res;
16294 u32 src, dst;
16295
16296 res = GET_SR;
16297 adr = AREG((Opcode >> 0) & 7);
16298 DECODE_EXT_WORD
16299 PRE_IO
16300 WRITE_WORD_F(adr, res)
16301 POST_IO
16302RET(18)
16303}
16304
16305// MOVESRa
16306OPCODE(0x40F8)
16307{
16308 u32 adr, res;
16309 u32 src, dst;
16310
16311 res = GET_SR;
16312 FETCH_SWORD(adr);
16313 PRE_IO
16314 WRITE_WORD_F(adr, res)
16315 POST_IO
16316RET(16)
16317}
16318
16319// MOVESRa
16320OPCODE(0x40F9)
16321{
16322 u32 adr, res;
16323 u32 src, dst;
16324
16325 res = GET_SR;
16326 FETCH_LONG(adr);
16327 PRE_IO
16328 WRITE_WORD_F(adr, res)
16329 POST_IO
16330RET(20)
16331}
16332
16333// MOVESRa
16334OPCODE(0x40DF)
16335{
16336 u32 adr, res;
16337 u32 src, dst;
16338
16339 res = GET_SR;
16340 adr = AREG(7);
16341 AREG(7) += 2;
16342 PRE_IO
16343 WRITE_WORD_F(adr, res)
16344 POST_IO
16345RET(12)
16346}
16347
16348// MOVESRa
16349OPCODE(0x40E7)
16350{
16351 u32 adr, res;
16352 u32 src, dst;
16353
16354 res = GET_SR;
16355 adr = AREG(7) - 2;
16356 AREG(7) = adr;
16357 PRE_IO
16358 WRITE_WORD_F(adr, res)
16359 POST_IO
16360RET(14)
16361}
16362
16363// MOVEaCCR
16364OPCODE(0x44C0)
16365{
16366 u32 adr, res;
16367 u32 src, dst;
16368
16369 res = DREGu16((Opcode >> 0) & 7);
16370 SET_CCR(res)
16371RET(12)
16372}
16373
16374// MOVEaCCR
16375OPCODE(0x44D0)
16376{
16377 u32 adr, res;
16378 u32 src, dst;
16379
16380 adr = AREG((Opcode >> 0) & 7);
16381 PRE_IO
16382 READ_WORD_F(adr, res)
16383 SET_CCR(res)
16384 POST_IO
16385RET(16)
16386}
16387
16388// MOVEaCCR
16389OPCODE(0x44D8)
16390{
16391 u32 adr, res;
16392 u32 src, dst;
16393
16394 adr = AREG((Opcode >> 0) & 7);
16395 AREG((Opcode >> 0) & 7) += 2;
16396 PRE_IO
16397 READ_WORD_F(adr, res)
16398 SET_CCR(res)
16399 POST_IO
16400RET(16)
16401}
16402
16403// MOVEaCCR
16404OPCODE(0x44E0)
16405{
16406 u32 adr, res;
16407 u32 src, dst;
16408
16409 adr = AREG((Opcode >> 0) & 7) - 2;
16410 AREG((Opcode >> 0) & 7) = adr;
16411 PRE_IO
16412 READ_WORD_F(adr, res)
16413 SET_CCR(res)
16414 POST_IO
16415RET(18)
16416}
16417
16418// MOVEaCCR
16419OPCODE(0x44E8)
16420{
16421 u32 adr, res;
16422 u32 src, dst;
16423
16424 FETCH_SWORD(adr);
16425 adr += AREG((Opcode >> 0) & 7);
16426 PRE_IO
16427 READ_WORD_F(adr, res)
16428 SET_CCR(res)
16429 POST_IO
16430RET(20)
16431}
16432
16433// MOVEaCCR
16434OPCODE(0x44F0)
16435{
16436 u32 adr, res;
16437 u32 src, dst;
16438
16439 adr = AREG((Opcode >> 0) & 7);
16440 DECODE_EXT_WORD
16441 PRE_IO
16442 READ_WORD_F(adr, res)
16443 SET_CCR(res)
16444 POST_IO
16445RET(22)
16446}
16447
16448// MOVEaCCR
16449OPCODE(0x44F8)
16450{
16451 u32 adr, res;
16452 u32 src, dst;
16453
16454 FETCH_SWORD(adr);
16455 PRE_IO
16456 READ_WORD_F(adr, res)
16457 SET_CCR(res)
16458 POST_IO
16459RET(20)
16460}
16461
16462// MOVEaCCR
16463OPCODE(0x44F9)
16464{
16465 u32 adr, res;
16466 u32 src, dst;
16467
16468 FETCH_LONG(adr);
16469 PRE_IO
16470 READ_WORD_F(adr, res)
16471 SET_CCR(res)
16472 POST_IO
16473RET(24)
16474}
16475
16476// MOVEaCCR
16477OPCODE(0x44FA)
16478{
16479 u32 adr, res;
16480 u32 src, dst;
16481
be26eb23 16482 adr = GET_SWORD + GET_PC;
70357ce5 16483 PC++;
16484 PRE_IO
16485 READ_WORD_F(adr, res)
16486 SET_CCR(res)
16487 POST_IO
16488RET(20)
16489}
16490
16491// MOVEaCCR
16492OPCODE(0x44FB)
16493{
16494 u32 adr, res;
16495 u32 src, dst;
16496
be26eb23 16497 adr = GET_PC;
70357ce5 16498 DECODE_EXT_WORD
16499 PRE_IO
16500 READ_WORD_F(adr, res)
16501 SET_CCR(res)
16502 POST_IO
16503RET(22)
16504}
16505
16506// MOVEaCCR
16507OPCODE(0x44FC)
16508{
16509 u32 adr, res;
16510 u32 src, dst;
16511
16512 FETCH_WORD(res);
16513 SET_CCR(res)
16514RET(16)
16515}
16516
16517// MOVEaCCR
16518OPCODE(0x44DF)
16519{
16520 u32 adr, res;
16521 u32 src, dst;
16522
16523 adr = AREG(7);
16524 AREG(7) += 2;
16525 PRE_IO
16526 READ_WORD_F(adr, res)
16527 SET_CCR(res)
16528 POST_IO
16529RET(16)
16530}
16531
16532// MOVEaCCR
16533OPCODE(0x44E7)
16534{
16535 u32 adr, res;
16536 u32 src, dst;
16537
16538 adr = AREG(7) - 2;
16539 AREG(7) = adr;
16540 PRE_IO
16541 READ_WORD_F(adr, res)
16542 SET_CCR(res)
16543 POST_IO
16544RET(18)
16545}
16546
16547// MOVEaSR
16548OPCODE(0x46C0)
16549{
16550 u32 adr, res;
16551 u32 src, dst;
16552
16553 if (flag_S)
16554 {
16555 res = DREGu16((Opcode >> 0) & 7);
16556 SET_SR(res)
16557 if (!flag_S)
16558 {
16559 res = AREG(7);
16560 AREG(7) = ASP;
16561 ASP = res;
16562 }
16563 CHECK_INT_TO_JUMP(12)
16564 }
16565 else
16566 {
d0ae0cb4 16567 SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
70357ce5 16568 RET(4)
16569 }
16570RET(12)
16571}
16572
16573// MOVEaSR
16574OPCODE(0x46D0)
16575{
16576 u32 adr, res;
16577 u32 src, dst;
16578
16579 if (flag_S)
16580 {
16581 adr = AREG((Opcode >> 0) & 7);
16582 PRE_IO
16583 READ_WORD_F(adr, res)
16584 SET_SR(res)
16585 if (!flag_S)
16586 {
16587 res = AREG(7);
16588 AREG(7) = ASP;
16589 ASP = res;
16590 }
16591 POST_IO
16592 CHECK_INT_TO_JUMP(16)
16593 }
16594 else
16595 {
d0ae0cb4 16596 SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
70357ce5 16597 RET(4)
16598 }
16599RET(16)
16600}
16601
16602// MOVEaSR
16603OPCODE(0x46D8)
16604{
16605 u32 adr, res;
16606 u32 src, dst;
16607
16608 if (flag_S)
16609 {
16610 adr = AREG((Opcode >> 0) & 7);
16611 AREG((Opcode >> 0) & 7) += 2;
16612 PRE_IO
16613 READ_WORD_F(adr, res)
16614 SET_SR(res)
16615 if (!flag_S)
16616 {
16617 res = AREG(7);
16618 AREG(7) = ASP;
16619 ASP = res;
16620 }
16621 POST_IO
16622 CHECK_INT_TO_JUMP(16)
16623 }
16624 else
16625 {
d0ae0cb4 16626 SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
70357ce5 16627 RET(4)
16628 }
16629RET(16)
16630}
16631
16632// MOVEaSR
16633OPCODE(0x46E0)
16634{
16635 u32 adr, res;
16636 u32 src, dst;
16637
16638 if (flag_S)
16639 {
16640 adr = AREG((Opcode >> 0) & 7) - 2;
16641 AREG((Opcode >> 0) & 7) = adr;
16642 PRE_IO
16643 READ_WORD_F(adr, res)
16644 SET_SR(res)
16645 if (!flag_S)
16646 {
16647 res = AREG(7);
16648 AREG(7) = ASP;
16649 ASP = res;
16650 }
16651 POST_IO
16652 CHECK_INT_TO_JUMP(18)
16653 }
16654 else
16655 {
d0ae0cb4 16656 SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
70357ce5 16657 RET(4)
16658 }
16659RET(18)
16660}
16661
16662// MOVEaSR
16663OPCODE(0x46E8)
16664{
16665 u32 adr, res;
16666 u32 src, dst;
16667
16668 if (flag_S)
16669 {
16670 FETCH_SWORD(adr);
16671 adr += AREG((Opcode >> 0) & 7);
16672 PRE_IO
16673 READ_WORD_F(adr, res)
16674 SET_SR(res)
16675 if (!flag_S)
16676 {
16677 res = AREG(7);
16678 AREG(7) = ASP;
16679 ASP = res;
16680 }
16681 POST_IO
16682 CHECK_INT_TO_JUMP(20)
16683 }
16684 else
16685 {
d0ae0cb4 16686 SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
70357ce5 16687 RET(4)
16688 }
16689RET(20)
16690}
16691
16692// MOVEaSR
16693OPCODE(0x46F0)
16694{
16695 u32 adr, res;
16696 u32 src, dst;
16697
16698 if (flag_S)
16699 {
16700 adr = AREG((Opcode >> 0) & 7);
16701 DECODE_EXT_WORD
16702 PRE_IO
16703 READ_WORD_F(adr, res)
16704 SET_SR(res)
16705 if (!flag_S)
16706 {
16707 res = AREG(7);
16708 AREG(7) = ASP;
16709 ASP = res;
16710 }
16711 POST_IO
16712 CHECK_INT_TO_JUMP(22)
16713 }
16714 else
16715 {
d0ae0cb4 16716 SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
70357ce5 16717 RET(4)
16718 }
16719RET(22)
16720}
16721
16722
16723// MOVEaSR
16724OPCODE(0x46F8)
16725{
16726 u32 adr, res;
16727 u32 src, dst;
16728
16729 if (flag_S)
16730 {
16731 FETCH_SWORD(adr);
16732 PRE_IO
16733 READ_WORD_F(adr, res)
16734 SET_SR(res)
16735 if (!flag_S)
16736 {
16737 res = AREG(7);
16738 AREG(7) = ASP;
16739 ASP = res;
16740 }
16741 POST_IO
16742 CHECK_INT_TO_JUMP(20)
16743 }
16744 else
16745 {
d0ae0cb4 16746 SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
70357ce5 16747 RET(4)
16748 }
16749RET(20)
16750}
16751
16752// MOVEaSR
16753OPCODE(0x46F9)
16754{
16755 u32 adr, res;
16756 u32 src, dst;
16757
16758 if (flag_S)
16759 {
16760 FETCH_LONG(adr);
16761 PRE_IO
16762 READ_WORD_F(adr, res)
16763 SET_SR(res)
16764 if (!flag_S)
16765 {
16766 res = AREG(7);
16767 AREG(7) = ASP;
16768 ASP = res;
16769 }
16770 POST_IO
16771 CHECK_INT_TO_JUMP(24)
16772 }
16773 else
16774 {
d0ae0cb4 16775 SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
70357ce5 16776 RET(4)
16777 }
16778RET(24)
16779}
16780
16781// MOVEaSR
16782OPCODE(0x46FA)
16783{
16784 u32 adr, res;
16785 u32 src, dst;
16786
16787 if (flag_S)
16788 {
be26eb23 16789 adr = GET_SWORD + GET_PC;
70357ce5 16790 PC++;
16791 PRE_IO
16792 READ_WORD_F(adr, res)
16793 SET_SR(res)
16794 if (!flag_S)
16795 {
16796 res = AREG(7);
16797 AREG(7) = ASP;
16798 ASP = res;
16799 }
16800 POST_IO
d0ae0cb4 16801 CHECK_INT_TO_JUMP(20)
70357ce5 16802 }
16803 else
16804 {
d0ae0cb4 16805 SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
70357ce5 16806 RET(4)
16807 }
16808RET(20)
16809}
16810
16811// MOVEaSR
16812OPCODE(0x46FB)
16813{
16814 u32 adr, res;
16815 u32 src, dst;
16816
16817 if (flag_S)
16818 {
be26eb23 16819 adr = GET_PC;
70357ce5 16820 DECODE_EXT_WORD
16821 PRE_IO
16822 READ_WORD_F(adr, res)
16823 SET_SR(res)
16824 if (!flag_S)
16825 {
16826 res = AREG(7);
16827 AREG(7) = ASP;
16828 ASP = res;
16829 }
16830 POST_IO
16831 CHECK_INT_TO_JUMP(22)
16832 }
16833 else
16834 {
d0ae0cb4 16835 SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
70357ce5 16836 RET(4)
16837 }
16838RET(22)
16839}
16840
16841// MOVEaSR
16842OPCODE(0x46FC)
16843{
16844 u32 adr, res;
16845 u32 src, dst;
16846
16847 if (flag_S)
16848 {
16849 FETCH_WORD(res);
16850 SET_SR(res)
16851 if (!flag_S)
16852 {
16853 res = AREG(7);
16854 AREG(7) = ASP;
16855 ASP = res;
16856 }
16857 CHECK_INT_TO_JUMP(16)
16858 }
16859 else
16860 {
d0ae0cb4 16861 SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
70357ce5 16862 RET(4)
16863 }
16864RET(16)
16865}
16866
16867// MOVEaSR
16868OPCODE(0x46DF)
16869{
16870 u32 adr, res;
16871 u32 src, dst;
16872
16873 if (flag_S)
16874 {
16875 adr = AREG(7);
16876 AREG(7) += 2;
16877 PRE_IO
16878 READ_WORD_F(adr, res)
16879 SET_SR(res)
16880 if (!flag_S)
16881 {
16882 res = AREG(7);
16883 AREG(7) = ASP;
16884 ASP = res;
16885 }
16886 POST_IO
16887 CHECK_INT_TO_JUMP(16)
16888 }
16889 else
16890 {
d0ae0cb4 16891 SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
70357ce5 16892 RET(4)
16893 }
16894RET(16)
16895}
16896
16897// MOVEaSR
16898OPCODE(0x46E7)
16899{
16900 u32 adr, res;
16901 u32 src, dst;
16902
16903 if (flag_S)
16904 {
16905 adr = AREG(7) - 2;
16906 AREG(7) = adr;
16907 PRE_IO
16908 READ_WORD_F(adr, res)
16909 SET_SR(res)
16910 if (!flag_S)
16911 {
16912 res = AREG(7);
16913 AREG(7) = ASP;
16914 ASP = res;
16915 }
16916 POST_IO
16917 CHECK_INT_TO_JUMP(18)
16918 }
16919 else
16920 {
d0ae0cb4 16921 SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
70357ce5 16922 RET(4)
16923 }
16924RET(18)
16925}
16926
16927// NBCD
16928OPCODE(0x4800)
16929{
16930 u32 adr, res;
16931 u32 src, dst;
16932
16933 res = DREGu8((Opcode >> 0) & 7);
16934 res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1);
16935
16936 if (res != 0x9a)
16937 {
16938 if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
16939 res &= 0xFF;
16940 DREGu8((Opcode >> 0) & 7) = res;
16941 flag_NotZ |= res;
16942 flag_X = flag_C = M68K_SR_C;
16943 }
16944 else flag_X = flag_C = 0;
16945 flag_N = res;
16946RET(6)
16947}
16948
16949// NBCD
16950OPCODE(0x4810)
16951{
16952 u32 adr, res;
16953 u32 src, dst;
16954
16955 adr = AREG((Opcode >> 0) & 7);
16956 PRE_IO
16957 READ_BYTE_F(adr, res)
16958 res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1);
16959
16960 if (res != 0x9a)
16961 {
16962 if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
16963 res &= 0xFF;
16964 WRITE_BYTE_F(adr, res)
16965 flag_NotZ |= res;
16966 flag_X = flag_C = M68K_SR_C;
16967 }
16968 else flag_X = flag_C = 0;
16969 flag_N = res;
16970 POST_IO
16971RET(12)
16972}
16973
16974// NBCD
16975OPCODE(0x4818)
16976{
16977 u32 adr, res;
16978 u32 src, dst;
16979
16980 adr = AREG((Opcode >> 0) & 7);
16981 AREG((Opcode >> 0) & 7) += 1;
16982 PRE_IO
16983 READ_BYTE_F(adr, res)
16984 res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1);
16985
16986 if (res != 0x9a)
16987 {
16988 if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
16989 res &= 0xFF;
16990 WRITE_BYTE_F(adr, res)
16991 flag_NotZ |= res;
16992 flag_X = flag_C = M68K_SR_C;
16993 }
16994 else flag_X = flag_C = 0;
16995 flag_N = res;
16996 POST_IO
16997RET(12)
16998}
16999
17000// NBCD
17001OPCODE(0x4820)
17002{
17003 u32 adr, res;
17004 u32 src, dst;
17005
17006 adr = AREG((Opcode >> 0) & 7) - 1;
17007 AREG((Opcode >> 0) & 7) = adr;
17008 PRE_IO
17009 READ_BYTE_F(adr, res)
17010 res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1);
17011
17012 if (res != 0x9a)
17013 {
17014 if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
17015 res &= 0xFF;
17016 WRITE_BYTE_F(adr, res)
17017 flag_NotZ |= res;
17018 flag_X = flag_C = M68K_SR_C;
17019 }
17020 else flag_X = flag_C = 0;
17021 flag_N = res;
17022 POST_IO
17023RET(14)
17024}
17025
17026// NBCD
17027OPCODE(0x4828)
17028{
17029 u32 adr, res;
17030 u32 src, dst;
17031
17032 FETCH_SWORD(adr);
17033 adr += AREG((Opcode >> 0) & 7);
17034 PRE_IO
17035 READ_BYTE_F(adr, res)
17036 res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1);
17037
17038 if (res != 0x9a)
17039 {
17040 if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
17041 res &= 0xFF;
17042 WRITE_BYTE_F(adr, res)
17043 flag_NotZ |= res;
17044 flag_X = flag_C = M68K_SR_C;
17045 }
17046 else flag_X = flag_C = 0;
17047 flag_N = res;
17048 POST_IO
17049RET(16)
17050}
17051
17052// NBCD
17053OPCODE(0x4830)
17054{
17055 u32 adr, res;
17056 u32 src, dst;
17057
17058 adr = AREG((Opcode >> 0) & 7);
17059 DECODE_EXT_WORD
17060 PRE_IO
17061 READ_BYTE_F(adr, res)
17062 res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1);
17063
17064 if (res != 0x9a)
17065 {
17066 if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
17067 res &= 0xFF;
17068 WRITE_BYTE_F(adr, res)
17069 flag_NotZ |= res;
17070 flag_X = flag_C = M68K_SR_C;
17071 }
17072 else flag_X = flag_C = 0;
17073 flag_N = res;
17074 POST_IO
17075RET(18)
17076}
17077
17078// NBCD
17079OPCODE(0x4838)
17080{
17081 u32 adr, res;
17082 u32 src, dst;
17083
17084 FETCH_SWORD(adr);
17085 PRE_IO
17086 READ_BYTE_F(adr, res)
17087 res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1);
17088
17089 if (res != 0x9a)
17090 {
17091 if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
17092 res &= 0xFF;
17093 WRITE_BYTE_F(adr, res)
17094 flag_NotZ |= res;
17095 flag_X = flag_C = M68K_SR_C;
17096 }
17097 else flag_X = flag_C = 0;
17098 flag_N = res;
17099 POST_IO
17100RET(16)
17101}
17102
17103// NBCD
17104OPCODE(0x4839)
17105{
17106 u32 adr, res;
17107 u32 src, dst;
17108
17109 FETCH_LONG(adr);
17110 PRE_IO
17111 READ_BYTE_F(adr, res)
17112 res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1);
17113
17114 if (res != 0x9a)
17115 {
17116 if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
17117 res &= 0xFF;
17118 WRITE_BYTE_F(adr, res)
17119 flag_NotZ |= res;
17120 flag_X = flag_C = M68K_SR_C;
17121 }
17122 else flag_X = flag_C = 0;
17123 flag_N = res;
17124 POST_IO
17125RET(20)
17126}
17127
17128// NBCD
17129OPCODE(0x481F)
17130{
17131 u32 adr, res;
17132 u32 src, dst;
17133
17134 adr = AREG(7);
17135 AREG(7) += 2;
17136 PRE_IO
17137 READ_BYTE_F(adr, res)
17138 res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1);
17139
17140 if (res != 0x9a)
17141 {
17142 if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
17143 res &= 0xFF;
17144 WRITE_BYTE_F(adr, res)
17145 flag_NotZ |= res;
17146 flag_X = flag_C = M68K_SR_C;
17147 }
17148 else flag_X = flag_C = 0;
17149 flag_N = res;
17150 POST_IO
17151RET(12)
17152}
17153
17154// NBCD
17155OPCODE(0x4827)
17156{
17157 u32 adr, res;
17158 u32 src, dst;
17159
17160 adr = AREG(7) - 2;
17161 AREG(7) = adr;
17162 PRE_IO
17163 READ_BYTE_F(adr, res)
17164 res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1);
17165
17166 if (res != 0x9a)
17167 {
17168 if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10;
17169 res &= 0xFF;
17170 WRITE_BYTE_F(adr, res)
17171 flag_NotZ |= res;
17172 flag_X = flag_C = M68K_SR_C;
17173 }
17174 else flag_X = flag_C = 0;
17175 flag_N = res;
17176 POST_IO
17177RET(14)
17178}
17179
17180// PEA
17181OPCODE(0x4850)
17182{
17183 u32 adr, res;
17184 u32 src, dst;
17185
17186 adr = AREG((Opcode >> 0) & 7);
17187 PRE_IO
17188 PUSH_32_F(adr)
17189 POST_IO
17190RET(12)
17191}
17192
17193// PEA
17194OPCODE(0x4868)
17195{
17196 u32 adr, res;
17197 u32 src, dst;
17198
17199 FETCH_SWORD(adr);
17200 adr += AREG((Opcode >> 0) & 7);
17201 PRE_IO
17202 PUSH_32_F(adr)
17203 POST_IO
17204RET(16)
17205}
17206
17207// PEA
17208OPCODE(0x4870)
17209{
17210 u32 adr, res;
17211 u32 src, dst;
17212
17213 adr = AREG((Opcode >> 0) & 7);
17214 DECODE_EXT_WORD
17215 PRE_IO
17216 PUSH_32_F(adr)
17217 POST_IO
17218RET(20)
17219}
17220
17221// PEA
17222OPCODE(0x4878)
17223{
17224 u32 adr, res;
17225 u32 src, dst;
17226
17227 FETCH_SWORD(adr);
17228 PRE_IO
17229 PUSH_32_F(adr)
17230 POST_IO
17231RET(16)
17232}
17233
17234// PEA
17235OPCODE(0x4879)
17236{
17237 u32 adr, res;
17238 u32 src, dst;
17239
17240 FETCH_LONG(adr);
17241 PRE_IO
17242 PUSH_32_F(adr)
17243 POST_IO
17244RET(20)
17245}
17246
17247// PEA
17248OPCODE(0x487A)
17249{
17250 u32 adr, res;
17251 u32 src, dst;
17252
be26eb23 17253 adr = GET_SWORD + GET_PC;
70357ce5 17254 PC++;
17255 PRE_IO
17256 PUSH_32_F(adr)
17257 POST_IO
17258RET(16)
17259}
17260
17261// PEA
17262OPCODE(0x487B)
17263{
17264 u32 adr, res;
17265 u32 src, dst;
17266
be26eb23 17267 adr = GET_PC;
70357ce5 17268 DECODE_EXT_WORD
17269 PRE_IO
17270 PUSH_32_F(adr)
17271 POST_IO
17272RET(20)
17273}
17274
17275// SWAP
17276OPCODE(0x4840)
17277{
17278 u32 adr, res;
17279 u32 src, dst;
17280
17281 res = DREGu32((Opcode >> 0) & 7);
17282 res = (res >> 16) | (res << 16);
17283 flag_C = 0;
17284 flag_V = 0;
17285 flag_NotZ = res;
17286 flag_N = res >> 24;
17287 DREGu32((Opcode >> 0) & 7) = res;
17288RET(4)
17289}
17290
17291// MOVEMRa
17292OPCODE(0x4890)
17293{
17294 u32 adr, res;
17295 u32 src, dst;
17296
17297 u32 *psrc;
17298
17299 FETCH_WORD(res);
17300 adr = AREG((Opcode >> 0) & 7);
17301 psrc = &DREGu32(0);
17302 dst = adr;
17303 PRE_IO
17304 do
17305 {
17306 if (res & 1)
17307 {
17308 WRITE_WORD_F(adr, *psrc)
17309 adr += 2;
17310 }
17311 psrc++;
17312 } while (res >>= 1);
17313 POST_IO
17314 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
17315#ifdef USE_CYCLONE_TIMING
17316RET(8)
17317#else
17318RET(12)
17319#endif
17320}
17321
17322// MOVEMRa
17323OPCODE(0x48A0)
17324{
17325 u32 adr, res;
17326 u32 src, dst;
17327
17328 u32 *psrc;
17329
17330 FETCH_WORD(res);
17331 adr = AREG((Opcode >> 0) & 7);
17332 psrc = &AREGu32(7);
17333 dst = adr;
17334 PRE_IO
17335 do
17336 {
17337 if (res & 1)
17338 {
17339 adr -= 2;
17340 WRITE_WORD_F(adr, *psrc)
17341 }
17342 psrc--;
17343 } while (res >>= 1);
17344 AREG((Opcode >> 0) & 7) = adr;
17345 POST_IO
17346 m68kcontext.io_cycle_counter -= (dst - adr) * 2;
17347RET(8)
17348}
17349
17350// MOVEMRa
17351OPCODE(0x48A8)
17352{
17353 u32 adr, res;
17354 u32 src, dst;
17355
17356 u32 *psrc;
17357
17358 FETCH_WORD(res);
17359 FETCH_SWORD(adr);
17360 adr += AREG((Opcode >> 0) & 7);
17361 psrc = &DREGu32(0);
17362 dst = adr;
17363 PRE_IO
17364 do
17365 {
17366 if (res & 1)
17367 {
17368 WRITE_WORD_F(adr, *psrc)
17369 adr += 2;
17370 }
17371 psrc++;
17372 } while (res >>= 1);
17373 POST_IO
17374 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
17375#ifdef USE_CYCLONE_TIMING
17376RET(12)
17377#else
17378RET(20)
17379#endif
17380}
17381
17382// MOVEMRa
17383OPCODE(0x48B0)
17384{
17385 u32 adr, res;
17386 u32 src, dst;
17387
17388 u32 *psrc;
17389
17390 FETCH_WORD(res);
17391 adr = AREG((Opcode >> 0) & 7);
17392 DECODE_EXT_WORD
17393 psrc = &DREGu32(0);
17394 dst = adr;
17395 PRE_IO
17396 do
17397 {
17398 if (res & 1)
17399 {
17400 WRITE_WORD_F(adr, *psrc)
17401 adr += 2;
17402 }
17403 psrc++;
17404 } while (res >>= 1);
17405 POST_IO
17406 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
17407#ifdef USE_CYCLONE_TIMING
17408RET(14)
17409#else
17410RET(24)
17411#endif
17412}
17413
17414// MOVEMRa
17415OPCODE(0x48B8)
17416{
17417 u32 adr, res;
17418 u32 src, dst;
17419
17420 u32 *psrc;
17421
17422 FETCH_WORD(res);
17423 FETCH_SWORD(adr);
17424 psrc = &DREGu32(0);
17425 dst = adr;
17426 PRE_IO
17427 do
17428 {
17429 if (res & 1)
17430 {
17431 WRITE_WORD_F(adr, *psrc)
17432 adr += 2;
17433 }
17434 psrc++;
17435 } while (res >>= 1);
17436 POST_IO
17437 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
17438#ifdef USE_CYCLONE_TIMING
17439RET(12)
17440#else
17441RET(20)
17442#endif
17443}
17444
17445// MOVEMRa
17446OPCODE(0x48B9)
17447{
17448 u32 adr, res;
17449 u32 src, dst;
17450
17451 u32 *psrc;
17452
17453 FETCH_WORD(res);
17454 FETCH_LONG(adr);
17455 psrc = &DREGu32(0);
17456 dst = adr;
17457 PRE_IO
17458 do
17459 {
17460 if (res & 1)
17461 {
17462 WRITE_WORD_F(adr, *psrc)
17463 adr += 2;
17464 }
17465 psrc++;
17466 } while (res >>= 1);
17467 POST_IO
17468 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
17469#ifdef USE_CYCLONE_TIMING
17470RET(16)
17471#else
17472RET(28)
17473#endif
17474}
17475
17476// MOVEMRa
17477OPCODE(0x48A7)
17478{
17479 u32 adr, res;
17480 u32 src, dst;
17481
17482 u32 *psrc;
17483
17484 FETCH_WORD(res);
17485 adr = AREG(7);
17486 psrc = &AREGu32(7);
17487 dst = adr;
17488 PRE_IO
17489 do
17490 {
17491 if (res & 1)
17492 {
17493 adr -= 2;
17494 WRITE_WORD_F(adr, *psrc)
17495 }
17496 psrc--;
17497 } while (res >>= 1);
17498 AREG(7) = adr;
17499 POST_IO
17500 m68kcontext.io_cycle_counter -= (dst - adr) * 2;
17501RET(8)
17502}
17503
17504// MOVEMRa
17505OPCODE(0x48D0)
17506{
17507 u32 adr, res;
17508 u32 src, dst;
17509
17510 u32 *psrc;
17511
17512 FETCH_WORD(res);
17513 adr = AREG((Opcode >> 0) & 7);
17514 psrc = &DREGu32(0);
17515 dst = adr;
17516 PRE_IO
17517 do
17518 {
17519 if (res & 1)
17520 {
17521 WRITE_LONG_F(adr, *psrc)
17522 adr += 4;
17523 }
17524 psrc++;
17525 } while (res >>= 1);
17526 POST_IO
17527 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
17528#ifdef USE_CYCLONE_TIMING
17529RET(8)
17530#else
17531RET(16)
17532#endif
17533}
17534
17535// MOVEMRa
17536OPCODE(0x48E0)
17537{
17538 u32 adr, res;
17539 u32 src, dst;
17540
17541 u32 *psrc;
17542
17543 FETCH_WORD(res);
17544 adr = AREG((Opcode >> 0) & 7);
17545 psrc = &AREGu32(7);
17546 dst = adr;
17547 PRE_IO
17548 do
17549 {
17550 if (res & 1)
17551 {
17552 adr -= 4;
17553 WRITE_LONG_DEC_F(adr, *psrc)
17554 }
17555 psrc--;
17556 } while (res >>= 1);
17557 AREG((Opcode >> 0) & 7) = adr;
17558 POST_IO
17559 m68kcontext.io_cycle_counter -= (dst - adr) * 2;
17560RET(8)
17561}
17562
17563// MOVEMRa
17564OPCODE(0x48E8)
17565{
17566 u32 adr, res;
17567 u32 src, dst;
17568
17569 u32 *psrc;
17570
17571 FETCH_WORD(res);
17572 FETCH_SWORD(adr);
17573 adr += AREG((Opcode >> 0) & 7);
17574 psrc = &DREGu32(0);
17575 dst = adr;
17576 PRE_IO
17577 do
17578 {
17579 if (res & 1)
17580 {
17581 WRITE_LONG_F(adr, *psrc)
17582 adr += 4;
17583 }
17584 psrc++;
17585 } while (res >>= 1);
17586 POST_IO
17587 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
17588#ifdef USE_CYCLONE_TIMING
17589RET(12)
17590#else
17591RET(24)
17592#endif
17593}
17594
17595// MOVEMRa
17596OPCODE(0x48F0)
17597{
17598 u32 adr, res;
17599 u32 src, dst;
17600
17601 u32 *psrc;
17602
17603 FETCH_WORD(res);
17604 adr = AREG((Opcode >> 0) & 7);
17605 DECODE_EXT_WORD
17606 psrc = &DREGu32(0);
17607 dst = adr;
17608 PRE_IO
17609 do
17610 {
17611 if (res & 1)
17612 {
17613 WRITE_LONG_F(adr, *psrc)
17614 adr += 4;
17615 }
17616 psrc++;
17617 } while (res >>= 1);
17618 POST_IO
17619 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
17620#ifdef USE_CYCLONE_TIMING
17621RET(14)
17622#else
17623RET(28)
17624#endif
17625}
17626
17627// MOVEMRa
17628OPCODE(0x48F8)
17629{
17630 u32 adr, res;
17631 u32 src, dst;
17632
17633 u32 *psrc;
17634
17635 FETCH_WORD(res);
17636 FETCH_SWORD(adr);
17637 psrc = &DREGu32(0);
17638 dst = adr;
17639 PRE_IO
17640 do
17641 {
17642 if (res & 1)
17643 {
17644 WRITE_LONG_F(adr, *psrc)
17645 adr += 4;
17646 }
17647 psrc++;
17648 } while (res >>= 1);
17649 POST_IO
17650 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
17651#ifdef USE_CYCLONE_TIMING
17652RET(12)
17653#else
17654RET(24)
17655#endif
17656}
17657
17658// MOVEMRa
17659OPCODE(0x48F9)
17660{
17661 u32 adr, res;
17662 u32 src, dst;
17663
17664 u32 *psrc;
17665
17666 FETCH_WORD(res);
17667 FETCH_LONG(adr);
17668 psrc = &DREGu32(0);
17669 dst = adr;
17670 PRE_IO
17671 do
17672 {
17673 if (res & 1)
17674 {
17675 WRITE_LONG_F(adr, *psrc)
17676 adr += 4;
17677 }
17678 psrc++;
17679 } while (res >>= 1);
17680 POST_IO
17681 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
17682#ifdef USE_CYCLONE_TIMING
17683RET(16)
17684#else
17685RET(32)
17686#endif
17687}
17688
17689// MOVEMRa
17690OPCODE(0x48E7)
17691{
17692 u32 adr, res;
17693 u32 src, dst;
17694
17695 u32 *psrc;
17696
17697 FETCH_WORD(res);
17698 adr = AREG(7);
17699 psrc = &AREGu32(7);
17700 dst = adr;
17701 PRE_IO
17702 do
17703 {
17704 if (res & 1)
17705 {
17706 adr -= 4;
17707 WRITE_LONG_DEC_F(adr, *psrc)
17708 }
17709 psrc--;
17710 } while (res >>= 1);
17711 AREG(7) = adr;
17712 POST_IO
17713 m68kcontext.io_cycle_counter -= (dst - adr) * 2;
17714RET(8)
17715}
17716
17717// EXT
17718OPCODE(0x4880)
17719{
17720 u32 adr, res;
17721 u32 src, dst;
17722
17723 res = (s32)DREGs8((Opcode >> 0) & 7);
17724 flag_C = 0;
17725 flag_V = 0;
17726 flag_NotZ = res;
17727 flag_N = res;
17728 DREGu16((Opcode >> 0) & 7) = res;
17729RET(4)
17730}
17731
17732// EXT
17733OPCODE(0x48C0)
17734{
17735 u32 adr, res;
17736 u32 src, dst;
17737
17738 res = (s32)DREGs16((Opcode >> 0) & 7);
17739 flag_C = 0;
17740 flag_V = 0;
17741 flag_NotZ = res;
17742 flag_N = res >> 8;
17743 DREGu32((Opcode >> 0) & 7) = res;
17744RET(4)
17745}
17746
17747// TST
17748OPCODE(0x4A00)
17749{
17750 u32 adr, res;
17751 u32 src, dst;
17752
17753 res = DREGu8((Opcode >> 0) & 7);
17754 flag_C = 0;
17755 flag_V = 0;
17756 flag_NotZ = res;
17757 flag_N = res;
17758RET(4)
17759}
17760
17761// TST
17762OPCODE(0x4A10)
17763{
17764 u32 adr, res;
17765 u32 src, dst;
17766
17767 adr = AREG((Opcode >> 0) & 7);
17768 PRE_IO
17769 READ_BYTE_F(adr, res)
17770 flag_C = 0;
17771 flag_V = 0;
17772 flag_NotZ = res;
17773 flag_N = res;
17774 POST_IO
17775RET(8)
17776}
17777
17778// TST
17779OPCODE(0x4A18)
17780{
17781 u32 adr, res;
17782 u32 src, dst;
17783
17784 adr = AREG((Opcode >> 0) & 7);
17785 AREG((Opcode >> 0) & 7) += 1;
17786 PRE_IO
17787 READ_BYTE_F(adr, res)
17788 flag_C = 0;
17789 flag_V = 0;
17790 flag_NotZ = res;
17791 flag_N = res;
17792 POST_IO
17793RET(8)
17794}
17795
17796// TST
17797OPCODE(0x4A20)
17798{
17799 u32 adr, res;
17800 u32 src, dst;
17801
17802 adr = AREG((Opcode >> 0) & 7) - 1;
17803 AREG((Opcode >> 0) & 7) = adr;
17804 PRE_IO
17805 READ_BYTE_F(adr, res)
17806 flag_C = 0;
17807 flag_V = 0;
17808 flag_NotZ = res;
17809 flag_N = res;
17810 POST_IO
17811RET(10)
17812}
17813
17814// TST
17815OPCODE(0x4A28)
17816{
17817 u32 adr, res;
17818 u32 src, dst;
17819
17820 FETCH_SWORD(adr);
17821 adr += AREG((Opcode >> 0) & 7);
17822 PRE_IO
17823 READ_BYTE_F(adr, res)
17824 flag_C = 0;
17825 flag_V = 0;
17826 flag_NotZ = res;
17827 flag_N = res;
17828 POST_IO
17829RET(12)
17830}
17831
17832// TST
17833OPCODE(0x4A30)
17834{
17835 u32 adr, res;
17836 u32 src, dst;
17837
17838 adr = AREG((Opcode >> 0) & 7);
17839 DECODE_EXT_WORD
17840 PRE_IO
17841 READ_BYTE_F(adr, res)
17842 flag_C = 0;
17843 flag_V = 0;
17844 flag_NotZ = res;
17845 flag_N = res;
17846 POST_IO
17847RET(14)
17848}
17849
17850// TST
17851OPCODE(0x4A38)
17852{
17853 u32 adr, res;
17854 u32 src, dst;
17855
17856 FETCH_SWORD(adr);
17857 PRE_IO
17858 READ_BYTE_F(adr, res)
17859 flag_C = 0;
17860 flag_V = 0;
17861 flag_NotZ = res;
17862 flag_N = res;
17863 POST_IO
17864RET(12)
17865}
17866
17867// TST
17868OPCODE(0x4A39)
17869{
17870 u32 adr, res;
17871 u32 src, dst;
17872
17873 FETCH_LONG(adr);
17874 PRE_IO
17875 READ_BYTE_F(adr, res)
17876 flag_C = 0;
17877 flag_V = 0;
17878 flag_NotZ = res;
17879 flag_N = res;
17880 POST_IO
17881RET(16)
17882}
17883
17884// TST
17885OPCODE(0x4A1F)
17886{
17887 u32 adr, res;
17888 u32 src, dst;
17889
17890 adr = AREG(7);
17891 AREG(7) += 2;
17892 PRE_IO
17893 READ_BYTE_F(adr, res)
17894 flag_C = 0;
17895 flag_V = 0;
17896 flag_NotZ = res;
17897 flag_N = res;
17898 POST_IO
17899RET(8)
17900}
17901
17902// TST
17903OPCODE(0x4A27)
17904{
17905 u32 adr, res;
17906 u32 src, dst;
17907
17908 adr = AREG(7) - 2;
17909 AREG(7) = adr;
17910 PRE_IO
17911 READ_BYTE_F(adr, res)
17912 flag_C = 0;
17913 flag_V = 0;
17914 flag_NotZ = res;
17915 flag_N = res;
17916 POST_IO
17917RET(10)
17918}
17919
17920// TST
17921OPCODE(0x4A40)
17922{
17923 u32 adr, res;
17924 u32 src, dst;
17925
17926 res = DREGu16((Opcode >> 0) & 7);
17927 flag_C = 0;
17928 flag_V = 0;
17929 flag_NotZ = res;
17930 flag_N = res >> 8;
17931RET(4)
17932}
17933
17934// TST
17935OPCODE(0x4A50)
17936{
17937 u32 adr, res;
17938 u32 src, dst;
17939
17940 adr = AREG((Opcode >> 0) & 7);
17941 PRE_IO
17942 READ_WORD_F(adr, res)
17943 flag_C = 0;
17944 flag_V = 0;
17945 flag_NotZ = res;
17946 flag_N = res >> 8;
17947 POST_IO
17948RET(8)
17949}
17950
17951// TST
17952OPCODE(0x4A58)
17953{
17954 u32 adr, res;
17955 u32 src, dst;
17956
17957 adr = AREG((Opcode >> 0) & 7);
17958 AREG((Opcode >> 0) & 7) += 2;
17959 PRE_IO
17960 READ_WORD_F(adr, res)
17961 flag_C = 0;
17962 flag_V = 0;
17963 flag_NotZ = res;
17964 flag_N = res >> 8;
17965 POST_IO
17966RET(8)
17967}
17968
17969// TST
17970OPCODE(0x4A60)
17971{
17972 u32 adr, res;
17973 u32 src, dst;
17974
17975 adr = AREG((Opcode >> 0) & 7) - 2;
17976 AREG((Opcode >> 0) & 7) = adr;
17977 PRE_IO
17978 READ_WORD_F(adr, res)
17979 flag_C = 0;
17980 flag_V = 0;
17981 flag_NotZ = res;
17982 flag_N = res >> 8;
17983 POST_IO
17984RET(10)
17985}
17986
17987// TST
17988OPCODE(0x4A68)
17989{
17990 u32 adr, res;
17991 u32 src, dst;
17992
17993 FETCH_SWORD(adr);
17994 adr += AREG((Opcode >> 0) & 7);
17995 PRE_IO
17996 READ_WORD_F(adr, res)
17997 flag_C = 0;
17998 flag_V = 0;
17999 flag_NotZ = res;
18000 flag_N = res >> 8;
18001 POST_IO
18002RET(12)
18003}
18004
18005// TST
18006OPCODE(0x4A70)
18007{
18008 u32 adr, res;
18009 u32 src, dst;
18010
18011 adr = AREG((Opcode >> 0) & 7);
18012 DECODE_EXT_WORD
18013 PRE_IO
18014 READ_WORD_F(adr, res)
18015 flag_C = 0;
18016 flag_V = 0;
18017 flag_NotZ = res;
18018 flag_N = res >> 8;
18019 POST_IO
18020RET(14)
18021}
18022
18023// TST
18024OPCODE(0x4A78)
18025{
18026 u32 adr, res;
18027 u32 src, dst;
18028
18029 FETCH_SWORD(adr);
18030 PRE_IO
18031 READ_WORD_F(adr, res)
18032 flag_C = 0;
18033 flag_V = 0;
18034 flag_NotZ = res;
18035 flag_N = res >> 8;
18036 POST_IO
18037RET(12)
18038}
18039
18040// TST
18041OPCODE(0x4A79)
18042{
18043 u32 adr, res;
18044 u32 src, dst;
18045
18046 FETCH_LONG(adr);
18047 PRE_IO
18048 READ_WORD_F(adr, res)
18049 flag_C = 0;
18050 flag_V = 0;
18051 flag_NotZ = res;
18052 flag_N = res >> 8;
18053 POST_IO
18054RET(16)
18055}
18056
18057// TST
18058OPCODE(0x4A5F)
18059{
18060 u32 adr, res;
18061 u32 src, dst;
18062
18063 adr = AREG(7);
18064 AREG(7) += 2;
18065 PRE_IO
18066 READ_WORD_F(adr, res)
18067 flag_C = 0;
18068 flag_V = 0;
18069 flag_NotZ = res;
18070 flag_N = res >> 8;
18071 POST_IO
18072RET(8)
18073}
18074
18075// TST
18076OPCODE(0x4A67)
18077{
18078 u32 adr, res;
18079 u32 src, dst;
18080
18081 adr = AREG(7) - 2;
18082 AREG(7) = adr;
18083 PRE_IO
18084 READ_WORD_F(adr, res)
18085 flag_C = 0;
18086 flag_V = 0;
18087 flag_NotZ = res;
18088 flag_N = res >> 8;
18089 POST_IO
18090RET(10)
18091}
18092
18093// TST
18094OPCODE(0x4A80)
18095{
18096 u32 adr, res;
18097 u32 src, dst;
18098
18099 res = DREGu32((Opcode >> 0) & 7);
18100 flag_C = 0;
18101 flag_V = 0;
18102 flag_NotZ = res;
18103 flag_N = res >> 24;
18104RET(4)
18105}
18106
18107// TST
18108OPCODE(0x4A90)
18109{
18110 u32 adr, res;
18111 u32 src, dst;
18112
18113 adr = AREG((Opcode >> 0) & 7);
18114 PRE_IO
18115 READ_LONG_F(adr, res)
18116 flag_C = 0;
18117 flag_V = 0;
18118 flag_NotZ = res;
18119 flag_N = res >> 24;
18120 POST_IO
18121RET(12)
18122}
18123
18124// TST
18125OPCODE(0x4A98)
18126{
18127 u32 adr, res;
18128 u32 src, dst;
18129
18130 adr = AREG((Opcode >> 0) & 7);
18131 AREG((Opcode >> 0) & 7) += 4;
18132 PRE_IO
18133 READ_LONG_F(adr, res)
18134 flag_C = 0;
18135 flag_V = 0;
18136 flag_NotZ = res;
18137 flag_N = res >> 24;
18138 POST_IO
18139RET(12)
18140}
18141
18142// TST
18143OPCODE(0x4AA0)
18144{
18145 u32 adr, res;
18146 u32 src, dst;
18147
18148 adr = AREG((Opcode >> 0) & 7) - 4;
18149 AREG((Opcode >> 0) & 7) = adr;
18150 PRE_IO
18151 READ_LONG_F(adr, res)
18152 flag_C = 0;
18153 flag_V = 0;
18154 flag_NotZ = res;
18155 flag_N = res >> 24;
18156 POST_IO
18157RET(14)
18158}
18159
18160// TST
18161OPCODE(0x4AA8)
18162{
18163 u32 adr, res;
18164 u32 src, dst;
18165
18166 FETCH_SWORD(adr);
18167 adr += AREG((Opcode >> 0) & 7);
18168 PRE_IO
18169 READ_LONG_F(adr, res)
18170 flag_C = 0;
18171 flag_V = 0;
18172 flag_NotZ = res;
18173 flag_N = res >> 24;
18174 POST_IO
18175RET(16)
18176}
18177
18178// TST
18179OPCODE(0x4AB0)
18180{
18181 u32 adr, res;
18182 u32 src, dst;
18183
18184 adr = AREG((Opcode >> 0) & 7);
18185 DECODE_EXT_WORD
18186 PRE_IO
18187 READ_LONG_F(adr, res)
18188 flag_C = 0;
18189 flag_V = 0;
18190 flag_NotZ = res;
18191 flag_N = res >> 24;
18192 POST_IO
18193RET(18)
18194}
18195
18196// TST
18197OPCODE(0x4AB8)
18198{
18199 u32 adr, res;
18200 u32 src, dst;
18201
18202 FETCH_SWORD(adr);
18203 PRE_IO
18204 READ_LONG_F(adr, res)
18205 flag_C = 0;
18206 flag_V = 0;
18207 flag_NotZ = res;
18208 flag_N = res >> 24;
18209 POST_IO
18210RET(16)
18211}
18212
18213// TST
18214OPCODE(0x4AB9)
18215{
18216 u32 adr, res;
18217 u32 src, dst;
18218
18219 FETCH_LONG(adr);
18220 PRE_IO
18221 READ_LONG_F(adr, res)
18222 flag_C = 0;
18223 flag_V = 0;
18224 flag_NotZ = res;
18225 flag_N = res >> 24;
18226 POST_IO
18227RET(20)
18228}
18229
18230// TST
18231OPCODE(0x4A9F)
18232{
18233 u32 adr, res;
18234 u32 src, dst;
18235
18236 adr = AREG(7);
18237 AREG(7) += 4;
18238 PRE_IO
18239 READ_LONG_F(adr, res)
18240 flag_C = 0;
18241 flag_V = 0;
18242 flag_NotZ = res;
18243 flag_N = res >> 24;
18244 POST_IO
18245RET(12)
18246}
18247
18248// TST
18249OPCODE(0x4AA7)
18250{
18251 u32 adr, res;
18252 u32 src, dst;
18253
18254 adr = AREG(7) - 4;
18255 AREG(7) = adr;
18256 PRE_IO
18257 READ_LONG_F(adr, res)
18258 flag_C = 0;
18259 flag_V = 0;
18260 flag_NotZ = res;
18261 flag_N = res >> 24;
18262 POST_IO
18263RET(14)
18264}
18265
18266// TAS
18267OPCODE(0x4AC0)
18268{
18269 u32 adr, res;
18270 u32 src, dst;
18271
18272 res = DREGu8((Opcode >> 0) & 7);
18273 flag_C = 0;
18274 flag_V = 0;
18275 flag_NotZ = res;
18276 flag_N = res;
18277 res |= 0x80;
18278 DREGu8((Opcode >> 0) & 7) = res;
18279RET(4)
18280}
18281
18282// TAS
18283OPCODE(0x4AD0)
18284{
18285 u32 adr, res;
18286 u32 src, dst;
18287
18288 adr = AREG((Opcode >> 0) & 7);
18289 PRE_IO
18290 READ_BYTE_F(adr, res)
18291 flag_C = 0;
18292 flag_V = 0;
18293 flag_NotZ = res;
18294 flag_N = res;
b5e5172d 18295#ifdef PICODRIVE_HACK
18296 if (g_m68kcontext == &PicoCpuFS68k) {
18297 res |= 0x80;
18298 WRITE_BYTE_F(adr, res);
18299 }
18300#endif
18301
70357ce5 18302 POST_IO
b5e5172d 18303#ifdef USE_CYCLONE_TIMING
18304RET(18)
18305#else
70357ce5 18306RET(8)
b5e5172d 18307#endif
70357ce5 18308}
18309
18310// TAS
18311OPCODE(0x4AD8)
18312{
18313 u32 adr, res;
18314 u32 src, dst;
18315
18316 adr = AREG((Opcode >> 0) & 7);
18317 AREG((Opcode >> 0) & 7) += 1;
18318 PRE_IO
18319 READ_BYTE_F(adr, res)
18320 flag_C = 0;
18321 flag_V = 0;
18322 flag_NotZ = res;
18323 flag_N = res;
b5e5172d 18324
18325#ifdef PICODRIVE_HACK
18326 if (g_m68kcontext == &PicoCpuFS68k) {
18327 res |= 0x80;
18328 WRITE_BYTE_F(adr, res);
18329 }
18330#endif
18331
70357ce5 18332 POST_IO
b5e5172d 18333#ifdef USE_CYCLONE_TIMING
18334RET(18)
18335#else
70357ce5 18336RET(8)
b5e5172d 18337#endif
70357ce5 18338}
18339
18340// TAS
18341OPCODE(0x4AE0)
18342{
18343 u32 adr, res;
18344 u32 src, dst;
18345
18346 adr = AREG((Opcode >> 0) & 7) - 1;
18347 AREG((Opcode >> 0) & 7) = adr;
18348 PRE_IO
18349 READ_BYTE_F(adr, res)
18350 flag_C = 0;
18351 flag_V = 0;
18352 flag_NotZ = res;
18353 flag_N = res;
b5e5172d 18354
18355#ifdef PICODRIVE_HACK
18356 if (g_m68kcontext == &PicoCpuFS68k) {
18357 res |= 0x80;
18358 WRITE_BYTE_F(adr, res);
18359 }
18360#endif
18361
70357ce5 18362 POST_IO
b5e5172d 18363#ifdef USE_CYCLONE_TIMING
18364RET(20)
18365#else
70357ce5 18366RET(10)
b5e5172d 18367#endif
70357ce5 18368}
18369
18370// TAS
18371OPCODE(0x4AE8)
18372{
18373 u32 adr, res;
18374 u32 src, dst;
18375
18376 FETCH_SWORD(adr);
18377 adr += AREG((Opcode >> 0) & 7);
18378 PRE_IO
18379 READ_BYTE_F(adr, res)
18380 flag_C = 0;
18381 flag_V = 0;
18382 flag_NotZ = res;
18383 flag_N = res;
b5e5172d 18384
18385#ifdef PICODRIVE_HACK
18386 if (g_m68kcontext == &PicoCpuFS68k) {
18387 res |= 0x80;
18388 WRITE_BYTE_F(adr, res);
18389 }
18390#endif
18391
70357ce5 18392 POST_IO
b5e5172d 18393#ifdef USE_CYCLONE_TIMING
18394RET(22)
18395#else
70357ce5 18396RET(12)
b5e5172d 18397#endif
70357ce5 18398}
18399
18400// TAS
18401OPCODE(0x4AF0)
18402{
18403 u32 adr, res;
18404 u32 src, dst;
18405
18406 adr = AREG((Opcode >> 0) & 7);
18407 DECODE_EXT_WORD
18408 PRE_IO
18409 READ_BYTE_F(adr, res)
18410 flag_C = 0;
18411 flag_V = 0;
18412 flag_NotZ = res;
18413 flag_N = res;
b5e5172d 18414
18415#ifdef PICODRIVE_HACK
18416 if (g_m68kcontext == &PicoCpuFS68k) {
18417 res |= 0x80;
18418 WRITE_BYTE_F(adr, res);
18419 }
18420#endif
18421
70357ce5 18422 POST_IO
b5e5172d 18423#ifdef USE_CYCLONE_TIMING
18424RET(24)
18425#else
70357ce5 18426RET(14)
b5e5172d 18427#endif
70357ce5 18428}
18429
18430// TAS
18431OPCODE(0x4AF8)
18432{
18433 u32 adr, res;
18434 u32 src, dst;
18435
18436 FETCH_SWORD(adr);
18437 PRE_IO
18438 READ_BYTE_F(adr, res)
18439 flag_C = 0;
18440 flag_V = 0;
18441 flag_NotZ = res;
18442 flag_N = res;
b5e5172d 18443
18444#ifdef PICODRIVE_HACK
18445 if (g_m68kcontext == &PicoCpuFS68k) {
18446 res |= 0x80;
18447 WRITE_BYTE_F(adr, res);
18448 }
18449#endif
18450
70357ce5 18451 POST_IO
b5e5172d 18452#ifdef USE_CYCLONE_TIMING
18453RET(22)
18454#else
70357ce5 18455RET(12)
b5e5172d 18456#endif
70357ce5 18457}
18458
18459// TAS
18460OPCODE(0x4AF9)
18461{
18462 u32 adr, res;
18463 u32 src, dst;
18464
18465 FETCH_LONG(adr);
18466 PRE_IO
18467 READ_BYTE_F(adr, res)
18468 flag_C = 0;
18469 flag_V = 0;
18470 flag_NotZ = res;
18471 flag_N = res;
b5e5172d 18472
18473#ifdef PICODRIVE_HACK
18474 if (g_m68kcontext == &PicoCpuFS68k) {
18475 res |= 0x80;
18476 WRITE_BYTE_F(adr, res);
18477 }
18478#endif
18479
70357ce5 18480 POST_IO
b5e5172d 18481#ifdef USE_CYCLONE_TIMING
18482RET(26)
18483#else
70357ce5 18484RET(16)
b5e5172d 18485#endif
70357ce5 18486}
18487
18488// TAS
18489OPCODE(0x4ADF)
18490{
18491 u32 adr, res;
18492 u32 src, dst;
18493
18494 adr = AREG(7);
18495 AREG(7) += 2;
18496 PRE_IO
18497 READ_BYTE_F(adr, res)
18498 flag_C = 0;
18499 flag_V = 0;
18500 flag_NotZ = res;
18501 flag_N = res;
b5e5172d 18502
18503#ifdef PICODRIVE_HACK
18504 if (g_m68kcontext == &PicoCpuFS68k) {
18505 res |= 0x80;
18506 WRITE_BYTE_F(adr, res);
18507 }
18508#endif
18509
70357ce5 18510 POST_IO
b5e5172d 18511#ifdef USE_CYCLONE_TIMING
18512RET(18)
18513#else
70357ce5 18514RET(8)
b5e5172d 18515#endif
70357ce5 18516}
18517
18518// TAS
18519OPCODE(0x4AE7)
18520{
18521 u32 adr, res;
18522 u32 src, dst;
18523
18524 adr = AREG(7) - 2;
18525 AREG(7) = adr;
18526 PRE_IO
18527 READ_BYTE_F(adr, res)
18528 flag_C = 0;
18529 flag_V = 0;
18530 flag_NotZ = res;
18531 flag_N = res;
b5e5172d 18532
18533#ifdef PICODRIVE_HACK
18534 if (g_m68kcontext == &PicoCpuFS68k) {
18535 res |= 0x80;
18536 WRITE_BYTE_F(adr, res);
18537 }
18538#endif
18539
70357ce5 18540 POST_IO
b5e5172d 18541#ifdef USE_CYCLONE_TIMING
18542RET(20)
18543#else
18544RET(8)
18545#endif
70357ce5 18546}
18547
18548// ILLEGAL
18549OPCODE(0x4AFC)
18550{
d0ae0cb4 18551 SET_PC(execute_exception(M68K_ILLEGAL_INSTRUCTION_EX, GET_PC-2, GET_SR));
03e4f2a3 18552RET(0)
70357ce5 18553}
18554
18555// ILLEGAL A000-AFFF
18556OPCODE(0xA000)
18557{
d0ae0cb4 18558 SET_PC(execute_exception(M68K_1010_EX, GET_PC-2, GET_SR));
03e4f2a3 18559RET(0)
70357ce5 18560}
18561
18562// ILLEGAL F000-FFFF
18563OPCODE(0xF000)
18564{
d0ae0cb4 18565 SET_PC(execute_exception(M68K_1111_EX, GET_PC-2, GET_SR));
03e4f2a3 18566RET(0) // 4 already taken by exc. handler
70357ce5 18567}
18568
18569// MOVEMaR
18570OPCODE(0x4C90)
18571{
18572 u32 adr, res;
18573 u32 src, dst;
18574
18575 s32 *psrc;
18576
18577 FETCH_WORD(res);
18578 adr = AREG((Opcode >> 0) & 7);
18579 psrc = &DREGs32(0);
18580 dst = adr;
18581 PRE_IO
18582 do
18583 {
18584 if (res & 1)
18585 {
18586 READSX_WORD_F(adr, *psrc)
18587 adr += 2;
18588 }
18589 psrc++;
18590 } while (res >>= 1);
18591 POST_IO
18592 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
18593#ifdef USE_CYCLONE_TIMING
18594RET(12)
18595#else
18596RET(16)
18597#endif
18598}
18599
18600// MOVEMaR
18601OPCODE(0x4C98)
18602{
18603 u32 adr, res;
18604 u32 src, dst;
18605
18606 s32 *psrc;
18607
18608 FETCH_WORD(res);
18609 adr = AREG((Opcode >> 0) & 7);
18610 psrc = &DREGs32(0);
18611 dst = adr;
18612 PRE_IO
18613 do
18614 {
18615 if (res & 1)
18616 {
18617 READSX_WORD_F(adr, *psrc)
18618 adr += 2;
18619 }
18620 psrc++;
18621 } while (res >>= 1);
18622 AREG((Opcode >> 0) & 7) = adr;
18623 POST_IO
18624 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
18625RET(12)
18626}
18627
18628// MOVEMaR
18629OPCODE(0x4CA8)
18630{
18631 u32 adr, res;
18632 u32 src, dst;
18633
18634 s32 *psrc;
18635
18636 FETCH_WORD(res);
18637 FETCH_SWORD(adr);
18638 adr += AREG((Opcode >> 0) & 7);
18639 psrc = &DREGs32(0);
18640 dst = adr;
18641 PRE_IO
18642 do
18643 {
18644 if (res & 1)
18645 {
18646 READSX_WORD_F(adr, *psrc)
18647 adr += 2;
18648 }
18649 psrc++;
18650 } while (res >>= 1);
18651 POST_IO
18652 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
18653#ifdef USE_CYCLONE_TIMING
18654RET(16)
18655#else
18656RET(24)
18657#endif
18658}
18659
18660// MOVEMaR
18661OPCODE(0x4CB0)
18662{
18663 u32 adr, res;
18664 u32 src, dst;
18665
18666 s32 *psrc;
18667
18668 FETCH_WORD(res);
18669 adr = AREG((Opcode >> 0) & 7);
18670 DECODE_EXT_WORD
18671 psrc = &DREGs32(0);
18672 dst = adr;
18673 PRE_IO
18674 do
18675 {
18676 if (res & 1)
18677 {
18678 READSX_WORD_F(adr, *psrc)
18679 adr += 2;
18680 }
18681 psrc++;
18682 } while (res >>= 1);
18683 POST_IO
18684 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
18685#ifdef USE_CYCLONE_TIMING
18686RET(18)
18687#else
18688RET(28)
18689#endif
18690}
18691
18692// MOVEMaR
18693OPCODE(0x4CB8)
18694{
18695 u32 adr, res;
18696 u32 src, dst;
18697
18698 s32 *psrc;
18699
18700 FETCH_WORD(res);
18701 FETCH_SWORD(adr);
18702 psrc = &DREGs32(0);
18703 dst = adr;
18704 PRE_IO
18705 do
18706 {
18707 if (res & 1)
18708 {
18709 READSX_WORD_F(adr, *psrc)
18710 adr += 2;
18711 }
18712 psrc++;
18713 } while (res >>= 1);
18714 POST_IO
18715 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
18716#ifdef USE_CYCLONE_TIMING
18717RET(16)
18718#else
18719RET(24)
18720#endif
18721}
18722
18723// MOVEMaR
18724OPCODE(0x4CB9)
18725{
18726 u32 adr, res;
18727 u32 src, dst;
18728
18729 s32 *psrc;
18730
18731 FETCH_WORD(res);
18732 FETCH_LONG(adr);
18733 psrc = &DREGs32(0);
18734 dst = adr;
18735 PRE_IO
18736 do
18737 {
18738 if (res & 1)
18739 {
18740 READSX_WORD_F(adr, *psrc)
18741 adr += 2;
18742 }
18743 psrc++;
18744 } while (res >>= 1);
18745 POST_IO
18746 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
18747#ifdef USE_CYCLONE_TIMING
18748RET(20)
18749#else
18750RET(32)
18751#endif
18752}
18753
18754// MOVEMaR
18755OPCODE(0x4CBA)
18756{
18757 u32 adr, res;
18758 u32 src, dst;
18759
18760 s32 *psrc;
18761
18762 FETCH_WORD(res);
be26eb23 18763 adr = GET_SWORD + GET_PC;
70357ce5 18764 PC++;
18765 psrc = &DREGs32(0);
18766 dst = adr;
18767 PRE_IO
18768 do
18769 {
18770 if (res & 1)
18771 {
18772 READSX_WORD_F(adr, *psrc)
18773 adr += 2;
18774 }
18775 psrc++;
18776 } while (res >>= 1);
18777 POST_IO
18778 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
18779#ifdef USE_CYCLONE_TIMING
18780RET(16)
18781#else
18782RET(24)
18783#endif
18784}
18785
18786// MOVEMaR
18787OPCODE(0x4CBB)
18788{
18789 u32 adr, res;
18790 u32 src, dst;
18791
18792 s32 *psrc;
18793
18794 FETCH_WORD(res);
be26eb23 18795 adr = GET_PC;
70357ce5 18796 DECODE_EXT_WORD
18797 psrc = &DREGs32(0);
18798 dst = adr;
18799 PRE_IO
18800 do
18801 {
18802 if (res & 1)
18803 {
18804 READSX_WORD_F(adr, *psrc)
18805 adr += 2;
18806 }
18807 psrc++;
18808 } while (res >>= 1);
18809 POST_IO
18810 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
18811#ifdef USE_CYCLONE_TIMING
18812RET(18)
18813#else
18814RET(28)
18815#endif
18816}
18817
18818// MOVEMaR
18819OPCODE(0x4C9F)
18820{
18821 u32 adr, res;
18822 u32 src, dst;
18823
18824 s32 *psrc;
18825
18826 FETCH_WORD(res);
18827 adr = AREG(7);
18828 psrc = &DREGs32(0);
18829 dst = adr;
18830 PRE_IO
18831 do
18832 {
18833 if (res & 1)
18834 {
18835 READSX_WORD_F(adr, *psrc)
18836 adr += 2;
18837 }
18838 psrc++;
18839 } while (res >>= 1);
18840 AREG(7) = adr;
18841 POST_IO
18842 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
18843RET(12)
18844}
18845
18846// MOVEMaR
18847OPCODE(0x4CD0)
18848{
18849 u32 adr, res;
18850 u32 src, dst;
18851
18852 u32 *psrc;
18853
18854 FETCH_WORD(res);
18855 adr = AREG((Opcode >> 0) & 7);
18856 psrc = &DREGu32(0);
18857 dst = adr;
18858 PRE_IO
18859 do
18860 {
18861 if (res & 1)
18862 {
18863 READ_LONG_F(adr, *psrc)
18864 adr += 4;
18865 }
18866 psrc++;
18867 } while (res >>= 1);
18868 POST_IO
18869 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
18870#ifdef USE_CYCLONE_TIMING
18871RET(12)
18872#else
18873RET(20)
18874#endif
18875}
18876
18877// MOVEMaR
18878OPCODE(0x4CD8)
18879{
18880 u32 adr, res;
18881 u32 src, dst;
18882
18883 u32 *psrc;
18884
18885 FETCH_WORD(res);
18886 adr = AREG((Opcode >> 0) & 7);
18887 psrc = &DREGu32(0);
18888 dst = adr;
18889 PRE_IO
18890 do
18891 {
18892 if (res & 1)
18893 {
18894 READ_LONG_F(adr, *psrc)
18895 adr += 4;
18896 }
18897 psrc++;
18898 } while (res >>= 1);
18899 AREG((Opcode >> 0) & 7) = adr;
18900 POST_IO
18901 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
18902RET(12)
18903}
18904
18905// MOVEMaR
18906OPCODE(0x4CE8)
18907{
18908 u32 adr, res;
18909 u32 src, dst;
18910
18911 u32 *psrc;
18912
18913 FETCH_WORD(res);
18914 FETCH_SWORD(adr);
18915 adr += AREG((Opcode >> 0) & 7);
18916 psrc = &DREGu32(0);
18917 dst = adr;
18918 PRE_IO
18919 do
18920 {
18921 if (res & 1)
18922 {
18923 READ_LONG_F(adr, *psrc)
18924 adr += 4;
18925 }
18926 psrc++;
18927 } while (res >>= 1);
18928 POST_IO
18929 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
18930#ifdef USE_CYCLONE_TIMING
18931RET(16)
18932#else
18933RET(28)
18934#endif
18935}
18936
18937// MOVEMaR
18938OPCODE(0x4CF0)
18939{
18940 u32 adr, res;
18941 u32 src, dst;
18942
18943 u32 *psrc;
18944
18945 FETCH_WORD(res);
18946 adr = AREG((Opcode >> 0) & 7);
18947 DECODE_EXT_WORD
18948 psrc = &DREGu32(0);
18949 dst = adr;
18950 PRE_IO
18951 do
18952 {
18953 if (res & 1)
18954 {
18955 READ_LONG_F(adr, *psrc)
18956 adr += 4;
18957 }
18958 psrc++;
18959 } while (res >>= 1);
18960 POST_IO
18961 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
18962#ifdef USE_CYCLONE_TIMING
18963RET(18)
18964#else
18965RET(32)
18966#endif
18967}
18968
18969// MOVEMaR
18970OPCODE(0x4CF8)
18971{
18972 u32 adr, res;
18973 u32 src, dst;
18974
18975 u32 *psrc;
18976
18977 FETCH_WORD(res);
18978 FETCH_SWORD(adr);
18979 psrc = &DREGu32(0);
18980 dst = adr;
18981 PRE_IO
18982 do
18983 {
18984 if (res & 1)
18985 {
18986 READ_LONG_F(adr, *psrc)
18987 adr += 4;
18988 }
18989 psrc++;
18990 } while (res >>= 1);
18991 POST_IO
18992 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
18993#ifdef USE_CYCLONE_TIMING
18994RET(16)
18995#else
18996RET(28)
18997#endif
18998}
18999
19000// MOVEMaR
19001OPCODE(0x4CF9)
19002{
19003 u32 adr, res;
19004 u32 src, dst;
19005
19006 u32 *psrc;
19007
19008 FETCH_WORD(res);
19009 FETCH_LONG(adr);
19010 psrc = &DREGu32(0);
19011 dst = adr;
19012 PRE_IO
19013 do
19014 {
19015 if (res & 1)
19016 {
19017 READ_LONG_F(adr, *psrc)
19018 adr += 4;
19019 }
19020 psrc++;
19021 } while (res >>= 1);
19022 POST_IO
19023 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
19024#ifdef USE_CYCLONE_TIMING
19025RET(20)
19026#else
19027RET(36)
19028#endif
19029}
19030
19031// MOVEMaR
19032OPCODE(0x4CFA)
19033{
19034 u32 adr, res;
19035 u32 src, dst;
19036
19037 u32 *psrc;
19038
19039 FETCH_WORD(res);
be26eb23 19040 adr = GET_SWORD + GET_PC;
70357ce5 19041 PC++;
19042 psrc = &DREGu32(0);
19043 dst = adr;
19044 PRE_IO
19045 do
19046 {
19047 if (res & 1)
19048 {
19049 READ_LONG_F(adr, *psrc)
19050 adr += 4;
19051 }
19052 psrc++;
19053 } while (res >>= 1);
19054 POST_IO
19055 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
19056#ifdef USE_CYCLONE_TIMING
19057RET(16)
19058#else
19059RET(28)
19060#endif
19061}
19062
19063// MOVEMaR
19064OPCODE(0x4CFB)
19065{
19066 u32 adr, res;
19067 u32 src, dst;
19068
19069 u32 *psrc;
19070
19071 FETCH_WORD(res);
be26eb23 19072 adr = GET_PC;
70357ce5 19073 DECODE_EXT_WORD
19074 psrc = &DREGu32(0);
19075 dst = adr;
19076 PRE_IO
19077 do
19078 {
19079 if (res & 1)
19080 {
19081 READ_LONG_F(adr, *psrc)
19082 adr += 4;
19083 }
19084 psrc++;
19085 } while (res >>= 1);
19086 POST_IO
19087 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
19088#ifdef USE_CYCLONE_TIMING
19089RET(18)
19090#else
19091RET(32)
19092#endif
19093}
19094
19095// MOVEMaR
19096OPCODE(0x4CDF)
19097{
19098 u32 adr, res;
19099 u32 src, dst;
19100
19101 u32 *psrc;
19102
19103 FETCH_WORD(res);
19104 adr = AREG(7);
19105 psrc = &DREGu32(0);
19106 dst = adr;
19107 PRE_IO
19108 do
19109 {
19110 if (res & 1)
19111 {
19112 READ_LONG_F(adr, *psrc)
19113 adr += 4;
19114 }
19115 psrc++;
19116 } while (res >>= 1);
19117 AREG(7) = adr;
19118 POST_IO
19119 m68kcontext.io_cycle_counter -= (adr - dst) * 2;
19120RET(12)
19121}
19122
19123// TRAP
19124OPCODE(0x4E40)
19125{
d0ae0cb4 19126 SET_PC(execute_exception(M68K_TRAP_BASE_EX + (Opcode & 0xF), GET_PC, GET_SR));
70357ce5 19127RET(4)
19128}
19129
19130// LINK
19131OPCODE(0x4E50)
19132{
19133 u32 adr, res;
19134 u32 src, dst;
19135
19136 res = AREGu32((Opcode >> 0) & 7);
19137 PRE_IO
19138 PUSH_32_F(res)
19139 res = AREG(7);
19140 AREG((Opcode >> 0) & 7) = res;
19141 FETCH_SWORD(res);
19142 AREG(7) += res;
19143 POST_IO
19144RET(16)
19145}
19146
19147// LINKA7
19148OPCODE(0x4E57)
19149{
19150 u32 adr, res;
19151 u32 src, dst;
19152
19153 AREG(7) -= 4;
19154 PRE_IO
19155 WRITE_LONG_DEC_F(AREG(7), AREG(7))
19156 FETCH_SWORD(res);
19157 AREG(7) += res;
19158 POST_IO
19159RET(16)
19160}
19161
19162// ULNK
19163OPCODE(0x4E58)
19164{
19165 u32 adr, res;
19166 u32 src, dst;
19167
19168 src = AREGu32((Opcode >> 0) & 7);
19169 AREG(7) = src + 4;
19170 PRE_IO
19171 READ_LONG_F(src, res)
19172 AREG((Opcode >> 0) & 7) = res;
19173 POST_IO
19174RET(12)
19175}
19176
19177// ULNKA7
19178OPCODE(0x4E5F)
19179{
19180 u32 adr, res;
19181 u32 src, dst;
19182
19183 PRE_IO
19184 READ_LONG_F(AREG(7), AREG(7))
19185 POST_IO
19186RET(12)
19187}
19188
19189// MOVEAUSP
19190OPCODE(0x4E60)
19191{
19192 u32 adr, res;
19193 u32 src, dst;
19194
19195 if (!flag_S)
19196 {
d0ae0cb4 19197 SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
70357ce5 19198 RET(4)
19199 }
19200 res = AREGu32((Opcode >> 0) & 7);
19201 ASP = res;
19202RET(4)
19203}
19204
19205// MOVEUSPA
19206OPCODE(0x4E68)
19207{
19208 u32 adr, res;
19209 u32 src, dst;
19210
19211 if (!flag_S)
19212 {
d0ae0cb4 19213 SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
70357ce5 19214 RET(4)
19215 }
19216 res = ASP;
19217 AREG((Opcode >> 0) & 7) = res;
19218RET(4)
19219}
19220
19221// RESET
19222OPCODE(0x4E70)
19223{
19224 u32 adr, res;
19225 u32 src, dst;
19226
19227 if (!flag_S)
19228 {
d0ae0cb4 19229 SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
70357ce5 19230 RET(4)
19231 }
19232 PRE_IO
19233 if (m68kcontext.reset_handler) m68kcontext.reset_handler();
19234// CPU->Reset_CallBack();
19235 POST_IO
19236RET(132)
19237}
19238
19239// NOP
19240OPCODE(0x4E71)
19241{
19242RET(4)
19243}
19244
19245// STOP
19246OPCODE(0x4E72)
19247{
19248 u32 adr, res;
19249 u32 src, dst;
19250
19251 if (!flag_S)
19252 {
d0ae0cb4 19253 SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
70357ce5 19254 RET(4)
19255 }
19256 FETCH_WORD(res);
19257 res &= M68K_SR_MASK;
19258 SET_SR(res)
19259 if (!flag_S)
19260 {
19261 res = AREG(7);
19262 AREG(7) = ASP;
19263 ASP = res;
19264 }
03e4f2a3 19265 m68kcontext.execinfo |= FM68K_HALTED;
fcf94fcc 19266RET0()
70357ce5 19267}
19268
19269// RTE
19270OPCODE(0x4E73)
19271{
19272 u32 adr, res;
19273 u32 src, dst;
19274
19275 if (!flag_S)
19276 {
d0ae0cb4 19277 SET_PC(execute_exception(M68K_PRIVILEGE_VIOLATION_EX, GET_PC-2, GET_SR));
70357ce5 19278 RET(4)
19279 }
19280 PRE_IO
19281 POP_16_F(res)
19282 SET_SR(res)
19283 POP_32_F(res)
19284 SET_PC(res)
19285 if (!flag_S)
19286 {
19287 res = AREG(7);
19288 AREG(7) = ASP;
19289 ASP = res;
19290 }
19291 POST_IO
03e4f2a3 19292 m68kcontext.execinfo &= ~(FM68K_EMULATE_GROUP_0|FM68K_EMULATE_TRACE|FM68K_DO_TRACE);
70357ce5 19293 CHECK_INT_TO_JUMP(20)
19294RET(20)
19295}
19296
19297// RTS
19298OPCODE(0x4E75)
19299{
19300 u32 adr, res;
19301 u32 src, dst;
19302
19303 PRE_IO
19304 POP_32_F(res)
19305 SET_PC(res)
19306 CHECK_BRANCH_EXCEPTION(res)
19307 POST_IO
19308RET(16)
19309}
19310
19311// TRAPV
19312OPCODE(0x4E76)
19313{
19314 if (flag_V & 0x80)
d0ae0cb4 19315 SET_PC(execute_exception(M68K_TRAPV_EX, GET_PC, GET_SR));
70357ce5 19316RET(4)
19317}
19318
19319// RTR
19320OPCODE(0x4E77)
19321{
19322 u32 adr, res;
19323 u32 src, dst;
19324
19325 PRE_IO
19326 POP_16_F(res)
19327 SET_CCR(res)
19328 POP_32_F(res)
19329 SET_PC(res)
19330 CHECK_BRANCH_EXCEPTION(res)
19331 POST_IO
19332RET(20)
19333}
19334
19335// JSR
19336OPCODE(0x4E90)
19337{
19338 u32 adr, res;
19339 u32 src, dst;
19340
19341 adr = AREG((Opcode >> 0) & 7);
19342 {
19343 u32 oldPC;
19344
be26eb23 19345 oldPC = GET_PC;
70357ce5 19346 PRE_IO
19347 PUSH_32_F(oldPC)
19348 }
19349 SET_PC(adr)
19350 CHECK_BRANCH_EXCEPTION(adr)
19351 POST_IO
19352RET(16)
19353}
19354
19355// JSR
19356OPCODE(0x4EA8)
19357{
19358 u32 adr, res;
19359 u32 src, dst;
19360
19361 FETCH_SWORD(adr);
19362 adr += AREG((Opcode >> 0) & 7);
19363 {
19364 u32 oldPC;
19365
be26eb23 19366 oldPC = GET_PC;
70357ce5 19367 PRE_IO
19368 PUSH_32_F(oldPC)
19369 }
19370 SET_PC(adr)
19371 CHECK_BRANCH_EXCEPTION(adr)
19372 POST_IO
19373RET(18)
19374}
19375
19376// JSR
19377OPCODE(0x4EB0)
19378{
19379 u32 adr, res;
19380 u32 src, dst;
19381
19382 adr = AREG((Opcode >> 0) & 7);
19383 DECODE_EXT_WORD
19384 {
19385 u32 oldPC;
19386
be26eb23 19387 oldPC = GET_PC;
70357ce5 19388 PRE_IO
19389 PUSH_32_F(oldPC)
19390 }
19391 SET_PC(adr)
19392 CHECK_BRANCH_EXCEPTION(adr)
19393 POST_IO
19394RET(22)
19395}
19396
19397// JSR
19398OPCODE(0x4EB8)
19399{
19400 u32 adr, res;
19401 u32 src, dst;
19402
19403 FETCH_SWORD(adr);
19404 {
19405 u32 oldPC;
19406
be26eb23 19407 oldPC = GET_PC;
70357ce5 19408 PRE_IO
19409 PUSH_32_F(oldPC)
19410 }
19411 SET_PC(adr)
19412 CHECK_BRANCH_EXCEPTION(adr)
19413 POST_IO
19414RET(18)
19415}
19416
19417// JSR
19418OPCODE(0x4EB9)
19419{
19420 u32 adr, res;
19421 u32 src, dst;
19422
19423 FETCH_LONG(adr);
19424 {
19425 u32 oldPC;
19426
be26eb23 19427 oldPC = GET_PC;
70357ce5 19428 PRE_IO
19429 PUSH_32_F(oldPC)
19430 }
19431 SET_PC(adr)
19432 CHECK_BRANCH_EXCEPTION(adr)
19433 POST_IO
19434RET(20)
19435}
19436
19437// JSR
19438OPCODE(0x4EBA)
19439{
19440 u32 adr, res;
19441 u32 src, dst;
19442
be26eb23 19443 adr = GET_SWORD + GET_PC;
70357ce5 19444 PC++;
19445 {
19446 u32 oldPC;
19447
be26eb23 19448 oldPC = GET_PC;
70357ce5 19449 PRE_IO
19450 PUSH_32_F(oldPC)
19451 }
19452 SET_PC(adr)
19453 CHECK_BRANCH_EXCEPTION(adr)
19454 POST_IO
19455RET(18)
19456}
19457
19458// JSR
19459OPCODE(0x4EBB)
19460{
19461 u32 adr, res;
19462 u32 src, dst;
19463
be26eb23 19464 adr = GET_PC;
70357ce5 19465 DECODE_EXT_WORD
19466 {
19467 u32 oldPC;
19468
be26eb23 19469 oldPC = GET_PC;
70357ce5 19470 PRE_IO
19471 PUSH_32_F(oldPC)
19472 }
19473 SET_PC(adr)
19474 CHECK_BRANCH_EXCEPTION(adr)
19475 POST_IO
19476RET(22)
19477}
19478
19479// JMP
19480OPCODE(0x4ED0)
19481{
19482 u32 adr, res;
19483 u32 src, dst;
19484
19485 adr = AREG((Opcode >> 0) & 7);
19486 SET_PC(adr)
19487 CHECK_BRANCH_EXCEPTION(adr)
19488RET(8)
19489}
19490
19491// JMP
19492OPCODE(0x4EE8)
19493{
19494 u32 adr, res;
19495 u32 src, dst;
19496
19497 FETCH_SWORD(adr);
19498 adr += AREG((Opcode >> 0) & 7);
19499 SET_PC(adr)
19500 CHECK_BRANCH_EXCEPTION(adr)
19501RET(10)
19502}
19503
19504// JMP
19505OPCODE(0x4EF0)
19506{
19507 u32 adr, res;
19508 u32 src, dst;
19509
19510 adr = AREG((Opcode >> 0) & 7);
19511 DECODE_EXT_WORD
19512 SET_PC(adr)
19513 CHECK_BRANCH_EXCEPTION(adr)
19514RET(14)
19515}
19516
19517// JMP
19518OPCODE(0x4EF8)
19519{
19520 u32 adr, res;
19521 u32 src, dst;
19522
19523 FETCH_SWORD(adr);
19524 SET_PC(adr)
19525 CHECK_BRANCH_EXCEPTION(adr)
19526RET(10)
19527}
19528
19529// JMP
19530OPCODE(0x4EF9)
19531{
19532 u32 adr, res;
19533 u32 src, dst;
19534
19535 FETCH_LONG(adr);
19536 SET_PC(adr)
19537 CHECK_BRANCH_EXCEPTION(adr)
19538RET(12)
19539}
19540
19541// JMP
19542OPCODE(0x4EFA)
19543{
19544 u32 adr, res;
19545 u32 src, dst;
19546
be26eb23 19547 adr = GET_SWORD + GET_PC;
70357ce5 19548 PC++;
19549 SET_PC(adr)
19550 CHECK_BRANCH_EXCEPTION(adr)
19551RET(10)
19552}
19553
19554// JMP
19555OPCODE(0x4EFB)
19556{
19557 u32 adr, res;
19558 u32 src, dst;
19559
be26eb23 19560 adr = GET_PC;
70357ce5 19561 DECODE_EXT_WORD
19562 SET_PC(adr)
19563 CHECK_BRANCH_EXCEPTION(adr)
19564RET(14)
19565}
19566
19567// CHK
19568OPCODE(0x4180)
19569{
19570 u32 adr, res;
19571 u32 src, dst;
19572
19573 src = DREGu16((Opcode >> 0) & 7);
19574 res = DREGu16((Opcode >> 9) & 7);
19575 if (((s32)res < 0) || (res > src))
19576 {
19577 flag_N = res >> 8;
d0ae0cb4 19578 SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
70357ce5 19579 }
19580RET(10)
19581}
19582
19583// CHK
19584OPCODE(0x4190)
19585{
19586 u32 adr, res;
19587 u32 src, dst;
19588
19589 adr = AREG((Opcode >> 0) & 7);
19590 PRE_IO
19591 READ_WORD_F(adr, src)
19592 res = DREGu16((Opcode >> 9) & 7);
19593 if (((s32)res < 0) || (res > src))
19594 {
19595 flag_N = res >> 8;
d0ae0cb4 19596 SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
70357ce5 19597 }
19598 POST_IO
19599RET(14)
19600}
19601
19602// CHK
19603OPCODE(0x4198)
19604{
19605 u32 adr, res;
19606 u32 src, dst;
19607
19608 adr = AREG((Opcode >> 0) & 7);
19609 AREG((Opcode >> 0) & 7) += 2;
19610 PRE_IO
19611 READ_WORD_F(adr, src)
19612 res = DREGu16((Opcode >> 9) & 7);
19613 if (((s32)res < 0) || (res > src))
19614 {
19615 flag_N = res >> 8;
d0ae0cb4 19616 SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
70357ce5 19617 }
19618 POST_IO
19619RET(14)
19620}
19621
19622// CHK
19623OPCODE(0x41A0)
19624{
19625 u32 adr, res;
19626 u32 src, dst;
19627
19628 adr = AREG((Opcode >> 0) & 7) - 2;
19629 AREG((Opcode >> 0) & 7) = adr;
19630 PRE_IO
19631 READ_WORD_F(adr, src)
19632 res = DREGu16((Opcode >> 9) & 7);
19633 if (((s32)res < 0) || (res > src))
19634 {
19635 flag_N = res >> 8;
d0ae0cb4 19636 SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
70357ce5 19637 }
19638 POST_IO
19639RET(16)
19640}
19641
19642// CHK
19643OPCODE(0x41A8)
19644{
19645 u32 adr, res;
19646 u32 src, dst;
19647
19648 FETCH_SWORD(adr);
19649 adr += AREG((Opcode >> 0) & 7);
19650 PRE_IO
19651 READ_WORD_F(adr, src)
19652 res = DREGu16((Opcode >> 9) & 7);
19653 if (((s32)res < 0) || (res > src))
19654 {
19655 flag_N = res >> 8;
d0ae0cb4 19656 SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
70357ce5 19657 }
19658 POST_IO
19659RET(18)
19660}
19661
19662// CHK
19663OPCODE(0x41B0)
19664{
19665 u32 adr, res;
19666 u32 src, dst;
19667
19668 adr = AREG((Opcode >> 0) & 7);
19669 DECODE_EXT_WORD
19670 PRE_IO
19671 READ_WORD_F(adr, src)
19672 res = DREGu16((Opcode >> 9) & 7);
19673 if (((s32)res < 0) || (res > src))
19674 {
19675 flag_N = res >> 8;
d0ae0cb4 19676 SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
70357ce5 19677 }
19678 POST_IO
19679RET(20)
19680}
19681
19682// CHK
19683OPCODE(0x41B8)
19684{
19685 u32 adr, res;
19686 u32 src, dst;
19687
19688 FETCH_SWORD(adr);
19689 PRE_IO
19690 READ_WORD_F(adr, src)
19691 res = DREGu16((Opcode >> 9) & 7);
19692 if (((s32)res < 0) || (res > src))
19693 {
19694 flag_N = res >> 8;
d0ae0cb4 19695 SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
70357ce5 19696 }
19697 POST_IO
19698RET(18)
19699}
19700
19701// CHK
19702OPCODE(0x41B9)
19703{
19704 u32 adr, res;
19705 u32 src, dst;
19706
19707 FETCH_LONG(adr);
19708 PRE_IO
19709 READ_WORD_F(adr, src)
19710 res = DREGu16((Opcode >> 9) & 7);
19711 if (((s32)res < 0) || (res > src))
19712 {
19713 flag_N = res >> 8;
d0ae0cb4 19714 SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
70357ce5 19715 }
19716 POST_IO
19717RET(22)
19718}
19719
19720// CHK
19721OPCODE(0x41BA)
19722{
19723 u32 adr, res;
19724 u32 src, dst;
19725
be26eb23 19726 adr = GET_SWORD + GET_PC;
70357ce5 19727 PC++;
19728 PRE_IO
19729 READ_WORD_F(adr, src)
19730 res = DREGu16((Opcode >> 9) & 7);
19731 if (((s32)res < 0) || (res > src))
19732 {
19733 flag_N = res >> 8;
d0ae0cb4 19734 SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
70357ce5 19735 }
19736 POST_IO
19737RET(18)
19738}
19739
19740// CHK
19741OPCODE(0x41BB)
19742{
19743 u32 adr, res;
19744 u32 src, dst;
19745
be26eb23 19746 adr = GET_PC;
70357ce5 19747 DECODE_EXT_WORD
19748 PRE_IO
19749 READ_WORD_F(adr, src)
19750 res = DREGu16((Opcode >> 9) & 7);
19751 if (((s32)res < 0) || (res > src))
19752 {
19753 flag_N = res >> 8;
d0ae0cb4 19754 SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
70357ce5 19755 }
19756 POST_IO
19757RET(20)
19758}
19759
19760// CHK
19761OPCODE(0x41BC)
19762{
19763 u32 adr, res;
19764 u32 src, dst;
19765
19766 FETCH_WORD(src);
19767 res = DREGu16((Opcode >> 9) & 7);
19768 if (((s32)res < 0) || (res > src))
19769 {
19770 flag_N = res >> 8;
d0ae0cb4 19771 SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
70357ce5 19772 }
19773 POST_IO
19774RET(14)
19775}
19776
19777// CHK
19778OPCODE(0x419F)
19779{
19780 u32 adr, res;
19781 u32 src, dst;
19782
19783 adr = AREG(7);
19784 AREG(7) += 2;
19785 PRE_IO
19786 READ_WORD_F(adr, src)
19787 res = DREGu16((Opcode >> 9) & 7);
19788 if (((s32)res < 0) || (res > src))
19789 {
19790 flag_N = res >> 8;
d0ae0cb4 19791 SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
70357ce5 19792 }
19793 POST_IO
19794RET(14)
19795}
19796
19797// CHK
19798OPCODE(0x41A7)
19799{
19800 u32 adr, res;
19801 u32 src, dst;
19802
19803 adr = AREG(7) - 2;
19804 AREG(7) = adr;
19805 PRE_IO
19806 READ_WORD_F(adr, src)
19807 res = DREGu16((Opcode >> 9) & 7);
19808 if (((s32)res < 0) || (res > src))
19809 {
19810 flag_N = res >> 8;
d0ae0cb4 19811 SET_PC(execute_exception(M68K_CHK_EX, GET_PC, GET_SR));
70357ce5 19812 }
19813 POST_IO
19814RET(16)
19815}
19816
19817// LEA
19818OPCODE(0x41D0)
19819{
19820 u32 adr, res;
19821 u32 src, dst;
19822
19823 adr = AREG((Opcode >> 0) & 7);
19824 res = adr;
19825 AREG((Opcode >> 9) & 7) = res;
19826RET(4)
19827}
19828
19829// LEA
19830OPCODE(0x41E8)
19831{
19832 u32 adr, res;
19833 u32 src, dst;
19834
19835 FETCH_SWORD(adr);
19836 adr += AREG((Opcode >> 0) & 7);
19837 res = adr;
19838 AREG((Opcode >> 9) & 7) = res;
19839RET(8)
19840}
19841
19842// LEA
19843OPCODE(0x41F0)
19844{
19845 u32 adr, res;
19846 u32 src, dst;
19847
19848 adr = AREG((Opcode >> 0) & 7);
19849 DECODE_EXT_WORD
19850 res = adr;
19851 AREG((Opcode >> 9) & 7) = res;
19852RET(12)
19853}
19854
19855// LEA
19856OPCODE(0x41F8)
19857{
19858 u32 adr, res;
19859 u32 src, dst;
19860
19861 FETCH_SWORD(adr);
19862 res = adr;
19863 AREG((Opcode >> 9) & 7) = res;
19864RET(8)
19865}
19866
19867// LEA
19868OPCODE(0x41F9)
19869{
19870 u32 adr, res;
19871 u32 src, dst;
19872
19873 FETCH_LONG(adr);
19874 res = adr;
19875 AREG((Opcode >> 9) & 7) = res;
19876RET(12)
19877}
19878
19879// LEA
19880OPCODE(0x41FA)
19881{
19882 u32 adr, res;
19883 u32 src, dst;
19884
be26eb23 19885 adr = GET_SWORD + GET_PC;
70357ce5 19886 PC++;
19887 res = adr;
19888 AREG((Opcode >> 9) & 7) = res;
19889RET(8)
19890}
19891
19892// LEA
19893OPCODE(0x41FB)
19894{
19895 u32 adr, res;
19896 u32 src, dst;
19897
be26eb23 19898 adr = GET_PC;
70357ce5 19899 DECODE_EXT_WORD
19900 res = adr;
19901 AREG((Opcode >> 9) & 7) = res;
19902RET(12)
19903}
19904
19905// STCC
19906OPCODE(0x50C0)
19907{
19908 u32 adr, res;
19909 u32 src, dst;
19910
19911 res = 0xFF;
19912 DREGu8((Opcode >> 0) & 7) = res;
19913 RET(6)
19914}
19915
19916// STCC
19917OPCODE(0x51C0)
19918{
19919 u32 adr, res;
19920 u32 src, dst;
19921
19922 res = 0;
19923 DREGu8((Opcode >> 0) & 7) = res;
19924 RET(4)
19925}
19926
19927// STCC
19928OPCODE(0x52C0)
19929{
19930 u32 adr, res;
19931 u32 src, dst;
19932
19933 if (flag_NotZ && (!(flag_C & 0x100)))
19934 {
19935 res = 0xFF;
19936 DREGu8((Opcode >> 0) & 7) = res;
19937 RET(6)
19938 }
19939 res = 0;
19940 DREGu8((Opcode >> 0) & 7) = res;
19941 RET(4)
19942}
19943
19944// STCC
19945OPCODE(0x53C0)
19946{
19947 u32 adr, res;
19948 u32 src, dst;
19949
19950 if ((!flag_NotZ) || (flag_C & 0x100))
19951 {
19952 res = 0xFF;
19953 DREGu8((Opcode >> 0) & 7) = res;
19954 RET(6)
19955 }
19956 res = 0;
19957 DREGu8((Opcode >> 0) & 7) = res;
19958 RET(4)
19959}
19960
19961// STCC
19962OPCODE(0x54C0)
19963{
19964 u32 adr, res;
19965 u32 src, dst;
19966
19967 if (!(flag_C & 0x100))
19968 {
19969 res = 0xFF;
19970 DREGu8((Opcode >> 0) & 7) = res;
19971 RET(6)
19972 }
19973 res = 0;
19974 DREGu8((Opcode >> 0) & 7) = res;
19975 RET(4)
19976}
19977
19978// STCC
19979OPCODE(0x55C0)
19980{
19981 u32 adr, res;
19982 u32 src, dst;
19983
19984 if (flag_C & 0x100)
19985 {
19986 res = 0xFF;
19987 DREGu8((Opcode >> 0) & 7) = res;
19988 RET(6)
19989 }
19990 res = 0;
19991 DREGu8((Opcode >> 0) & 7) = res;
19992 RET(4)
19993}
19994
19995// STCC
19996OPCODE(0x56C0)
19997{
19998 u32 adr, res;
19999 u32 src, dst;
20000
20001 if (flag_NotZ)
20002 {
20003 res = 0xFF;
20004 DREGu8((Opcode >> 0) & 7) = res;
20005 RET(6)
20006 }
20007 res = 0;
20008 DREGu8((Opcode >> 0) & 7) = res;
20009 RET(4)
20010}
20011
20012// STCC
20013OPCODE(0x57C0)
20014{
20015 u32 adr, res;
20016 u32 src, dst;
20017
20018 if (!flag_NotZ)
20019 {
20020 res = 0xFF;
20021 DREGu8((Opcode >> 0) & 7) = res;
20022 RET(6)
20023 }
20024 res = 0;
20025 DREGu8((Opcode >> 0) & 7) = res;
20026 RET(4)
20027}
20028
20029// STCC
20030OPCODE(0x58C0)
20031{
20032 u32 adr, res;
20033 u32 src, dst;
20034
20035 if (!(flag_V & 0x80))
20036 {
20037 res = 0xFF;
20038 DREGu8((Opcode >> 0) & 7) = res;
20039 RET(6)
20040 }
20041 res = 0;
20042 DREGu8((Opcode >> 0) & 7) = res;
20043 RET(4)
20044}
20045
20046// STCC
20047OPCODE(0x59C0)
20048{
20049 u32 adr, res;
20050 u32 src, dst;
20051
20052 if (flag_V & 0x80)
20053 {
20054 res = 0xFF;
20055 DREGu8((Opcode >> 0) & 7) = res;
20056 RET(6)
20057 }
20058 res = 0;
20059 DREGu8((Opcode >> 0) & 7) = res;
20060 RET(4)
20061}
20062
20063// STCC
20064OPCODE(0x5AC0)
20065{
20066 u32 adr, res;
20067 u32 src, dst;
20068
20069 if (!(flag_N & 0x80))
20070 {
20071 res = 0xFF;
20072 DREGu8((Opcode >> 0) & 7) = res;
20073 RET(6)
20074 }
20075 res = 0;
20076 DREGu8((Opcode >> 0) & 7) = res;
20077 RET(4)
20078}
20079
20080// STCC
20081OPCODE(0x5BC0)
20082{
20083 u32 adr, res;
20084 u32 src, dst;
20085
20086 if (flag_N & 0x80)
20087 {
20088 res = 0xFF;
20089 DREGu8((Opcode >> 0) & 7) = res;
20090 RET(6)
20091 }
20092 res = 0;
20093 DREGu8((Opcode >> 0) & 7) = res;
20094 RET(4)
20095}
20096
20097// STCC
20098OPCODE(0x5CC0)
20099{
20100 u32 adr, res;
20101 u32 src, dst;
20102
20103 if (!((flag_N ^ flag_V) & 0x80))
20104 {
20105 res = 0xFF;
20106 DREGu8((Opcode >> 0) & 7) = res;
20107 RET(6)
20108 }
20109 res = 0;
20110 DREGu8((Opcode >> 0) & 7) = res;
20111 RET(4)
20112}
20113
20114// STCC
20115OPCODE(0x5DC0)
20116{
20117 u32 adr, res;
20118 u32 src, dst;
20119
20120 if ((flag_N ^ flag_V) & 0x80)
20121 {
20122 res = 0xFF;
20123 DREGu8((Opcode >> 0) & 7) = res;
20124 RET(6)
20125 }
20126 res = 0;
20127 DREGu8((Opcode >> 0) & 7) = res;
20128 RET(4)
20129}
20130
20131// STCC
20132OPCODE(0x5EC0)
20133{
20134 u32 adr, res;
20135 u32 src, dst;
20136
20137 if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
20138 {
20139 res = 0xFF;
20140 DREGu8((Opcode >> 0) & 7) = res;
20141 RET(6)
20142 }
20143 res = 0;
20144 DREGu8((Opcode >> 0) & 7) = res;
20145 RET(4)
20146}
20147
20148// STCC
20149OPCODE(0x5FC0)
20150{
20151 u32 adr, res;
20152 u32 src, dst;
20153
20154 if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
20155 {
20156 res = 0xFF;
20157 DREGu8((Opcode >> 0) & 7) = res;
20158 RET(6)
20159 }
20160 res = 0;
20161 DREGu8((Opcode >> 0) & 7) = res;
20162 RET(4)
20163}
20164
20165// STCC
20166OPCODE(0x50D0)
20167{
20168 u32 adr, res;
20169 u32 src, dst;
20170
20171 adr = AREG((Opcode >> 0) & 7);
20172 res = 0xFF;
20173 PRE_IO
20174 WRITE_BYTE_F(adr, res)
20175 POST_IO
20176 RET(12)
20177}
20178
20179// STCC
20180OPCODE(0x51D0)
20181{
20182 u32 adr, res;
20183 u32 src, dst;
20184
20185 adr = AREG((Opcode >> 0) & 7);
20186 res = 0;
20187 PRE_IO
20188 WRITE_BYTE_F(adr, res)
20189 POST_IO
20190 RET(12)
20191}
20192
20193// STCC
20194OPCODE(0x52D0)
20195{
20196 u32 adr, res;
20197 u32 src, dst;
20198
20199 adr = AREG((Opcode >> 0) & 7);
20200 if (flag_NotZ && (!(flag_C & 0x100)))
20201 {
20202 res = 0xFF;
20203 PRE_IO
20204 WRITE_BYTE_F(adr, res)
20205 POST_IO
20206 RET(12)
20207 }
20208 res = 0;
20209 PRE_IO
20210 WRITE_BYTE_F(adr, res)
20211 POST_IO
20212 RET(12)
20213}
20214
20215// STCC
20216OPCODE(0x53D0)
20217{
20218 u32 adr, res;
20219 u32 src, dst;
20220
20221 adr = AREG((Opcode >> 0) & 7);
20222 if ((!flag_NotZ) || (flag_C & 0x100))
20223 {
20224 res = 0xFF;
20225 PRE_IO
20226 WRITE_BYTE_F(adr, res)
20227 POST_IO
20228 RET(12)
20229 }
20230 res = 0;
20231 PRE_IO
20232 WRITE_BYTE_F(adr, res)
20233 POST_IO
20234 RET(12)
20235}
20236
20237// STCC
20238OPCODE(0x54D0)
20239{
20240 u32 adr, res;
20241 u32 src, dst;
20242
20243 adr = AREG((Opcode >> 0) & 7);
20244 if (!(flag_C & 0x100))
20245 {
20246 res = 0xFF;
20247 PRE_IO
20248 WRITE_BYTE_F(adr, res)
20249 POST_IO
20250 RET(12)
20251 }
20252 res = 0;
20253 PRE_IO
20254 WRITE_BYTE_F(adr, res)
20255 POST_IO
20256 RET(12)
20257}
20258
20259// STCC
20260OPCODE(0x55D0)
20261{
20262 u32 adr, res;
20263 u32 src, dst;
20264
20265 adr = AREG((Opcode >> 0) & 7);
20266 if (flag_C & 0x100)
20267 {
20268 res = 0xFF;
20269 PRE_IO
20270 WRITE_BYTE_F(adr, res)
20271 POST_IO
20272 RET(12)
20273 }
20274 res = 0;
20275 PRE_IO
20276 WRITE_BYTE_F(adr, res)
20277 POST_IO
20278 RET(12)
20279}
20280
20281// STCC
20282OPCODE(0x56D0)
20283{
20284 u32 adr, res;
20285 u32 src, dst;
20286
20287 adr = AREG((Opcode >> 0) & 7);
20288 if (flag_NotZ)
20289 {
20290 res = 0xFF;
20291 PRE_IO
20292 WRITE_BYTE_F(adr, res)
20293 POST_IO
20294 RET(12)
20295 }
20296 res = 0;
20297 PRE_IO
20298 WRITE_BYTE_F(adr, res)
20299 POST_IO
20300 RET(12)
20301}
20302
20303// STCC
20304OPCODE(0x57D0)
20305{
20306 u32 adr, res;
20307 u32 src, dst;
20308
20309 adr = AREG((Opcode >> 0) & 7);
20310 if (!flag_NotZ)
20311 {
20312 res = 0xFF;
20313 PRE_IO
20314 WRITE_BYTE_F(adr, res)
20315 POST_IO
20316 RET(12)
20317 }
20318 res = 0;
20319 PRE_IO
20320 WRITE_BYTE_F(adr, res)
20321 POST_IO
20322 RET(12)
20323}
20324
20325// STCC
20326OPCODE(0x58D0)
20327{
20328 u32 adr, res;
20329 u32 src, dst;
20330
20331 adr = AREG((Opcode >> 0) & 7);
20332 if (!(flag_V & 0x80))
20333 {
20334 res = 0xFF;
20335 PRE_IO
20336 WRITE_BYTE_F(adr, res)
20337 POST_IO
20338 RET(12)
20339 }
20340 res = 0;
20341 PRE_IO
20342 WRITE_BYTE_F(adr, res)
20343 POST_IO
20344 RET(12)
20345}
20346
20347// STCC
20348OPCODE(0x59D0)
20349{
20350 u32 adr, res;
20351 u32 src, dst;
20352
20353 adr = AREG((Opcode >> 0) & 7);
20354 if (flag_V & 0x80)
20355 {
20356 res = 0xFF;
20357 PRE_IO
20358 WRITE_BYTE_F(adr, res)
20359 POST_IO
20360 RET(12)
20361 }
20362 res = 0;
20363 PRE_IO
20364 WRITE_BYTE_F(adr, res)
20365 POST_IO
20366 RET(12)
20367}
20368
20369// STCC
20370OPCODE(0x5AD0)
20371{
20372 u32 adr, res;
20373 u32 src, dst;
20374
20375 adr = AREG((Opcode >> 0) & 7);
20376 if (!(flag_N & 0x80))
20377 {
20378 res = 0xFF;
20379 PRE_IO
20380 WRITE_BYTE_F(adr, res)
20381 POST_IO
20382 RET(12)
20383 }
20384 res = 0;
20385 PRE_IO
20386 WRITE_BYTE_F(adr, res)
20387 POST_IO
20388 RET(12)
20389}
20390
20391// STCC
20392OPCODE(0x5BD0)
20393{
20394 u32 adr, res;
20395 u32 src, dst;
20396
20397 adr = AREG((Opcode >> 0) & 7);
20398 if (flag_N & 0x80)
20399 {
20400 res = 0xFF;
20401 PRE_IO
20402 WRITE_BYTE_F(adr, res)
20403 POST_IO
20404 RET(12)
20405 }
20406 res = 0;
20407 PRE_IO
20408 WRITE_BYTE_F(adr, res)
20409 POST_IO
20410 RET(12)
20411}
20412
20413// STCC
20414OPCODE(0x5CD0)
20415{
20416 u32 adr, res;
20417 u32 src, dst;
20418
20419 adr = AREG((Opcode >> 0) & 7);
20420 if (!((flag_N ^ flag_V) & 0x80))
20421 {
20422 res = 0xFF;
20423 PRE_IO
20424 WRITE_BYTE_F(adr, res)
20425 POST_IO
20426 RET(12)
20427 }
20428 res = 0;
20429 PRE_IO
20430 WRITE_BYTE_F(adr, res)
20431 POST_IO
20432 RET(12)
20433}
20434
20435// STCC
20436OPCODE(0x5DD0)
20437{
20438 u32 adr, res;
20439 u32 src, dst;
20440
20441 adr = AREG((Opcode >> 0) & 7);
20442 if ((flag_N ^ flag_V) & 0x80)
20443 {
20444 res = 0xFF;
20445 PRE_IO
20446 WRITE_BYTE_F(adr, res)
20447 POST_IO
20448 RET(12)
20449 }
20450 res = 0;
20451 PRE_IO
20452 WRITE_BYTE_F(adr, res)
20453 POST_IO
20454 RET(12)
20455}
20456
20457// STCC
20458OPCODE(0x5ED0)
20459{
20460 u32 adr, res;
20461 u32 src, dst;
20462
20463 adr = AREG((Opcode >> 0) & 7);
20464 if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
20465 {
20466 res = 0xFF;
20467 PRE_IO
20468 WRITE_BYTE_F(adr, res)
20469 POST_IO
20470 RET(12)
20471 }
20472 res = 0;
20473 PRE_IO
20474 WRITE_BYTE_F(adr, res)
20475 POST_IO
20476 RET(12)
20477}
20478
20479// STCC
20480OPCODE(0x5FD0)
20481{
20482 u32 adr, res;
20483 u32 src, dst;
20484
20485 adr = AREG((Opcode >> 0) & 7);
20486 if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
20487 {
20488 res = 0xFF;
20489 PRE_IO
20490 WRITE_BYTE_F(adr, res)
20491 POST_IO
20492 RET(12)
20493 }
20494 res = 0;
20495 PRE_IO
20496 WRITE_BYTE_F(adr, res)
20497 POST_IO
20498 RET(12)
20499}
20500
20501// STCC
20502OPCODE(0x50D8)
20503{
20504 u32 adr, res;
20505 u32 src, dst;
20506
20507 adr = AREG((Opcode >> 0) & 7);
20508 AREG((Opcode >> 0) & 7) += 1;
20509 res = 0xFF;
20510 PRE_IO
20511 WRITE_BYTE_F(adr, res)
20512 POST_IO
20513 RET(12)
20514}
20515
20516// STCC
20517OPCODE(0x51D8)
20518{
20519 u32 adr, res;
20520 u32 src, dst;
20521
20522 adr = AREG((Opcode >> 0) & 7);
20523 AREG((Opcode >> 0) & 7) += 1;
20524 res = 0;
20525 PRE_IO
20526 WRITE_BYTE_F(adr, res)
20527 POST_IO
20528 RET(12)
20529}
20530
20531// STCC
20532OPCODE(0x52D8)
20533{
20534 u32 adr, res;
20535 u32 src, dst;
20536
20537 adr = AREG((Opcode >> 0) & 7);
20538 AREG((Opcode >> 0) & 7) += 1;
20539 if (flag_NotZ && (!(flag_C & 0x100)))
20540 {
20541 res = 0xFF;
20542 PRE_IO
20543 WRITE_BYTE_F(adr, res)
20544 POST_IO
20545 RET(12)
20546 }
20547 res = 0;
20548 PRE_IO
20549 WRITE_BYTE_F(adr, res)
20550 POST_IO
20551 RET(12)
20552}
20553
20554// STCC
20555OPCODE(0x53D8)
20556{
20557 u32 adr, res;
20558 u32 src, dst;
20559
20560 adr = AREG((Opcode >> 0) & 7);
20561 AREG((Opcode >> 0) & 7) += 1;
20562 if ((!flag_NotZ) || (flag_C & 0x100))
20563 {
20564 res = 0xFF;
20565 PRE_IO
20566 WRITE_BYTE_F(adr, res)
20567 POST_IO
20568 RET(12)
20569 }
20570 res = 0;
20571 PRE_IO
20572 WRITE_BYTE_F(adr, res)
20573 POST_IO
20574 RET(12)
20575}
20576
20577// STCC
20578OPCODE(0x54D8)
20579{
20580 u32 adr, res;
20581 u32 src, dst;
20582
20583 adr = AREG((Opcode >> 0) & 7);
20584 AREG((Opcode >> 0) & 7) += 1;
20585 if (!(flag_C & 0x100))
20586 {
20587 res = 0xFF;
20588 PRE_IO
20589 WRITE_BYTE_F(adr, res)
20590 POST_IO
20591 RET(12)
20592 }
20593 res = 0;
20594 PRE_IO
20595 WRITE_BYTE_F(adr, res)
20596 POST_IO
20597 RET(12)
20598}
20599
20600// STCC
20601OPCODE(0x55D8)
20602{
20603 u32 adr, res;
20604 u32 src, dst;
20605
20606 adr = AREG((Opcode >> 0) & 7);
20607 AREG((Opcode >> 0) & 7) += 1;
20608 if (flag_C & 0x100)
20609 {
20610 res = 0xFF;
20611 PRE_IO
20612 WRITE_BYTE_F(adr, res)
20613 POST_IO
20614 RET(12)
20615 }
20616 res = 0;
20617 PRE_IO
20618 WRITE_BYTE_F(adr, res)
20619 POST_IO
20620 RET(12)
20621}
20622
20623// STCC
20624OPCODE(0x56D8)
20625{
20626 u32 adr, res;
20627 u32 src, dst;
20628
20629 adr = AREG((Opcode >> 0) & 7);
20630 AREG((Opcode >> 0) & 7) += 1;
20631 if (flag_NotZ)
20632 {
20633 res = 0xFF;
20634 PRE_IO
20635 WRITE_BYTE_F(adr, res)
20636 POST_IO
20637 RET(12)
20638 }
20639 res = 0;
20640 PRE_IO
20641 WRITE_BYTE_F(adr, res)
20642 POST_IO
20643 RET(12)
20644}
20645
20646// STCC
20647OPCODE(0x57D8)
20648{
20649 u32 adr, res;
20650 u32 src, dst;
20651
20652 adr = AREG((Opcode >> 0) & 7);
20653 AREG((Opcode >> 0) & 7) += 1;
20654 if (!flag_NotZ)
20655 {
20656 res = 0xFF;
20657 PRE_IO
20658 WRITE_BYTE_F(adr, res)
20659 POST_IO
20660 RET(12)
20661 }
20662 res = 0;
20663 PRE_IO
20664 WRITE_BYTE_F(adr, res)
20665 POST_IO
20666 RET(12)
20667}
20668
20669// STCC
20670OPCODE(0x58D8)
20671{
20672 u32 adr, res;
20673 u32 src, dst;
20674
20675 adr = AREG((Opcode >> 0) & 7);
20676 AREG((Opcode >> 0) & 7) += 1;
20677 if (!(flag_V & 0x80))
20678 {
20679 res = 0xFF;
20680 PRE_IO
20681 WRITE_BYTE_F(adr, res)
20682 POST_IO
20683 RET(12)
20684 }
20685 res = 0;
20686 PRE_IO
20687 WRITE_BYTE_F(adr, res)
20688 POST_IO
20689 RET(12)
20690}
20691
20692// STCC
20693OPCODE(0x59D8)
20694{
20695 u32 adr, res;
20696 u32 src, dst;
20697
20698 adr = AREG((Opcode >> 0) & 7);
20699 AREG((Opcode >> 0) & 7) += 1;
20700 if (flag_V & 0x80)
20701 {
20702 res = 0xFF;
20703 PRE_IO
20704 WRITE_BYTE_F(adr, res)
20705 POST_IO
20706 RET(12)
20707 }
20708 res = 0;
20709 PRE_IO
20710 WRITE_BYTE_F(adr, res)
20711 POST_IO
20712 RET(12)
20713}
20714
20715// STCC
20716OPCODE(0x5AD8)
20717{
20718 u32 adr, res;
20719 u32 src, dst;
20720
20721 adr = AREG((Opcode >> 0) & 7);
20722 AREG((Opcode >> 0) & 7) += 1;
20723 if (!(flag_N & 0x80))
20724 {
20725 res = 0xFF;
20726 PRE_IO
20727 WRITE_BYTE_F(adr, res)
20728 POST_IO
20729 RET(12)
20730 }
20731 res = 0;
20732 PRE_IO
20733 WRITE_BYTE_F(adr, res)
20734 POST_IO
20735 RET(12)
20736}
20737
20738// STCC
20739OPCODE(0x5BD8)
20740{
20741 u32 adr, res;
20742 u32 src, dst;
20743
20744 adr = AREG((Opcode >> 0) & 7);
20745 AREG((Opcode >> 0) & 7) += 1;
20746 if (flag_N & 0x80)
20747 {
20748 res = 0xFF;
20749 PRE_IO
20750 WRITE_BYTE_F(adr, res)
20751 POST_IO
20752 RET(12)
20753 }
20754 res = 0;
20755 PRE_IO
20756 WRITE_BYTE_F(adr, res)
20757 POST_IO
20758 RET(12)
20759}
20760
20761// STCC
20762OPCODE(0x5CD8)
20763{
20764 u32 adr, res;
20765 u32 src, dst;
20766
20767 adr = AREG((Opcode >> 0) & 7);
20768 AREG((Opcode >> 0) & 7) += 1;
20769 if (!((flag_N ^ flag_V) & 0x80))
20770 {
20771 res = 0xFF;
20772 PRE_IO
20773 WRITE_BYTE_F(adr, res)
20774 POST_IO
20775 RET(12)
20776 }
20777 res = 0;
20778 PRE_IO
20779 WRITE_BYTE_F(adr, res)
20780 POST_IO
20781 RET(12)
20782}
20783
20784// STCC
20785OPCODE(0x5DD8)
20786{
20787 u32 adr, res;
20788 u32 src, dst;
20789
20790 adr = AREG((Opcode >> 0) & 7);
20791 AREG((Opcode >> 0) & 7) += 1;
20792 if ((flag_N ^ flag_V) & 0x80)
20793 {
20794 res = 0xFF;
20795 PRE_IO
20796 WRITE_BYTE_F(adr, res)
20797 POST_IO
20798 RET(12)
20799 }
20800 res = 0;
20801 PRE_IO
20802 WRITE_BYTE_F(adr, res)
20803 POST_IO
20804 RET(12)
20805}
20806
20807// STCC
20808OPCODE(0x5ED8)
20809{
20810 u32 adr, res;
20811 u32 src, dst;
20812
20813 adr = AREG((Opcode >> 0) & 7);
20814 AREG((Opcode >> 0) & 7) += 1;
20815 if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
20816 {
20817 res = 0xFF;
20818 PRE_IO
20819 WRITE_BYTE_F(adr, res)
20820 POST_IO
20821 RET(12)
20822 }
20823 res = 0;
20824 PRE_IO
20825 WRITE_BYTE_F(adr, res)
20826 POST_IO
20827 RET(12)
20828}
20829
20830// STCC
20831OPCODE(0x5FD8)
20832{
20833 u32 adr, res;
20834 u32 src, dst;
20835
20836 adr = AREG((Opcode >> 0) & 7);
20837 AREG((Opcode >> 0) & 7) += 1;
20838 if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
20839 {
20840 res = 0xFF;
20841 PRE_IO
20842 WRITE_BYTE_F(adr, res)
20843 POST_IO
20844 RET(12)
20845 }
20846 res = 0;
20847 PRE_IO
20848 WRITE_BYTE_F(adr, res)
20849 POST_IO
20850 RET(12)
20851}
20852
20853// STCC
20854OPCODE(0x50E0)
20855{
20856 u32 adr, res;
20857 u32 src, dst;
20858
20859 adr = AREG((Opcode >> 0) & 7) - 1;
20860 AREG((Opcode >> 0) & 7) = adr;
20861 res = 0xFF;
20862 PRE_IO
20863 WRITE_BYTE_F(adr, res)
20864 POST_IO
20865 RET(14)
20866}
20867
20868// STCC
20869OPCODE(0x51E0)
20870{
20871 u32 adr, res;
20872 u32 src, dst;
20873
20874 adr = AREG((Opcode >> 0) & 7) - 1;
20875 AREG((Opcode >> 0) & 7) = adr;
20876 res = 0;
20877 PRE_IO
20878 WRITE_BYTE_F(adr, res)
20879 POST_IO
20880 RET(14)
20881}
20882
20883// STCC
20884OPCODE(0x52E0)
20885{
20886 u32 adr, res;
20887 u32 src, dst;
20888
20889 adr = AREG((Opcode >> 0) & 7) - 1;
20890 AREG((Opcode >> 0) & 7) = adr;
20891 if (flag_NotZ && (!(flag_C & 0x100)))
20892 {
20893 res = 0xFF;
20894 PRE_IO
20895 WRITE_BYTE_F(adr, res)
20896 POST_IO
20897 RET(14)
20898 }
20899 res = 0;
20900 PRE_IO
20901 WRITE_BYTE_F(adr, res)
20902 POST_IO
20903 RET(14)
20904}
20905
20906// STCC
20907OPCODE(0x53E0)
20908{
20909 u32 adr, res;
20910 u32 src, dst;
20911
20912 adr = AREG((Opcode >> 0) & 7) - 1;
20913 AREG((Opcode >> 0) & 7) = adr;
20914 if ((!flag_NotZ) || (flag_C & 0x100))
20915 {
20916 res = 0xFF;
20917 PRE_IO
20918 WRITE_BYTE_F(adr, res)
20919 POST_IO
20920 RET(14)
20921 }
20922 res = 0;
20923 PRE_IO
20924 WRITE_BYTE_F(adr, res)
20925 POST_IO
20926 RET(14)
20927}
20928
20929// STCC
20930OPCODE(0x54E0)
20931{
20932 u32 adr, res;
20933 u32 src, dst;
20934
20935 adr = AREG((Opcode >> 0) & 7) - 1;
20936 AREG((Opcode >> 0) & 7) = adr;
20937 if (!(flag_C & 0x100))
20938 {
20939 res = 0xFF;
20940 PRE_IO
20941 WRITE_BYTE_F(adr, res)
20942 POST_IO
20943 RET(14)
20944 }
20945 res = 0;
20946 PRE_IO
20947 WRITE_BYTE_F(adr, res)
20948 POST_IO
20949 RET(14)
20950}
20951
20952// STCC
20953OPCODE(0x55E0)
20954{
20955 u32 adr, res;
20956 u32 src, dst;
20957
20958 adr = AREG((Opcode >> 0) & 7) - 1;
20959 AREG((Opcode >> 0) & 7) = adr;
20960 if (flag_C & 0x100)
20961 {
20962 res = 0xFF;
20963 PRE_IO
20964 WRITE_BYTE_F(adr, res)
20965 POST_IO
20966 RET(14)
20967 }
20968 res = 0;
20969 PRE_IO
20970 WRITE_BYTE_F(adr, res)
20971 POST_IO
20972 RET(14)
20973}
20974
20975// STCC
20976OPCODE(0x56E0)
20977{
20978 u32 adr, res;
20979 u32 src, dst;
20980
20981 adr = AREG((Opcode >> 0) & 7) - 1;
20982 AREG((Opcode >> 0) & 7) = adr;
20983 if (flag_NotZ)
20984 {
20985 res = 0xFF;
20986 PRE_IO
20987 WRITE_BYTE_F(adr, res)
20988 POST_IO
20989 RET(14)
20990 }
20991 res = 0;
20992 PRE_IO
20993 WRITE_BYTE_F(adr, res)
20994 POST_IO
20995 RET(14)
20996}
20997
20998// STCC
20999OPCODE(0x57E0)
21000{
21001 u32 adr, res;
21002 u32 src, dst;
21003
21004 adr = AREG((Opcode >> 0) & 7) - 1;
21005 AREG((Opcode >> 0) & 7) = adr;
21006 if (!flag_NotZ)
21007 {
21008 res = 0xFF;
21009 PRE_IO
21010 WRITE_BYTE_F(adr, res)
21011 POST_IO
21012 RET(14)
21013 }
21014 res = 0;
21015 PRE_IO
21016 WRITE_BYTE_F(adr, res)
21017 POST_IO
21018 RET(14)
21019}
21020
21021// STCC
21022OPCODE(0x58E0)
21023{
21024 u32 adr, res;
21025 u32 src, dst;
21026
21027 adr = AREG((Opcode >> 0) & 7) - 1;
21028 AREG((Opcode >> 0) & 7) = adr;
21029 if (!(flag_V & 0x80))
21030 {
21031 res = 0xFF;
21032 PRE_IO
21033 WRITE_BYTE_F(adr, res)
21034 POST_IO
21035 RET(14)
21036 }
21037 res = 0;
21038 PRE_IO
21039 WRITE_BYTE_F(adr, res)
21040 POST_IO
21041 RET(14)
21042}
21043
21044// STCC
21045OPCODE(0x59E0)
21046{
21047 u32 adr, res;
21048 u32 src, dst;
21049
21050 adr = AREG((Opcode >> 0) & 7) - 1;
21051 AREG((Opcode >> 0) & 7) = adr;
21052 if (flag_V & 0x80)
21053 {
21054 res = 0xFF;
21055 PRE_IO
21056 WRITE_BYTE_F(adr, res)
21057 POST_IO
21058 RET(14)
21059 }
21060 res = 0;
21061 PRE_IO
21062 WRITE_BYTE_F(adr, res)
21063 POST_IO
21064 RET(14)
21065}
21066
21067// STCC
21068OPCODE(0x5AE0)
21069{
21070 u32 adr, res;
21071 u32 src, dst;
21072
21073 adr = AREG((Opcode >> 0) & 7) - 1;
21074 AREG((Opcode >> 0) & 7) = adr;
21075 if (!(flag_N & 0x80))
21076 {
21077 res = 0xFF;
21078 PRE_IO
21079 WRITE_BYTE_F(adr, res)
21080 POST_IO
21081 RET(14)
21082 }
21083 res = 0;
21084 PRE_IO
21085 WRITE_BYTE_F(adr, res)
21086 POST_IO
21087 RET(14)
21088}
21089
21090// STCC
21091OPCODE(0x5BE0)
21092{
21093 u32 adr, res;
21094 u32 src, dst;
21095
21096 adr = AREG((Opcode >> 0) & 7) - 1;
21097 AREG((Opcode >> 0) & 7) = adr;
21098 if (flag_N & 0x80)
21099 {
21100 res = 0xFF;
21101 PRE_IO
21102 WRITE_BYTE_F(adr, res)
21103 POST_IO
21104 RET(14)
21105 }
21106 res = 0;
21107 PRE_IO
21108 WRITE_BYTE_F(adr, res)
21109 POST_IO
21110 RET(14)
21111}
21112
21113// STCC
21114OPCODE(0x5CE0)
21115{
21116 u32 adr, res;
21117 u32 src, dst;
21118
21119 adr = AREG((Opcode >> 0) & 7) - 1;
21120 AREG((Opcode >> 0) & 7) = adr;
21121 if (!((flag_N ^ flag_V) & 0x80))
21122 {
21123 res = 0xFF;
21124 PRE_IO
21125 WRITE_BYTE_F(adr, res)
21126 POST_IO
21127 RET(14)
21128 }
21129 res = 0;
21130 PRE_IO
21131 WRITE_BYTE_F(adr, res)
21132 POST_IO
21133 RET(14)
21134}
21135
21136// STCC
21137OPCODE(0x5DE0)
21138{
21139 u32 adr, res;
21140 u32 src, dst;
21141
21142 adr = AREG((Opcode >> 0) & 7) - 1;
21143 AREG((Opcode >> 0) & 7) = adr;
21144 if ((flag_N ^ flag_V) & 0x80)
21145 {
21146 res = 0xFF;
21147 PRE_IO
21148 WRITE_BYTE_F(adr, res)
21149 POST_IO
21150 RET(14)
21151 }
21152 res = 0;
21153 PRE_IO
21154 WRITE_BYTE_F(adr, res)
21155 POST_IO
21156 RET(14)
21157}
21158
21159// STCC
21160OPCODE(0x5EE0)
21161{
21162 u32 adr, res;
21163 u32 src, dst;
21164
21165 adr = AREG((Opcode >> 0) & 7) - 1;
21166 AREG((Opcode >> 0) & 7) = adr;
21167 if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
21168 {
21169 res = 0xFF;
21170 PRE_IO
21171 WRITE_BYTE_F(adr, res)
21172 POST_IO
21173 RET(14)
21174 }
21175 res = 0;
21176 PRE_IO
21177 WRITE_BYTE_F(adr, res)
21178 POST_IO
21179 RET(14)
21180}
21181
21182// STCC
21183OPCODE(0x5FE0)
21184{
21185 u32 adr, res;
21186 u32 src, dst;
21187
21188 adr = AREG((Opcode >> 0) & 7) - 1;
21189 AREG((Opcode >> 0) & 7) = adr;
21190 if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
21191 {
21192 res = 0xFF;
21193 PRE_IO
21194 WRITE_BYTE_F(adr, res)
21195 POST_IO
21196 RET(14)
21197 }
21198 res = 0;
21199 PRE_IO
21200 WRITE_BYTE_F(adr, res)
21201 POST_IO
21202 RET(14)
21203}
21204
21205// STCC
21206OPCODE(0x50E8)
21207{
21208 u32 adr, res;
21209 u32 src, dst;
21210
21211 FETCH_SWORD(adr);
21212 adr += AREG((Opcode >> 0) & 7);
21213 res = 0xFF;
21214 PRE_IO
21215 WRITE_BYTE_F(adr, res)
21216 POST_IO
21217 RET(16)
21218}
21219
21220// STCC
21221OPCODE(0x51E8)
21222{
21223 u32 adr, res;
21224 u32 src, dst;
21225
21226 FETCH_SWORD(adr);
21227 adr += AREG((Opcode >> 0) & 7);
21228 res = 0;
21229 PRE_IO
21230 WRITE_BYTE_F(adr, res)
21231 POST_IO
21232 RET(16)
21233}
21234
21235// STCC
21236OPCODE(0x52E8)
21237{
21238 u32 adr, res;
21239 u32 src, dst;
21240
21241 FETCH_SWORD(adr);
21242 adr += AREG((Opcode >> 0) & 7);
21243 if (flag_NotZ && (!(flag_C & 0x100)))
21244 {
21245 res = 0xFF;
21246 PRE_IO
21247 WRITE_BYTE_F(adr, res)
21248 POST_IO
21249 RET(16)
21250 }
21251 res = 0;
21252 PRE_IO
21253 WRITE_BYTE_F(adr, res)
21254 POST_IO
21255 RET(16)
21256}
21257
21258// STCC
21259OPCODE(0x53E8)
21260{
21261 u32 adr, res;
21262 u32 src, dst;
21263
21264 FETCH_SWORD(adr);
21265 adr += AREG((Opcode >> 0) & 7);
21266 if ((!flag_NotZ) || (flag_C & 0x100))
21267 {
21268 res = 0xFF;
21269 PRE_IO
21270 WRITE_BYTE_F(adr, res)
21271 POST_IO
21272 RET(16)
21273 }
21274 res = 0;
21275 PRE_IO
21276 WRITE_BYTE_F(adr, res)
21277 POST_IO
21278 RET(16)
21279}
21280
21281// STCC
21282OPCODE(0x54E8)
21283{
21284 u32 adr, res;
21285 u32 src, dst;
21286
21287 FETCH_SWORD(adr);
21288 adr += AREG((Opcode >> 0) & 7);
21289 if (!(flag_C & 0x100))
21290 {
21291 res = 0xFF;
21292 PRE_IO
21293 WRITE_BYTE_F(adr, res)
21294 POST_IO
21295 RET(16)
21296 }
21297 res = 0;
21298 PRE_IO
21299 WRITE_BYTE_F(adr, res)
21300 POST_IO
21301 RET(16)
21302}
21303
21304// STCC
21305OPCODE(0x55E8)
21306{
21307 u32 adr, res;
21308 u32 src, dst;
21309
21310 FETCH_SWORD(adr);
21311 adr += AREG((Opcode >> 0) & 7);
21312 if (flag_C & 0x100)
21313 {
21314 res = 0xFF;
21315 PRE_IO
21316 WRITE_BYTE_F(adr, res)
21317 POST_IO
21318 RET(16)
21319 }
21320 res = 0;
21321 PRE_IO
21322 WRITE_BYTE_F(adr, res)
21323 POST_IO
21324 RET(16)
21325}
21326
21327// STCC
21328OPCODE(0x56E8)
21329{
21330 u32 adr, res;
21331 u32 src, dst;
21332
21333 FETCH_SWORD(adr);
21334 adr += AREG((Opcode >> 0) & 7);
21335 if (flag_NotZ)
21336 {
21337 res = 0xFF;
21338 PRE_IO
21339 WRITE_BYTE_F(adr, res)
21340 POST_IO
21341 RET(16)
21342 }
21343 res = 0;
21344 PRE_IO
21345 WRITE_BYTE_F(adr, res)
21346 POST_IO
21347 RET(16)
21348}
21349
21350// STCC
21351OPCODE(0x57E8)
21352{
21353 u32 adr, res;
21354 u32 src, dst;
21355
21356 FETCH_SWORD(adr);
21357 adr += AREG((Opcode >> 0) & 7);
21358 if (!flag_NotZ)
21359 {
21360 res = 0xFF;
21361 PRE_IO
21362 WRITE_BYTE_F(adr, res)
21363 POST_IO
21364 RET(16)
21365 }
21366 res = 0;
21367 PRE_IO
21368 WRITE_BYTE_F(adr, res)
21369 POST_IO
21370 RET(16)
21371}
21372
21373// STCC
21374OPCODE(0x58E8)
21375{
21376 u32 adr, res;
21377 u32 src, dst;
21378
21379 FETCH_SWORD(adr);
21380 adr += AREG((Opcode >> 0) & 7);
21381 if (!(flag_V & 0x80))
21382 {
21383 res = 0xFF;
21384 PRE_IO
21385 WRITE_BYTE_F(adr, res)
21386 POST_IO
21387 RET(16)
21388 }
21389 res = 0;
21390 PRE_IO
21391 WRITE_BYTE_F(adr, res)
21392 POST_IO
21393 RET(16)
21394}
21395
21396// STCC
21397OPCODE(0x59E8)
21398{
21399 u32 adr, res;
21400 u32 src, dst;
21401
21402 FETCH_SWORD(adr);
21403 adr += AREG((Opcode >> 0) & 7);
21404 if (flag_V & 0x80)
21405 {
21406 res = 0xFF;
21407 PRE_IO
21408 WRITE_BYTE_F(adr, res)
21409 POST_IO
21410 RET(16)
21411 }
21412 res = 0;
21413 PRE_IO
21414 WRITE_BYTE_F(adr, res)
21415 POST_IO
21416 RET(16)
21417}
21418
21419// STCC
21420OPCODE(0x5AE8)
21421{
21422 u32 adr, res;
21423 u32 src, dst;
21424
21425 FETCH_SWORD(adr);
21426 adr += AREG((Opcode >> 0) & 7);
21427 if (!(flag_N & 0x80))
21428 {
21429 res = 0xFF;
21430 PRE_IO
21431 WRITE_BYTE_F(adr, res)
21432 POST_IO
21433 RET(16)
21434 }
21435 res = 0;
21436 PRE_IO
21437 WRITE_BYTE_F(adr, res)
21438 POST_IO
21439 RET(16)
21440}
21441
21442// STCC
21443OPCODE(0x5BE8)
21444{
21445 u32 adr, res;
21446 u32 src, dst;
21447
21448 FETCH_SWORD(adr);
21449 adr += AREG((Opcode >> 0) & 7);
21450 if (flag_N & 0x80)
21451 {
21452 res = 0xFF;
21453 PRE_IO
21454 WRITE_BYTE_F(adr, res)
21455 POST_IO
21456 RET(16)
21457 }
21458 res = 0;
21459 PRE_IO
21460 WRITE_BYTE_F(adr, res)
21461 POST_IO
21462 RET(16)
21463}
21464
21465// STCC
21466OPCODE(0x5CE8)
21467{
21468 u32 adr, res;
21469 u32 src, dst;
21470
21471 FETCH_SWORD(adr);
21472 adr += AREG((Opcode >> 0) & 7);
21473 if (!((flag_N ^ flag_V) & 0x80))
21474 {
21475 res = 0xFF;
21476 PRE_IO
21477 WRITE_BYTE_F(adr, res)
21478 POST_IO
21479 RET(16)
21480 }
21481 res = 0;
21482 PRE_IO
21483 WRITE_BYTE_F(adr, res)
21484 POST_IO
21485 RET(16)
21486}
21487
21488// STCC
21489OPCODE(0x5DE8)
21490{
21491 u32 adr, res;
21492 u32 src, dst;
21493
21494 FETCH_SWORD(adr);
21495 adr += AREG((Opcode >> 0) & 7);
21496 if ((flag_N ^ flag_V) & 0x80)
21497 {
21498 res = 0xFF;
21499 PRE_IO
21500 WRITE_BYTE_F(adr, res)
21501 POST_IO
21502 RET(16)
21503 }
21504 res = 0;
21505 PRE_IO
21506 WRITE_BYTE_F(adr, res)
21507 POST_IO
21508 RET(16)
21509}
21510
21511// STCC
21512OPCODE(0x5EE8)
21513{
21514 u32 adr, res;
21515 u32 src, dst;
21516
21517 FETCH_SWORD(adr);
21518 adr += AREG((Opcode >> 0) & 7);
21519 if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
21520 {
21521 res = 0xFF;
21522 PRE_IO
21523 WRITE_BYTE_F(adr, res)
21524 POST_IO
21525 RET(16)
21526 }
21527 res = 0;
21528 PRE_IO
21529 WRITE_BYTE_F(adr, res)
21530 POST_IO
21531 RET(16)
21532}
21533
21534// STCC
21535OPCODE(0x5FE8)
21536{
21537 u32 adr, res;
21538 u32 src, dst;
21539
21540 FETCH_SWORD(adr);
21541 adr += AREG((Opcode >> 0) & 7);
21542 if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
21543 {
21544 res = 0xFF;
21545 PRE_IO
21546 WRITE_BYTE_F(adr, res)
21547 POST_IO
21548 RET(16)
21549 }
21550 res = 0;
21551 PRE_IO
21552 WRITE_BYTE_F(adr, res)
21553 POST_IO
21554 RET(16)
21555}
21556
21557// STCC
21558OPCODE(0x50F0)
21559{
21560 u32 adr, res;
21561 u32 src, dst;
21562
21563 adr = AREG((Opcode >> 0) & 7);
21564 DECODE_EXT_WORD
21565 res = 0xFF;
21566 PRE_IO
21567 WRITE_BYTE_F(adr, res)
21568 POST_IO
21569 RET(18)
21570}
21571
21572// STCC
21573OPCODE(0x51F0)
21574{
21575 u32 adr, res;
21576 u32 src, dst;
21577
21578 adr = AREG((Opcode >> 0) & 7);
21579 DECODE_EXT_WORD
21580 res = 0;
21581 PRE_IO
21582 WRITE_BYTE_F(adr, res)
21583 POST_IO
21584 RET(18)
21585}
21586
21587// STCC
21588OPCODE(0x52F0)
21589{
21590 u32 adr, res;
21591 u32 src, dst;
21592
21593 adr = AREG((Opcode >> 0) & 7);
21594 DECODE_EXT_WORD
21595 if (flag_NotZ && (!(flag_C & 0x100)))
21596 {
21597 res = 0xFF;
21598 PRE_IO
21599 WRITE_BYTE_F(adr, res)
21600 POST_IO
21601 RET(18)
21602 }
21603 res = 0;
21604 PRE_IO
21605 WRITE_BYTE_F(adr, res)
21606 POST_IO
21607 RET(18)
21608}
21609
21610// STCC
21611OPCODE(0x53F0)
21612{
21613 u32 adr, res;
21614 u32 src, dst;
21615
21616 adr = AREG((Opcode >> 0) & 7);
21617 DECODE_EXT_WORD
21618 if ((!flag_NotZ) || (flag_C & 0x100))
21619 {
21620 res = 0xFF;
21621 PRE_IO
21622 WRITE_BYTE_F(adr, res)
21623 POST_IO
21624 RET(18)
21625 }
21626 res = 0;
21627 PRE_IO
21628 WRITE_BYTE_F(adr, res)
21629 POST_IO
21630 RET(18)
21631}
21632
21633// STCC
21634OPCODE(0x54F0)
21635{
21636 u32 adr, res;
21637 u32 src, dst;
21638
21639 adr = AREG((Opcode >> 0) & 7);
21640 DECODE_EXT_WORD
21641 if (!(flag_C & 0x100))
21642 {
21643 res = 0xFF;
21644 PRE_IO
21645 WRITE_BYTE_F(adr, res)
21646 POST_IO
21647 RET(18)
21648 }
21649 res = 0;
21650 PRE_IO
21651 WRITE_BYTE_F(adr, res)
21652 POST_IO
21653 RET(18)
21654}
21655
21656// STCC
21657OPCODE(0x55F0)
21658{
21659 u32 adr, res;
21660 u32 src, dst;
21661
21662 adr = AREG((Opcode >> 0) & 7);
21663 DECODE_EXT_WORD
21664 if (flag_C & 0x100)
21665 {
21666 res = 0xFF;
21667 PRE_IO
21668 WRITE_BYTE_F(adr, res)
21669 POST_IO
21670 RET(18)
21671 }
21672 res = 0;
21673 PRE_IO
21674 WRITE_BYTE_F(adr, res)
21675 POST_IO
21676 RET(18)
21677}
21678
21679// STCC
21680OPCODE(0x56F0)
21681{
21682 u32 adr, res;
21683 u32 src, dst;
21684
21685 adr = AREG((Opcode >> 0) & 7);
21686 DECODE_EXT_WORD
21687 if (flag_NotZ)
21688 {
21689 res = 0xFF;
21690 PRE_IO
21691 WRITE_BYTE_F(adr, res)
21692 POST_IO
21693 RET(18)
21694 }
21695 res = 0;
21696 PRE_IO
21697 WRITE_BYTE_F(adr, res)
21698 POST_IO
21699 RET(18)
21700}
21701
21702// STCC
21703OPCODE(0x57F0)
21704{
21705 u32 adr, res;
21706 u32 src, dst;
21707
21708 adr = AREG((Opcode >> 0) & 7);
21709 DECODE_EXT_WORD
21710 if (!flag_NotZ)
21711 {
21712 res = 0xFF;
21713 PRE_IO
21714 WRITE_BYTE_F(adr, res)
21715 POST_IO
21716 RET(18)
21717 }
21718 res = 0;
21719 PRE_IO
21720 WRITE_BYTE_F(adr, res)
21721 POST_IO
21722 RET(18)
21723}
21724
21725// STCC
21726OPCODE(0x58F0)
21727{
21728 u32 adr, res;
21729 u32 src, dst;
21730
21731 adr = AREG((Opcode >> 0) & 7);
21732 DECODE_EXT_WORD
21733 if (!(flag_V & 0x80))
21734 {
21735 res = 0xFF;
21736 PRE_IO
21737 WRITE_BYTE_F(adr, res)
21738 POST_IO
21739 RET(18)
21740 }
21741 res = 0;
21742 PRE_IO
21743 WRITE_BYTE_F(adr, res)
21744 POST_IO
21745 RET(18)
21746}
21747
21748// STCC
21749OPCODE(0x59F0)
21750{
21751 u32 adr, res;
21752 u32 src, dst;
21753
21754 adr = AREG((Opcode >> 0) & 7);
21755 DECODE_EXT_WORD
21756 if (flag_V & 0x80)
21757 {
21758 res = 0xFF;
21759 PRE_IO
21760 WRITE_BYTE_F(adr, res)
21761 POST_IO
21762 RET(18)
21763 }
21764 res = 0;
21765 PRE_IO
21766 WRITE_BYTE_F(adr, res)
21767 POST_IO
21768 RET(18)
21769}
21770
21771// STCC
21772OPCODE(0x5AF0)
21773{
21774 u32 adr, res;
21775 u32 src, dst;
21776
21777 adr = AREG((Opcode >> 0) & 7);
21778 DECODE_EXT_WORD
21779 if (!(flag_N & 0x80))
21780 {
21781 res = 0xFF;
21782 PRE_IO
21783 WRITE_BYTE_F(adr, res)
21784 POST_IO
21785 RET(18)
21786 }
21787 res = 0;
21788 PRE_IO
21789 WRITE_BYTE_F(adr, res)
21790 POST_IO
21791 RET(18)
21792}
21793
21794// STCC
21795OPCODE(0x5BF0)
21796{
21797 u32 adr, res;
21798 u32 src, dst;
21799
21800 adr = AREG((Opcode >> 0) & 7);
21801 DECODE_EXT_WORD
21802 if (flag_N & 0x80)
21803 {
21804 res = 0xFF;
21805 PRE_IO
21806 WRITE_BYTE_F(adr, res)
21807 POST_IO
21808 RET(18)
21809 }
21810 res = 0;
21811 PRE_IO
21812 WRITE_BYTE_F(adr, res)
21813 POST_IO
21814 RET(18)
21815}
21816
21817// STCC
21818OPCODE(0x5CF0)
21819{
21820 u32 adr, res;
21821 u32 src, dst;
21822
21823 adr = AREG((Opcode >> 0) & 7);
21824 DECODE_EXT_WORD
21825 if (!((flag_N ^ flag_V) & 0x80))
21826 {
21827 res = 0xFF;
21828 PRE_IO
21829 WRITE_BYTE_F(adr, res)
21830 POST_IO
21831 RET(18)
21832 }
21833 res = 0;
21834 PRE_IO
21835 WRITE_BYTE_F(adr, res)
21836 POST_IO
21837 RET(18)
21838}
21839
21840// STCC
21841OPCODE(0x5DF0)
21842{
21843 u32 adr, res;
21844 u32 src, dst;
21845
21846 adr = AREG((Opcode >> 0) & 7);
21847 DECODE_EXT_WORD
21848 if ((flag_N ^ flag_V) & 0x80)
21849 {
21850 res = 0xFF;
21851 PRE_IO
21852 WRITE_BYTE_F(adr, res)
21853 POST_IO
21854 RET(18)
21855 }
21856 res = 0;
21857 PRE_IO
21858 WRITE_BYTE_F(adr, res)
21859 POST_IO
21860 RET(18)
21861}
21862
21863// STCC
21864OPCODE(0x5EF0)
21865{
21866 u32 adr, res;
21867 u32 src, dst;
21868
21869 adr = AREG((Opcode >> 0) & 7);
21870 DECODE_EXT_WORD
21871 if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
21872 {
21873 res = 0xFF;
21874 PRE_IO
21875 WRITE_BYTE_F(adr, res)
21876 POST_IO
21877 RET(18)
21878 }
21879 res = 0;
21880 PRE_IO
21881 WRITE_BYTE_F(adr, res)
21882 POST_IO
21883 RET(18)
21884}
21885
21886// STCC
21887OPCODE(0x5FF0)
21888{
21889 u32 adr, res;
21890 u32 src, dst;
21891
21892 adr = AREG((Opcode >> 0) & 7);
21893 DECODE_EXT_WORD
21894 if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
21895 {
21896 res = 0xFF;
21897 PRE_IO
21898 WRITE_BYTE_F(adr, res)
21899 POST_IO
21900 RET(18)
21901 }
21902 res = 0;
21903 PRE_IO
21904 WRITE_BYTE_F(adr, res)
21905 POST_IO
21906 RET(18)
21907}
21908
21909// STCC
21910OPCODE(0x50F8)
21911{
21912 u32 adr, res;
21913 u32 src, dst;
21914
21915 FETCH_SWORD(adr);
21916 res = 0xFF;
21917 PRE_IO
21918 WRITE_BYTE_F(adr, res)
21919 POST_IO
21920 RET(16)
21921}
21922
21923// STCC
21924OPCODE(0x51F8)
21925{
21926 u32 adr, res;
21927 u32 src, dst;
21928
21929 FETCH_SWORD(adr);
21930 res = 0;
21931 PRE_IO
21932 WRITE_BYTE_F(adr, res)
21933 POST_IO
21934 RET(16)
21935}
21936
21937// STCC
21938OPCODE(0x52F8)
21939{
21940 u32 adr, res;
21941 u32 src, dst;
21942
21943 FETCH_SWORD(adr);
21944 if (flag_NotZ && (!(flag_C & 0x100)))
21945 {
21946 res = 0xFF;
21947 PRE_IO
21948 WRITE_BYTE_F(adr, res)
21949 POST_IO
21950 RET(16)
21951 }
21952 res = 0;
21953 PRE_IO
21954 WRITE_BYTE_F(adr, res)
21955 POST_IO
21956 RET(16)
21957}
21958
21959// STCC
21960OPCODE(0x53F8)
21961{
21962 u32 adr, res;
21963 u32 src, dst;
21964
21965 FETCH_SWORD(adr);
21966 if ((!flag_NotZ) || (flag_C & 0x100))
21967 {
21968 res = 0xFF;
21969 PRE_IO
21970 WRITE_BYTE_F(adr, res)
21971 POST_IO
21972 RET(16)
21973 }
21974 res = 0;
21975 PRE_IO
21976 WRITE_BYTE_F(adr, res)
21977 POST_IO
21978 RET(16)
21979}
21980
21981// STCC
21982OPCODE(0x54F8)
21983{
21984 u32 adr, res;
21985 u32 src, dst;
21986
21987 FETCH_SWORD(adr);
21988 if (!(flag_C & 0x100))
21989 {
21990 res = 0xFF;
21991 PRE_IO
21992 WRITE_BYTE_F(adr, res)
21993 POST_IO
21994 RET(16)
21995 }
21996 res = 0;
21997 PRE_IO
21998 WRITE_BYTE_F(adr, res)
21999 POST_IO
22000 RET(16)
22001}
22002
22003// STCC
22004OPCODE(0x55F8)
22005{
22006 u32 adr, res;
22007 u32 src, dst;
22008
22009 FETCH_SWORD(adr);
22010 if (flag_C & 0x100)
22011 {
22012 res = 0xFF;
22013 PRE_IO
22014 WRITE_BYTE_F(adr, res)
22015 POST_IO
22016 RET(16)
22017 }
22018 res = 0;
22019 PRE_IO
22020 WRITE_BYTE_F(adr, res)
22021 POST_IO
22022 RET(16)
22023}
22024
22025// STCC
22026OPCODE(0x56F8)
22027{
22028 u32 adr, res;
22029 u32 src, dst;
22030
22031 FETCH_SWORD(adr);
22032 if (flag_NotZ)
22033 {
22034 res = 0xFF;
22035 PRE_IO
22036 WRITE_BYTE_F(adr, res)
22037 POST_IO
22038 RET(16)
22039 }
22040 res = 0;
22041 PRE_IO
22042 WRITE_BYTE_F(adr, res)
22043 POST_IO
22044 RET(16)
22045}
22046
22047// STCC
22048OPCODE(0x57F8)
22049{
22050 u32 adr, res;
22051 u32 src, dst;
22052
22053 FETCH_SWORD(adr);
22054 if (!flag_NotZ)
22055 {
22056 res = 0xFF;
22057 PRE_IO
22058 WRITE_BYTE_F(adr, res)
22059 POST_IO
22060 RET(16)
22061 }
22062 res = 0;
22063 PRE_IO
22064 WRITE_BYTE_F(adr, res)
22065 POST_IO
22066 RET(16)
22067}
22068
22069// STCC
22070OPCODE(0x58F8)
22071{
22072 u32 adr, res;
22073 u32 src, dst;
22074
22075 FETCH_SWORD(adr);
22076 if (!(flag_V & 0x80))
22077 {
22078 res = 0xFF;
22079 PRE_IO
22080 WRITE_BYTE_F(adr, res)
22081 POST_IO
22082 RET(16)
22083 }
22084 res = 0;
22085 PRE_IO
22086 WRITE_BYTE_F(adr, res)
22087 POST_IO
22088 RET(16)
22089}
22090
22091// STCC
22092OPCODE(0x59F8)
22093{
22094 u32 adr, res;
22095 u32 src, dst;
22096
22097 FETCH_SWORD(adr);
22098 if (flag_V & 0x80)
22099 {
22100 res = 0xFF;
22101 PRE_IO
22102 WRITE_BYTE_F(adr, res)
22103 POST_IO
22104 RET(16)
22105 }
22106 res = 0;
22107 PRE_IO
22108 WRITE_BYTE_F(adr, res)
22109 POST_IO
22110 RET(16)
22111}
22112
22113// STCC
22114OPCODE(0x5AF8)
22115{
22116 u32 adr, res;
22117 u32 src, dst;
22118
22119 FETCH_SWORD(adr);
22120 if (!(flag_N & 0x80))
22121 {
22122 res = 0xFF;
22123 PRE_IO
22124 WRITE_BYTE_F(adr, res)
22125 POST_IO
22126 RET(16)
22127 }
22128 res = 0;
22129 PRE_IO
22130 WRITE_BYTE_F(adr, res)
22131 POST_IO
22132 RET(16)
22133}
22134
22135// STCC
22136OPCODE(0x5BF8)
22137{
22138 u32 adr, res;
22139 u32 src, dst;
22140
22141 FETCH_SWORD(adr);
22142 if (flag_N & 0x80)
22143 {
22144 res = 0xFF;
22145 PRE_IO
22146 WRITE_BYTE_F(adr, res)
22147 POST_IO
22148 RET(16)
22149 }
22150 res = 0;
22151 PRE_IO
22152 WRITE_BYTE_F(adr, res)
22153 POST_IO
22154 RET(16)
22155}
22156
22157// STCC
22158OPCODE(0x5CF8)
22159{
22160 u32 adr, res;
22161 u32 src, dst;
22162
22163 FETCH_SWORD(adr);
22164 if (!((flag_N ^ flag_V) & 0x80))
22165 {
22166 res = 0xFF;
22167 PRE_IO
22168 WRITE_BYTE_F(adr, res)
22169 POST_IO
22170 RET(16)
22171 }
22172 res = 0;
22173 PRE_IO
22174 WRITE_BYTE_F(adr, res)
22175 POST_IO
22176 RET(16)
22177}
22178
22179// STCC
22180OPCODE(0x5DF8)
22181{
22182 u32 adr, res;
22183 u32 src, dst;
22184
22185 FETCH_SWORD(adr);
22186 if ((flag_N ^ flag_V) & 0x80)
22187 {
22188 res = 0xFF;
22189 PRE_IO
22190 WRITE_BYTE_F(adr, res)
22191 POST_IO
22192 RET(16)
22193 }
22194 res = 0;
22195 PRE_IO
22196 WRITE_BYTE_F(adr, res)
22197 POST_IO
22198 RET(16)
22199}
22200
22201// STCC
22202OPCODE(0x5EF8)
22203{
22204 u32 adr, res;
22205 u32 src, dst;
22206
22207 FETCH_SWORD(adr);
22208 if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
22209 {
22210 res = 0xFF;
22211 PRE_IO
22212 WRITE_BYTE_F(adr, res)
22213 POST_IO
22214 RET(16)
22215 }
22216 res = 0;
22217 PRE_IO
22218 WRITE_BYTE_F(adr, res)
22219 POST_IO
22220 RET(16)
22221}
22222
22223// STCC
22224OPCODE(0x5FF8)
22225{
22226 u32 adr, res;
22227 u32 src, dst;
22228
22229 FETCH_SWORD(adr);
22230 if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
22231 {
22232 res = 0xFF;
22233 PRE_IO
22234 WRITE_BYTE_F(adr, res)
22235 POST_IO
22236 RET(16)
22237 }
22238 res = 0;
22239 PRE_IO
22240 WRITE_BYTE_F(adr, res)
22241 POST_IO
22242 RET(16)
22243}
22244
22245// STCC
22246OPCODE(0x50F9)
22247{
22248 u32 adr, res;
22249 u32 src, dst;
22250
22251 FETCH_LONG(adr);
22252 res = 0xFF;
22253 PRE_IO
22254 WRITE_BYTE_F(adr, res)
22255 POST_IO
22256 RET(20)
22257}
22258
22259// STCC
22260OPCODE(0x51F9)
22261{
22262 u32 adr, res;
22263 u32 src, dst;
22264
22265 FETCH_LONG(adr);
22266 res = 0;
22267 PRE_IO
22268 WRITE_BYTE_F(adr, res)
22269 POST_IO
22270 RET(20)
22271}
22272
22273// STCC
22274OPCODE(0x52F9)
22275{
22276 u32 adr, res;
22277 u32 src, dst;
22278
22279 FETCH_LONG(adr);
22280 if (flag_NotZ && (!(flag_C & 0x100)))
22281 {
22282 res = 0xFF;
22283 PRE_IO
22284 WRITE_BYTE_F(adr, res)
22285 POST_IO
22286 RET(20)
22287 }
22288 res = 0;
22289 PRE_IO
22290 WRITE_BYTE_F(adr, res)
22291 POST_IO
22292 RET(20)
22293}
22294
22295// STCC
22296OPCODE(0x53F9)
22297{
22298 u32 adr, res;
22299 u32 src, dst;
22300
22301 FETCH_LONG(adr);
22302 if ((!flag_NotZ) || (flag_C & 0x100))
22303 {
22304 res = 0xFF;
22305 PRE_IO
22306 WRITE_BYTE_F(adr, res)
22307 POST_IO
22308 RET(20)
22309 }
22310 res = 0;
22311 PRE_IO
22312 WRITE_BYTE_F(adr, res)
22313 POST_IO
22314 RET(20)
22315}
22316
22317// STCC
22318OPCODE(0x54F9)
22319{
22320 u32 adr, res;
22321 u32 src, dst;
22322
22323 FETCH_LONG(adr);
22324 if (!(flag_C & 0x100))
22325 {
22326 res = 0xFF;
22327 PRE_IO
22328 WRITE_BYTE_F(adr, res)
22329 POST_IO
22330 RET(20)
22331 }
22332 res = 0;
22333 PRE_IO
22334 WRITE_BYTE_F(adr, res)
22335 POST_IO
22336 RET(20)
22337}
22338
22339// STCC
22340OPCODE(0x55F9)
22341{
22342 u32 adr, res;
22343 u32 src, dst;
22344
22345 FETCH_LONG(adr);
22346 if (flag_C & 0x100)
22347 {
22348 res = 0xFF;
22349 PRE_IO
22350 WRITE_BYTE_F(adr, res)
22351 POST_IO
22352 RET(20)
22353 }
22354 res = 0;
22355 PRE_IO
22356 WRITE_BYTE_F(adr, res)
22357 POST_IO
22358 RET(20)
22359}
22360
22361// STCC
22362OPCODE(0x56F9)
22363{
22364 u32 adr, res;
22365 u32 src, dst;
22366
22367 FETCH_LONG(adr);
22368 if (flag_NotZ)
22369 {
22370 res = 0xFF;
22371 PRE_IO
22372 WRITE_BYTE_F(adr, res)
22373 POST_IO
22374 RET(20)
22375 }
22376 res = 0;
22377 PRE_IO
22378 WRITE_BYTE_F(adr, res)
22379 POST_IO
22380 RET(20)
22381}
22382
22383// STCC
22384OPCODE(0x57F9)
22385{
22386 u32 adr, res;
22387 u32 src, dst;
22388
22389 FETCH_LONG(adr);
22390 if (!flag_NotZ)
22391 {
22392 res = 0xFF;
22393 PRE_IO
22394 WRITE_BYTE_F(adr, res)
22395 POST_IO
22396 RET(20)
22397 }
22398 res = 0;
22399 PRE_IO
22400 WRITE_BYTE_F(adr, res)
22401 POST_IO
22402 RET(20)
22403}
22404
22405// STCC
22406OPCODE(0x58F9)
22407{
22408 u32 adr, res;
22409 u32 src, dst;
22410
22411 FETCH_LONG(adr);
22412 if (!(flag_V & 0x80))
22413 {
22414 res = 0xFF;
22415 PRE_IO
22416 WRITE_BYTE_F(adr, res)
22417 POST_IO
22418 RET(20)
22419 }
22420 res = 0;
22421 PRE_IO
22422 WRITE_BYTE_F(adr, res)
22423 POST_IO
22424 RET(20)
22425}
22426
22427// STCC
22428OPCODE(0x59F9)
22429{
22430 u32 adr, res;
22431 u32 src, dst;
22432
22433 FETCH_LONG(adr);
22434 if (flag_V & 0x80)
22435 {
22436 res = 0xFF;
22437 PRE_IO
22438 WRITE_BYTE_F(adr, res)
22439 POST_IO
22440 RET(20)
22441 }
22442 res = 0;
22443 PRE_IO
22444 WRITE_BYTE_F(adr, res)
22445 POST_IO
22446 RET(20)
22447}
22448
22449// STCC
22450OPCODE(0x5AF9)
22451{
22452 u32 adr, res;
22453 u32 src, dst;
22454
22455 FETCH_LONG(adr);
22456 if (!(flag_N & 0x80))
22457 {
22458 res = 0xFF;
22459 PRE_IO
22460 WRITE_BYTE_F(adr, res)
22461 POST_IO
22462 RET(20)
22463 }
22464 res = 0;
22465 PRE_IO
22466 WRITE_BYTE_F(adr, res)
22467 POST_IO
22468 RET(20)
22469}
22470
22471// STCC
22472OPCODE(0x5BF9)
22473{
22474 u32 adr, res;
22475 u32 src, dst;
22476
22477 FETCH_LONG(adr);
22478 if (flag_N & 0x80)
22479 {
22480 res = 0xFF;
22481 PRE_IO
22482 WRITE_BYTE_F(adr, res)
22483 POST_IO
22484 RET(20)
22485 }
22486 res = 0;
22487 PRE_IO
22488 WRITE_BYTE_F(adr, res)
22489 POST_IO
22490 RET(20)
22491}
22492
22493// STCC
22494OPCODE(0x5CF9)
22495{
22496 u32 adr, res;
22497 u32 src, dst;
22498
22499 FETCH_LONG(adr);
22500 if (!((flag_N ^ flag_V) & 0x80))
22501 {
22502 res = 0xFF;
22503 PRE_IO
22504 WRITE_BYTE_F(adr, res)
22505 POST_IO
22506 RET(20)
22507 }
22508 res = 0;
22509 PRE_IO
22510 WRITE_BYTE_F(adr, res)
22511 POST_IO
22512 RET(20)
22513}
22514
22515// STCC
22516OPCODE(0x5DF9)
22517{
22518 u32 adr, res;
22519 u32 src, dst;
22520
22521 FETCH_LONG(adr);
22522 if ((flag_N ^ flag_V) & 0x80)
22523 {
22524 res = 0xFF;
22525 PRE_IO
22526 WRITE_BYTE_F(adr, res)
22527 POST_IO
22528 RET(20)
22529 }
22530 res = 0;
22531 PRE_IO
22532 WRITE_BYTE_F(adr, res)
22533 POST_IO
22534 RET(20)
22535}
22536
22537// STCC
22538OPCODE(0x5EF9)
22539{
22540 u32 adr, res;
22541 u32 src, dst;
22542
22543 FETCH_LONG(adr);
22544 if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
22545 {
22546 res = 0xFF;
22547 PRE_IO
22548 WRITE_BYTE_F(adr, res)
22549 POST_IO
22550 RET(20)
22551 }
22552 res = 0;
22553 PRE_IO
22554 WRITE_BYTE_F(adr, res)
22555 POST_IO
22556 RET(20)
22557}
22558
22559// STCC
22560OPCODE(0x5FF9)
22561{
22562 u32 adr, res;
22563 u32 src, dst;
22564
22565 FETCH_LONG(adr);
22566 if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
22567 {
22568 res = 0xFF;
22569 PRE_IO
22570 WRITE_BYTE_F(adr, res)
22571 POST_IO
22572 RET(20)
22573 }
22574 res = 0;
22575 PRE_IO
22576 WRITE_BYTE_F(adr, res)
22577 POST_IO
22578 RET(20)
22579}
22580
22581// STCC
22582OPCODE(0x50DF)
22583{
22584 u32 adr, res;
22585 u32 src, dst;
22586
22587 adr = AREG(7);
22588 AREG(7) += 2;
22589 res = 0xFF;
22590 PRE_IO
22591 WRITE_BYTE_F(adr, res)
22592 POST_IO
22593 RET(12)
22594}
22595
22596// STCC
22597OPCODE(0x51DF)
22598{
22599 u32 adr, res;
22600 u32 src, dst;
22601
22602 adr = AREG(7);
22603 AREG(7) += 2;
22604 res = 0;
22605 PRE_IO
22606 WRITE_BYTE_F(adr, res)
22607 POST_IO
22608 RET(12)
22609}
22610
22611// STCC
22612OPCODE(0x52DF)
22613{
22614 u32 adr, res;
22615 u32 src, dst;
22616
22617 adr = AREG(7);
22618 AREG(7) += 2;
22619 if (flag_NotZ && (!(flag_C & 0x100)))
22620 {
22621 res = 0xFF;
22622 PRE_IO
22623 WRITE_BYTE_F(adr, res)
22624 POST_IO
22625 RET(12)
22626 }
22627 res = 0;
22628 PRE_IO
22629 WRITE_BYTE_F(adr, res)
22630 POST_IO
22631 RET(12)
22632}
22633
22634// STCC
22635OPCODE(0x53DF)
22636{
22637 u32 adr, res;
22638 u32 src, dst;
22639
22640 adr = AREG(7);
22641 AREG(7) += 2;
22642 if ((!flag_NotZ) || (flag_C & 0x100))
22643 {
22644 res = 0xFF;
22645 PRE_IO
22646 WRITE_BYTE_F(adr, res)
22647 POST_IO
22648 RET(12)
22649 }
22650 res = 0;
22651 PRE_IO
22652 WRITE_BYTE_F(adr, res)
22653 POST_IO
22654 RET(12)
22655}
22656
22657// STCC
22658OPCODE(0x54DF)
22659{
22660 u32 adr, res;
22661 u32 src, dst;
22662
22663 adr = AREG(7);
22664 AREG(7) += 2;
22665 if (!(flag_C & 0x100))
22666 {
22667 res = 0xFF;
22668 PRE_IO
22669 WRITE_BYTE_F(adr, res)
22670 POST_IO
22671 RET(12)
22672 }
22673 res = 0;
22674 PRE_IO
22675 WRITE_BYTE_F(adr, res)
22676 POST_IO
22677 RET(12)
22678}
22679
22680// STCC
22681OPCODE(0x55DF)
22682{
22683 u32 adr, res;
22684 u32 src, dst;
22685
22686 adr = AREG(7);
22687 AREG(7) += 2;
22688 if (flag_C & 0x100)
22689 {
22690 res = 0xFF;
22691 PRE_IO
22692 WRITE_BYTE_F(adr, res)
22693 POST_IO
22694 RET(12)
22695 }
22696 res = 0;
22697 PRE_IO
22698 WRITE_BYTE_F(adr, res)
22699 POST_IO
22700 RET(12)
22701}
22702
22703// STCC
22704OPCODE(0x56DF)
22705{
22706 u32 adr, res;
22707 u32 src, dst;
22708
22709 adr = AREG(7);
22710 AREG(7) += 2;
22711 if (flag_NotZ)
22712 {
22713 res = 0xFF;
22714 PRE_IO
22715 WRITE_BYTE_F(adr, res)
22716 POST_IO
22717 RET(12)
22718 }
22719 res = 0;
22720 PRE_IO
22721 WRITE_BYTE_F(adr, res)
22722 POST_IO
22723 RET(12)
22724}
22725
22726// STCC
22727OPCODE(0x57DF)
22728{
22729 u32 adr, res;
22730 u32 src, dst;
22731
22732 adr = AREG(7);
22733 AREG(7) += 2;
22734 if (!flag_NotZ)
22735 {
22736 res = 0xFF;
22737 PRE_IO
22738 WRITE_BYTE_F(adr, res)
22739 POST_IO
22740 RET(12)
22741 }
22742 res = 0;
22743 PRE_IO
22744 WRITE_BYTE_F(adr, res)
22745 POST_IO
22746 RET(12)
22747}
22748
22749// STCC
22750OPCODE(0x58DF)
22751{
22752 u32 adr, res;
22753 u32 src, dst;
22754
22755 adr = AREG(7);
22756 AREG(7) += 2;
22757 if (!(flag_V & 0x80))
22758 {
22759 res = 0xFF;
22760 PRE_IO
22761 WRITE_BYTE_F(adr, res)
22762 POST_IO
22763 RET(12)
22764 }
22765 res = 0;
22766 PRE_IO
22767 WRITE_BYTE_F(adr, res)
22768 POST_IO
22769 RET(12)
22770}
22771
22772// STCC
22773OPCODE(0x59DF)
22774{
22775 u32 adr, res;
22776 u32 src, dst;
22777
22778 adr = AREG(7);
22779 AREG(7) += 2;
22780 if (flag_V & 0x80)
22781 {
22782 res = 0xFF;
22783 PRE_IO
22784 WRITE_BYTE_F(adr, res)
22785 POST_IO
22786 RET(12)
22787 }
22788 res = 0;
22789 PRE_IO
22790 WRITE_BYTE_F(adr, res)
22791 POST_IO
22792 RET(12)
22793}
22794
22795// STCC
22796OPCODE(0x5ADF)
22797{
22798 u32 adr, res;
22799 u32 src, dst;
22800
22801 adr = AREG(7);
22802 AREG(7) += 2;
22803 if (!(flag_N & 0x80))
22804 {
22805 res = 0xFF;
22806 PRE_IO
22807 WRITE_BYTE_F(adr, res)
22808 POST_IO
22809 RET(12)
22810 }
22811 res = 0;
22812 PRE_IO
22813 WRITE_BYTE_F(adr, res)
22814 POST_IO
22815 RET(12)
22816}
22817
22818// STCC
22819OPCODE(0x5BDF)
22820{
22821 u32 adr, res;
22822 u32 src, dst;
22823
22824 adr = AREG(7);
22825 AREG(7) += 2;
22826 if (flag_N & 0x80)
22827 {
22828 res = 0xFF;
22829 PRE_IO
22830 WRITE_BYTE_F(adr, res)
22831 POST_IO
22832 RET(12)
22833 }
22834 res = 0;
22835 PRE_IO
22836 WRITE_BYTE_F(adr, res)
22837 POST_IO
22838 RET(12)
22839}
22840
22841// STCC
22842OPCODE(0x5CDF)
22843{
22844 u32 adr, res;
22845 u32 src, dst;
22846
22847 adr = AREG(7);
22848 AREG(7) += 2;
22849 if (!((flag_N ^ flag_V) & 0x80))
22850 {
22851 res = 0xFF;
22852 PRE_IO
22853 WRITE_BYTE_F(adr, res)
22854 POST_IO
22855 RET(12)
22856 }
22857 res = 0;
22858 PRE_IO
22859 WRITE_BYTE_F(adr, res)
22860 POST_IO
22861 RET(12)
22862}
22863
22864// STCC
22865OPCODE(0x5DDF)
22866{
22867 u32 adr, res;
22868 u32 src, dst;
22869
22870 adr = AREG(7);
22871 AREG(7) += 2;
22872 if ((flag_N ^ flag_V) & 0x80)
22873 {
22874 res = 0xFF;
22875 PRE_IO
22876 WRITE_BYTE_F(adr, res)
22877 POST_IO
22878 RET(12)
22879 }
22880 res = 0;
22881 PRE_IO
22882 WRITE_BYTE_F(adr, res)
22883 POST_IO
22884 RET(12)
22885}
22886
22887// STCC
22888OPCODE(0x5EDF)
22889{
22890 u32 adr, res;
22891 u32 src, dst;
22892
22893 adr = AREG(7);
22894 AREG(7) += 2;
22895 if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
22896 {
22897 res = 0xFF;
22898 PRE_IO
22899 WRITE_BYTE_F(adr, res)
22900 POST_IO
22901 RET(12)
22902 }
22903 res = 0;
22904 PRE_IO
22905 WRITE_BYTE_F(adr, res)
22906 POST_IO
22907 RET(12)
22908}
22909
22910// STCC
22911OPCODE(0x5FDF)
22912{
22913 u32 adr, res;
22914 u32 src, dst;
22915
22916 adr = AREG(7);
22917 AREG(7) += 2;
22918 if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
22919 {
22920 res = 0xFF;
22921 PRE_IO
22922 WRITE_BYTE_F(adr, res)
22923 POST_IO
22924 RET(12)
22925 }
22926 res = 0;
22927 PRE_IO
22928 WRITE_BYTE_F(adr, res)
22929 POST_IO
22930 RET(12)
22931}
22932
22933// STCC
22934OPCODE(0x50E7)
22935{
22936 u32 adr, res;
22937 u32 src, dst;
22938
22939 adr = AREG(7) - 2;
22940 AREG(7) = adr;
22941 res = 0xFF;
22942 PRE_IO
22943 WRITE_BYTE_F(adr, res)
22944 POST_IO
22945 RET(14)
22946}
22947
22948// STCC
22949OPCODE(0x51E7)
22950{
22951 u32 adr, res;
22952 u32 src, dst;
22953
22954 adr = AREG(7) - 2;
22955 AREG(7) = adr;
22956 res = 0;
22957 PRE_IO
22958 WRITE_BYTE_F(adr, res)
22959 POST_IO
22960 RET(14)
22961}
22962
22963// STCC
22964OPCODE(0x52E7)
22965{
22966 u32 adr, res;
22967 u32 src, dst;
22968
22969 adr = AREG(7) - 2;
22970 AREG(7) = adr;
22971 if (flag_NotZ && (!(flag_C & 0x100)))
22972 {
22973 res = 0xFF;
22974 PRE_IO
22975 WRITE_BYTE_F(adr, res)
22976 POST_IO
22977 RET(14)
22978 }
22979 res = 0;
22980 PRE_IO
22981 WRITE_BYTE_F(adr, res)
22982 POST_IO
22983 RET(14)
22984}
22985
22986// STCC
22987OPCODE(0x53E7)
22988{
22989 u32 adr, res;
22990 u32 src, dst;
22991
22992 adr = AREG(7) - 2;
22993 AREG(7) = adr;
22994 if ((!flag_NotZ) || (flag_C & 0x100))
22995 {
22996 res = 0xFF;
22997 PRE_IO
22998 WRITE_BYTE_F(adr, res)
22999 POST_IO
23000 RET(14)
23001 }
23002 res = 0;
23003 PRE_IO
23004 WRITE_BYTE_F(adr, res)
23005 POST_IO
23006 RET(14)
23007}
23008
23009// STCC
23010OPCODE(0x54E7)
23011{
23012 u32 adr, res;
23013 u32 src, dst;
23014
23015 adr = AREG(7) - 2;
23016 AREG(7) = adr;
23017 if (!(flag_C & 0x100))
23018 {
23019 res = 0xFF;
23020 PRE_IO
23021 WRITE_BYTE_F(adr, res)
23022 POST_IO
23023 RET(14)
23024 }
23025 res = 0;
23026 PRE_IO
23027 WRITE_BYTE_F(adr, res)
23028 POST_IO
23029 RET(14)
23030}
23031
23032// STCC
23033OPCODE(0x55E7)
23034{
23035 u32 adr, res;
23036 u32 src, dst;
23037
23038 adr = AREG(7) - 2;
23039 AREG(7) = adr;
23040 if (flag_C & 0x100)
23041 {
23042 res = 0xFF;
23043 PRE_IO
23044 WRITE_BYTE_F(adr, res)
23045 POST_IO
23046 RET(14)
23047 }
23048 res = 0;
23049 PRE_IO
23050 WRITE_BYTE_F(adr, res)
23051 POST_IO
23052 RET(14)
23053}
23054
23055// STCC
23056OPCODE(0x56E7)
23057{
23058 u32 adr, res;
23059 u32 src, dst;
23060
23061 adr = AREG(7) - 2;
23062 AREG(7) = adr;
23063 if (flag_NotZ)
23064 {
23065 res = 0xFF;
23066 PRE_IO
23067 WRITE_BYTE_F(adr, res)
23068 POST_IO
23069 RET(14)
23070 }
23071 res = 0;
23072 PRE_IO
23073 WRITE_BYTE_F(adr, res)
23074 POST_IO
23075 RET(14)
23076}
23077
23078// STCC
23079OPCODE(0x57E7)
23080{
23081 u32 adr, res;
23082 u32 src, dst;
23083
23084 adr = AREG(7) - 2;
23085 AREG(7) = adr;
23086 if (!flag_NotZ)
23087 {
23088 res = 0xFF;
23089 PRE_IO
23090 WRITE_BYTE_F(adr, res)
23091 POST_IO
23092 RET(14)
23093 }
23094 res = 0;
23095 PRE_IO
23096 WRITE_BYTE_F(adr, res)
23097 POST_IO
23098 RET(14)
23099}
23100
23101// STCC
23102OPCODE(0x58E7)
23103{
23104 u32 adr, res;
23105 u32 src, dst;
23106
23107 adr = AREG(7) - 2;
23108 AREG(7) = adr;
23109 if (!(flag_V & 0x80))
23110 {
23111 res = 0xFF;
23112 PRE_IO
23113 WRITE_BYTE_F(adr, res)
23114 POST_IO
23115 RET(14)
23116 }
23117 res = 0;
23118 PRE_IO
23119 WRITE_BYTE_F(adr, res)
23120 POST_IO
23121 RET(14)
23122}
23123
23124// STCC
23125OPCODE(0x59E7)
23126{
23127 u32 adr, res;
23128 u32 src, dst;
23129
23130 adr = AREG(7) - 2;
23131 AREG(7) = adr;
23132 if (flag_V & 0x80)
23133 {
23134 res = 0xFF;
23135 PRE_IO
23136 WRITE_BYTE_F(adr, res)
23137 POST_IO
23138 RET(14)
23139 }
23140 res = 0;
23141 PRE_IO
23142 WRITE_BYTE_F(adr, res)
23143 POST_IO
23144 RET(14)
23145}
23146
23147// STCC
23148OPCODE(0x5AE7)
23149{
23150 u32 adr, res;
23151 u32 src, dst;
23152
23153 adr = AREG(7) - 2;
23154 AREG(7) = adr;
23155 if (!(flag_N & 0x80))
23156 {
23157 res = 0xFF;
23158 PRE_IO
23159 WRITE_BYTE_F(adr, res)
23160 POST_IO
23161 RET(14)
23162 }
23163 res = 0;
23164 PRE_IO
23165 WRITE_BYTE_F(adr, res)
23166 POST_IO
23167 RET(14)
23168}
23169
23170// STCC
23171OPCODE(0x5BE7)
23172{
23173 u32 adr, res;
23174 u32 src, dst;
23175
23176 adr = AREG(7) - 2;
23177 AREG(7) = adr;
23178 if (flag_N & 0x80)
23179 {
23180 res = 0xFF;
23181 PRE_IO
23182 WRITE_BYTE_F(adr, res)
23183 POST_IO
23184 RET(14)
23185 }
23186 res = 0;
23187 PRE_IO
23188 WRITE_BYTE_F(adr, res)
23189 POST_IO
23190 RET(14)
23191}
23192
23193// STCC
23194OPCODE(0x5CE7)
23195{
23196 u32 adr, res;
23197 u32 src, dst;
23198
23199 adr = AREG(7) - 2;
23200 AREG(7) = adr;
23201 if (!((flag_N ^ flag_V) & 0x80))
23202 {
23203 res = 0xFF;
23204 PRE_IO
23205 WRITE_BYTE_F(adr, res)
23206 POST_IO
23207 RET(14)
23208 }
23209 res = 0;
23210 PRE_IO
23211 WRITE_BYTE_F(adr, res)
23212 POST_IO
23213 RET(14)
23214}
23215
23216// STCC
23217OPCODE(0x5DE7)
23218{
23219 u32 adr, res;
23220 u32 src, dst;
23221
23222 adr = AREG(7) - 2;
23223 AREG(7) = adr;
23224 if ((flag_N ^ flag_V) & 0x80)
23225 {
23226 res = 0xFF;
23227 PRE_IO
23228 WRITE_BYTE_F(adr, res)
23229 POST_IO
23230 RET(14)
23231 }
23232 res = 0;
23233 PRE_IO
23234 WRITE_BYTE_F(adr, res)
23235 POST_IO
23236 RET(14)
23237}
23238
23239// STCC
23240OPCODE(0x5EE7)
23241{
23242 u32 adr, res;
23243 u32 src, dst;
23244
23245 adr = AREG(7) - 2;
23246 AREG(7) = adr;
23247 if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
23248 {
23249 res = 0xFF;
23250 PRE_IO
23251 WRITE_BYTE_F(adr, res)
23252 POST_IO
23253 RET(14)
23254 }
23255 res = 0;
23256 PRE_IO
23257 WRITE_BYTE_F(adr, res)
23258 POST_IO
23259 RET(14)
23260}
23261
23262// STCC
23263OPCODE(0x5FE7)
23264{
23265 u32 adr, res;
23266 u32 src, dst;
23267
23268 adr = AREG(7) - 2;
23269 AREG(7) = adr;
23270 if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
23271 {
23272 res = 0xFF;
23273 PRE_IO
23274 WRITE_BYTE_F(adr, res)
23275 POST_IO
23276 RET(14)
23277 }
23278 res = 0;
23279 PRE_IO
23280 WRITE_BYTE_F(adr, res)
23281 POST_IO
23282 RET(14)
23283}
23284
23285// DBCC
23286OPCODE(0x50C8)
23287{
23288 u32 adr, res;
23289 u32 src, dst;
23290
23291 PC++;
23292RET(12)
23293}
23294
23295// DBCC
23296OPCODE(0x51C8)
23297{
23298 u32 adr, res;
23299 u32 src, dst;
23300
23301 res = DREGu16((Opcode >> 0) & 7);
23302 res--;
23303 DREGu16((Opcode >> 0) & 7) = res;
23304 if ((s32)res != -1)
23305 {
23306 u32 newPC;
23307
be26eb23 23308 newPC = GET_PC;
70357ce5 23309 newPC += GET_SWORD;
23310 SET_PC(newPC);
23311 CHECK_BRANCH_EXCEPTION(newPC)
23312 RET(10)
23313 }
23314 PC++;
23315RET(14)
23316}
23317
23318// DBCC
23319OPCODE(0x52C8)
23320{
23321 u32 adr, res;
23322 u32 src, dst;
23323
23324 if ((!flag_NotZ) || (flag_C & 0x100))
23325 {
23326 res = DREGu16((Opcode >> 0) & 7);
23327 res--;
23328 DREGu16((Opcode >> 0) & 7) = res;
23329 if ((s32)res != -1)
23330 {
23331 u32 newPC;
23332
be26eb23 23333 newPC = GET_PC;
70357ce5 23334 newPC += GET_SWORD;
23335 SET_PC(newPC);
23336 CHECK_BRANCH_EXCEPTION(newPC)
23337 RET(10)
23338 }
23339 }
23340 else
23341 {
23342 PC++;
23343 RET(12)
23344 }
23345 PC++;
23346RET(14)
23347}
23348
23349// DBCC
23350OPCODE(0x53C8)
23351{
23352 u32 adr, res;
23353 u32 src, dst;
23354
23355 if (flag_NotZ && (!(flag_C & 0x100)))
23356 {
23357 res = DREGu16((Opcode >> 0) & 7);
23358 res--;
23359 DREGu16((Opcode >> 0) & 7) = res;
23360 if ((s32)res != -1)
23361 {
23362 u32 newPC;
23363
be26eb23 23364 newPC = GET_PC;
70357ce5 23365 newPC += GET_SWORD;
23366 SET_PC(newPC);
23367 CHECK_BRANCH_EXCEPTION(newPC)
23368 RET(10)
23369 }
23370 }
23371 else
23372 {
23373 PC++;
23374 RET(12)
23375 }
23376 PC++;
23377RET(14)
23378}
23379
23380// DBCC
23381OPCODE(0x54C8)
23382{
23383 u32 adr, res;
23384 u32 src, dst;
23385
23386 if (flag_C & 0x100)
23387 {
23388 res = DREGu16((Opcode >> 0) & 7);
23389 res--;
23390 DREGu16((Opcode >> 0) & 7) = res;
23391 if ((s32)res != -1)
23392 {
23393 u32 newPC;
23394
be26eb23 23395 newPC = GET_PC;
70357ce5 23396 newPC += GET_SWORD;
23397 SET_PC(newPC);
23398 CHECK_BRANCH_EXCEPTION(newPC)
23399 RET(10)
23400 }
23401 }
23402 else
23403 {
23404 PC++;
23405 RET(12)
23406 }
23407 PC++;
23408RET(14)
23409}
23410
23411// DBCC
23412OPCODE(0x55C8)
23413{
23414 u32 adr, res;
23415 u32 src, dst;
23416
23417 if (!(flag_C & 0x100))
23418 {
23419 res = DREGu16((Opcode >> 0) & 7);
23420 res--;
23421 DREGu16((Opcode >> 0) & 7) = res;
23422 if ((s32)res != -1)
23423 {
23424 u32 newPC;
23425
be26eb23 23426 newPC = GET_PC;
70357ce5 23427 newPC += GET_SWORD;
23428 SET_PC(newPC);
23429 CHECK_BRANCH_EXCEPTION(newPC)
23430 RET(10)
23431 }
23432 }
23433 else
23434 {
23435 PC++;
23436 RET(12)
23437 }
23438 PC++;
23439RET(14)
23440}
23441
23442// DBCC
23443OPCODE(0x56C8)
23444{
23445 u32 adr, res;
23446 u32 src, dst;
23447
23448 if (!flag_NotZ)
23449 {
23450 res = DREGu16((Opcode >> 0) & 7);
23451 res--;
23452 DREGu16((Opcode >> 0) & 7) = res;
23453 if ((s32)res != -1)
23454 {
23455 u32 newPC;
23456
be26eb23 23457 newPC = GET_PC;
70357ce5 23458 newPC += GET_SWORD;
23459 SET_PC(newPC);
23460 CHECK_BRANCH_EXCEPTION(newPC)
23461 RET(10)
23462 }
23463 }
23464 else
23465 {
23466 PC++;
23467 RET(12)
23468 }
23469 PC++;
23470RET(14)
23471}
23472
23473// DBCC
23474OPCODE(0x57C8)
23475{
23476 u32 adr, res;
23477 u32 src, dst;
23478
23479 if (flag_NotZ)
23480 {
23481 res = DREGu16((Opcode >> 0) & 7);
23482 res--;
23483 DREGu16((Opcode >> 0) & 7) = res;
23484 if ((s32)res != -1)
23485 {
23486 u32 newPC;
23487
be26eb23 23488 newPC = GET_PC;
70357ce5 23489 newPC += GET_SWORD;
23490 SET_PC(newPC);
23491 CHECK_BRANCH_EXCEPTION(newPC)
23492 RET(10)
23493 }
23494 }
23495 else
23496 {
23497 PC++;
23498 RET(12)
23499 }
23500 PC++;
23501RET(14)
23502}
23503
23504// DBCC
23505OPCODE(0x58C8)
23506{
23507 u32 adr, res;
23508 u32 src, dst;
23509
23510 if (flag_V & 0x80)
23511 {
23512 res = DREGu16((Opcode >> 0) & 7);
23513 res--;
23514 DREGu16((Opcode >> 0) & 7) = res;
23515 if ((s32)res != -1)
23516 {
23517 u32 newPC;
23518
be26eb23 23519 newPC = GET_PC;
70357ce5 23520 newPC += GET_SWORD;
23521 SET_PC(newPC);
23522 CHECK_BRANCH_EXCEPTION(newPC)
23523 RET(10)
23524 }
23525 }
23526 else
23527 {
23528 PC++;
23529 RET(12)
23530 }
23531 PC++;
23532RET(14)
23533}
23534
23535// DBCC
23536OPCODE(0x59C8)
23537{
23538 u32 adr, res;
23539 u32 src, dst;
23540
23541 if (!(flag_V & 0x80))
23542 {
23543 res = DREGu16((Opcode >> 0) & 7);
23544 res--;
23545 DREGu16((Opcode >> 0) & 7) = res;
23546 if ((s32)res != -1)
23547 {
23548 u32 newPC;
23549
be26eb23 23550 newPC = GET_PC;
70357ce5 23551 newPC += GET_SWORD;
23552 SET_PC(newPC);
23553 CHECK_BRANCH_EXCEPTION(newPC)
23554 RET(10)
23555 }
23556 }
23557 else
23558 {
23559 PC++;
23560 RET(12)
23561 }
23562 PC++;
23563RET(14)
23564}
23565
23566// DBCC
23567OPCODE(0x5AC8)
23568{
23569 u32 adr, res;
23570 u32 src, dst;
23571
23572 if (flag_N & 0x80)
23573 {
23574 res = DREGu16((Opcode >> 0) & 7);
23575 res--;
23576 DREGu16((Opcode >> 0) & 7) = res;
23577 if ((s32)res != -1)
23578 {
23579 u32 newPC;
23580
be26eb23 23581 newPC = GET_PC;
70357ce5 23582 newPC += GET_SWORD;
23583 SET_PC(newPC);
23584 CHECK_BRANCH_EXCEPTION(newPC)
23585 RET(10)
23586 }
23587 }
23588 else
23589 {
23590 PC++;
23591 RET(12)
23592 }
23593 PC++;
23594RET(14)
23595}
23596
23597// DBCC
23598OPCODE(0x5BC8)
23599{
23600 u32 adr, res;
23601 u32 src, dst;
23602
23603 if (!(flag_N & 0x80))
23604 {
23605 res = DREGu16((Opcode >> 0) & 7);
23606 res--;
23607 DREGu16((Opcode >> 0) & 7) = res;
23608 if ((s32)res != -1)
23609 {
23610 u32 newPC;
23611
be26eb23 23612 newPC = GET_PC;
70357ce5 23613 newPC += GET_SWORD;
23614 SET_PC(newPC);
23615 CHECK_BRANCH_EXCEPTION(newPC)
23616 RET(10)
23617 }
23618 }
23619 else
23620 {
23621 PC++;
23622 RET(12)
23623 }
23624 PC++;
23625RET(14)
23626}
23627
23628// DBCC
23629OPCODE(0x5CC8)
23630{
23631 u32 adr, res;
23632 u32 src, dst;
23633
23634 if ((flag_N ^ flag_V) & 0x80)
23635 {
23636 res = DREGu16((Opcode >> 0) & 7);
23637 res--;
23638 DREGu16((Opcode >> 0) & 7) = res;
23639 if ((s32)res != -1)
23640 {
23641 u32 newPC;
23642
be26eb23 23643 newPC = GET_PC;
70357ce5 23644 newPC += GET_SWORD;
23645 SET_PC(newPC);
23646 CHECK_BRANCH_EXCEPTION(newPC)
23647 RET(10)
23648 }
23649 }
23650 else
23651 {
23652 PC++;
23653 RET(12)
23654 }
23655 PC++;
23656RET(14)
23657}
23658
23659// DBCC
23660OPCODE(0x5DC8)
23661{
23662 u32 adr, res;
23663 u32 src, dst;
23664
23665 if (!((flag_N ^ flag_V) & 0x80))
23666 {
23667 res = DREGu16((Opcode >> 0) & 7);
23668 res--;
23669 DREGu16((Opcode >> 0) & 7) = res;
23670 if ((s32)res != -1)
23671 {
23672 u32 newPC;
23673
be26eb23 23674 newPC = GET_PC;
70357ce5 23675 newPC += GET_SWORD;
23676 SET_PC(newPC);
23677 CHECK_BRANCH_EXCEPTION(newPC)
23678 RET(10)
23679 }
23680 }
23681 else
23682 {
23683 PC++;
23684 RET(12)
23685 }
23686 PC++;
23687RET(14)
23688}
23689
23690// DBCC
23691OPCODE(0x5EC8)
23692{
23693 u32 adr, res;
23694 u32 src, dst;
23695
23696 if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
23697 {
23698 res = DREGu16((Opcode >> 0) & 7);
23699 res--;
23700 DREGu16((Opcode >> 0) & 7) = res;
23701 if ((s32)res != -1)
23702 {
23703 u32 newPC;
23704
be26eb23 23705 newPC = GET_PC;
70357ce5 23706 newPC += GET_SWORD;
23707 SET_PC(newPC);
23708 CHECK_BRANCH_EXCEPTION(newPC)
23709 RET(10)
23710 }
23711 }
23712 else
23713 {
23714 PC++;
23715 RET(12)
23716 }
23717 PC++;
23718RET(14)
23719}
23720
23721// DBCC
23722OPCODE(0x5FC8)
23723{
23724 u32 adr, res;
23725 u32 src, dst;
23726
23727 if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
23728 {
23729 res = DREGu16((Opcode >> 0) & 7);
23730 res--;
23731 DREGu16((Opcode >> 0) & 7) = res;
23732 if ((s32)res != -1)
23733 {
23734 u32 newPC;
23735
be26eb23 23736 newPC = GET_PC;
70357ce5 23737 newPC += GET_SWORD;
23738 SET_PC(newPC);
23739 CHECK_BRANCH_EXCEPTION(newPC)
23740 RET(10)
23741 }
23742 }
23743 else
23744 {
23745 PC++;
23746 RET(12)
23747 }
23748 PC++;
23749RET(14)
23750}
23751
23752// ADDQ
23753OPCODE(0x5000)
23754{
23755 u32 adr, res;
23756 u32 src, dst;
23757
23758 src = (((Opcode >> 9) - 1) & 7) + 1;
23759 dst = DREGu8((Opcode >> 0) & 7);
23760 res = dst + src;
23761 flag_N = flag_X = flag_C = res;
23762 flag_V = (src ^ res) & (dst ^ res);
23763 flag_NotZ = res & 0xFF;
23764 DREGu8((Opcode >> 0) & 7) = res;
23765RET(4)
23766}
23767
23768// ADDQ
23769OPCODE(0x5010)
23770{
23771 u32 adr, res;
23772 u32 src, dst;
23773
23774 src = (((Opcode >> 9) - 1) & 7) + 1;
23775 adr = AREG((Opcode >> 0) & 7);
23776 PRE_IO
23777 READ_BYTE_F(adr, dst)
23778 res = dst + src;
23779 flag_N = flag_X = flag_C = res;
23780 flag_V = (src ^ res) & (dst ^ res);
23781 flag_NotZ = res & 0xFF;
23782 WRITE_BYTE_F(adr, res)
23783 POST_IO
23784RET(12)
23785}
23786
23787// ADDQ
23788OPCODE(0x5018)
23789{
23790 u32 adr, res;
23791 u32 src, dst;
23792
23793 src = (((Opcode >> 9) - 1) & 7) + 1;
23794 adr = AREG((Opcode >> 0) & 7);
23795 AREG((Opcode >> 0) & 7) += 1;
23796 PRE_IO
23797 READ_BYTE_F(adr, dst)
23798 res = dst + src;
23799 flag_N = flag_X = flag_C = res;
23800 flag_V = (src ^ res) & (dst ^ res);
23801 flag_NotZ = res & 0xFF;
23802 WRITE_BYTE_F(adr, res)
23803 POST_IO
23804RET(12)
23805}
23806
23807// ADDQ
23808OPCODE(0x5020)
23809{
23810 u32 adr, res;
23811 u32 src, dst;
23812
23813 src = (((Opcode >> 9) - 1) & 7) + 1;
23814 adr = AREG((Opcode >> 0) & 7) - 1;
23815 AREG((Opcode >> 0) & 7) = adr;
23816 PRE_IO
23817 READ_BYTE_F(adr, dst)
23818 res = dst + src;
23819 flag_N = flag_X = flag_C = res;
23820 flag_V = (src ^ res) & (dst ^ res);
23821 flag_NotZ = res & 0xFF;
23822 WRITE_BYTE_F(adr, res)
23823 POST_IO
23824RET(14)
23825}
23826
23827// ADDQ
23828OPCODE(0x5028)
23829{
23830 u32 adr, res;
23831 u32 src, dst;
23832
23833 src = (((Opcode >> 9) - 1) & 7) + 1;
23834 FETCH_SWORD(adr);
23835 adr += AREG((Opcode >> 0) & 7);
23836 PRE_IO
23837 READ_BYTE_F(adr, dst)
23838 res = dst + src;
23839 flag_N = flag_X = flag_C = res;
23840 flag_V = (src ^ res) & (dst ^ res);
23841 flag_NotZ = res & 0xFF;
23842 WRITE_BYTE_F(adr, res)
23843 POST_IO
23844RET(16)
23845}
23846
23847// ADDQ
23848OPCODE(0x5030)
23849{
23850 u32 adr, res;
23851 u32 src, dst;
23852
23853 src = (((Opcode >> 9) - 1) & 7) + 1;
23854 adr = AREG((Opcode >> 0) & 7);
23855 DECODE_EXT_WORD
23856 PRE_IO
23857 READ_BYTE_F(adr, dst)
23858 res = dst + src;
23859 flag_N = flag_X = flag_C = res;
23860 flag_V = (src ^ res) & (dst ^ res);
23861 flag_NotZ = res & 0xFF;
23862 WRITE_BYTE_F(adr, res)
23863 POST_IO
23864RET(18)
23865}
23866
23867// ADDQ
23868OPCODE(0x5038)
23869{
23870 u32 adr, res;
23871 u32 src, dst;
23872
23873 src = (((Opcode >> 9) - 1) & 7) + 1;
23874 FETCH_SWORD(adr);
23875 PRE_IO
23876 READ_BYTE_F(adr, dst)
23877 res = dst + src;
23878 flag_N = flag_X = flag_C = res;
23879 flag_V = (src ^ res) & (dst ^ res);
23880 flag_NotZ = res & 0xFF;
23881 WRITE_BYTE_F(adr, res)
23882 POST_IO
23883RET(16)
23884}
23885
23886// ADDQ
23887OPCODE(0x5039)
23888{
23889 u32 adr, res;
23890 u32 src, dst;
23891
23892 src = (((Opcode >> 9) - 1) & 7) + 1;
23893 FETCH_LONG(adr);
23894 PRE_IO
23895 READ_BYTE_F(adr, dst)
23896 res = dst + src;
23897 flag_N = flag_X = flag_C = res;
23898 flag_V = (src ^ res) & (dst ^ res);
23899 flag_NotZ = res & 0xFF;
23900 WRITE_BYTE_F(adr, res)
23901 POST_IO
23902RET(20)
23903}
23904
23905// ADDQ
23906OPCODE(0x501F)
23907{
23908 u32 adr, res;
23909 u32 src, dst;
23910
23911 src = (((Opcode >> 9) - 1) & 7) + 1;
23912 adr = AREG(7);
23913 AREG(7) += 2;
23914 PRE_IO
23915 READ_BYTE_F(adr, dst)
23916 res = dst + src;
23917 flag_N = flag_X = flag_C = res;
23918 flag_V = (src ^ res) & (dst ^ res);
23919 flag_NotZ = res & 0xFF;
23920 WRITE_BYTE_F(adr, res)
23921 POST_IO
23922RET(12)
23923}
23924
23925// ADDQ
23926OPCODE(0x5027)
23927{
23928 u32 adr, res;
23929 u32 src, dst;
23930
23931 src = (((Opcode >> 9) - 1) & 7) + 1;
23932 adr = AREG(7) - 2;
23933 AREG(7) = adr;
23934 PRE_IO
23935 READ_BYTE_F(adr, dst)
23936 res = dst + src;
23937 flag_N = flag_X = flag_C = res;
23938 flag_V = (src ^ res) & (dst ^ res);
23939 flag_NotZ = res & 0xFF;
23940 WRITE_BYTE_F(adr, res)
23941 POST_IO
23942RET(14)
23943}
23944
23945// ADDQ
23946OPCODE(0x5040)
23947{
23948 u32 adr, res;
23949 u32 src, dst;
23950
23951 src = (((Opcode >> 9) - 1) & 7) + 1;
23952 dst = DREGu16((Opcode >> 0) & 7);
23953 res = dst + src;
23954 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
23955 flag_N = flag_X = flag_C = res >> 8;
23956 flag_NotZ = res & 0xFFFF;
23957 DREGu16((Opcode >> 0) & 7) = res;
23958RET(4)
23959}
23960
23961// ADDQ
23962OPCODE(0x5048)
23963{
23964 u32 adr, res;
23965 u32 src, dst;
23966
23967 src = (((Opcode >> 9) - 1) & 7) + 1;
23968 dst = AREGu32((Opcode >> 0) & 7);
23969 res = dst + src;
23970 AREG((Opcode >> 0) & 7) = res;
03e4f2a3 23971#ifdef USE_CYCLONE_TIMING
70357ce5 23972RET(4)
23973#else
23974RET(8)
23975#endif
23976}
23977
23978// ADDQ
23979OPCODE(0x5050)
23980{
23981 u32 adr, res;
23982 u32 src, dst;
23983
23984 src = (((Opcode >> 9) - 1) & 7) + 1;
23985 adr = AREG((Opcode >> 0) & 7);
23986 PRE_IO
23987 READ_WORD_F(adr, dst)
23988 res = dst + src;
23989 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
23990 flag_N = flag_X = flag_C = res >> 8;
23991 flag_NotZ = res & 0xFFFF;
23992 WRITE_WORD_F(adr, res)
23993 POST_IO
23994RET(12)
23995}
23996
23997// ADDQ
23998OPCODE(0x5058)
23999{
24000 u32 adr, res;
24001 u32 src, dst;
24002
24003 src = (((Opcode >> 9) - 1) & 7) + 1;
24004 adr = AREG((Opcode >> 0) & 7);
24005 AREG((Opcode >> 0) & 7) += 2;
24006 PRE_IO
24007 READ_WORD_F(adr, dst)
24008 res = dst + src;
24009 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
24010 flag_N = flag_X = flag_C = res >> 8;
24011 flag_NotZ = res & 0xFFFF;
24012 WRITE_WORD_F(adr, res)
24013 POST_IO
24014RET(12)
24015}
24016
24017// ADDQ
24018OPCODE(0x5060)
24019{
24020 u32 adr, res;
24021 u32 src, dst;
24022
24023 src = (((Opcode >> 9) - 1) & 7) + 1;
24024 adr = AREG((Opcode >> 0) & 7) - 2;
24025 AREG((Opcode >> 0) & 7) = adr;
24026 PRE_IO
24027 READ_WORD_F(adr, dst)
24028 res = dst + src;
24029 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
24030 flag_N = flag_X = flag_C = res >> 8;
24031 flag_NotZ = res & 0xFFFF;
24032 WRITE_WORD_F(adr, res)
24033 POST_IO
24034RET(14)
24035}
24036
24037// ADDQ
24038OPCODE(0x5068)
24039{
24040 u32 adr, res;
24041 u32 src, dst;
24042
24043 src = (((Opcode >> 9) - 1) & 7) + 1;
24044 FETCH_SWORD(adr);
24045 adr += AREG((Opcode >> 0) & 7);
24046 PRE_IO
24047 READ_WORD_F(adr, dst)
24048 res = dst + src;
24049 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
24050 flag_N = flag_X = flag_C = res >> 8;
24051 flag_NotZ = res & 0xFFFF;
24052 WRITE_WORD_F(adr, res)
24053 POST_IO
24054RET(16)
24055}
24056
24057// ADDQ
24058OPCODE(0x5070)
24059{
24060 u32 adr, res;
24061 u32 src, dst;
24062
24063 src = (((Opcode >> 9) - 1) & 7) + 1;
24064 adr = AREG((Opcode >> 0) & 7);
24065 DECODE_EXT_WORD
24066 PRE_IO
24067 READ_WORD_F(adr, dst)
24068 res = dst + src;
24069 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
24070 flag_N = flag_X = flag_C = res >> 8;
24071 flag_NotZ = res & 0xFFFF;
24072 WRITE_WORD_F(adr, res)
24073 POST_IO
24074RET(18)
24075}
24076
24077// ADDQ
24078OPCODE(0x5078)
24079{
24080 u32 adr, res;
24081 u32 src, dst;
24082
24083 src = (((Opcode >> 9) - 1) & 7) + 1;
24084 FETCH_SWORD(adr);
24085 PRE_IO
24086 READ_WORD_F(adr, dst)
24087 res = dst + src;
24088 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
24089 flag_N = flag_X = flag_C = res >> 8;
24090 flag_NotZ = res & 0xFFFF;
24091 WRITE_WORD_F(adr, res)
24092 POST_IO
24093RET(16)
24094}
24095
24096// ADDQ
24097OPCODE(0x5079)
24098{
24099 u32 adr, res;
24100 u32 src, dst;
24101
24102 src = (((Opcode >> 9) - 1) & 7) + 1;
24103 FETCH_LONG(adr);
24104 PRE_IO
24105 READ_WORD_F(adr, dst)
24106 res = dst + src;
24107 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
24108 flag_N = flag_X = flag_C = res >> 8;
24109 flag_NotZ = res & 0xFFFF;
24110 WRITE_WORD_F(adr, res)
24111 POST_IO
24112RET(20)
24113}
24114
24115// ADDQ
24116OPCODE(0x505F)
24117{
24118 u32 adr, res;
24119 u32 src, dst;
24120
24121 src = (((Opcode >> 9) - 1) & 7) + 1;
24122 adr = AREG(7);
24123 AREG(7) += 2;
24124 PRE_IO
24125 READ_WORD_F(adr, dst)
24126 res = dst + src;
24127 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
24128 flag_N = flag_X = flag_C = res >> 8;
24129 flag_NotZ = res & 0xFFFF;
24130 WRITE_WORD_F(adr, res)
24131 POST_IO
24132RET(12)
24133}
24134
24135// ADDQ
24136OPCODE(0x5067)
24137{
24138 u32 adr, res;
24139 u32 src, dst;
24140
24141 src = (((Opcode >> 9) - 1) & 7) + 1;
24142 adr = AREG(7) - 2;
24143 AREG(7) = adr;
24144 PRE_IO
24145 READ_WORD_F(adr, dst)
24146 res = dst + src;
24147 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
24148 flag_N = flag_X = flag_C = res >> 8;
24149 flag_NotZ = res & 0xFFFF;
24150 WRITE_WORD_F(adr, res)
24151 POST_IO
24152RET(14)
24153}
24154
24155// ADDQ
24156OPCODE(0x5080)
24157{
24158 u32 adr, res;
24159 u32 src, dst;
24160
24161 src = (((Opcode >> 9) - 1) & 7) + 1;
24162 dst = DREGu32((Opcode >> 0) & 7);
24163 res = dst + src;
24164 flag_NotZ = res;
24165 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
24166 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
24167 flag_N = res >> 24;
24168 DREGu32((Opcode >> 0) & 7) = res;
24169RET(8)
24170}
24171
24172// ADDQ
24173OPCODE(0x5088)
24174{
24175 u32 adr, res;
24176 u32 src, dst;
24177
24178 src = (((Opcode >> 9) - 1) & 7) + 1;
24179 dst = AREGu32((Opcode >> 0) & 7);
24180 res = dst + src;
24181 AREG((Opcode >> 0) & 7) = res;
24182RET(8)
24183}
24184
24185// ADDQ
24186OPCODE(0x5090)
24187{
24188 u32 adr, res;
24189 u32 src, dst;
24190
24191 src = (((Opcode >> 9) - 1) & 7) + 1;
24192 adr = AREG((Opcode >> 0) & 7);
24193 PRE_IO
24194 READ_LONG_F(adr, dst)
24195 res = dst + src;
24196 flag_NotZ = res;
24197 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
24198 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
24199 flag_N = res >> 24;
24200 WRITE_LONG_F(adr, res)
24201 POST_IO
24202RET(20)
24203}
24204
24205// ADDQ
24206OPCODE(0x5098)
24207{
24208 u32 adr, res;
24209 u32 src, dst;
24210
24211 src = (((Opcode >> 9) - 1) & 7) + 1;
24212 adr = AREG((Opcode >> 0) & 7);
24213 AREG((Opcode >> 0) & 7) += 4;
24214 PRE_IO
24215 READ_LONG_F(adr, dst)
24216 res = dst + src;
24217 flag_NotZ = res;
24218 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
24219 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
24220 flag_N = res >> 24;
24221 WRITE_LONG_F(adr, res)
24222 POST_IO
24223RET(20)
24224}
24225
24226// ADDQ
24227OPCODE(0x50A0)
24228{
24229 u32 adr, res;
24230 u32 src, dst;
24231
24232 src = (((Opcode >> 9) - 1) & 7) + 1;
24233 adr = AREG((Opcode >> 0) & 7) - 4;
24234 AREG((Opcode >> 0) & 7) = adr;
24235 PRE_IO
24236 READ_LONG_F(adr, dst)
24237 res = dst + src;
24238 flag_NotZ = res;
24239 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
24240 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
24241 flag_N = res >> 24;
24242 WRITE_LONG_F(adr, res)
24243 POST_IO
24244RET(22)
24245}
24246
24247// ADDQ
24248OPCODE(0x50A8)
24249{
24250 u32 adr, res;
24251 u32 src, dst;
24252
24253 src = (((Opcode >> 9) - 1) & 7) + 1;
24254 FETCH_SWORD(adr);
24255 adr += AREG((Opcode >> 0) & 7);
24256 PRE_IO
24257 READ_LONG_F(adr, dst)
24258 res = dst + src;
24259 flag_NotZ = res;
24260 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
24261 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
24262 flag_N = res >> 24;
24263 WRITE_LONG_F(adr, res)
24264 POST_IO
24265RET(24)
24266}
24267
24268// ADDQ
24269OPCODE(0x50B0)
24270{
24271 u32 adr, res;
24272 u32 src, dst;
24273
24274 src = (((Opcode >> 9) - 1) & 7) + 1;
24275 adr = AREG((Opcode >> 0) & 7);
24276 DECODE_EXT_WORD
24277 PRE_IO
24278 READ_LONG_F(adr, dst)
24279 res = dst + src;
24280 flag_NotZ = res;
24281 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
24282 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
24283 flag_N = res >> 24;
24284 WRITE_LONG_F(adr, res)
24285 POST_IO
24286RET(26)
24287}
24288
24289// ADDQ
24290OPCODE(0x50B8)
24291{
24292 u32 adr, res;
24293 u32 src, dst;
24294
24295 src = (((Opcode >> 9) - 1) & 7) + 1;
24296 FETCH_SWORD(adr);
24297 PRE_IO
24298 READ_LONG_F(adr, dst)
24299 res = dst + src;
24300 flag_NotZ = res;
24301 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
24302 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
24303 flag_N = res >> 24;
24304 WRITE_LONG_F(adr, res)
24305 POST_IO
24306RET(24)
24307}
24308
24309// ADDQ
24310OPCODE(0x50B9)
24311{
24312 u32 adr, res;
24313 u32 src, dst;
24314
24315 src = (((Opcode >> 9) - 1) & 7) + 1;
24316 FETCH_LONG(adr);
24317 PRE_IO
24318 READ_LONG_F(adr, dst)
24319 res = dst + src;
24320 flag_NotZ = res;
24321 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
24322 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
24323 flag_N = res >> 24;
24324 WRITE_LONG_F(adr, res)
24325 POST_IO
24326RET(28)
24327}
24328
24329// ADDQ
24330OPCODE(0x509F)
24331{
24332 u32 adr, res;
24333 u32 src, dst;
24334
24335 src = (((Opcode >> 9) - 1) & 7) + 1;
24336 adr = AREG(7);
24337 AREG(7) += 4;
24338 PRE_IO
24339 READ_LONG_F(adr, dst)
24340 res = dst + src;
24341 flag_NotZ = res;
24342 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
24343 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
24344 flag_N = res >> 24;
24345 WRITE_LONG_F(adr, res)
24346 POST_IO
24347RET(20)
24348}
24349
24350// ADDQ
24351OPCODE(0x50A7)
24352{
24353 u32 adr, res;
24354 u32 src, dst;
24355
24356 src = (((Opcode >> 9) - 1) & 7) + 1;
24357 adr = AREG(7) - 4;
24358 AREG(7) = adr;
24359 PRE_IO
24360 READ_LONG_F(adr, dst)
24361 res = dst + src;
24362 flag_NotZ = res;
24363 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
24364 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
24365 flag_N = res >> 24;
24366 WRITE_LONG_F(adr, res)
24367 POST_IO
24368RET(22)
24369}
24370
24371// SUBQ
24372OPCODE(0x5100)
24373{
24374 u32 adr, res;
24375 u32 src, dst;
24376
24377 src = (((Opcode >> 9) - 1) & 7) + 1;
24378 dst = DREGu8((Opcode >> 0) & 7);
24379 res = dst - src;
24380 flag_N = flag_X = flag_C = res;
24381 flag_V = (src ^ dst) & (res ^ dst);
24382 flag_NotZ = res & 0xFF;
24383 DREGu8((Opcode >> 0) & 7) = res;
24384RET(4)
24385}
24386
24387// SUBQ
24388OPCODE(0x5110)
24389{
24390 u32 adr, res;
24391 u32 src, dst;
24392
24393 src = (((Opcode >> 9) - 1) & 7) + 1;
24394 adr = AREG((Opcode >> 0) & 7);
24395 PRE_IO
24396 READ_BYTE_F(adr, dst)
24397 res = dst - src;
24398 flag_N = flag_X = flag_C = res;
24399 flag_V = (src ^ dst) & (res ^ dst);
24400 flag_NotZ = res & 0xFF;
24401 WRITE_BYTE_F(adr, res)
24402 POST_IO
24403RET(12)
24404}
24405
24406// SUBQ
24407OPCODE(0x5118)
24408{
24409 u32 adr, res;
24410 u32 src, dst;
24411
24412 src = (((Opcode >> 9) - 1) & 7) + 1;
24413 adr = AREG((Opcode >> 0) & 7);
24414 AREG((Opcode >> 0) & 7) += 1;
24415 PRE_IO
24416 READ_BYTE_F(adr, dst)
24417 res = dst - src;
24418 flag_N = flag_X = flag_C = res;
24419 flag_V = (src ^ dst) & (res ^ dst);
24420 flag_NotZ = res & 0xFF;
24421 WRITE_BYTE_F(adr, res)
24422 POST_IO
24423RET(12)
24424}
24425
24426// SUBQ
24427OPCODE(0x5120)
24428{
24429 u32 adr, res;
24430 u32 src, dst;
24431
24432 src = (((Opcode >> 9) - 1) & 7) + 1;
24433 adr = AREG((Opcode >> 0) & 7) - 1;
24434 AREG((Opcode >> 0) & 7) = adr;
24435 PRE_IO
24436 READ_BYTE_F(adr, dst)
24437 res = dst - src;
24438 flag_N = flag_X = flag_C = res;
24439 flag_V = (src ^ dst) & (res ^ dst);
24440 flag_NotZ = res & 0xFF;
24441 WRITE_BYTE_F(adr, res)
24442 POST_IO
24443RET(14)
24444}
24445
24446// SUBQ
24447OPCODE(0x5128)
24448{
24449 u32 adr, res;
24450 u32 src, dst;
24451
24452 src = (((Opcode >> 9) - 1) & 7) + 1;
24453 FETCH_SWORD(adr);
24454 adr += AREG((Opcode >> 0) & 7);
24455 PRE_IO
24456 READ_BYTE_F(adr, dst)
24457 res = dst - src;
24458 flag_N = flag_X = flag_C = res;
24459 flag_V = (src ^ dst) & (res ^ dst);
24460 flag_NotZ = res & 0xFF;
24461 WRITE_BYTE_F(adr, res)
24462 POST_IO
24463RET(16)
24464}
24465
24466// SUBQ
24467OPCODE(0x5130)
24468{
24469 u32 adr, res;
24470 u32 src, dst;
24471
24472 src = (((Opcode >> 9) - 1) & 7) + 1;
24473 adr = AREG((Opcode >> 0) & 7);
24474 DECODE_EXT_WORD
24475 PRE_IO
24476 READ_BYTE_F(adr, dst)
24477 res = dst - src;
24478 flag_N = flag_X = flag_C = res;
24479 flag_V = (src ^ dst) & (res ^ dst);
24480 flag_NotZ = res & 0xFF;
24481 WRITE_BYTE_F(adr, res)
24482 POST_IO
24483RET(18)
24484}
24485
24486// SUBQ
24487OPCODE(0x5138)
24488{
24489 u32 adr, res;
24490 u32 src, dst;
24491
24492 src = (((Opcode >> 9) - 1) & 7) + 1;
24493 FETCH_SWORD(adr);
24494 PRE_IO
24495 READ_BYTE_F(adr, dst)
24496 res = dst - src;
24497 flag_N = flag_X = flag_C = res;
24498 flag_V = (src ^ dst) & (res ^ dst);
24499 flag_NotZ = res & 0xFF;
24500 WRITE_BYTE_F(adr, res)
24501 POST_IO
24502RET(16)
24503}
24504
24505// SUBQ
24506OPCODE(0x5139)
24507{
24508 u32 adr, res;
24509 u32 src, dst;
24510
24511 src = (((Opcode >> 9) - 1) & 7) + 1;
24512 FETCH_LONG(adr);
24513 PRE_IO
24514 READ_BYTE_F(adr, dst)
24515 res = dst - src;
24516 flag_N = flag_X = flag_C = res;
24517 flag_V = (src ^ dst) & (res ^ dst);
24518 flag_NotZ = res & 0xFF;
24519 WRITE_BYTE_F(adr, res)
24520 POST_IO
24521RET(20)
24522}
24523
24524// SUBQ
24525OPCODE(0x511F)
24526{
24527 u32 adr, res;
24528 u32 src, dst;
24529
24530 src = (((Opcode >> 9) - 1) & 7) + 1;
24531 adr = AREG(7);
24532 AREG(7) += 2;
24533 PRE_IO
24534 READ_BYTE_F(adr, dst)
24535 res = dst - src;
24536 flag_N = flag_X = flag_C = res;
24537 flag_V = (src ^ dst) & (res ^ dst);
24538 flag_NotZ = res & 0xFF;
24539 WRITE_BYTE_F(adr, res)
24540 POST_IO
24541RET(12)
24542}
24543
24544// SUBQ
24545OPCODE(0x5127)
24546{
24547 u32 adr, res;
24548 u32 src, dst;
24549
24550 src = (((Opcode >> 9) - 1) & 7) + 1;
24551 adr = AREG(7) - 2;
24552 AREG(7) = adr;
24553 PRE_IO
24554 READ_BYTE_F(adr, dst)
24555 res = dst - src;
24556 flag_N = flag_X = flag_C = res;
24557 flag_V = (src ^ dst) & (res ^ dst);
24558 flag_NotZ = res & 0xFF;
24559 WRITE_BYTE_F(adr, res)
24560 POST_IO
24561RET(14)
24562}
24563
24564// SUBQ
24565OPCODE(0x5140)
24566{
24567 u32 adr, res;
24568 u32 src, dst;
24569
24570 src = (((Opcode >> 9) - 1) & 7) + 1;
24571 dst = DREGu16((Opcode >> 0) & 7);
24572 res = dst - src;
24573 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
24574 flag_N = flag_X = flag_C = res >> 8;
24575 flag_NotZ = res & 0xFFFF;
24576 DREGu16((Opcode >> 0) & 7) = res;
24577RET(4)
24578}
24579
24580// SUBQ
24581OPCODE(0x5148)
24582{
24583 u32 adr, res;
24584 u32 src, dst;
24585
24586 src = (((Opcode >> 9) - 1) & 7) + 1;
24587 dst = AREGu32((Opcode >> 0) & 7);
24588 res = dst - src;
24589 AREG((Opcode >> 0) & 7) = res;
24590RET(8)
24591}
24592
24593// SUBQ
24594OPCODE(0x5150)
24595{
24596 u32 adr, res;
24597 u32 src, dst;
24598
24599 src = (((Opcode >> 9) - 1) & 7) + 1;
24600 adr = AREG((Opcode >> 0) & 7);
24601 PRE_IO
24602 READ_WORD_F(adr, dst)
24603 res = dst - src;
24604 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
24605 flag_N = flag_X = flag_C = res >> 8;
24606 flag_NotZ = res & 0xFFFF;
24607 WRITE_WORD_F(adr, res)
24608 POST_IO
24609RET(12)
24610}
24611
24612// SUBQ
24613OPCODE(0x5158)
24614{
24615 u32 adr, res;
24616 u32 src, dst;
24617
24618 src = (((Opcode >> 9) - 1) & 7) + 1;
24619 adr = AREG((Opcode >> 0) & 7);
24620 AREG((Opcode >> 0) & 7) += 2;
24621 PRE_IO
24622 READ_WORD_F(adr, dst)
24623 res = dst - src;
24624 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
24625 flag_N = flag_X = flag_C = res >> 8;
24626 flag_NotZ = res & 0xFFFF;
24627 WRITE_WORD_F(adr, res)
24628 POST_IO
24629RET(12)
24630}
24631
24632// SUBQ
24633OPCODE(0x5160)
24634{
24635 u32 adr, res;
24636 u32 src, dst;
24637
24638 src = (((Opcode >> 9) - 1) & 7) + 1;
24639 adr = AREG((Opcode >> 0) & 7) - 2;
24640 AREG((Opcode >> 0) & 7) = adr;
24641 PRE_IO
24642 READ_WORD_F(adr, dst)
24643 res = dst - src;
24644 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
24645 flag_N = flag_X = flag_C = res >> 8;
24646 flag_NotZ = res & 0xFFFF;
24647 WRITE_WORD_F(adr, res)
24648 POST_IO
24649RET(14)
24650}
24651
24652// SUBQ
24653OPCODE(0x5168)
24654{
24655 u32 adr, res;
24656 u32 src, dst;
24657
24658 src = (((Opcode >> 9) - 1) & 7) + 1;
24659 FETCH_SWORD(adr);
24660 adr += AREG((Opcode >> 0) & 7);
24661 PRE_IO
24662 READ_WORD_F(adr, dst)
24663 res = dst - src;
24664 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
24665 flag_N = flag_X = flag_C = res >> 8;
24666 flag_NotZ = res & 0xFFFF;
24667 WRITE_WORD_F(adr, res)
24668 POST_IO
24669RET(16)
24670}
24671
24672// SUBQ
24673OPCODE(0x5170)
24674{
24675 u32 adr, res;
24676 u32 src, dst;
24677
24678 src = (((Opcode >> 9) - 1) & 7) + 1;
24679 adr = AREG((Opcode >> 0) & 7);
24680 DECODE_EXT_WORD
24681 PRE_IO
24682 READ_WORD_F(adr, dst)
24683 res = dst - src;
24684 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
24685 flag_N = flag_X = flag_C = res >> 8;
24686 flag_NotZ = res & 0xFFFF;
24687 WRITE_WORD_F(adr, res)
24688 POST_IO
24689RET(18)
24690}
24691
24692// SUBQ
24693OPCODE(0x5178)
24694{
24695 u32 adr, res;
24696 u32 src, dst;
24697
24698 src = (((Opcode >> 9) - 1) & 7) + 1;
24699 FETCH_SWORD(adr);
24700 PRE_IO
24701 READ_WORD_F(adr, dst)
24702 res = dst - src;
24703 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
24704 flag_N = flag_X = flag_C = res >> 8;
24705 flag_NotZ = res & 0xFFFF;
24706 WRITE_WORD_F(adr, res)
24707 POST_IO
24708RET(16)
24709}
24710
24711// SUBQ
24712OPCODE(0x5179)
24713{
24714 u32 adr, res;
24715 u32 src, dst;
24716
24717 src = (((Opcode >> 9) - 1) & 7) + 1;
24718 FETCH_LONG(adr);
24719 PRE_IO
24720 READ_WORD_F(adr, dst)
24721 res = dst - src;
24722 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
24723 flag_N = flag_X = flag_C = res >> 8;
24724 flag_NotZ = res & 0xFFFF;
24725 WRITE_WORD_F(adr, res)
24726 POST_IO
24727RET(20)
24728}
24729
24730// SUBQ
24731OPCODE(0x515F)
24732{
24733 u32 adr, res;
24734 u32 src, dst;
24735
24736 src = (((Opcode >> 9) - 1) & 7) + 1;
24737 adr = AREG(7);
24738 AREG(7) += 2;
24739 PRE_IO
24740 READ_WORD_F(adr, dst)
24741 res = dst - src;
24742 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
24743 flag_N = flag_X = flag_C = res >> 8;
24744 flag_NotZ = res & 0xFFFF;
24745 WRITE_WORD_F(adr, res)
24746 POST_IO
24747RET(12)
24748}
24749
24750// SUBQ
24751OPCODE(0x5167)
24752{
24753 u32 adr, res;
24754 u32 src, dst;
24755
24756 src = (((Opcode >> 9) - 1) & 7) + 1;
24757 adr = AREG(7) - 2;
24758 AREG(7) = adr;
24759 PRE_IO
24760 READ_WORD_F(adr, dst)
24761 res = dst - src;
24762 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
24763 flag_N = flag_X = flag_C = res >> 8;
24764 flag_NotZ = res & 0xFFFF;
24765 WRITE_WORD_F(adr, res)
24766 POST_IO
24767RET(14)
24768}
24769
24770// SUBQ
24771OPCODE(0x5180)
24772{
24773 u32 adr, res;
24774 u32 src, dst;
24775
24776 src = (((Opcode >> 9) - 1) & 7) + 1;
24777 dst = DREGu32((Opcode >> 0) & 7);
24778 res = dst - src;
24779 flag_NotZ = res;
24780 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
24781 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
24782 flag_N = res >> 24;
24783 DREGu32((Opcode >> 0) & 7) = res;
24784RET(8)
24785}
24786
24787// SUBQ
24788OPCODE(0x5188)
24789{
24790 u32 adr, res;
24791 u32 src, dst;
24792
24793 src = (((Opcode >> 9) - 1) & 7) + 1;
24794 dst = AREGu32((Opcode >> 0) & 7);
24795 res = dst - src;
24796 AREG((Opcode >> 0) & 7) = res;
24797RET(8)
24798}
24799
24800// SUBQ
24801OPCODE(0x5190)
24802{
24803 u32 adr, res;
24804 u32 src, dst;
24805
24806 src = (((Opcode >> 9) - 1) & 7) + 1;
24807 adr = AREG((Opcode >> 0) & 7);
24808 PRE_IO
24809 READ_LONG_F(adr, dst)
24810 res = dst - src;
24811 flag_NotZ = res;
24812 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
24813 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
24814 flag_N = res >> 24;
24815 WRITE_LONG_F(adr, res)
24816 POST_IO
24817RET(20)
24818}
24819
24820// SUBQ
24821OPCODE(0x5198)
24822{
24823 u32 adr, res;
24824 u32 src, dst;
24825
24826 src = (((Opcode >> 9) - 1) & 7) + 1;
24827 adr = AREG((Opcode >> 0) & 7);
24828 AREG((Opcode >> 0) & 7) += 4;
24829 PRE_IO
24830 READ_LONG_F(adr, dst)
24831 res = dst - src;
24832 flag_NotZ = res;
24833 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
24834 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
24835 flag_N = res >> 24;
24836 WRITE_LONG_F(adr, res)
24837 POST_IO
24838RET(20)
24839}
24840
24841// SUBQ
24842OPCODE(0x51A0)
24843{
24844 u32 adr, res;
24845 u32 src, dst;
24846
24847 src = (((Opcode >> 9) - 1) & 7) + 1;
24848 adr = AREG((Opcode >> 0) & 7) - 4;
24849 AREG((Opcode >> 0) & 7) = adr;
24850 PRE_IO
24851 READ_LONG_F(adr, dst)
24852 res = dst - src;
24853 flag_NotZ = res;
24854 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
24855 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
24856 flag_N = res >> 24;
24857 WRITE_LONG_F(adr, res)
24858 POST_IO
24859RET(22)
24860}
24861
24862// SUBQ
24863OPCODE(0x51A8)
24864{
24865 u32 adr, res;
24866 u32 src, dst;
24867
24868 src = (((Opcode >> 9) - 1) & 7) + 1;
24869 FETCH_SWORD(adr);
24870 adr += AREG((Opcode >> 0) & 7);
24871 PRE_IO
24872 READ_LONG_F(adr, dst)
24873 res = dst - src;
24874 flag_NotZ = res;
24875 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
24876 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
24877 flag_N = res >> 24;
24878 WRITE_LONG_F(adr, res)
24879 POST_IO
24880RET(24)
24881}
24882
24883// SUBQ
24884OPCODE(0x51B0)
24885{
24886 u32 adr, res;
24887 u32 src, dst;
24888
24889 src = (((Opcode >> 9) - 1) & 7) + 1;
24890 adr = AREG((Opcode >> 0) & 7);
24891 DECODE_EXT_WORD
24892 PRE_IO
24893 READ_LONG_F(adr, dst)
24894 res = dst - src;
24895 flag_NotZ = res;
24896 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
24897 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
24898 flag_N = res >> 24;
24899 WRITE_LONG_F(adr, res)
24900 POST_IO
24901RET(26)
24902}
24903
24904// SUBQ
24905OPCODE(0x51B8)
24906{
24907 u32 adr, res;
24908 u32 src, dst;
24909
24910 src = (((Opcode >> 9) - 1) & 7) + 1;
24911 FETCH_SWORD(adr);
24912 PRE_IO
24913 READ_LONG_F(adr, dst)
24914 res = dst - src;
24915 flag_NotZ = res;
24916 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
24917 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
24918 flag_N = res >> 24;
24919 WRITE_LONG_F(adr, res)
24920 POST_IO
24921RET(24)
24922}
24923
24924// SUBQ
24925OPCODE(0x51B9)
24926{
24927 u32 adr, res;
24928 u32 src, dst;
24929
24930 src = (((Opcode >> 9) - 1) & 7) + 1;
24931 FETCH_LONG(adr);
24932 PRE_IO
24933 READ_LONG_F(adr, dst)
24934 res = dst - src;
24935 flag_NotZ = res;
24936 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
24937 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
24938 flag_N = res >> 24;
24939 WRITE_LONG_F(adr, res)
24940 POST_IO
24941RET(28)
24942}
24943
24944// SUBQ
24945OPCODE(0x519F)
24946{
24947 u32 adr, res;
24948 u32 src, dst;
24949
24950 src = (((Opcode >> 9) - 1) & 7) + 1;
24951 adr = AREG(7);
24952 AREG(7) += 4;
24953 PRE_IO
24954 READ_LONG_F(adr, dst)
24955 res = dst - src;
24956 flag_NotZ = res;
24957 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
24958 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
24959 flag_N = res >> 24;
24960 WRITE_LONG_F(adr, res)
24961 POST_IO
24962RET(20)
24963}
24964
24965// SUBQ
24966OPCODE(0x51A7)
24967{
24968 u32 adr, res;
24969 u32 src, dst;
24970
24971 src = (((Opcode >> 9) - 1) & 7) + 1;
24972 adr = AREG(7) - 4;
24973 AREG(7) = adr;
24974 PRE_IO
24975 READ_LONG_F(adr, dst)
24976 res = dst - src;
24977 flag_NotZ = res;
24978 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
24979 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
24980 flag_N = res >> 24;
24981 WRITE_LONG_F(adr, res)
24982 POST_IO
24983RET(22)
24984}
24985
24986// BCC
24987OPCODE(0x6201)
24988{
24989 u32 adr, res;
24990 u32 src, dst;
24991
24992 if (flag_NotZ && (!(flag_C & 0x100)))
24993 {
24994 PC += ((s8)(Opcode & 0xFE)) >> 1;
24995 m68kcontext.io_cycle_counter -= 2;
24996 }
24997RET(8)
24998}
24999
25000// BCC
25001OPCODE(0x6301)
25002{
25003 u32 adr, res;
25004 u32 src, dst;
25005
25006 if ((!flag_NotZ) || (flag_C & 0x100))
25007 {
25008 PC += ((s8)(Opcode & 0xFE)) >> 1;
25009 m68kcontext.io_cycle_counter -= 2;
25010 }
25011RET(8)
25012}
25013
25014// BCC
25015OPCODE(0x6401)
25016{
25017 u32 adr, res;
25018 u32 src, dst;
25019
25020 if (!(flag_C & 0x100))
25021 {
25022 PC += ((s8)(Opcode & 0xFE)) >> 1;
25023 m68kcontext.io_cycle_counter -= 2;
25024 }
25025RET(8)
25026}
25027
25028// BCC
25029OPCODE(0x6501)
25030{
25031 u32 adr, res;
25032 u32 src, dst;
25033
25034 if (flag_C & 0x100)
25035 {
25036 PC += ((s8)(Opcode & 0xFE)) >> 1;
25037 m68kcontext.io_cycle_counter -= 2;
25038 }
25039RET(8)
25040}
25041
25042// BCC
25043OPCODE(0x6601)
25044{
25045 u32 adr, res;
25046 u32 src, dst;
25047
25048 if (flag_NotZ)
25049 {
25050 PC += ((s8)(Opcode & 0xFE)) >> 1;
25051 m68kcontext.io_cycle_counter -= 2;
25052 }
25053RET(8)
25054}
25055
25056// BCC
25057OPCODE(0x6701)
25058{
25059 u32 adr, res;
25060 u32 src, dst;
25061
25062 if (!flag_NotZ)
25063 {
25064 PC += ((s8)(Opcode & 0xFE)) >> 1;
25065 m68kcontext.io_cycle_counter -= 2;
25066 }
25067RET(8)
25068}
25069
25070// BCC
25071OPCODE(0x6801)
25072{
25073 u32 adr, res;
25074 u32 src, dst;
25075
25076 if (!(flag_V & 0x80))
25077 {
25078 PC += ((s8)(Opcode & 0xFE)) >> 1;
25079 m68kcontext.io_cycle_counter -= 2;
25080 }
25081RET(8)
25082}
25083
25084// BCC
25085OPCODE(0x6901)
25086{
25087 u32 adr, res;
25088 u32 src, dst;
25089
25090 if (flag_V & 0x80)
25091 {
25092 PC += ((s8)(Opcode & 0xFE)) >> 1;
25093 m68kcontext.io_cycle_counter -= 2;
25094 }
25095RET(8)
25096}
25097
25098// BCC
25099OPCODE(0x6A01)
25100{
25101 u32 adr, res;
25102 u32 src, dst;
25103
25104 if (!(flag_N & 0x80))
25105 {
25106 PC += ((s8)(Opcode & 0xFE)) >> 1;
25107 m68kcontext.io_cycle_counter -= 2;
25108 }
25109RET(8)
25110}
25111
25112// BCC
25113OPCODE(0x6B01)
25114{
25115 u32 adr, res;
25116 u32 src, dst;
25117
25118 if (flag_N & 0x80)
25119 {
25120 PC += ((s8)(Opcode & 0xFE)) >> 1;
25121 m68kcontext.io_cycle_counter -= 2;
25122 }
25123RET(8)
25124}
25125
25126// BCC
25127OPCODE(0x6C01)
25128{
25129 u32 adr, res;
25130 u32 src, dst;
25131
25132 if (!((flag_N ^ flag_V) & 0x80))
25133 {
25134 PC += ((s8)(Opcode & 0xFE)) >> 1;
25135 m68kcontext.io_cycle_counter -= 2;
25136 }
25137RET(8)
25138}
25139
25140// BCC
25141OPCODE(0x6D01)
25142{
25143 u32 adr, res;
25144 u32 src, dst;
25145
25146 if ((flag_N ^ flag_V) & 0x80)
25147 {
25148 PC += ((s8)(Opcode & 0xFE)) >> 1;
25149 m68kcontext.io_cycle_counter -= 2;
25150 }
25151RET(8)
25152}
25153
25154// BCC
25155OPCODE(0x6E01)
25156{
25157 u32 adr, res;
25158 u32 src, dst;
25159
25160 if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
25161 {
25162 PC += ((s8)(Opcode & 0xFE)) >> 1;
25163 m68kcontext.io_cycle_counter -= 2;
25164 }
25165RET(8)
25166}
25167
25168// BCC
25169OPCODE(0x6F01)
25170{
25171 u32 adr, res;
25172 u32 src, dst;
25173
25174 if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
25175 {
25176 PC += ((s8)(Opcode & 0xFE)) >> 1;
25177 m68kcontext.io_cycle_counter -= 2;
25178 }
25179RET(8)
25180}
25181
25182// BCC16
25183OPCODE(0x6200)
25184{
25185 u32 adr, res;
25186 u32 src, dst;
25187
25188 if (flag_NotZ && (!(flag_C & 0x100)))
25189 {
25190 u32 newPC;
25191
be26eb23 25192 newPC = GET_PC;
70357ce5 25193 newPC += GET_SWORD;
25194 SET_PC(newPC);
25195 CHECK_BRANCH_EXCEPTION(newPC)
25196 RET(10)
25197 }
25198 PC++;
25199RET(12)
25200}
25201
25202// BCC16
25203OPCODE(0x6300)
25204{
25205 u32 adr, res;
25206 u32 src, dst;
25207
25208 if ((!flag_NotZ) || (flag_C & 0x100))
25209 {
25210 u32 newPC;
25211
be26eb23 25212 newPC = GET_PC;
70357ce5 25213 newPC += GET_SWORD;
25214 SET_PC(newPC);
25215 CHECK_BRANCH_EXCEPTION(newPC)
25216 RET(10)
25217 }
25218 PC++;
25219RET(12)
25220}
25221
25222// BCC16
25223OPCODE(0x6400)
25224{
25225 u32 adr, res;
25226 u32 src, dst;
25227
25228 if (!(flag_C & 0x100))
25229 {
25230 u32 newPC;
25231
be26eb23 25232 newPC = GET_PC;
70357ce5 25233 newPC += GET_SWORD;
25234 SET_PC(newPC);
25235 CHECK_BRANCH_EXCEPTION(newPC)
25236 RET(10)
25237 }
25238 PC++;
25239RET(12)
25240}
25241
25242// BCC16
25243OPCODE(0x6500)
25244{
25245 u32 adr, res;
25246 u32 src, dst;
25247
25248 if (flag_C & 0x100)
25249 {
25250 u32 newPC;
25251
be26eb23 25252 newPC = GET_PC;
70357ce5 25253 newPC += GET_SWORD;
25254 SET_PC(newPC);
25255 CHECK_BRANCH_EXCEPTION(newPC)
25256 RET(10)
25257 }
25258 PC++;
25259RET(12)
25260}
25261
25262// BCC16
25263OPCODE(0x6600)
25264{
25265 u32 adr, res;
25266 u32 src, dst;
25267
25268 if (flag_NotZ)
25269 {
25270 u32 newPC;
25271
be26eb23 25272 newPC = GET_PC;
70357ce5 25273 newPC += GET_SWORD;
25274 SET_PC(newPC);
25275 CHECK_BRANCH_EXCEPTION(newPC)
25276 RET(10)
25277 }
25278 PC++;
25279RET(12)
25280}
25281
25282// BCC16
25283OPCODE(0x6700)
25284{
25285 u32 adr, res;
25286 u32 src, dst;
25287
25288 if (!flag_NotZ)
25289 {
25290 u32 newPC;
25291
be26eb23 25292 newPC = GET_PC;
70357ce5 25293 newPC += GET_SWORD;
25294 SET_PC(newPC);
25295 CHECK_BRANCH_EXCEPTION(newPC)
25296 RET(10)
25297 }
25298 PC++;
25299RET(12)
25300}
25301
25302// BCC16
25303OPCODE(0x6800)
25304{
25305 u32 adr, res;
25306 u32 src, dst;
25307
25308 if (!(flag_V & 0x80))
25309 {
25310 u32 newPC;
25311
be26eb23 25312 newPC = GET_PC;
70357ce5 25313 newPC += GET_SWORD;
25314 SET_PC(newPC);
25315 CHECK_BRANCH_EXCEPTION(newPC)
25316 RET(10)
25317 }
25318 PC++;
25319RET(12)
25320}
25321
25322// BCC16
25323OPCODE(0x6900)
25324{
25325 u32 adr, res;
25326 u32 src, dst;
25327
25328 if (flag_V & 0x80)
25329 {
25330 u32 newPC;
25331
be26eb23 25332 newPC = GET_PC;
70357ce5 25333 newPC += GET_SWORD;
25334 SET_PC(newPC);
25335 CHECK_BRANCH_EXCEPTION(newPC)
25336 RET(10)
25337 }
25338 PC++;
25339RET(12)
25340}
25341
25342// BCC16
25343OPCODE(0x6A00)
25344{
25345 u32 adr, res;
25346 u32 src, dst;
25347
25348 if (!(flag_N & 0x80))
25349 {
25350 u32 newPC;
25351
be26eb23 25352 newPC = GET_PC;
70357ce5 25353 newPC += GET_SWORD;
25354 SET_PC(newPC);
25355 CHECK_BRANCH_EXCEPTION(newPC)
25356 RET(10)
25357 }
25358 PC++;
25359RET(12)
25360}
25361
25362// BCC16
25363OPCODE(0x6B00)
25364{
25365 u32 adr, res;
25366 u32 src, dst;
25367
25368 if (flag_N & 0x80)
25369 {
25370 u32 newPC;
25371
be26eb23 25372 newPC = GET_PC;
70357ce5 25373 newPC += GET_SWORD;
25374 SET_PC(newPC);
25375 CHECK_BRANCH_EXCEPTION(newPC)
25376 RET(10)
25377 }
25378 PC++;
25379RET(12)
25380}
25381
25382// BCC16
25383OPCODE(0x6C00)
25384{
25385 u32 adr, res;
25386 u32 src, dst;
25387
25388 if (!((flag_N ^ flag_V) & 0x80))
25389 {
25390 u32 newPC;
25391
be26eb23 25392 newPC = GET_PC;
70357ce5 25393 newPC += GET_SWORD;
25394 SET_PC(newPC);
25395 CHECK_BRANCH_EXCEPTION(newPC)
25396 RET(10)
25397 }
25398 PC++;
25399RET(12)
25400}
25401
25402// BCC16
25403OPCODE(0x6D00)
25404{
25405 u32 adr, res;
25406 u32 src, dst;
25407
25408 if ((flag_N ^ flag_V) & 0x80)
25409 {
25410 u32 newPC;
25411
be26eb23 25412 newPC = GET_PC;
70357ce5 25413 newPC += GET_SWORD;
25414 SET_PC(newPC);
25415 CHECK_BRANCH_EXCEPTION(newPC)
25416 RET(10)
25417 }
25418 PC++;
25419RET(12)
25420}
25421
25422// BCC16
25423OPCODE(0x6E00)
25424{
25425 u32 adr, res;
25426 u32 src, dst;
25427
25428 if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80)))
25429 {
25430 u32 newPC;
25431
be26eb23 25432 newPC = GET_PC;
70357ce5 25433 newPC += GET_SWORD;
25434 SET_PC(newPC);
25435 CHECK_BRANCH_EXCEPTION(newPC)
25436 RET(10)
25437 }
25438 PC++;
25439RET(12)
25440}
25441
25442// BCC16
25443OPCODE(0x6F00)
25444{
25445 u32 adr, res;
25446 u32 src, dst;
25447
25448 if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80))
25449 {
25450 u32 newPC;
25451
be26eb23 25452 newPC = GET_PC;
70357ce5 25453 newPC += GET_SWORD;
25454 SET_PC(newPC);
25455 CHECK_BRANCH_EXCEPTION(newPC)
25456 RET(10)
25457 }
25458 PC++;
25459RET(12)
25460}
25461
25462// BRA
25463OPCODE(0x6001)
25464{
25465#ifdef FAMEC_CHECK_BRANCHES
be26eb23 25466 u32 newPC = GET_PC;
70357ce5 25467 s8 offs=Opcode;
25468 newPC += offs;
25469 SET_PC(newPC);
25470 CHECK_BRANCH_EXCEPTION(offs)
25471#else
25472 PC += ((s8)(Opcode & 0xFE)) >> 1;
25473#endif
25474RET(10)
25475}
25476
25477// BRA16
25478OPCODE(0x6000)
25479{
25480 u32 adr, res;
25481 u32 src, dst;
25482
25483 {
25484 u32 newPC;
25485
be26eb23 25486 newPC = GET_PC;
70357ce5 25487 newPC += GET_SWORD;
25488 SET_PC(newPC);
25489 CHECK_BRANCH_EXCEPTION(newPC)
25490 }
25491RET(10)
25492}
25493
25494// BSR
25495OPCODE(0x6101)
25496{
25497 u32 adr, res;
25498 u32 src, dst;
25499 u32 oldPC;
25500 s8 offs;
25501
25502 PRE_IO
25503
be26eb23 25504 oldPC = GET_PC;
70357ce5 25505 PUSH_32_F(oldPC)
25506#ifdef FAMEC_CHECK_BRANCHES
25507 offs = Opcode;
25508 oldPC += offs;
25509 SET_PC(oldPC);
25510 CHECK_BRANCH_EXCEPTION(offs)
25511#else
25512 PC += ((s8)(Opcode & 0xFE)) >> 1;
25513#endif
25514 POST_IO
25515RET(18)
25516}
25517
25518// BSR16
25519OPCODE(0x6100)
25520{
25521 u32 adr, res;
25522 u32 src, dst;
25523
25524 PRE_IO
25525 {
25526 u32 oldPC, newPC;
25527
be26eb23 25528 newPC = GET_PC;
70357ce5 25529 oldPC = newPC + 2;
25530 PUSH_32_F(oldPC)
25531 newPC += GET_SWORD;
25532 SET_PC(newPC);
25533 CHECK_BRANCH_EXCEPTION(newPC)
25534 }
25535 POST_IO
25536RET(18)
25537}
25538
25539// MOVEQ
25540OPCODE(0x7000)
25541{
25542 u32 adr, res;
25543 u32 src, dst;
25544
25545 res = (s32)(s8)Opcode;
25546 flag_C = flag_V = 0;
25547 flag_N = flag_NotZ = res;
25548 DREGu32((Opcode >> 9) & 7) = res;
25549RET(4)
25550}
25551
25552// ORaD
25553OPCODE(0x8000)
25554{
25555 u32 adr, res;
25556 u32 src, dst;
25557
25558 src = DREGu8((Opcode >> 0) & 7);
25559 res = DREGu8((Opcode >> 9) & 7);
25560 res |= src;
25561 flag_C = 0;
25562 flag_V = 0;
25563 flag_NotZ = res;
25564 flag_N = res;
25565 DREGu8((Opcode >> 9) & 7) = res;
25566RET(4)
25567}
25568
25569// ORaD
25570OPCODE(0x8010)
25571{
25572 u32 adr, res;
25573 u32 src, dst;
25574
25575 adr = AREG((Opcode >> 0) & 7);
25576 PRE_IO
25577 READ_BYTE_F(adr, src)
25578 res = DREGu8((Opcode >> 9) & 7);
25579 res |= src;
25580 flag_C = 0;
25581 flag_V = 0;
25582 flag_NotZ = res;
25583 flag_N = res;
25584 DREGu8((Opcode >> 9) & 7) = res;
25585 POST_IO
25586RET(8)
25587}
25588
25589// ORaD
25590OPCODE(0x8018)
25591{
25592 u32 adr, res;
25593 u32 src, dst;
25594
25595 adr = AREG((Opcode >> 0) & 7);
25596 AREG((Opcode >> 0) & 7) += 1;
25597 PRE_IO
25598 READ_BYTE_F(adr, src)
25599 res = DREGu8((Opcode >> 9) & 7);
25600 res |= src;
25601 flag_C = 0;
25602 flag_V = 0;
25603 flag_NotZ = res;
25604 flag_N = res;
25605 DREGu8((Opcode >> 9) & 7) = res;
25606 POST_IO
25607RET(8)
25608}
25609
25610// ORaD
25611OPCODE(0x8020)
25612{
25613 u32 adr, res;
25614 u32 src, dst;
25615
25616 adr = AREG((Opcode >> 0) & 7) - 1;
25617 AREG((Opcode >> 0) & 7) = adr;
25618 PRE_IO
25619 READ_BYTE_F(adr, src)
25620 res = DREGu8((Opcode >> 9) & 7);
25621 res |= src;
25622 flag_C = 0;
25623 flag_V = 0;
25624 flag_NotZ = res;
25625 flag_N = res;
25626 DREGu8((Opcode >> 9) & 7) = res;
25627 POST_IO
25628RET(10)
25629}
25630
25631// ORaD
25632OPCODE(0x8028)
25633{
25634 u32 adr, res;
25635 u32 src, dst;
25636
25637 FETCH_SWORD(adr);
25638 adr += AREG((Opcode >> 0) & 7);
25639 PRE_IO
25640 READ_BYTE_F(adr, src)
25641 res = DREGu8((Opcode >> 9) & 7);
25642 res |= src;
25643 flag_C = 0;
25644 flag_V = 0;
25645 flag_NotZ = res;
25646 flag_N = res;
25647 DREGu8((Opcode >> 9) & 7) = res;
25648 POST_IO
25649RET(12)
25650}
25651
25652// ORaD
25653OPCODE(0x8030)
25654{
25655 u32 adr, res;
25656 u32 src, dst;
25657
25658 adr = AREG((Opcode >> 0) & 7);
25659 DECODE_EXT_WORD
25660 PRE_IO
25661 READ_BYTE_F(adr, src)
25662 res = DREGu8((Opcode >> 9) & 7);
25663 res |= src;
25664 flag_C = 0;
25665 flag_V = 0;
25666 flag_NotZ = res;
25667 flag_N = res;
25668 DREGu8((Opcode >> 9) & 7) = res;
25669 POST_IO
25670RET(14)
25671}
25672
25673// ORaD
25674OPCODE(0x8038)
25675{
25676 u32 adr, res;
25677 u32 src, dst;
25678
25679 FETCH_SWORD(adr);
25680 PRE_IO
25681 READ_BYTE_F(adr, src)
25682 res = DREGu8((Opcode >> 9) & 7);
25683 res |= src;
25684 flag_C = 0;
25685 flag_V = 0;
25686 flag_NotZ = res;
25687 flag_N = res;
25688 DREGu8((Opcode >> 9) & 7) = res;
25689 POST_IO
25690RET(12)
25691}
25692
25693// ORaD
25694OPCODE(0x8039)
25695{
25696 u32 adr, res;
25697 u32 src, dst;
25698
25699 FETCH_LONG(adr);
25700 PRE_IO
25701 READ_BYTE_F(adr, src)
25702 res = DREGu8((Opcode >> 9) & 7);
25703 res |= src;
25704 flag_C = 0;
25705 flag_V = 0;
25706 flag_NotZ = res;
25707 flag_N = res;
25708 DREGu8((Opcode >> 9) & 7) = res;
25709 POST_IO
25710RET(16)
25711}
25712
25713// ORaD
25714OPCODE(0x803A)
25715{
25716 u32 adr, res;
25717 u32 src, dst;
25718
be26eb23 25719 adr = GET_SWORD + GET_PC;
70357ce5 25720 PC++;
25721 PRE_IO
25722 READ_BYTE_F(adr, src)
25723 res = DREGu8((Opcode >> 9) & 7);
25724 res |= src;
25725 flag_C = 0;
25726 flag_V = 0;
25727 flag_NotZ = res;
25728 flag_N = res;
25729 DREGu8((Opcode >> 9) & 7) = res;
25730 POST_IO
25731RET(12)
25732}
25733
25734// ORaD
25735OPCODE(0x803B)
25736{
25737 u32 adr, res;
25738 u32 src, dst;
25739
be26eb23 25740 adr = GET_PC;
70357ce5 25741 DECODE_EXT_WORD
25742 PRE_IO
25743 READ_BYTE_F(adr, src)
25744 res = DREGu8((Opcode >> 9) & 7);
25745 res |= src;
25746 flag_C = 0;
25747 flag_V = 0;
25748 flag_NotZ = res;
25749 flag_N = res;
25750 DREGu8((Opcode >> 9) & 7) = res;
25751 POST_IO
25752RET(14)
25753}
25754
25755// ORaD
25756OPCODE(0x803C)
25757{
25758 u32 adr, res;
25759 u32 src, dst;
25760
25761 FETCH_BYTE(src);
25762 res = DREGu8((Opcode >> 9) & 7);
25763 res |= src;
25764 flag_C = 0;
25765 flag_V = 0;
25766 flag_NotZ = res;
25767 flag_N = res;
25768 DREGu8((Opcode >> 9) & 7) = res;
25769RET(8)
25770}
25771
25772// ORaD
25773OPCODE(0x801F)
25774{
25775 u32 adr, res;
25776 u32 src, dst;
25777
25778 adr = AREG(7);
25779 AREG(7) += 2;
25780 PRE_IO
25781 READ_BYTE_F(adr, src)
25782 res = DREGu8((Opcode >> 9) & 7);
25783 res |= src;
25784 flag_C = 0;
25785 flag_V = 0;
25786 flag_NotZ = res;
25787 flag_N = res;
25788 DREGu8((Opcode >> 9) & 7) = res;
25789 POST_IO
25790RET(8)
25791}
25792
25793// ORaD
25794OPCODE(0x8027)
25795{
25796 u32 adr, res;
25797 u32 src, dst;
25798
25799 adr = AREG(7) - 2;
25800 AREG(7) = adr;
25801 PRE_IO
25802 READ_BYTE_F(adr, src)
25803 res = DREGu8((Opcode >> 9) & 7);
25804 res |= src;
25805 flag_C = 0;
25806 flag_V = 0;
25807 flag_NotZ = res;
25808 flag_N = res;
25809 DREGu8((Opcode >> 9) & 7) = res;
25810 POST_IO
25811RET(10)
25812}
25813
25814// ORaD
25815OPCODE(0x8040)
25816{
25817 u32 adr, res;
25818 u32 src, dst;
25819
25820 src = DREGu16((Opcode >> 0) & 7);
25821 res = DREGu16((Opcode >> 9) & 7);
25822 res |= src;
25823 flag_C = 0;
25824 flag_V = 0;
25825 flag_NotZ = res;
25826 flag_N = res >> 8;
25827 DREGu16((Opcode >> 9) & 7) = res;
25828RET(4)
25829}
25830
25831// ORaD
25832OPCODE(0x8050)
25833{
25834 u32 adr, res;
25835 u32 src, dst;
25836
25837 adr = AREG((Opcode >> 0) & 7);
25838 PRE_IO
25839 READ_WORD_F(adr, src)
25840 res = DREGu16((Opcode >> 9) & 7);
25841 res |= src;
25842 flag_C = 0;
25843 flag_V = 0;
25844 flag_NotZ = res;
25845 flag_N = res >> 8;
25846 DREGu16((Opcode >> 9) & 7) = res;
25847 POST_IO
25848RET(8)
25849}
25850
25851// ORaD
25852OPCODE(0x8058)
25853{
25854 u32 adr, res;
25855 u32 src, dst;
25856
25857 adr = AREG((Opcode >> 0) & 7);
25858 AREG((Opcode >> 0) & 7) += 2;
25859 PRE_IO
25860 READ_WORD_F(adr, src)
25861 res = DREGu16((Opcode >> 9) & 7);
25862 res |= src;
25863 flag_C = 0;
25864 flag_V = 0;
25865 flag_NotZ = res;
25866 flag_N = res >> 8;
25867 DREGu16((Opcode >> 9) & 7) = res;
25868 POST_IO
25869RET(8)
25870}
25871
25872// ORaD
25873OPCODE(0x8060)
25874{
25875 u32 adr, res;
25876 u32 src, dst;
25877
25878 adr = AREG((Opcode >> 0) & 7) - 2;
25879 AREG((Opcode >> 0) & 7) = adr;
25880 PRE_IO
25881 READ_WORD_F(adr, src)
25882 res = DREGu16((Opcode >> 9) & 7);
25883 res |= src;
25884 flag_C = 0;
25885 flag_V = 0;
25886 flag_NotZ = res;
25887 flag_N = res >> 8;
25888 DREGu16((Opcode >> 9) & 7) = res;
25889 POST_IO
25890RET(10)
25891}
25892
25893// ORaD
25894OPCODE(0x8068)
25895{
25896 u32 adr, res;
25897 u32 src, dst;
25898
25899 FETCH_SWORD(adr);
25900 adr += AREG((Opcode >> 0) & 7);
25901 PRE_IO
25902 READ_WORD_F(adr, src)
25903 res = DREGu16((Opcode >> 9) & 7);
25904 res |= src;
25905 flag_C = 0;
25906 flag_V = 0;
25907 flag_NotZ = res;
25908 flag_N = res >> 8;
25909 DREGu16((Opcode >> 9) & 7) = res;
25910 POST_IO
25911RET(12)
25912}
25913
25914// ORaD
25915OPCODE(0x8070)
25916{
25917 u32 adr, res;
25918 u32 src, dst;
25919
25920 adr = AREG((Opcode >> 0) & 7);
25921 DECODE_EXT_WORD
25922 PRE_IO
25923 READ_WORD_F(adr, src)
25924 res = DREGu16((Opcode >> 9) & 7);
25925 res |= src;
25926 flag_C = 0;
25927 flag_V = 0;
25928 flag_NotZ = res;
25929 flag_N = res >> 8;
25930 DREGu16((Opcode >> 9) & 7) = res;
25931 POST_IO
25932RET(14)
25933}
25934
25935// ORaD
25936OPCODE(0x8078)
25937{
25938 u32 adr, res;
25939 u32 src, dst;
25940
25941 FETCH_SWORD(adr);
25942 PRE_IO
25943 READ_WORD_F(adr, src)
25944 res = DREGu16((Opcode >> 9) & 7);
25945 res |= src;
25946 flag_C = 0;
25947 flag_V = 0;
25948 flag_NotZ = res;
25949 flag_N = res >> 8;
25950 DREGu16((Opcode >> 9) & 7) = res;
25951 POST_IO
25952RET(12)
25953}
25954
25955// ORaD
25956OPCODE(0x8079)
25957{
25958 u32 adr, res;
25959 u32 src, dst;
25960
25961 FETCH_LONG(adr);
25962 PRE_IO
25963 READ_WORD_F(adr, src)
25964 res = DREGu16((Opcode >> 9) & 7);
25965 res |= src;
25966 flag_C = 0;
25967 flag_V = 0;
25968 flag_NotZ = res;
25969 flag_N = res >> 8;
25970 DREGu16((Opcode >> 9) & 7) = res;
25971 POST_IO
25972RET(16)
25973}
25974
25975// ORaD
25976OPCODE(0x807A)
25977{
25978 u32 adr, res;
25979 u32 src, dst;
25980
be26eb23 25981 adr = GET_SWORD + GET_PC;
70357ce5 25982 PC++;
25983 PRE_IO
25984 READ_WORD_F(adr, src)
25985 res = DREGu16((Opcode >> 9) & 7);
25986 res |= src;
25987 flag_C = 0;
25988 flag_V = 0;
25989 flag_NotZ = res;
25990 flag_N = res >> 8;
25991 DREGu16((Opcode >> 9) & 7) = res;
25992 POST_IO
25993RET(12)
25994}
25995
25996// ORaD
25997OPCODE(0x807B)
25998{
25999 u32 adr, res;
26000 u32 src, dst;
26001
be26eb23 26002 adr = GET_PC;
70357ce5 26003 DECODE_EXT_WORD
26004 PRE_IO
26005 READ_WORD_F(adr, src)
26006 res = DREGu16((Opcode >> 9) & 7);
26007 res |= src;
26008 flag_C = 0;
26009 flag_V = 0;
26010 flag_NotZ = res;
26011 flag_N = res >> 8;
26012 DREGu16((Opcode >> 9) & 7) = res;
26013 POST_IO
26014RET(14)
26015}
26016
26017// ORaD
26018OPCODE(0x807C)
26019{
26020 u32 adr, res;
26021 u32 src, dst;
26022
26023 FETCH_WORD(src);
26024 res = DREGu16((Opcode >> 9) & 7);
26025 res |= src;
26026 flag_C = 0;
26027 flag_V = 0;
26028 flag_NotZ = res;
26029 flag_N = res >> 8;
26030 DREGu16((Opcode >> 9) & 7) = res;
26031RET(8)
26032}
26033
26034// ORaD
26035OPCODE(0x805F)
26036{
26037 u32 adr, res;
26038 u32 src, dst;
26039
26040 adr = AREG(7);
26041 AREG(7) += 2;
26042 PRE_IO
26043 READ_WORD_F(adr, src)
26044 res = DREGu16((Opcode >> 9) & 7);
26045 res |= src;
26046 flag_C = 0;
26047 flag_V = 0;
26048 flag_NotZ = res;
26049 flag_N = res >> 8;
26050 DREGu16((Opcode >> 9) & 7) = res;
26051 POST_IO
26052RET(8)
26053}
26054
26055// ORaD
26056OPCODE(0x8067)
26057{
26058 u32 adr, res;
26059 u32 src, dst;
26060
26061 adr = AREG(7) - 2;
26062 AREG(7) = adr;
26063 PRE_IO
26064 READ_WORD_F(adr, src)
26065 res = DREGu16((Opcode >> 9) & 7);
26066 res |= src;
26067 flag_C = 0;
26068 flag_V = 0;
26069 flag_NotZ = res;
26070 flag_N = res >> 8;
26071 DREGu16((Opcode >> 9) & 7) = res;
26072 POST_IO
26073RET(10)
26074}
26075
26076// ORaD
26077OPCODE(0x8080)
26078{
26079 u32 adr, res;
26080 u32 src, dst;
26081
26082 src = DREGu32((Opcode >> 0) & 7);
26083 res = DREGu32((Opcode >> 9) & 7);
26084 res |= src;
26085 flag_C = 0;
26086 flag_V = 0;
26087 flag_NotZ = res;
26088 flag_N = res >> 24;
26089 DREGu32((Opcode >> 9) & 7) = res;
26090RET(8)
26091}
26092
26093// ORaD
26094OPCODE(0x8090)
26095{
26096 u32 adr, res;
26097 u32 src, dst;
26098
26099 adr = AREG((Opcode >> 0) & 7);
26100 PRE_IO
26101 READ_LONG_F(adr, src)
26102 res = DREGu32((Opcode >> 9) & 7);
26103 res |= src;
26104 flag_C = 0;
26105 flag_V = 0;
26106 flag_NotZ = res;
26107 flag_N = res >> 24;
26108 DREGu32((Opcode >> 9) & 7) = res;
26109 POST_IO
26110RET(14)
26111}
26112
26113// ORaD
26114OPCODE(0x8098)
26115{
26116 u32 adr, res;
26117 u32 src, dst;
26118
26119 adr = AREG((Opcode >> 0) & 7);
26120 AREG((Opcode >> 0) & 7) += 4;
26121 PRE_IO
26122 READ_LONG_F(adr, src)
26123 res = DREGu32((Opcode >> 9) & 7);
26124 res |= src;
26125 flag_C = 0;
26126 flag_V = 0;
26127 flag_NotZ = res;
26128 flag_N = res >> 24;
26129 DREGu32((Opcode >> 9) & 7) = res;
26130 POST_IO
26131RET(14)
26132}
26133
26134// ORaD
26135OPCODE(0x80A0)
26136{
26137 u32 adr, res;
26138 u32 src, dst;
26139
26140 adr = AREG((Opcode >> 0) & 7) - 4;
26141 AREG((Opcode >> 0) & 7) = adr;
26142 PRE_IO
26143 READ_LONG_F(adr, src)
26144 res = DREGu32((Opcode >> 9) & 7);
26145 res |= src;
26146 flag_C = 0;
26147 flag_V = 0;
26148 flag_NotZ = res;
26149 flag_N = res >> 24;
26150 DREGu32((Opcode >> 9) & 7) = res;
26151 POST_IO
26152RET(16)
26153}
26154
26155// ORaD
26156OPCODE(0x80A8)
26157{
26158 u32 adr, res;
26159 u32 src, dst;
26160
26161 FETCH_SWORD(adr);
26162 adr += AREG((Opcode >> 0) & 7);
26163 PRE_IO
26164 READ_LONG_F(adr, src)
26165 res = DREGu32((Opcode >> 9) & 7);
26166 res |= src;
26167 flag_C = 0;
26168 flag_V = 0;
26169 flag_NotZ = res;
26170 flag_N = res >> 24;
26171 DREGu32((Opcode >> 9) & 7) = res;
26172 POST_IO
26173RET(18)
26174}
26175
26176// ORaD
26177OPCODE(0x80B0)
26178{
26179 u32 adr, res;
26180 u32 src, dst;
26181
26182 adr = AREG((Opcode >> 0) & 7);
26183 DECODE_EXT_WORD
26184 PRE_IO
26185 READ_LONG_F(adr, src)
26186 res = DREGu32((Opcode >> 9) & 7);
26187 res |= src;
26188 flag_C = 0;
26189 flag_V = 0;
26190 flag_NotZ = res;
26191 flag_N = res >> 24;
26192 DREGu32((Opcode >> 9) & 7) = res;
26193 POST_IO
26194RET(20)
26195}
26196
26197// ORaD
26198OPCODE(0x80B8)
26199{
26200 u32 adr, res;
26201 u32 src, dst;
26202
26203 FETCH_SWORD(adr);
26204 PRE_IO
26205 READ_LONG_F(adr, src)
26206 res = DREGu32((Opcode >> 9) & 7);
26207 res |= src;
26208 flag_C = 0;
26209 flag_V = 0;
26210 flag_NotZ = res;
26211 flag_N = res >> 24;
26212 DREGu32((Opcode >> 9) & 7) = res;
26213 POST_IO
26214RET(18)
26215}
26216
26217// ORaD
26218OPCODE(0x80B9)
26219{
26220 u32 adr, res;
26221 u32 src, dst;
26222
26223 FETCH_LONG(adr);
26224 PRE_IO
26225 READ_LONG_F(adr, src)
26226 res = DREGu32((Opcode >> 9) & 7);
26227 res |= src;
26228 flag_C = 0;
26229 flag_V = 0;
26230 flag_NotZ = res;
26231 flag_N = res >> 24;
26232 DREGu32((Opcode >> 9) & 7) = res;
26233 POST_IO
26234RET(22)
26235}
26236
26237// ORaD
26238OPCODE(0x80BA)
26239{
26240 u32 adr, res;
26241 u32 src, dst;
26242
be26eb23 26243 adr = GET_SWORD + GET_PC;
70357ce5 26244 PC++;
26245 PRE_IO
26246 READ_LONG_F(adr, src)
26247 res = DREGu32((Opcode >> 9) & 7);
26248 res |= src;
26249 flag_C = 0;
26250 flag_V = 0;
26251 flag_NotZ = res;
26252 flag_N = res >> 24;
26253 DREGu32((Opcode >> 9) & 7) = res;
26254 POST_IO
26255RET(18)
26256}
26257
26258// ORaD
26259OPCODE(0x80BB)
26260{
26261 u32 adr, res;
26262 u32 src, dst;
26263
be26eb23 26264 adr = GET_PC;
70357ce5 26265 DECODE_EXT_WORD
26266 PRE_IO
26267 READ_LONG_F(adr, src)
26268 res = DREGu32((Opcode >> 9) & 7);
26269 res |= src;
26270 flag_C = 0;
26271 flag_V = 0;
26272 flag_NotZ = res;
26273 flag_N = res >> 24;
26274 DREGu32((Opcode >> 9) & 7) = res;
26275 POST_IO
26276RET(20)
26277}
26278
26279// ORaD
26280OPCODE(0x80BC)
26281{
26282 u32 adr, res;
26283 u32 src, dst;
26284
26285 FETCH_LONG(src);
26286 res = DREGu32((Opcode >> 9) & 7);
26287 res |= src;
26288 flag_C = 0;
26289 flag_V = 0;
26290 flag_NotZ = res;
26291 flag_N = res >> 24;
26292 DREGu32((Opcode >> 9) & 7) = res;
26293RET(16)
26294}
26295
26296// ORaD
26297OPCODE(0x809F)
26298{
26299 u32 adr, res;
26300 u32 src, dst;
26301
26302 adr = AREG(7);
26303 AREG(7) += 4;
26304 PRE_IO
26305 READ_LONG_F(adr, src)
26306 res = DREGu32((Opcode >> 9) & 7);
26307 res |= src;
26308 flag_C = 0;
26309 flag_V = 0;
26310 flag_NotZ = res;
26311 flag_N = res >> 24;
26312 DREGu32((Opcode >> 9) & 7) = res;
26313 POST_IO
26314RET(14)
26315}
26316
26317// ORaD
26318OPCODE(0x80A7)
26319{
26320 u32 adr, res;
26321 u32 src, dst;
26322
26323 adr = AREG(7) - 4;
26324 AREG(7) = adr;
26325 PRE_IO
26326 READ_LONG_F(adr, src)
26327 res = DREGu32((Opcode >> 9) & 7);
26328 res |= src;
26329 flag_C = 0;
26330 flag_V = 0;
26331 flag_NotZ = res;
26332 flag_N = res >> 24;
26333 DREGu32((Opcode >> 9) & 7) = res;
26334 POST_IO
26335RET(16)
26336}
26337
26338// ORDa
26339OPCODE(0x8110)
26340{
26341 u32 adr, res;
26342 u32 src, dst;
26343
26344 src = DREGu8((Opcode >> 9) & 7);
26345 adr = AREG((Opcode >> 0) & 7);
26346 PRE_IO
26347 READ_BYTE_F(adr, res)
26348 res |= src;
26349 flag_C = 0;
26350 flag_V = 0;
26351 flag_NotZ = res;
26352 flag_N = res;
26353 WRITE_BYTE_F(adr, res)
26354 POST_IO
26355RET(12)
26356}
26357
26358// ORDa
26359OPCODE(0x8118)
26360{
26361 u32 adr, res;
26362 u32 src, dst;
26363
26364 src = DREGu8((Opcode >> 9) & 7);
26365 adr = AREG((Opcode >> 0) & 7);
26366 AREG((Opcode >> 0) & 7) += 1;
26367 PRE_IO
26368 READ_BYTE_F(adr, res)
26369 res |= src;
26370 flag_C = 0;
26371 flag_V = 0;
26372 flag_NotZ = res;
26373 flag_N = res;
26374 WRITE_BYTE_F(adr, res)
26375 POST_IO
26376RET(12)
26377}
26378
26379// ORDa
26380OPCODE(0x8120)
26381{
26382 u32 adr, res;
26383 u32 src, dst;
26384
26385 src = DREGu8((Opcode >> 9) & 7);
26386 adr = AREG((Opcode >> 0) & 7) - 1;
26387 AREG((Opcode >> 0) & 7) = adr;
26388 PRE_IO
26389 READ_BYTE_F(adr, res)
26390 res |= src;
26391 flag_C = 0;
26392 flag_V = 0;
26393 flag_NotZ = res;
26394 flag_N = res;
26395 WRITE_BYTE_F(adr, res)
26396 POST_IO
26397RET(14)
26398}
26399
26400// ORDa
26401OPCODE(0x8128)
26402{
26403 u32 adr, res;
26404 u32 src, dst;
26405
26406 src = DREGu8((Opcode >> 9) & 7);
26407 FETCH_SWORD(adr);
26408 adr += AREG((Opcode >> 0) & 7);
26409 PRE_IO
26410 READ_BYTE_F(adr, res)
26411 res |= src;
26412 flag_C = 0;
26413 flag_V = 0;
26414 flag_NotZ = res;
26415 flag_N = res;
26416 WRITE_BYTE_F(adr, res)
26417 POST_IO
26418RET(16)
26419}
26420
26421// ORDa
26422OPCODE(0x8130)
26423{
26424 u32 adr, res;
26425 u32 src, dst;
26426
26427 src = DREGu8((Opcode >> 9) & 7);
26428 adr = AREG((Opcode >> 0) & 7);
26429 DECODE_EXT_WORD
26430 PRE_IO
26431 READ_BYTE_F(adr, res)
26432 res |= src;
26433 flag_C = 0;
26434 flag_V = 0;
26435 flag_NotZ = res;
26436 flag_N = res;
26437 WRITE_BYTE_F(adr, res)
26438 POST_IO
26439RET(18)
26440}
26441
26442// ORDa
26443OPCODE(0x8138)
26444{
26445 u32 adr, res;
26446 u32 src, dst;
26447
26448 src = DREGu8((Opcode >> 9) & 7);
26449 FETCH_SWORD(adr);
26450 PRE_IO
26451 READ_BYTE_F(adr, res)
26452 res |= src;
26453 flag_C = 0;
26454 flag_V = 0;
26455 flag_NotZ = res;
26456 flag_N = res;
26457 WRITE_BYTE_F(adr, res)
26458 POST_IO
26459RET(16)
26460}
26461
26462// ORDa
26463OPCODE(0x8139)
26464{
26465 u32 adr, res;
26466 u32 src, dst;
26467
26468 src = DREGu8((Opcode >> 9) & 7);
26469 FETCH_LONG(adr);
26470 PRE_IO
26471 READ_BYTE_F(adr, res)
26472 res |= src;
26473 flag_C = 0;
26474 flag_V = 0;
26475 flag_NotZ = res;
26476 flag_N = res;
26477 WRITE_BYTE_F(adr, res)
26478 POST_IO
26479RET(20)
26480}
26481
26482// ORDa
26483OPCODE(0x811F)
26484{
26485 u32 adr, res;
26486 u32 src, dst;
26487
26488 src = DREGu8((Opcode >> 9) & 7);
26489 adr = AREG(7);
26490 AREG(7) += 2;
26491 PRE_IO
26492 READ_BYTE_F(adr, res)
26493 res |= src;
26494 flag_C = 0;
26495 flag_V = 0;
26496 flag_NotZ = res;
26497 flag_N = res;
26498 WRITE_BYTE_F(adr, res)
26499 POST_IO
26500RET(12)
26501}
26502
26503// ORDa
26504OPCODE(0x8127)
26505{
26506 u32 adr, res;
26507 u32 src, dst;
26508
26509 src = DREGu8((Opcode >> 9) & 7);
26510 adr = AREG(7) - 2;
26511 AREG(7) = adr;
26512 PRE_IO
26513 READ_BYTE_F(adr, res)
26514 res |= src;
26515 flag_C = 0;
26516 flag_V = 0;
26517 flag_NotZ = res;
26518 flag_N = res;
26519 WRITE_BYTE_F(adr, res)
26520 POST_IO
26521RET(14)
26522}
26523
26524// ORDa
26525OPCODE(0x8150)
26526{
26527 u32 adr, res;
26528 u32 src, dst;
26529
26530 src = DREGu16((Opcode >> 9) & 7);
26531 adr = AREG((Opcode >> 0) & 7);
26532 PRE_IO
26533 READ_WORD_F(adr, res)
26534 res |= src;
26535 flag_C = 0;
26536 flag_V = 0;
26537 flag_NotZ = res;
26538 flag_N = res >> 8;
26539 WRITE_WORD_F(adr, res)
26540 POST_IO
26541RET(12)
26542}
26543
26544// ORDa
26545OPCODE(0x8158)
26546{
26547 u32 adr, res;
26548 u32 src, dst;
26549
26550 src = DREGu16((Opcode >> 9) & 7);
26551 adr = AREG((Opcode >> 0) & 7);
26552 AREG((Opcode >> 0) & 7) += 2;
26553 PRE_IO
26554 READ_WORD_F(adr, res)
26555 res |= src;
26556 flag_C = 0;
26557 flag_V = 0;
26558 flag_NotZ = res;
26559 flag_N = res >> 8;
26560 WRITE_WORD_F(adr, res)
26561 POST_IO
26562RET(12)
26563}
26564
26565// ORDa
26566OPCODE(0x8160)
26567{
26568 u32 adr, res;
26569 u32 src, dst;
26570
26571 src = DREGu16((Opcode >> 9) & 7);
26572 adr = AREG((Opcode >> 0) & 7) - 2;
26573 AREG((Opcode >> 0) & 7) = adr;
26574 PRE_IO
26575 READ_WORD_F(adr, res)
26576 res |= src;
26577 flag_C = 0;
26578 flag_V = 0;
26579 flag_NotZ = res;
26580 flag_N = res >> 8;
26581 WRITE_WORD_F(adr, res)
26582 POST_IO
26583RET(14)
26584}
26585
26586// ORDa
26587OPCODE(0x8168)
26588{
26589 u32 adr, res;
26590 u32 src, dst;
26591
26592 src = DREGu16((Opcode >> 9) & 7);
26593 FETCH_SWORD(adr);
26594 adr += AREG((Opcode >> 0) & 7);
26595 PRE_IO
26596 READ_WORD_F(adr, res)
26597 res |= src;
26598 flag_C = 0;
26599 flag_V = 0;
26600 flag_NotZ = res;
26601 flag_N = res >> 8;
26602 WRITE_WORD_F(adr, res)
26603 POST_IO
26604RET(16)
26605}
26606
26607// ORDa
26608OPCODE(0x8170)
26609{
26610 u32 adr, res;
26611 u32 src, dst;
26612
26613 src = DREGu16((Opcode >> 9) & 7);
26614 adr = AREG((Opcode >> 0) & 7);
26615 DECODE_EXT_WORD
26616 PRE_IO
26617 READ_WORD_F(adr, res)
26618 res |= src;
26619 flag_C = 0;
26620 flag_V = 0;
26621 flag_NotZ = res;
26622 flag_N = res >> 8;
26623 WRITE_WORD_F(adr, res)
26624 POST_IO
26625RET(18)
26626}
26627
26628// ORDa
26629OPCODE(0x8178)
26630{
26631 u32 adr, res;
26632 u32 src, dst;
26633
26634 src = DREGu16((Opcode >> 9) & 7);
26635 FETCH_SWORD(adr);
26636 PRE_IO
26637 READ_WORD_F(adr, res)
26638 res |= src;
26639 flag_C = 0;
26640 flag_V = 0;
26641 flag_NotZ = res;
26642 flag_N = res >> 8;
26643 WRITE_WORD_F(adr, res)
26644 POST_IO
26645RET(16)
26646}
26647
26648// ORDa
26649OPCODE(0x8179)
26650{
26651 u32 adr, res;
26652 u32 src, dst;
26653
26654 src = DREGu16((Opcode >> 9) & 7);
26655 FETCH_LONG(adr);
26656 PRE_IO
26657 READ_WORD_F(adr, res)
26658 res |= src;
26659 flag_C = 0;
26660 flag_V = 0;
26661 flag_NotZ = res;
26662 flag_N = res >> 8;
26663 WRITE_WORD_F(adr, res)
26664 POST_IO
26665RET(20)
26666}
26667
26668// ORDa
26669OPCODE(0x815F)
26670{
26671 u32 adr, res;
26672 u32 src, dst;
26673
26674 src = DREGu16((Opcode >> 9) & 7);
26675 adr = AREG(7);
26676 AREG(7) += 2;
26677 PRE_IO
26678 READ_WORD_F(adr, res)
26679 res |= src;
26680 flag_C = 0;
26681 flag_V = 0;
26682 flag_NotZ = res;
26683 flag_N = res >> 8;
26684 WRITE_WORD_F(adr, res)
26685 POST_IO
26686RET(12)
26687}
26688
26689// ORDa
26690OPCODE(0x8167)
26691{
26692 u32 adr, res;
26693 u32 src, dst;
26694
26695 src = DREGu16((Opcode >> 9) & 7);
26696 adr = AREG(7) - 2;
26697 AREG(7) = adr;
26698 PRE_IO
26699 READ_WORD_F(adr, res)
26700 res |= src;
26701 flag_C = 0;
26702 flag_V = 0;
26703 flag_NotZ = res;
26704 flag_N = res >> 8;
26705 WRITE_WORD_F(adr, res)
26706 POST_IO
26707RET(14)
26708}
26709
26710// ORDa
26711OPCODE(0x8190)
26712{
26713 u32 adr, res;
26714 u32 src, dst;
26715
26716 src = DREGu32((Opcode >> 9) & 7);
26717 adr = AREG((Opcode >> 0) & 7);
26718 PRE_IO
26719 READ_LONG_F(adr, res)
26720 res |= src;
26721 flag_C = 0;
26722 flag_V = 0;
26723 flag_NotZ = res;
26724 flag_N = res >> 24;
26725 WRITE_LONG_F(adr, res)
26726 POST_IO
26727RET(20)
26728}
26729
26730// ORDa
26731OPCODE(0x8198)
26732{
26733 u32 adr, res;
26734 u32 src, dst;
26735
26736 src = DREGu32((Opcode >> 9) & 7);
26737 adr = AREG((Opcode >> 0) & 7);
26738 AREG((Opcode >> 0) & 7) += 4;
26739 PRE_IO
26740 READ_LONG_F(adr, res)
26741 res |= src;
26742 flag_C = 0;
26743 flag_V = 0;
26744 flag_NotZ = res;
26745 flag_N = res >> 24;
26746 WRITE_LONG_F(adr, res)
26747 POST_IO
26748RET(20)
26749}
26750
26751// ORDa
26752OPCODE(0x81A0)
26753{
26754 u32 adr, res;
26755 u32 src, dst;
26756
26757 src = DREGu32((Opcode >> 9) & 7);
26758 adr = AREG((Opcode >> 0) & 7) - 4;
26759 AREG((Opcode >> 0) & 7) = adr;
26760 PRE_IO
26761 READ_LONG_F(adr, res)
26762 res |= src;
26763 flag_C = 0;
26764 flag_V = 0;
26765 flag_NotZ = res;
26766 flag_N = res >> 24;
26767 WRITE_LONG_F(adr, res)
26768 POST_IO
26769RET(22)
26770}
26771
26772// ORDa
26773OPCODE(0x81A8)
26774{
26775 u32 adr, res;
26776 u32 src, dst;
26777
26778 src = DREGu32((Opcode >> 9) & 7);
26779 FETCH_SWORD(adr);
26780 adr += AREG((Opcode >> 0) & 7);
26781 PRE_IO
26782 READ_LONG_F(adr, res)
26783 res |= src;
26784 flag_C = 0;
26785 flag_V = 0;
26786 flag_NotZ = res;
26787 flag_N = res >> 24;
26788 WRITE_LONG_F(adr, res)
26789 POST_IO
26790RET(24)
26791}
26792
26793// ORDa
26794OPCODE(0x81B0)
26795{
26796 u32 adr, res;
26797 u32 src, dst;
26798
26799 src = DREGu32((Opcode >> 9) & 7);
26800 adr = AREG((Opcode >> 0) & 7);
26801 DECODE_EXT_WORD
26802 PRE_IO
26803 READ_LONG_F(adr, res)
26804 res |= src;
26805 flag_C = 0;
26806 flag_V = 0;
26807 flag_NotZ = res;
26808 flag_N = res >> 24;
26809 WRITE_LONG_F(adr, res)
26810 POST_IO
26811RET(26)
26812}
26813
26814// ORDa
26815OPCODE(0x81B8)
26816{
26817 u32 adr, res;
26818 u32 src, dst;
26819
26820 src = DREGu32((Opcode >> 9) & 7);
26821 FETCH_SWORD(adr);
26822 PRE_IO
26823 READ_LONG_F(adr, res)
26824 res |= src;
26825 flag_C = 0;
26826 flag_V = 0;
26827 flag_NotZ = res;
26828 flag_N = res >> 24;
26829 WRITE_LONG_F(adr, res)
26830 POST_IO
26831RET(24)
26832}
26833
26834// ORDa
26835OPCODE(0x81B9)
26836{
26837 u32 adr, res;
26838 u32 src, dst;
26839
26840 src = DREGu32((Opcode >> 9) & 7);
26841 FETCH_LONG(adr);
26842 PRE_IO
26843 READ_LONG_F(adr, res)
26844 res |= src;
26845 flag_C = 0;
26846 flag_V = 0;
26847 flag_NotZ = res;
26848 flag_N = res >> 24;
26849 WRITE_LONG_F(adr, res)
26850 POST_IO
26851RET(28)
26852}
26853
26854// ORDa
26855OPCODE(0x819F)
26856{
26857 u32 adr, res;
26858 u32 src, dst;
26859
26860 src = DREGu32((Opcode >> 9) & 7);
26861 adr = AREG(7);
26862 AREG(7) += 4;
26863 PRE_IO
26864 READ_LONG_F(adr, res)
26865 res |= src;
26866 flag_C = 0;
26867 flag_V = 0;
26868 flag_NotZ = res;
26869 flag_N = res >> 24;
26870 WRITE_LONG_F(adr, res)
26871 POST_IO
26872RET(20)
26873}
26874
26875// ORDa
26876OPCODE(0x81A7)
26877{
26878 u32 adr, res;
26879 u32 src, dst;
26880
26881 src = DREGu32((Opcode >> 9) & 7);
26882 adr = AREG(7) - 4;
26883 AREG(7) = adr;
26884 PRE_IO
26885 READ_LONG_F(adr, res)
26886 res |= src;
26887 flag_C = 0;
26888 flag_V = 0;
26889 flag_NotZ = res;
26890 flag_N = res >> 24;
26891 WRITE_LONG_F(adr, res)
26892 POST_IO
26893RET(22)
26894}
26895
26896// SBCD
26897OPCODE(0x8100)
26898{
26899 u32 adr, res;
26900 u32 src, dst;
26901
26902 src = DREGu8((Opcode >> 0) & 7);
26903 dst = DREGu8((Opcode >> 9) & 7);
26904 res = (dst & 0xF) - (src & 0xF) - ((flag_X >> M68K_SR_X_SFT) & 1);
26905 if (res > 9) res -= 6;
26906 res += (dst & 0xF0) - (src & 0xF0);
26907 if (res > 0x99)
26908 {
26909 res += 0xA0;
26910 flag_X = flag_C = M68K_SR_C;
26911 }
26912 else flag_X = flag_C = 0;
26913 flag_NotZ |= res & 0xFF;
26914 flag_N = res;
26915 DREGu8((Opcode >> 9) & 7) = res;
26916RET(6)
26917}
26918
26919// SBCDM
26920OPCODE(0x8108)
26921{
26922 u32 adr, res;
26923 u32 src, dst;
26924
26925 adr = AREG((Opcode >> 0) & 7) - 1;
26926 AREG((Opcode >> 0) & 7) = adr;
26927 PRE_IO
26928 READ_BYTE_F(adr, src)
26929 adr = AREG((Opcode >> 9) & 7) - 1;
26930 AREG((Opcode >> 9) & 7) = adr;
26931 READ_BYTE_F(adr, dst)
26932 res = (dst & 0xF) - (src & 0xF) - ((flag_X >> M68K_SR_X_SFT) & 1);
26933 if (res > 9) res -= 6;
26934 res += (dst & 0xF0) - (src & 0xF0);
26935 if (res > 0x99)
26936 {
26937 res += 0xA0;
26938 flag_X = flag_C = M68K_SR_C;
26939 }
26940 else flag_X = flag_C = 0;
26941 flag_NotZ |= res & 0xFF;
26942 flag_N = res;
26943 WRITE_BYTE_F(adr, res)
26944 POST_IO
26945RET(18)
26946}
26947
26948// SBCD7M
26949OPCODE(0x810F)
26950{
26951 u32 adr, res;
26952 u32 src, dst;
26953
26954 adr = AREG(7) - 2;
26955 AREG(7) = adr;
26956 PRE_IO
26957 READ_BYTE_F(adr, src)
26958 adr = AREG((Opcode >> 9) & 7) - 1;
26959 AREG((Opcode >> 9) & 7) = adr;
26960 READ_BYTE_F(adr, dst)
26961 res = (dst & 0xF) - (src & 0xF) - ((flag_X >> M68K_SR_X_SFT) & 1);
26962 if (res > 9) res -= 6;
26963 res += (dst & 0xF0) - (src & 0xF0);
26964 if (res > 0x99)
26965 {
26966 res += 0xA0;
26967 flag_X = flag_C = M68K_SR_C;
26968 }
26969 else flag_X = flag_C = 0;
26970 flag_NotZ |= res & 0xFF;
26971 flag_N = res;
26972 WRITE_BYTE_F(adr, res)
26973 POST_IO
26974RET(18)
26975}
26976
26977// SBCDM7
26978OPCODE(0x8F08)
26979{
26980 u32 adr, res;
26981 u32 src, dst;
26982
26983 adr = AREG((Opcode >> 0) & 7) - 1;
26984 AREG((Opcode >> 0) & 7) = adr;
26985 PRE_IO
26986 READ_BYTE_F(adr, src)
26987 adr = AREG(7) - 2;
26988 AREG(7) = adr;
26989 READ_BYTE_F(adr, dst)
26990 res = (dst & 0xF) - (src & 0xF) - ((flag_X >> M68K_SR_X_SFT) & 1);
26991 if (res > 9) res -= 6;
26992 res += (dst & 0xF0) - (src & 0xF0);
26993 if (res > 0x99)
26994 {
26995 res += 0xA0;
26996 flag_X = flag_C = M68K_SR_C;
26997 }
26998 else flag_X = flag_C = 0;
26999 flag_NotZ |= res & 0xFF;
27000 flag_N = res;
27001 WRITE_BYTE_F(adr, res)
27002 POST_IO
27003RET(18)
27004}
27005
27006// SBCD7M7
27007OPCODE(0x8F0F)
27008{
27009 u32 adr, res;
27010 u32 src, dst;
27011
27012 adr = AREG(7) - 2;
27013 AREG(7) = adr;
27014 PRE_IO
27015 READ_BYTE_F(adr, src)
27016 adr = AREG(7) - 2;
27017 AREG(7) = adr;
27018 READ_BYTE_F(adr, dst)
27019 res = (dst & 0xF) - (src & 0xF) - ((flag_X >> M68K_SR_X_SFT) & 1);
27020 if (res > 9) res -= 6;
27021 res += (dst & 0xF0) - (src & 0xF0);
27022 if (res > 0x99)
27023 {
27024 res += 0xA0;
27025 flag_X = flag_C = M68K_SR_C;
27026 }
27027 else flag_X = flag_C = 0;
27028 flag_NotZ |= res & 0xFF;
27029 flag_N = res;
27030 WRITE_BYTE_F(adr, res)
27031 POST_IO
27032RET(18)
27033}
27034
27035// DIVU
27036OPCODE(0x80C0)
27037{
27038 u32 adr, res;
27039 u32 src, dst;
27040
27041 src = DREGu16((Opcode >> 0) & 7);
27042 if (src == 0)
27043 {
d0ae0cb4 27044 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 27045#ifdef USE_CYCLONE_TIMING_DIV
27046RET(140)
27047#else
27048RET(10)
27049#endif
27050 }
27051 dst = DREGu32((Opcode >> 9) & 7);
27052 {
27053 u32 q, r;
27054
27055 q = dst / src;
27056 r = dst % src;
27057
27058 if (q & 0xFFFF0000)
27059 {
27060 flag_V = M68K_SR_V;
27061#ifdef USE_CYCLONE_TIMING_DIV
27062RET(140)
27063#else
27064RET(70)
27065#endif
27066 }
27067 q &= 0x0000FFFF;
27068 flag_NotZ = q;
27069 flag_N = q >> 8;
27070 flag_V = flag_C = 0;
27071 res = q | (r << 16);
27072 DREGu32((Opcode >> 9) & 7) = res;
27073 }
27074#ifdef USE_CYCLONE_TIMING_DIV
27075RET(140)
27076#else
27077RET(90)
27078#endif
27079}
27080
27081// DIVU
27082OPCODE(0x80D0)
27083{
27084 u32 adr, res;
27085 u32 src, dst;
27086
27087 adr = AREG((Opcode >> 0) & 7);
27088 PRE_IO
27089 READ_WORD_F(adr, src)
27090 if (src == 0)
27091 {
d0ae0cb4 27092 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 27093#ifdef USE_CYCLONE_TIMING_DIV
27094RET(144)
27095#else
27096RET(14)
27097#endif
27098 }
27099 dst = DREGu32((Opcode >> 9) & 7);
27100 {
27101 u32 q, r;
27102
27103 q = dst / src;
27104 r = dst % src;
27105
27106 if (q & 0xFFFF0000)
27107 {
27108 flag_V = M68K_SR_V;
27109#ifdef USE_CYCLONE_TIMING_DIV
27110RET(144)
27111#else
27112 RET(74)
27113#endif
27114 }
27115 q &= 0x0000FFFF;
27116 flag_NotZ = q;
27117 flag_N = q >> 8;
27118 flag_V = flag_C = 0;
27119 res = q | (r << 16);
27120 DREGu32((Opcode >> 9) & 7) = res;
27121 }
27122#ifdef USE_CYCLONE_TIMING_DIV
27123RET(144)
27124#else
27125RET(94)
27126#endif
27127}
27128
27129// DIVU
27130OPCODE(0x80D8)
27131{
27132 u32 adr, res;
27133 u32 src, dst;
27134
27135 adr = AREG((Opcode >> 0) & 7);
27136 AREG((Opcode >> 0) & 7) += 2;
27137 PRE_IO
27138 READ_WORD_F(adr, src)
27139 if (src == 0)
27140 {
d0ae0cb4 27141 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 27142#ifdef USE_CYCLONE_TIMING_DIV
27143RET(144)
27144#else
27145RET(14)
27146#endif
27147 }
27148 dst = DREGu32((Opcode >> 9) & 7);
27149 {
27150 u32 q, r;
27151
27152 q = dst / src;
27153 r = dst % src;
27154
27155 if (q & 0xFFFF0000)
27156 {
27157 flag_V = M68K_SR_V;
27158#ifdef USE_CYCLONE_TIMING_DIV
27159RET(144)
27160#else
27161 RET(74)
27162#endif
27163 }
27164 q &= 0x0000FFFF;
27165 flag_NotZ = q;
27166 flag_N = q >> 8;
27167 flag_V = flag_C = 0;
27168 res = q | (r << 16);
27169 DREGu32((Opcode >> 9) & 7) = res;
27170 }
27171#ifdef USE_CYCLONE_TIMING_DIV
27172RET(144)
27173#else
27174RET(94)
27175#endif
27176}
27177
27178// DIVU
27179OPCODE(0x80E0)
27180{
27181 u32 adr, res;
27182 u32 src, dst;
27183
27184 adr = AREG((Opcode >> 0) & 7) - 2;
27185 AREG((Opcode >> 0) & 7) = adr;
27186 PRE_IO
27187 READ_WORD_F(adr, src)
27188 if (src == 0)
27189 {
d0ae0cb4 27190 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 27191#ifdef USE_CYCLONE_TIMING_DIV
27192RET(146)
27193#else
27194RET(16)
27195#endif
27196 }
27197 dst = DREGu32((Opcode >> 9) & 7);
27198 {
27199 u32 q, r;
27200
27201 q = dst / src;
27202 r = dst % src;
27203
27204 if (q & 0xFFFF0000)
27205 {
27206 flag_V = M68K_SR_V;
27207#ifdef USE_CYCLONE_TIMING_DIV
27208RET(146)
27209#else
27210 RET(76)
27211#endif
27212 }
27213 q &= 0x0000FFFF;
27214 flag_NotZ = q;
27215 flag_N = q >> 8;
27216 flag_V = flag_C = 0;
27217 res = q | (r << 16);
27218 DREGu32((Opcode >> 9) & 7) = res;
27219 }
27220#ifdef USE_CYCLONE_TIMING_DIV
27221RET(146)
27222#else
27223RET(96)
27224#endif
27225}
27226
27227// DIVU
27228OPCODE(0x80E8)
27229{
27230 u32 adr, res;
27231 u32 src, dst;
27232
27233 FETCH_SWORD(adr);
27234 adr += AREG((Opcode >> 0) & 7);
27235 PRE_IO
27236 READ_WORD_F(adr, src)
27237 if (src == 0)
27238 {
d0ae0cb4 27239 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 27240#ifdef USE_CYCLONE_TIMING_DIV
27241RET(148)
27242#else
27243RET(18)
27244#endif
27245 }
27246 dst = DREGu32((Opcode >> 9) & 7);
27247 {
27248 u32 q, r;
27249
27250 q = dst / src;
27251 r = dst % src;
27252
27253 if (q & 0xFFFF0000)
27254 {
27255 flag_V = M68K_SR_V;
27256#ifdef USE_CYCLONE_TIMING_DIV
27257RET(148)
27258#else
27259 RET(78)
27260#endif
27261 }
27262 q &= 0x0000FFFF;
27263 flag_NotZ = q;
27264 flag_N = q >> 8;
27265 flag_V = flag_C = 0;
27266 res = q | (r << 16);
27267 DREGu32((Opcode >> 9) & 7) = res;
27268 }
27269#ifdef USE_CYCLONE_TIMING_DIV
27270RET(148)
27271#else
27272RET(98)
27273#endif
27274}
27275
27276// DIVU
27277OPCODE(0x80F0)
27278{
27279 u32 adr, res;
27280 u32 src, dst;
27281
27282 adr = AREG((Opcode >> 0) & 7);
27283 DECODE_EXT_WORD
27284 PRE_IO
27285 READ_WORD_F(adr, src)
27286 if (src == 0)
27287 {
d0ae0cb4 27288 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 27289#ifdef USE_CYCLONE_TIMING_DIV
27290RET(150)
27291#else
27292RET(20)
27293#endif
27294 }
27295 dst = DREGu32((Opcode >> 9) & 7);
27296 {
27297 u32 q, r;
27298
27299 q = dst / src;
27300 r = dst % src;
27301
27302 if (q & 0xFFFF0000)
27303 {
27304 flag_V = M68K_SR_V;
27305#ifdef USE_CYCLONE_TIMING_DIV
27306RET(150)
27307#else
27308 RET(80)
27309#endif
27310 }
27311 q &= 0x0000FFFF;
27312 flag_NotZ = q;
27313 flag_N = q >> 8;
27314 flag_V = flag_C = 0;
27315 res = q | (r << 16);
27316 DREGu32((Opcode >> 9) & 7) = res;
27317 }
27318#ifdef USE_CYCLONE_TIMING_DIV
27319RET(150)
27320#else
27321RET(100)
27322#endif
27323}
27324
27325// DIVU
27326OPCODE(0x80F8)
27327{
27328 u32 adr, res;
27329 u32 src, dst;
27330
27331 FETCH_SWORD(adr);
27332 PRE_IO
27333 READ_WORD_F(adr, src)
27334 if (src == 0)
27335 {
d0ae0cb4 27336 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 27337#ifdef USE_CYCLONE_TIMING_DIV
27338RET(148)
27339#else
27340RET(18)
27341#endif
27342 }
27343 dst = DREGu32((Opcode >> 9) & 7);
27344 {
27345 u32 q, r;
27346
27347 q = dst / src;
27348 r = dst % src;
27349
27350 if (q & 0xFFFF0000)
27351 {
27352 flag_V = M68K_SR_V;
27353#ifdef USE_CYCLONE_TIMING_DIV
27354RET(148)
27355#else
27356 RET(78)
27357#endif
27358 }
27359 q &= 0x0000FFFF;
27360 flag_NotZ = q;
27361 flag_N = q >> 8;
27362 flag_V = flag_C = 0;
27363 res = q | (r << 16);
27364 DREGu32((Opcode >> 9) & 7) = res;
27365 }
27366#ifdef USE_CYCLONE_TIMING_DIV
27367RET(148)
27368#else
27369RET(98)
27370#endif
27371}
27372
27373// DIVU
27374OPCODE(0x80F9)
27375{
27376 u32 adr, res;
27377 u32 src, dst;
27378
27379 FETCH_LONG(adr);
27380 PRE_IO
27381 READ_WORD_F(adr, src)
27382 if (src == 0)
27383 {
d0ae0cb4 27384 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 27385#ifdef USE_CYCLONE_TIMING_DIV
27386RET(162)
27387#else
27388RET(22)
27389#endif
27390 }
27391 dst = DREGu32((Opcode >> 9) & 7);
27392 {
27393 u32 q, r;
27394
27395 q = dst / src;
27396 r = dst % src;
27397
27398 if (q & 0xFFFF0000)
27399 {
27400 flag_V = M68K_SR_V;
27401#ifdef USE_CYCLONE_TIMING_DIV
27402RET(162)
27403#else
27404 RET(82)
27405#endif
27406 }
27407 q &= 0x0000FFFF;
27408 flag_NotZ = q;
27409 flag_N = q >> 8;
27410 flag_V = flag_C = 0;
27411 res = q | (r << 16);
27412 DREGu32((Opcode >> 9) & 7) = res;
27413 }
27414#ifdef USE_CYCLONE_TIMING_DIV
27415RET(162)
27416#else
27417RET(102)
27418#endif
27419}
27420
27421// DIVU
27422OPCODE(0x80FA)
27423{
27424 u32 adr, res;
27425 u32 src, dst;
27426
be26eb23 27427 adr = GET_SWORD + GET_PC;
70357ce5 27428 PC++;
27429 PRE_IO
27430 READ_WORD_F(adr, src)
27431 if (src == 0)
27432 {
d0ae0cb4 27433 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 27434#ifdef USE_CYCLONE_TIMING_DIV
27435RET(148)
27436#else
27437RET(18)
27438#endif
27439 }
27440 dst = DREGu32((Opcode >> 9) & 7);
27441 {
27442 u32 q, r;
27443
27444 q = dst / src;
27445 r = dst % src;
27446
27447 if (q & 0xFFFF0000)
27448 {
27449 flag_V = M68K_SR_V;
27450#ifdef USE_CYCLONE_TIMING_DIV
27451RET(148)
27452#else
27453 RET(78)
27454#endif
27455 }
27456 q &= 0x0000FFFF;
27457 flag_NotZ = q;
27458 flag_N = q >> 8;
27459 flag_V = flag_C = 0;
27460 res = q | (r << 16);
27461 DREGu32((Opcode >> 9) & 7) = res;
27462 }
27463#ifdef USE_CYCLONE_TIMING_DIV
27464RET(148)
27465#else
27466RET(98)
27467#endif
27468}
27469
27470// DIVU
27471OPCODE(0x80FB)
27472{
27473 u32 adr, res;
27474 u32 src, dst;
27475
be26eb23 27476 adr = GET_PC;
70357ce5 27477 DECODE_EXT_WORD
27478 PRE_IO
27479 READ_WORD_F(adr, src)
27480 if (src == 0)
27481 {
d0ae0cb4 27482 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 27483#ifdef USE_CYCLONE_TIMING_DIV
27484RET(160)
27485#else
27486RET(20)
27487#endif
27488 }
27489 dst = DREGu32((Opcode >> 9) & 7);
27490 {
27491 u32 q, r;
27492
27493 q = dst / src;
27494 r = dst % src;
27495
27496 if (q & 0xFFFF0000)
27497 {
27498 flag_V = M68K_SR_V;
27499#ifdef USE_CYCLONE_TIMING_DIV
27500RET(160)
27501#else
27502 RET(80)
27503#endif
27504 }
27505 q &= 0x0000FFFF;
27506 flag_NotZ = q;
27507 flag_N = q >> 8;
27508 flag_V = flag_C = 0;
27509 res = q | (r << 16);
27510 DREGu32((Opcode >> 9) & 7) = res;
27511 }
27512#ifdef USE_CYCLONE_TIMING_DIV
27513RET(160)
27514#else
27515RET(100)
27516#endif
27517}
27518
27519// DIVU
27520OPCODE(0x80FC)
27521{
27522 u32 adr, res;
27523 u32 src, dst;
27524
27525 FETCH_WORD(src);
27526 if (src == 0)
27527 {
d0ae0cb4 27528 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 27529#ifdef USE_CYCLONE_TIMING_DIV
27530RET(144)
27531#else
27532RET(14)
27533#endif
27534 }
27535 dst = DREGu32((Opcode >> 9) & 7);
27536 {
27537 u32 q, r;
27538
27539 q = dst / src;
27540 r = dst % src;
27541
27542 if (q & 0xFFFF0000)
27543 {
27544 flag_V = M68K_SR_V;
27545#ifdef USE_CYCLONE_TIMING_DIV
27546RET(144)
27547#else
27548 RET(74)
27549#endif
27550 }
27551 q &= 0x0000FFFF;
27552 flag_NotZ = q;
27553 flag_N = q >> 8;
27554 flag_V = flag_C = 0;
27555 res = q | (r << 16);
27556 DREGu32((Opcode >> 9) & 7) = res;
27557 }
27558#ifdef USE_CYCLONE_TIMING_DIV
27559RET(144)
27560#else
27561RET(94)
27562#endif
27563}
27564
27565// DIVU
27566OPCODE(0x80DF)
27567{
27568 u32 adr, res;
27569 u32 src, dst;
27570
27571 adr = AREG(7);
27572 AREG(7) += 2;
27573 PRE_IO
27574 READ_WORD_F(adr, src)
27575 if (src == 0)
27576 {
d0ae0cb4 27577 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 27578#ifdef USE_CYCLONE_TIMING_DIV
27579RET(144)
27580#else
27581RET(14)
27582#endif
27583 }
27584 dst = DREGu32((Opcode >> 9) & 7);
27585 {
27586 u32 q, r;
27587
27588 q = dst / src;
27589 r = dst % src;
27590
27591 if (q & 0xFFFF0000)
27592 {
27593 flag_V = M68K_SR_V;
27594#ifdef USE_CYCLONE_TIMING_DIV
27595RET(144)
27596#else
27597 RET(74)
27598#endif
27599 }
27600 q &= 0x0000FFFF;
27601 flag_NotZ = q;
27602 flag_N = q >> 8;
27603 flag_V = flag_C = 0;
27604 res = q | (r << 16);
27605 DREGu32((Opcode >> 9) & 7) = res;
27606 }
27607#ifdef USE_CYCLONE_TIMING_DIV
27608RET(144)
27609#else
27610RET(94)
27611#endif
27612}
27613
27614// DIVU
27615OPCODE(0x80E7)
27616{
27617 u32 adr, res;
27618 u32 src, dst;
27619
27620 adr = AREG(7) - 2;
27621 AREG(7) = adr;
27622 PRE_IO
27623 READ_WORD_F(adr, src)
27624 if (src == 0)
27625 {
d0ae0cb4 27626 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 27627#ifdef USE_CYCLONE_TIMING_DIV
27628RET(146)
27629#else
27630RET(16)
27631#endif
27632 }
27633 dst = DREGu32((Opcode >> 9) & 7);
27634 {
27635 u32 q, r;
27636
27637 q = dst / src;
27638 r = dst % src;
27639
27640 if (q & 0xFFFF0000)
27641 {
27642 flag_V = M68K_SR_V;
27643#ifdef USE_CYCLONE_TIMING_DIV
27644RET(146)
27645#else
27646 RET(76)
27647#endif
27648 }
27649 q &= 0x0000FFFF;
27650 flag_NotZ = q;
27651 flag_N = q >> 8;
27652 flag_V = flag_C = 0;
27653 res = q | (r << 16);
27654 DREGu32((Opcode >> 9) & 7) = res;
27655 }
27656#ifdef USE_CYCLONE_TIMING_DIV
27657RET(146)
27658#else
27659RET(96)
27660#endif
27661}
27662
27663// DIVS
27664OPCODE(0x81C0)
27665{
27666 u32 adr, res;
27667 u32 src, dst;
27668
27669 src = (s32)DREGs16((Opcode >> 0) & 7);
27670 if (src == 0)
27671 {
d0ae0cb4 27672 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 27673#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 27674goto end81C0;
70357ce5 27675#endif
27676 RET(10)
27677 }
27678 dst = DREGu32((Opcode >> 9) & 7);
27679 if ((dst == 0x80000000) && (src == (u32)-1))
27680 {
27681 flag_NotZ = flag_N = 0;
27682 flag_V = flag_C = 0;
27683 res = 0;
27684 DREGu32((Opcode >> 9) & 7) = res;
27685#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 27686goto end81C0;
70357ce5 27687#endif
27688 RET(50)
27689 }
27690 {
27691 s32 q, r;
27692
27693 q = (s32)dst / (s32)src;
27694 r = (s32)dst % (s32)src;
27695
27696 if ((q > 0x7FFF) || (q < -0x8000))
27697 {
27698 flag_V = M68K_SR_V;
27699#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 27700goto end81C0;
70357ce5 27701#endif
27702 RET(80)
27703 }
27704 q &= 0x0000FFFF;
27705 flag_NotZ = q;
27706 flag_N = q >> 8;
27707 flag_V = flag_C = 0;
27708 res = q | (r << 16);
27709 DREGu32((Opcode >> 9) & 7) = res;
27710 }
27711#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 27712end81C0: m68kcontext.io_cycle_counter -= 50;
70357ce5 27713#endif
27714RET(108)
27715}
27716
27717// DIVS
27718OPCODE(0x81D0)
27719{
27720 u32 adr, res;
27721 u32 src, dst;
27722
27723 adr = AREG((Opcode >> 0) & 7);
27724 PRE_IO
27725 READSX_WORD_F(adr, src)
27726 if (src == 0)
27727 {
d0ae0cb4 27728 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 27729#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 27730goto end81D0;
70357ce5 27731#endif
27732 RET(14)
27733 }
27734 dst = DREGu32((Opcode >> 9) & 7);
27735 if ((dst == 0x80000000) && (src == (u32)-1))
27736 {
27737 flag_NotZ = flag_N = 0;
27738 flag_V = flag_C = 0;
27739 res = 0;
27740 DREGu32((Opcode >> 9) & 7) = res;
27741#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 27742goto end81D0;
70357ce5 27743#endif
27744 RET(54)
27745 }
27746 {
27747 s32 q, r;
27748
27749 q = (s32)dst / (s32)src;
27750 r = (s32)dst % (s32)src;
27751
27752 if ((q > 0x7FFF) || (q < -0x8000))
27753 {
27754 flag_V = M68K_SR_V;
27755#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 27756goto end81D0;
70357ce5 27757#endif
27758 RET(84)
27759 }
27760 q &= 0x0000FFFF;
27761 flag_NotZ = q;
27762 flag_N = q >> 8;
27763 flag_V = flag_C = 0;
27764 res = q | (r << 16);
27765 DREGu32((Opcode >> 9) & 7) = res;
27766 }
27767#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 27768end81D0: m68kcontext.io_cycle_counter -= 50;
70357ce5 27769#endif
27770RET(112)
27771}
27772
27773// DIVS
27774OPCODE(0x81D8)
27775{
27776 u32 adr, res;
27777 u32 src, dst;
27778
27779 adr = AREG((Opcode >> 0) & 7);
27780 AREG((Opcode >> 0) & 7) += 2;
27781 PRE_IO
27782 READSX_WORD_F(adr, src)
27783 if (src == 0)
27784 {
d0ae0cb4 27785 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 27786#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 27787goto end81D8;
70357ce5 27788#endif
27789 RET(14)
27790 }
27791 dst = DREGu32((Opcode >> 9) & 7);
27792 if ((dst == 0x80000000) && (src == (u32)-1))
27793 {
27794 flag_NotZ = flag_N = 0;
27795 flag_V = flag_C = 0;
27796 res = 0;
27797 DREGu32((Opcode >> 9) & 7) = res;
27798#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 27799goto end81D8;
70357ce5 27800#endif
27801 RET(54)
27802 }
27803 {
27804 s32 q, r;
27805
27806 q = (s32)dst / (s32)src;
27807 r = (s32)dst % (s32)src;
27808
27809 if ((q > 0x7FFF) || (q < -0x8000))
27810 {
27811 flag_V = M68K_SR_V;
27812#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 27813goto end81D8;
70357ce5 27814#endif
27815 RET(84)
27816 }
27817 q &= 0x0000FFFF;
27818 flag_NotZ = q;
27819 flag_N = q >> 8;
27820 flag_V = flag_C = 0;
27821 res = q | (r << 16);
27822 DREGu32((Opcode >> 9) & 7) = res;
27823 }
27824#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 27825end81D8: m68kcontext.io_cycle_counter -= 50;
70357ce5 27826#endif
27827RET(112)
27828}
27829
27830// DIVS
27831OPCODE(0x81E0)
27832{
27833 u32 adr, res;
27834 u32 src, dst;
27835
27836 adr = AREG((Opcode >> 0) & 7) - 2;
27837 AREG((Opcode >> 0) & 7) = adr;
27838 PRE_IO
27839 READSX_WORD_F(adr, src)
27840 if (src == 0)
27841 {
d0ae0cb4 27842 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 27843#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 27844goto end81E0;
70357ce5 27845#endif
27846 RET(16)
27847 }
27848 dst = DREGu32((Opcode >> 9) & 7);
27849 if ((dst == 0x80000000) && (src == (u32)-1))
27850 {
27851 flag_NotZ = flag_N = 0;
27852 flag_V = flag_C = 0;
27853 res = 0;
27854 DREGu32((Opcode >> 9) & 7) = res;
27855#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 27856goto end81E0;
70357ce5 27857#endif
27858 RET(56)
27859 }
27860 {
27861 s32 q, r;
27862
27863 q = (s32)dst / (s32)src;
27864 r = (s32)dst % (s32)src;
27865
27866 if ((q > 0x7FFF) || (q < -0x8000))
27867 {
27868 flag_V = M68K_SR_V;
27869#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 27870goto end81E0;
70357ce5 27871#endif
27872 RET(86)
27873 }
27874 q &= 0x0000FFFF;
27875 flag_NotZ = q;
27876 flag_N = q >> 8;
27877 flag_V = flag_C = 0;
27878 res = q | (r << 16);
27879 DREGu32((Opcode >> 9) & 7) = res;
27880 }
27881#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 27882end81E0: m68kcontext.io_cycle_counter -= 50;
70357ce5 27883#endif
27884RET(114)
27885}
27886
27887// DIVS
27888OPCODE(0x81E8)
27889{
27890 u32 adr, res;
27891 u32 src, dst;
27892
27893 FETCH_SWORD(adr);
27894 adr += AREG((Opcode >> 0) & 7);
27895 PRE_IO
27896 READSX_WORD_F(adr, src)
27897 if (src == 0)
27898 {
d0ae0cb4 27899 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 27900#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 27901goto end81E8;
70357ce5 27902#endif
27903 RET(18)
27904 }
27905 dst = DREGu32((Opcode >> 9) & 7);
27906 if ((dst == 0x80000000) && (src == (u32)-1))
27907 {
27908 flag_NotZ = flag_N = 0;
27909 flag_V = flag_C = 0;
27910 res = 0;
27911 DREGu32((Opcode >> 9) & 7) = res;
27912#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 27913goto end81E8;
70357ce5 27914#endif
27915 RET(58)
27916 }
27917 {
27918 s32 q, r;
27919
27920 q = (s32)dst / (s32)src;
27921 r = (s32)dst % (s32)src;
27922
27923 if ((q > 0x7FFF) || (q < -0x8000))
27924 {
27925 flag_V = M68K_SR_V;
27926#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 27927goto end81E8;
70357ce5 27928#endif
27929 RET(88)
27930 }
27931 q &= 0x0000FFFF;
27932 flag_NotZ = q;
27933 flag_N = q >> 8;
27934 flag_V = flag_C = 0;
27935 res = q | (r << 16);
27936 DREGu32((Opcode >> 9) & 7) = res;
27937 }
27938#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 27939end81E8: m68kcontext.io_cycle_counter -= 50;
70357ce5 27940#endif
27941RET(116)
27942}
27943
27944// DIVS
27945OPCODE(0x81F0)
27946{
27947 u32 adr, res;
27948 u32 src, dst;
27949
27950 adr = AREG((Opcode >> 0) & 7);
27951 DECODE_EXT_WORD
27952 PRE_IO
27953 READSX_WORD_F(adr, src)
27954 if (src == 0)
27955 {
d0ae0cb4 27956 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 27957#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 27958goto end81F0;
70357ce5 27959#endif
27960 RET(20)
27961 }
27962 dst = DREGu32((Opcode >> 9) & 7);
27963 if ((dst == 0x80000000) && (src == (u32)-1))
27964 {
27965 flag_NotZ = flag_N = 0;
27966 flag_V = flag_C = 0;
27967 res = 0;
27968 DREGu32((Opcode >> 9) & 7) = res;
27969#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 27970goto end81F0;
70357ce5 27971#endif
27972 RET(60)
27973 }
27974 {
27975 s32 q, r;
27976
27977 q = (s32)dst / (s32)src;
27978 r = (s32)dst % (s32)src;
27979
27980 if ((q > 0x7FFF) || (q < -0x8000))
27981 {
27982 flag_V = M68K_SR_V;
27983#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 27984goto end81F0;
70357ce5 27985#endif
27986 RET(90)
27987 }
27988 q &= 0x0000FFFF;
27989 flag_NotZ = q;
27990 flag_N = q >> 8;
27991 flag_V = flag_C = 0;
27992 res = q | (r << 16);
27993 DREGu32((Opcode >> 9) & 7) = res;
27994 }
27995#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 27996end81F0: m68kcontext.io_cycle_counter -= 50;
70357ce5 27997#endif
27998RET(118)
27999}
28000
28001// DIVS
28002OPCODE(0x81F8)
28003{
28004 u32 adr, res;
28005 u32 src, dst;
28006
28007 FETCH_SWORD(adr);
28008 PRE_IO
28009 READSX_WORD_F(adr, src)
28010 if (src == 0)
28011 {
d0ae0cb4 28012 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 28013#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28014goto end81F8;
70357ce5 28015#endif
28016 RET(18)
28017 }
28018 dst = DREGu32((Opcode >> 9) & 7);
28019 if ((dst == 0x80000000) && (src == (u32)-1))
28020 {
28021 flag_NotZ = flag_N = 0;
28022 flag_V = flag_C = 0;
28023 res = 0;
28024 DREGu32((Opcode >> 9) & 7) = res;
28025#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28026goto end81F8;
70357ce5 28027#endif
28028 RET(58)
28029 }
28030 {
28031 s32 q, r;
28032
28033 q = (s32)dst / (s32)src;
28034 r = (s32)dst % (s32)src;
28035
28036 if ((q > 0x7FFF) || (q < -0x8000))
28037 {
28038 flag_V = M68K_SR_V;
28039#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28040goto end81F8;
70357ce5 28041#endif
28042 RET(88)
28043 }
28044 q &= 0x0000FFFF;
28045 flag_NotZ = q;
28046 flag_N = q >> 8;
28047 flag_V = flag_C = 0;
28048 res = q | (r << 16);
28049 DREGu32((Opcode >> 9) & 7) = res;
28050 }
28051#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28052end81F8: m68kcontext.io_cycle_counter -= 50;
70357ce5 28053#endif
28054RET(116)
28055}
28056
28057// DIVS
28058OPCODE(0x81F9)
28059{
28060 u32 adr, res;
28061 u32 src, dst;
28062
28063 FETCH_LONG(adr);
28064 PRE_IO
28065 READSX_WORD_F(adr, src)
28066 if (src == 0)
28067 {
d0ae0cb4 28068 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 28069#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28070goto end81F9;
70357ce5 28071#endif
28072 RET(22)
28073 }
28074 dst = DREGu32((Opcode >> 9) & 7);
28075 if ((dst == 0x80000000) && (src == (u32)-1))
28076 {
28077 flag_NotZ = flag_N = 0;
28078 flag_V = flag_C = 0;
28079 res = 0;
28080 DREGu32((Opcode >> 9) & 7) = res;
28081#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28082goto end81F9;
70357ce5 28083#endif
28084 RET(62)
28085 }
28086 {
28087 s32 q, r;
28088
28089 q = (s32)dst / (s32)src;
28090 r = (s32)dst % (s32)src;
28091
28092 if ((q > 0x7FFF) || (q < -0x8000))
28093 {
28094 flag_V = M68K_SR_V;
28095#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28096goto end81F9;
70357ce5 28097#endif
28098 RET(92)
28099 }
28100 q &= 0x0000FFFF;
28101 flag_NotZ = q;
28102 flag_N = q >> 8;
28103 flag_V = flag_C = 0;
28104 res = q | (r << 16);
28105 DREGu32((Opcode >> 9) & 7) = res;
28106 }
28107#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28108end81F9: m68kcontext.io_cycle_counter -= 50;
70357ce5 28109#endif
28110RET(120)
28111}
28112
28113// DIVS
28114OPCODE(0x81FA)
28115{
28116 u32 adr, res;
28117 u32 src, dst;
28118
be26eb23 28119 adr = GET_SWORD + GET_PC;
70357ce5 28120 PC++;
28121 PRE_IO
28122 READSX_WORD_F(adr, src)
28123 if (src == 0)
28124 {
d0ae0cb4 28125 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 28126#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28127goto end81FA;
70357ce5 28128#endif
28129 RET(18)
28130 }
28131 dst = DREGu32((Opcode >> 9) & 7);
28132 if ((dst == 0x80000000) && (src == (u32)-1))
28133 {
28134 flag_NotZ = flag_N = 0;
28135 flag_V = flag_C = 0;
28136 res = 0;
28137 DREGu32((Opcode >> 9) & 7) = res;
28138#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28139goto end81FA;
70357ce5 28140#endif
28141 RET(58)
28142 }
28143 {
28144 s32 q, r;
28145
28146 q = (s32)dst / (s32)src;
28147 r = (s32)dst % (s32)src;
28148
28149 if ((q > 0x7FFF) || (q < -0x8000))
28150 {
28151 flag_V = M68K_SR_V;
28152#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28153goto end81FA;
70357ce5 28154#endif
28155 RET(88)
28156 }
28157 q &= 0x0000FFFF;
28158 flag_NotZ = q;
28159 flag_N = q >> 8;
28160 flag_V = flag_C = 0;
28161 res = q | (r << 16);
28162 DREGu32((Opcode >> 9) & 7) = res;
28163 }
28164#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28165end81FA: m68kcontext.io_cycle_counter -= 50;
70357ce5 28166#endif
28167RET(116)
28168}
28169
28170// DIVS
28171OPCODE(0x81FB)
28172{
28173 u32 adr, res;
28174 u32 src, dst;
28175
be26eb23 28176 adr = GET_PC;
70357ce5 28177 DECODE_EXT_WORD
28178 PRE_IO
28179 READSX_WORD_F(adr, src)
28180 if (src == 0)
28181 {
d0ae0cb4 28182 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 28183#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28184goto end81FB;
70357ce5 28185#endif
28186 RET(20)
28187 }
28188 dst = DREGu32((Opcode >> 9) & 7);
28189 if ((dst == 0x80000000) && (src == (u32)-1))
28190 {
28191 flag_NotZ = flag_N = 0;
28192 flag_V = flag_C = 0;
28193 res = 0;
28194 DREGu32((Opcode >> 9) & 7) = res;
28195#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28196goto end81FB;
70357ce5 28197#endif
28198 RET(60)
28199 }
28200 {
28201 s32 q, r;
28202
28203 q = (s32)dst / (s32)src;
28204 r = (s32)dst % (s32)src;
28205
28206 if ((q > 0x7FFF) || (q < -0x8000))
28207 {
28208 flag_V = M68K_SR_V;
28209#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28210goto end81FB;
70357ce5 28211#endif
28212 RET(90)
28213 }
28214 q &= 0x0000FFFF;
28215 flag_NotZ = q;
28216 flag_N = q >> 8;
28217 flag_V = flag_C = 0;
28218 res = q | (r << 16);
28219 DREGu32((Opcode >> 9) & 7) = res;
28220 }
28221#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28222end81FB: m68kcontext.io_cycle_counter -= 50;
70357ce5 28223#endif
28224RET(118)
28225}
28226
28227// DIVS
28228OPCODE(0x81FC)
28229{
28230 u32 adr, res;
28231 u32 src, dst;
28232
28233 FETCH_SWORD(src);
28234 if (src == 0)
28235 {
d0ae0cb4 28236 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 28237#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28238goto end81FC;
70357ce5 28239#endif
28240 RET(14)
28241 }
28242 dst = DREGu32((Opcode >> 9) & 7);
28243 if ((dst == 0x80000000) && (src == (u32)-1))
28244 {
28245 flag_NotZ = flag_N = 0;
28246 flag_V = flag_C = 0;
28247 res = 0;
28248 DREGu32((Opcode >> 9) & 7) = res;
28249#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28250goto end81FC;
70357ce5 28251#endif
28252 RET(54)
28253 }
28254 {
28255 s32 q, r;
28256
28257 q = (s32)dst / (s32)src;
28258 r = (s32)dst % (s32)src;
28259
28260 if ((q > 0x7FFF) || (q < -0x8000))
28261 {
28262 flag_V = M68K_SR_V;
28263#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28264goto end81FC;
70357ce5 28265#endif
28266 RET(84)
28267 }
28268 q &= 0x0000FFFF;
28269 flag_NotZ = q;
28270 flag_N = q >> 8;
28271 flag_V = flag_C = 0;
28272 res = q | (r << 16);
28273 DREGu32((Opcode >> 9) & 7) = res;
28274 }
28275#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28276end81FC: m68kcontext.io_cycle_counter -= 50;
70357ce5 28277#endif
28278RET(112)
28279}
28280
28281// DIVS
28282OPCODE(0x81DF)
28283{
28284 u32 adr, res;
28285 u32 src, dst;
28286
28287 adr = AREG(7);
28288 AREG(7) += 2;
28289 PRE_IO
28290 READSX_WORD_F(adr, src)
28291 if (src == 0)
28292 {
d0ae0cb4 28293 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 28294#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28295goto end81DF;
70357ce5 28296#endif
28297 RET(14)
28298 }
28299 dst = DREGu32((Opcode >> 9) & 7);
28300 if ((dst == 0x80000000) && (src == (u32)-1))
28301 {
28302 flag_NotZ = flag_N = 0;
28303 flag_V = flag_C = 0;
28304 res = 0;
28305 DREGu32((Opcode >> 9) & 7) = res;
28306#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28307goto end81DF;
70357ce5 28308#endif
28309 RET(54)
28310 }
28311 {
28312 s32 q, r;
28313
28314 q = (s32)dst / (s32)src;
28315 r = (s32)dst % (s32)src;
28316
28317 if ((q > 0x7FFF) || (q < -0x8000))
28318 {
28319 flag_V = M68K_SR_V;
28320#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28321goto end81DF;
70357ce5 28322#endif
28323 RET(84)
28324 }
28325 q &= 0x0000FFFF;
28326 flag_NotZ = q;
28327 flag_N = q >> 8;
28328 flag_V = flag_C = 0;
28329 res = q | (r << 16);
28330 DREGu32((Opcode >> 9) & 7) = res;
28331 }
28332#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28333end81DF: m68kcontext.io_cycle_counter -= 50;
70357ce5 28334#endif
28335RET(112)
28336}
28337
28338// DIVS
28339OPCODE(0x81E7)
28340{
28341 u32 adr, res;
28342 u32 src, dst;
28343
28344 adr = AREG(7) - 2;
28345 AREG(7) = adr;
28346 PRE_IO
28347 READSX_WORD_F(adr, src)
28348 if (src == 0)
28349 {
d0ae0cb4 28350 SET_PC(execute_exception(M68K_ZERO_DIVIDE_EX, GET_PC, GET_SR));
70357ce5 28351#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28352goto end81E7;
70357ce5 28353#endif
28354 RET(16)
28355 }
28356 dst = DREGu32((Opcode >> 9) & 7);
28357 if ((dst == 0x80000000) && (src == (u32)-1))
28358 {
28359 flag_NotZ = flag_N = 0;
28360 flag_V = flag_C = 0;
28361 res = 0;
28362 DREGu32((Opcode >> 9) & 7) = res;
28363#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28364goto end81E7;
70357ce5 28365#endif
28366 RET(56)
28367 }
28368 {
28369 s32 q, r;
28370
28371 q = (s32)dst / (s32)src;
28372 r = (s32)dst % (s32)src;
28373
28374 if ((q > 0x7FFF) || (q < -0x8000))
28375 {
28376 flag_V = M68K_SR_V;
28377#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28378goto end81E7;
70357ce5 28379#endif
28380 RET(86)
28381 }
28382 q &= 0x0000FFFF;
28383 flag_NotZ = q;
28384 flag_N = q >> 8;
28385 flag_V = flag_C = 0;
28386 res = q | (r << 16);
28387 DREGu32((Opcode >> 9) & 7) = res;
28388 }
28389#ifdef USE_CYCLONE_TIMING_DIV
9112b6ce 28390end81E7: m68kcontext.io_cycle_counter -= 50;
70357ce5 28391#endif
28392RET(114)
28393}
28394
28395// SUBaD
28396OPCODE(0x9000)
28397{
28398 u32 adr, res;
28399 u32 src, dst;
28400
28401 src = DREGu8((Opcode >> 0) & 7);
28402 dst = DREGu8((Opcode >> 9) & 7);
28403 res = dst - src;
28404 flag_N = flag_X = flag_C = res;
28405 flag_V = (src ^ dst) & (res ^ dst);
28406 flag_NotZ = res & 0xFF;
28407 DREGu8((Opcode >> 9) & 7) = res;
28408RET(4)
28409}
28410
28411// SUBaD
03e4f2a3 28412#if 0
70357ce5 28413OPCODE(0x9008)
28414{
28415 u32 adr, res;
28416 u32 src, dst;
28417
28418 // can't read byte from Ax registers !
28419 m68kcontext.execinfo |= M68K_FAULTED;
28420 m68kcontext.io_cycle_counter = 0;
28421/*
28422 goto famec_Exec_End;
28423 dst = DREGu8((Opcode >> 9) & 7);
28424 res = dst - src;
28425 flag_N = flag_X = flag_C = res;
28426 flag_V = (src ^ dst) & (res ^ dst);
28427 flag_NotZ = res & 0xFF;
28428 DREGu8((Opcode >> 9) & 7) = res;
28429*/
28430RET(4)
28431}
03e4f2a3 28432#endif
70357ce5 28433
28434// SUBaD
28435OPCODE(0x9010)
28436{
28437 u32 adr, res;
28438 u32 src, dst;
28439
28440 adr = AREG((Opcode >> 0) & 7);
28441 PRE_IO
28442 READ_BYTE_F(adr, src)
28443 dst = DREGu8((Opcode >> 9) & 7);
28444 res = dst - src;
28445 flag_N = flag_X = flag_C = res;
28446 flag_V = (src ^ dst) & (res ^ dst);
28447 flag_NotZ = res & 0xFF;
28448 DREGu8((Opcode >> 9) & 7) = res;
28449 POST_IO
28450RET(8)
28451}
28452
28453// SUBaD
28454OPCODE(0x9018)
28455{
28456 u32 adr, res;
28457 u32 src, dst;
28458
28459 adr = AREG((Opcode >> 0) & 7);
28460 AREG((Opcode >> 0) & 7) += 1;
28461 PRE_IO
28462 READ_BYTE_F(adr, src)
28463 dst = DREGu8((Opcode >> 9) & 7);
28464 res = dst - src;
28465 flag_N = flag_X = flag_C = res;
28466 flag_V = (src ^ dst) & (res ^ dst);
28467 flag_NotZ = res & 0xFF;
28468 DREGu8((Opcode >> 9) & 7) = res;
28469 POST_IO
28470RET(8)
28471}
28472
28473// SUBaD
28474OPCODE(0x9020)
28475{
28476 u32 adr, res;
28477 u32 src, dst;
28478
28479 adr = AREG((Opcode >> 0) & 7) - 1;
28480 AREG((Opcode >> 0) & 7) = adr;
28481 PRE_IO
28482 READ_BYTE_F(adr, src)
28483 dst = DREGu8((Opcode >> 9) & 7);
28484 res = dst - src;
28485 flag_N = flag_X = flag_C = res;
28486 flag_V = (src ^ dst) & (res ^ dst);
28487 flag_NotZ = res & 0xFF;
28488 DREGu8((Opcode >> 9) & 7) = res;
28489 POST_IO
28490RET(10)
28491}
28492
28493// SUBaD
28494OPCODE(0x9028)
28495{
28496 u32 adr, res;
28497 u32 src, dst;
28498
28499 FETCH_SWORD(adr);
28500 adr += AREG((Opcode >> 0) & 7);
28501 PRE_IO
28502 READ_BYTE_F(adr, src)
28503 dst = DREGu8((Opcode >> 9) & 7);
28504 res = dst - src;
28505 flag_N = flag_X = flag_C = res;
28506 flag_V = (src ^ dst) & (res ^ dst);
28507 flag_NotZ = res & 0xFF;
28508 DREGu8((Opcode >> 9) & 7) = res;
28509 POST_IO
28510RET(12)
28511}
28512
28513// SUBaD
28514OPCODE(0x9030)
28515{
28516 u32 adr, res;
28517 u32 src, dst;
28518
28519 adr = AREG((Opcode >> 0) & 7);
28520 DECODE_EXT_WORD
28521 PRE_IO
28522 READ_BYTE_F(adr, src)
28523 dst = DREGu8((Opcode >> 9) & 7);
28524 res = dst - src;
28525 flag_N = flag_X = flag_C = res;
28526 flag_V = (src ^ dst) & (res ^ dst);
28527 flag_NotZ = res & 0xFF;
28528 DREGu8((Opcode >> 9) & 7) = res;
28529 POST_IO
28530RET(14)
28531}
28532
28533// SUBaD
28534OPCODE(0x9038)
28535{
28536 u32 adr, res;
28537 u32 src, dst;
28538
28539 FETCH_SWORD(adr);
28540 PRE_IO
28541 READ_BYTE_F(adr, src)
28542 dst = DREGu8((Opcode >> 9) & 7);
28543 res = dst - src;
28544 flag_N = flag_X = flag_C = res;
28545 flag_V = (src ^ dst) & (res ^ dst);
28546 flag_NotZ = res & 0xFF;
28547 DREGu8((Opcode >> 9) & 7) = res;
28548 POST_IO
28549RET(12)
28550}
28551
28552// SUBaD
28553OPCODE(0x9039)
28554{
28555 u32 adr, res;
28556 u32 src, dst;
28557
28558 FETCH_LONG(adr);
28559 PRE_IO
28560 READ_BYTE_F(adr, src)
28561 dst = DREGu8((Opcode >> 9) & 7);
28562 res = dst - src;
28563 flag_N = flag_X = flag_C = res;
28564 flag_V = (src ^ dst) & (res ^ dst);
28565 flag_NotZ = res & 0xFF;
28566 DREGu8((Opcode >> 9) & 7) = res;
28567 POST_IO
28568RET(16)
28569}
28570
28571// SUBaD
28572OPCODE(0x903A)
28573{
28574 u32 adr, res;
28575 u32 src, dst;
28576
be26eb23 28577 adr = GET_SWORD + GET_PC;
70357ce5 28578 PC++;
28579 PRE_IO
28580 READ_BYTE_F(adr, src)
28581 dst = DREGu8((Opcode >> 9) & 7);
28582 res = dst - src;
28583 flag_N = flag_X = flag_C = res;
28584 flag_V = (src ^ dst) & (res ^ dst);
28585 flag_NotZ = res & 0xFF;
28586 DREGu8((Opcode >> 9) & 7) = res;
28587 POST_IO
28588RET(12)
28589}
28590
28591// SUBaD
28592OPCODE(0x903B)
28593{
28594 u32 adr, res;
28595 u32 src, dst;
28596
be26eb23 28597 adr = GET_PC;
70357ce5 28598 DECODE_EXT_WORD
28599 PRE_IO
28600 READ_BYTE_F(adr, src)
28601 dst = DREGu8((Opcode >> 9) & 7);
28602 res = dst - src;
28603 flag_N = flag_X = flag_C = res;
28604 flag_V = (src ^ dst) & (res ^ dst);
28605 flag_NotZ = res & 0xFF;
28606 DREGu8((Opcode >> 9) & 7) = res;
28607 POST_IO
28608RET(14)
28609}
28610
28611// SUBaD
28612OPCODE(0x903C)
28613{
28614 u32 adr, res;
28615 u32 src, dst;
28616
28617 FETCH_BYTE(src);
28618 dst = DREGu8((Opcode >> 9) & 7);
28619 res = dst - src;
28620 flag_N = flag_X = flag_C = res;
28621 flag_V = (src ^ dst) & (res ^ dst);
28622 flag_NotZ = res & 0xFF;
28623 DREGu8((Opcode >> 9) & 7) = res;
28624RET(8)
28625}
28626
28627// SUBaD
28628OPCODE(0x901F)
28629{
28630 u32 adr, res;
28631 u32 src, dst;
28632
28633 adr = AREG(7);
28634 AREG(7) += 2;
28635 PRE_IO
28636 READ_BYTE_F(adr, src)
28637 dst = DREGu8((Opcode >> 9) & 7);
28638 res = dst - src;
28639 flag_N = flag_X = flag_C = res;
28640 flag_V = (src ^ dst) & (res ^ dst);
28641 flag_NotZ = res & 0xFF;
28642 DREGu8((Opcode >> 9) & 7) = res;
28643 POST_IO
28644RET(8)
28645}
28646
28647// SUBaD
28648OPCODE(0x9027)
28649{
28650 u32 adr, res;
28651 u32 src, dst;
28652
28653 adr = AREG(7) - 2;
28654 AREG(7) = adr;
28655 PRE_IO
28656 READ_BYTE_F(adr, src)
28657 dst = DREGu8((Opcode >> 9) & 7);
28658 res = dst - src;
28659 flag_N = flag_X = flag_C = res;
28660 flag_V = (src ^ dst) & (res ^ dst);
28661 flag_NotZ = res & 0xFF;
28662 DREGu8((Opcode >> 9) & 7) = res;
28663 POST_IO
28664RET(10)
28665}
28666
28667// SUBaD
28668OPCODE(0x9040)
28669{
28670 u32 adr, res;
28671 u32 src, dst;
28672
28673 src = DREGu16((Opcode >> 0) & 7);
28674 dst = DREGu16((Opcode >> 9) & 7);
28675 res = dst - src;
28676 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
28677 flag_N = flag_X = flag_C = res >> 8;
28678 flag_NotZ = res & 0xFFFF;
28679 DREGu16((Opcode >> 9) & 7) = res;
28680RET(4)
28681}
28682
28683// SUBaD
28684OPCODE(0x9048)
28685{
28686 u32 adr, res;
28687 u32 src, dst;
28688
28689 src = AREGu16((Opcode >> 0) & 7);
28690 dst = DREGu16((Opcode >> 9) & 7);
28691 res = dst - src;
28692 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
28693 flag_N = flag_X = flag_C = res >> 8;
28694 flag_NotZ = res & 0xFFFF;
28695 DREGu16((Opcode >> 9) & 7) = res;
28696RET(4)
28697}
28698
28699// SUBaD
28700OPCODE(0x9050)
28701{
28702 u32 adr, res;
28703 u32 src, dst;
28704
28705 adr = AREG((Opcode >> 0) & 7);
28706 PRE_IO
28707 READ_WORD_F(adr, src)
28708 dst = DREGu16((Opcode >> 9) & 7);
28709 res = dst - src;
28710 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
28711 flag_N = flag_X = flag_C = res >> 8;
28712 flag_NotZ = res & 0xFFFF;
28713 DREGu16((Opcode >> 9) & 7) = res;
28714 POST_IO
28715RET(8)
28716}
28717
28718// SUBaD
28719OPCODE(0x9058)
28720{
28721 u32 adr, res;
28722 u32 src, dst;
28723
28724 adr = AREG((Opcode >> 0) & 7);
28725 AREG((Opcode >> 0) & 7) += 2;
28726 PRE_IO
28727 READ_WORD_F(adr, src)
28728 dst = DREGu16((Opcode >> 9) & 7);
28729 res = dst - src;
28730 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
28731 flag_N = flag_X = flag_C = res >> 8;
28732 flag_NotZ = res & 0xFFFF;
28733 DREGu16((Opcode >> 9) & 7) = res;
28734 POST_IO
28735RET(8)
28736}
28737
28738// SUBaD
28739OPCODE(0x9060)
28740{
28741 u32 adr, res;
28742 u32 src, dst;
28743
28744 adr = AREG((Opcode >> 0) & 7) - 2;
28745 AREG((Opcode >> 0) & 7) = adr;
28746 PRE_IO
28747 READ_WORD_F(adr, src)
28748 dst = DREGu16((Opcode >> 9) & 7);
28749 res = dst - src;
28750 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
28751 flag_N = flag_X = flag_C = res >> 8;
28752 flag_NotZ = res & 0xFFFF;
28753 DREGu16((Opcode >> 9) & 7) = res;
28754 POST_IO
28755RET(10)
28756}
28757
28758// SUBaD
28759OPCODE(0x9068)
28760{
28761 u32 adr, res;
28762 u32 src, dst;
28763
28764 FETCH_SWORD(adr);
28765 adr += AREG((Opcode >> 0) & 7);
28766 PRE_IO
28767 READ_WORD_F(adr, src)
28768 dst = DREGu16((Opcode >> 9) & 7);
28769 res = dst - src;
28770 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
28771 flag_N = flag_X = flag_C = res >> 8;
28772 flag_NotZ = res & 0xFFFF;
28773 DREGu16((Opcode >> 9) & 7) = res;
28774 POST_IO
28775RET(12)
28776}
28777
28778// SUBaD
28779OPCODE(0x9070)
28780{
28781 u32 adr, res;
28782 u32 src, dst;
28783
28784 adr = AREG((Opcode >> 0) & 7);
28785 DECODE_EXT_WORD
28786 PRE_IO
28787 READ_WORD_F(adr, src)
28788 dst = DREGu16((Opcode >> 9) & 7);
28789 res = dst - src;
28790 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
28791 flag_N = flag_X = flag_C = res >> 8;
28792 flag_NotZ = res & 0xFFFF;
28793 DREGu16((Opcode >> 9) & 7) = res;
28794 POST_IO
28795RET(14)
28796}
28797
28798// SUBaD
28799OPCODE(0x9078)
28800{
28801 u32 adr, res;
28802 u32 src, dst;
28803
28804 FETCH_SWORD(adr);
28805 PRE_IO
28806 READ_WORD_F(adr, src)
28807 dst = DREGu16((Opcode >> 9) & 7);
28808 res = dst - src;
28809 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
28810 flag_N = flag_X = flag_C = res >> 8;
28811 flag_NotZ = res & 0xFFFF;
28812 DREGu16((Opcode >> 9) & 7) = res;
28813 POST_IO
28814RET(12)
28815}
28816
28817// SUBaD
28818OPCODE(0x9079)
28819{
28820 u32 adr, res;
28821 u32 src, dst;
28822
28823 FETCH_LONG(adr);
28824 PRE_IO
28825 READ_WORD_F(adr, src)
28826 dst = DREGu16((Opcode >> 9) & 7);
28827 res = dst - src;
28828 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
28829 flag_N = flag_X = flag_C = res >> 8;
28830 flag_NotZ = res & 0xFFFF;
28831 DREGu16((Opcode >> 9) & 7) = res;
28832 POST_IO
28833RET(16)
28834}
28835
28836// SUBaD
28837OPCODE(0x907A)
28838{
28839 u32 adr, res;
28840 u32 src, dst;
28841
be26eb23 28842 adr = GET_SWORD + GET_PC;
70357ce5 28843 PC++;
28844 PRE_IO
28845 READ_WORD_F(adr, src)
28846 dst = DREGu16((Opcode >> 9) & 7);
28847 res = dst - src;
28848 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
28849 flag_N = flag_X = flag_C = res >> 8;
28850 flag_NotZ = res & 0xFFFF;
28851 DREGu16((Opcode >> 9) & 7) = res;
28852 POST_IO
28853RET(12)
28854}
28855
28856// SUBaD
28857OPCODE(0x907B)
28858{
28859 u32 adr, res;
28860 u32 src, dst;
28861
be26eb23 28862 adr = GET_PC;
70357ce5 28863 DECODE_EXT_WORD
28864 PRE_IO
28865 READ_WORD_F(adr, src)
28866 dst = DREGu16((Opcode >> 9) & 7);
28867 res = dst - src;
28868 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
28869 flag_N = flag_X = flag_C = res >> 8;
28870 flag_NotZ = res & 0xFFFF;
28871 DREGu16((Opcode >> 9) & 7) = res;
28872 POST_IO
28873RET(14)
28874}
28875
28876// SUBaD
28877OPCODE(0x907C)
28878{
28879 u32 adr, res;
28880 u32 src, dst;
28881
28882 FETCH_WORD(src);
28883 dst = DREGu16((Opcode >> 9) & 7);
28884 res = dst - src;
28885 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
28886 flag_N = flag_X = flag_C = res >> 8;
28887 flag_NotZ = res & 0xFFFF;
28888 DREGu16((Opcode >> 9) & 7) = res;
28889RET(8)
28890}
28891
28892// SUBaD
28893OPCODE(0x905F)
28894{
28895 u32 adr, res;
28896 u32 src, dst;
28897
28898 adr = AREG(7);
28899 AREG(7) += 2;
28900 PRE_IO
28901 READ_WORD_F(adr, src)
28902 dst = DREGu16((Opcode >> 9) & 7);
28903 res = dst - src;
28904 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
28905 flag_N = flag_X = flag_C = res >> 8;
28906 flag_NotZ = res & 0xFFFF;
28907 DREGu16((Opcode >> 9) & 7) = res;
28908 POST_IO
28909RET(8)
28910}
28911
28912// SUBaD
28913OPCODE(0x9067)
28914{
28915 u32 adr, res;
28916 u32 src, dst;
28917
28918 adr = AREG(7) - 2;
28919 AREG(7) = adr;
28920 PRE_IO
28921 READ_WORD_F(adr, src)
28922 dst = DREGu16((Opcode >> 9) & 7);
28923 res = dst - src;
28924 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
28925 flag_N = flag_X = flag_C = res >> 8;
28926 flag_NotZ = res & 0xFFFF;
28927 DREGu16((Opcode >> 9) & 7) = res;
28928 POST_IO
28929RET(10)
28930}
28931
28932// SUBaD
28933OPCODE(0x9080)
28934{
28935 u32 adr, res;
28936 u32 src, dst;
28937
28938 src = DREGu32((Opcode >> 0) & 7);
28939 dst = DREGu32((Opcode >> 9) & 7);
28940 res = dst - src;
28941 flag_NotZ = res;
28942 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
28943 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
28944 flag_N = res >> 24;
28945 DREGu32((Opcode >> 9) & 7) = res;
28946RET(8)
28947}
28948
28949// SUBaD
28950OPCODE(0x9088)
28951{
28952 u32 adr, res;
28953 u32 src, dst;
28954
28955 src = AREGu32((Opcode >> 0) & 7);
28956 dst = DREGu32((Opcode >> 9) & 7);
28957 res = dst - src;
28958 flag_NotZ = res;
28959 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
28960 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
28961 flag_N = res >> 24;
28962 DREGu32((Opcode >> 9) & 7) = res;
28963RET(8)
28964}
28965
28966// SUBaD
28967OPCODE(0x9090)
28968{
28969 u32 adr, res;
28970 u32 src, dst;
28971
28972 adr = AREG((Opcode >> 0) & 7);
28973 PRE_IO
28974 READ_LONG_F(adr, src)
28975 dst = DREGu32((Opcode >> 9) & 7);
28976 res = dst - src;
28977 flag_NotZ = res;
28978 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
28979 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
28980 flag_N = res >> 24;
28981 DREGu32((Opcode >> 9) & 7) = res;
28982 POST_IO
28983RET(14)
28984}
28985
28986// SUBaD
28987OPCODE(0x9098)
28988{
28989 u32 adr, res;
28990 u32 src, dst;
28991
28992 adr = AREG((Opcode >> 0) & 7);
28993 AREG((Opcode >> 0) & 7) += 4;
28994 PRE_IO
28995 READ_LONG_F(adr, src)
28996 dst = DREGu32((Opcode >> 9) & 7);
28997 res = dst - src;
28998 flag_NotZ = res;
28999 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
29000 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
29001 flag_N = res >> 24;
29002 DREGu32((Opcode >> 9) & 7) = res;
29003 POST_IO
29004RET(14)
29005}
29006
29007// SUBaD
29008OPCODE(0x90A0)
29009{
29010 u32 adr, res;
29011 u32 src, dst;
29012
29013 adr = AREG((Opcode >> 0) & 7) - 4;
29014 AREG((Opcode >> 0) & 7) = adr;
29015 PRE_IO
29016 READ_LONG_F(adr, src)
29017 dst = DREGu32((Opcode >> 9) & 7);
29018 res = dst - src;
29019 flag_NotZ = res;
29020 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
29021 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
29022 flag_N = res >> 24;
29023 DREGu32((Opcode >> 9) & 7) = res;
29024 POST_IO
29025RET(16)
29026}
29027
29028// SUBaD
29029OPCODE(0x90A8)
29030{
29031 u32 adr, res;
29032 u32 src, dst;
29033
29034 FETCH_SWORD(adr);
29035 adr += AREG((Opcode >> 0) & 7);
29036 PRE_IO
29037 READ_LONG_F(adr, src)
29038 dst = DREGu32((Opcode >> 9) & 7);
29039 res = dst - src;
29040 flag_NotZ = res;
29041 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
29042 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
29043 flag_N = res >> 24;
29044 DREGu32((Opcode >> 9) & 7) = res;
29045 POST_IO
29046RET(18)
29047}
29048
29049// SUBaD
29050OPCODE(0x90B0)
29051{
29052 u32 adr, res;
29053 u32 src, dst;
29054
29055 adr = AREG((Opcode >> 0) & 7);
29056 DECODE_EXT_WORD
29057 PRE_IO
29058 READ_LONG_F(adr, src)
29059 dst = DREGu32((Opcode >> 9) & 7);
29060 res = dst - src;
29061 flag_NotZ = res;
29062 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
29063 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
29064 flag_N = res >> 24;
29065 DREGu32((Opcode >> 9) & 7) = res;
29066 POST_IO
29067RET(20)
29068}
29069
29070// SUBaD
29071OPCODE(0x90B8)
29072{
29073 u32 adr, res;
29074 u32 src, dst;
29075
29076 FETCH_SWORD(adr);
29077 PRE_IO
29078 READ_LONG_F(adr, src)
29079 dst = DREGu32((Opcode >> 9) & 7);
29080 res = dst - src;
29081 flag_NotZ = res;
29082 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
29083 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
29084 flag_N = res >> 24;
29085 DREGu32((Opcode >> 9) & 7) = res;
29086 POST_IO
29087RET(18)
29088}
29089
29090// SUBaD
29091OPCODE(0x90B9)
29092{
29093 u32 adr, res;
29094 u32 src, dst;
29095
29096 FETCH_LONG(adr);
29097 PRE_IO
29098 READ_LONG_F(adr, src)
29099 dst = DREGu32((Opcode >> 9) & 7);
29100 res = dst - src;
29101 flag_NotZ = res;
29102 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
29103 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
29104 flag_N = res >> 24;
29105 DREGu32((Opcode >> 9) & 7) = res;
29106 POST_IO
29107RET(22)
29108}
29109
29110// SUBaD
29111OPCODE(0x90BA)
29112{
29113 u32 adr, res;
29114 u32 src, dst;
29115
be26eb23 29116 adr = GET_SWORD + GET_PC;
70357ce5 29117 PC++;
29118 PRE_IO
29119 READ_LONG_F(adr, src)
29120 dst = DREGu32((Opcode >> 9) & 7);
29121 res = dst - src;
29122 flag_NotZ = res;
29123 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
29124 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
29125 flag_N = res >> 24;
29126 DREGu32((Opcode >> 9) & 7) = res;
29127 POST_IO
29128RET(18)
29129}
29130
29131// SUBaD
29132OPCODE(0x90BB)
29133{
29134 u32 adr, res;
29135 u32 src, dst;
29136
be26eb23 29137 adr = GET_PC;
70357ce5 29138 DECODE_EXT_WORD
29139 PRE_IO
29140 READ_LONG_F(adr, src)
29141 dst = DREGu32((Opcode >> 9) & 7);
29142 res = dst - src;
29143 flag_NotZ = res;
29144 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
29145 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
29146 flag_N = res >> 24;
29147 DREGu32((Opcode >> 9) & 7) = res;
29148 POST_IO
29149RET(20)
29150}
29151
29152// SUBaD
29153OPCODE(0x90BC)
29154{
29155 u32 adr, res;
29156 u32 src, dst;
29157
29158 FETCH_LONG(src);
29159 dst = DREGu32((Opcode >> 9) & 7);
29160 res = dst - src;
29161 flag_NotZ = res;
29162 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
29163 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
29164 flag_N = res >> 24;
29165 DREGu32((Opcode >> 9) & 7) = res;
29166RET(16)
29167}
29168
29169// SUBaD
29170OPCODE(0x909F)
29171{
29172 u32 adr, res;
29173 u32 src, dst;
29174
29175 adr = AREG(7);
29176 AREG(7) += 4;
29177 PRE_IO
29178 READ_LONG_F(adr, src)
29179 dst = DREGu32((Opcode >> 9) & 7);
29180 res = dst - src;
29181 flag_NotZ = res;
29182 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
29183 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
29184 flag_N = res >> 24;
29185 DREGu32((Opcode >> 9) & 7) = res;
29186 POST_IO
29187RET(14)
29188}
29189
29190// SUBaD
29191OPCODE(0x90A7)
29192{
29193 u32 adr, res;
29194 u32 src, dst;
29195
29196 adr = AREG(7) - 4;
29197 AREG(7) = adr;
29198 PRE_IO
29199 READ_LONG_F(adr, src)
29200 dst = DREGu32((Opcode >> 9) & 7);
29201 res = dst - src;
29202 flag_NotZ = res;
29203 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
29204 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
29205 flag_N = res >> 24;
29206 DREGu32((Opcode >> 9) & 7) = res;
29207 POST_IO
29208RET(16)
29209}
29210
29211// SUBDa
29212OPCODE(0x9110)
29213{
29214 u32 adr, res;
29215 u32 src, dst;
29216
29217 src = DREGu8((Opcode >> 9) & 7);
29218 adr = AREG((Opcode >> 0) & 7);
29219 PRE_IO
29220 READ_BYTE_F(adr, dst)
29221 res = dst - src;
29222 flag_N = flag_X = flag_C = res;
29223 flag_V = (src ^ dst) & (res ^ dst);
29224 flag_NotZ = res & 0xFF;
29225 WRITE_BYTE_F(adr, res)
29226 POST_IO
29227RET(12)
29228}
29229
29230// SUBDa
29231OPCODE(0x9118)
29232{
29233 u32 adr, res;
29234 u32 src, dst;
29235
29236 src = DREGu8((Opcode >> 9) & 7);
29237 adr = AREG((Opcode >> 0) & 7);
29238 AREG((Opcode >> 0) & 7) += 1;
29239 PRE_IO
29240 READ_BYTE_F(adr, dst)
29241 res = dst - src;
29242 flag_N = flag_X = flag_C = res;
29243 flag_V = (src ^ dst) & (res ^ dst);
29244 flag_NotZ = res & 0xFF;
29245 WRITE_BYTE_F(adr, res)
29246 POST_IO
29247RET(12)
29248}
29249
29250// SUBDa
29251OPCODE(0x9120)
29252{
29253 u32 adr, res;
29254 u32 src, dst;
29255
29256 src = DREGu8((Opcode >> 9) & 7);
29257 adr = AREG((Opcode >> 0) & 7) - 1;
29258 AREG((Opcode >> 0) & 7) = adr;
29259 PRE_IO
29260 READ_BYTE_F(adr, dst)
29261 res = dst - src;
29262 flag_N = flag_X = flag_C = res;
29263 flag_V = (src ^ dst) & (res ^ dst);
29264 flag_NotZ = res & 0xFF;
29265 WRITE_BYTE_F(adr, res)
29266 POST_IO
29267RET(14)
29268}
29269
29270// SUBDa
29271OPCODE(0x9128)
29272{
29273 u32 adr, res;
29274 u32 src, dst;
29275
29276 src = DREGu8((Opcode >> 9) & 7);
29277 FETCH_SWORD(adr);
29278 adr += AREG((Opcode >> 0) & 7);
29279 PRE_IO
29280 READ_BYTE_F(adr, dst)
29281 res = dst - src;
29282 flag_N = flag_X = flag_C = res;
29283 flag_V = (src ^ dst) & (res ^ dst);
29284 flag_NotZ = res & 0xFF;
29285 WRITE_BYTE_F(adr, res)
29286 POST_IO
29287RET(16)
29288}
29289
29290// SUBDa
29291OPCODE(0x9130)
29292{
29293 u32 adr, res;
29294 u32 src, dst;
29295
29296 src = DREGu8((Opcode >> 9) & 7);
29297 adr = AREG((Opcode >> 0) & 7);
29298 DECODE_EXT_WORD
29299 PRE_IO
29300 READ_BYTE_F(adr, dst)
29301 res = dst - src;
29302 flag_N = flag_X = flag_C = res;
29303 flag_V = (src ^ dst) & (res ^ dst);
29304 flag_NotZ = res & 0xFF;
29305 WRITE_BYTE_F(adr, res)
29306 POST_IO
29307RET(18)
29308}
29309
29310// SUBDa
29311OPCODE(0x9138)
29312{
29313 u32 adr, res;
29314 u32 src, dst;
29315
29316 src = DREGu8((Opcode >> 9) & 7);
29317 FETCH_SWORD(adr);
29318 PRE_IO
29319 READ_BYTE_F(adr, dst)
29320 res = dst - src;
29321 flag_N = flag_X = flag_C = res;
29322 flag_V = (src ^ dst) & (res ^ dst);
29323 flag_NotZ = res & 0xFF;
29324 WRITE_BYTE_F(adr, res)
29325 POST_IO
29326RET(16)
29327}
29328
29329// SUBDa
29330OPCODE(0x9139)
29331{
29332 u32 adr, res;
29333 u32 src, dst;
29334
29335 src = DREGu8((Opcode >> 9) & 7);
29336 FETCH_LONG(adr);
29337 PRE_IO
29338 READ_BYTE_F(adr, dst)
29339 res = dst - src;
29340 flag_N = flag_X = flag_C = res;
29341 flag_V = (src ^ dst) & (res ^ dst);
29342 flag_NotZ = res & 0xFF;
29343 WRITE_BYTE_F(adr, res)
29344 POST_IO
29345RET(20)
29346}
29347
29348// SUBDa
29349OPCODE(0x911F)
29350{
29351 u32 adr, res;
29352 u32 src, dst;
29353
29354 src = DREGu8((Opcode >> 9) & 7);
29355 adr = AREG(7);
29356 AREG(7) += 2;
29357 PRE_IO
29358 READ_BYTE_F(adr, dst)
29359 res = dst - src;
29360 flag_N = flag_X = flag_C = res;
29361 flag_V = (src ^ dst) & (res ^ dst);
29362 flag_NotZ = res & 0xFF;
29363 WRITE_BYTE_F(adr, res)
29364 POST_IO
29365RET(12)
29366}
29367
29368// SUBDa
29369OPCODE(0x9127)
29370{
29371 u32 adr, res;
29372 u32 src, dst;
29373
29374 src = DREGu8((Opcode >> 9) & 7);
29375 adr = AREG(7) - 2;
29376 AREG(7) = adr;
29377 PRE_IO
29378 READ_BYTE_F(adr, dst)
29379 res = dst - src;
29380 flag_N = flag_X = flag_C = res;
29381 flag_V = (src ^ dst) & (res ^ dst);
29382 flag_NotZ = res & 0xFF;
29383 WRITE_BYTE_F(adr, res)
29384 POST_IO
29385RET(14)
29386}
29387
29388// SUBDa
29389OPCODE(0x9150)
29390{
29391 u32 adr, res;
29392 u32 src, dst;
29393
29394 src = DREGu16((Opcode >> 9) & 7);
29395 adr = AREG((Opcode >> 0) & 7);
29396 PRE_IO
29397 READ_WORD_F(adr, dst)
29398 res = dst - src;
29399 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
29400 flag_N = flag_X = flag_C = res >> 8;
29401 flag_NotZ = res & 0xFFFF;
29402 WRITE_WORD_F(adr, res)
29403 POST_IO
29404RET(12)
29405}
29406
29407// SUBDa
29408OPCODE(0x9158)
29409{
29410 u32 adr, res;
29411 u32 src, dst;
29412
29413 src = DREGu16((Opcode >> 9) & 7);
29414 adr = AREG((Opcode >> 0) & 7);
29415 AREG((Opcode >> 0) & 7) += 2;
29416 PRE_IO
29417 READ_WORD_F(adr, dst)
29418 res = dst - src;
29419 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
29420 flag_N = flag_X = flag_C = res >> 8;
29421 flag_NotZ = res & 0xFFFF;
29422 WRITE_WORD_F(adr, res)
29423 POST_IO
29424RET(12)
29425}
29426
29427// SUBDa
29428OPCODE(0x9160)
29429{
29430 u32 adr, res;
29431 u32 src, dst;
29432
29433 src = DREGu16((Opcode >> 9) & 7);
29434 adr = AREG((Opcode >> 0) & 7) - 2;
29435 AREG((Opcode >> 0) & 7) = adr;
29436 PRE_IO
29437 READ_WORD_F(adr, dst)
29438 res = dst - src;
29439 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
29440 flag_N = flag_X = flag_C = res >> 8;
29441 flag_NotZ = res & 0xFFFF;
29442 WRITE_WORD_F(adr, res)
29443 POST_IO
29444RET(14)
29445}
29446
29447// SUBDa
29448OPCODE(0x9168)
29449{
29450 u32 adr, res;
29451 u32 src, dst;
29452
29453 src = DREGu16((Opcode >> 9) & 7);
29454 FETCH_SWORD(adr);
29455 adr += AREG((Opcode >> 0) & 7);
29456 PRE_IO
29457 READ_WORD_F(adr, dst)
29458 res = dst - src;
29459 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
29460 flag_N = flag_X = flag_C = res >> 8;
29461 flag_NotZ = res & 0xFFFF;
29462 WRITE_WORD_F(adr, res)
29463 POST_IO
29464RET(16)
29465}
29466
29467// SUBDa
29468OPCODE(0x9170)
29469{
29470 u32 adr, res;
29471 u32 src, dst;
29472
29473 src = DREGu16((Opcode >> 9) & 7);
29474 adr = AREG((Opcode >> 0) & 7);
29475 DECODE_EXT_WORD
29476 PRE_IO
29477 READ_WORD_F(adr, dst)
29478 res = dst - src;
29479 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
29480 flag_N = flag_X = flag_C = res >> 8;
29481 flag_NotZ = res & 0xFFFF;
29482 WRITE_WORD_F(adr, res)
29483 POST_IO
29484RET(18)
29485}
29486
29487// SUBDa
29488OPCODE(0x9178)
29489{
29490 u32 adr, res;
29491 u32 src, dst;
29492
29493 src = DREGu16((Opcode >> 9) & 7);
29494 FETCH_SWORD(adr);
29495 PRE_IO
29496 READ_WORD_F(adr, dst)
29497 res = dst - src;
29498 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
29499 flag_N = flag_X = flag_C = res >> 8;
29500 flag_NotZ = res & 0xFFFF;
29501 WRITE_WORD_F(adr, res)
29502 POST_IO
29503RET(16)
29504}
29505
29506// SUBDa
29507OPCODE(0x9179)
29508{
29509 u32 adr, res;
29510 u32 src, dst;
29511
29512 src = DREGu16((Opcode >> 9) & 7);
29513 FETCH_LONG(adr);
29514 PRE_IO
29515 READ_WORD_F(adr, dst)
29516 res = dst - src;
29517 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
29518 flag_N = flag_X = flag_C = res >> 8;
29519 flag_NotZ = res & 0xFFFF;
29520 WRITE_WORD_F(adr, res)
29521 POST_IO
29522RET(20)
29523}
29524
29525// SUBDa
29526OPCODE(0x915F)
29527{
29528 u32 adr, res;
29529 u32 src, dst;
29530
29531 src = DREGu16((Opcode >> 9) & 7);
29532 adr = AREG(7);
29533 AREG(7) += 2;
29534 PRE_IO
29535 READ_WORD_F(adr, dst)
29536 res = dst - src;
29537 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
29538 flag_N = flag_X = flag_C = res >> 8;
29539 flag_NotZ = res & 0xFFFF;
29540 WRITE_WORD_F(adr, res)
29541 POST_IO
29542RET(12)
29543}
29544
29545// SUBDa
29546OPCODE(0x9167)
29547{
29548 u32 adr, res;
29549 u32 src, dst;
29550
29551 src = DREGu16((Opcode >> 9) & 7);
29552 adr = AREG(7) - 2;
29553 AREG(7) = adr;
29554 PRE_IO
29555 READ_WORD_F(adr, dst)
29556 res = dst - src;
29557 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
29558 flag_N = flag_X = flag_C = res >> 8;
29559 flag_NotZ = res & 0xFFFF;
29560 WRITE_WORD_F(adr, res)
29561 POST_IO
29562RET(14)
29563}
29564
29565// SUBDa
29566OPCODE(0x9190)
29567{
29568 u32 adr, res;
29569 u32 src, dst;
29570
29571 src = DREGu32((Opcode >> 9) & 7);
29572 adr = AREG((Opcode >> 0) & 7);
29573 PRE_IO
29574 READ_LONG_F(adr, dst)
29575 res = dst - src;
29576 flag_NotZ = res;
29577 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
29578 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
29579 flag_N = res >> 24;
29580 WRITE_LONG_F(adr, res)
29581 POST_IO
29582RET(20)
29583}
29584
29585// SUBDa
29586OPCODE(0x9198)
29587{
29588 u32 adr, res;
29589 u32 src, dst;
29590
29591 src = DREGu32((Opcode >> 9) & 7);
29592 adr = AREG((Opcode >> 0) & 7);
29593 AREG((Opcode >> 0) & 7) += 4;
29594 PRE_IO
29595 READ_LONG_F(adr, dst)
29596 res = dst - src;
29597 flag_NotZ = res;
29598 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
29599 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
29600 flag_N = res >> 24;
29601 WRITE_LONG_F(adr, res)
29602 POST_IO
29603RET(20)
29604}
29605
29606// SUBDa
29607OPCODE(0x91A0)
29608{
29609 u32 adr, res;
29610 u32 src, dst;
29611
29612 src = DREGu32((Opcode >> 9) & 7);
29613 adr = AREG((Opcode >> 0) & 7) - 4;
29614 AREG((Opcode >> 0) & 7) = adr;
29615 PRE_IO
29616 READ_LONG_F(adr, dst)
29617 res = dst - src;
29618 flag_NotZ = res;
29619 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
29620 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
29621 flag_N = res >> 24;
29622 WRITE_LONG_F(adr, res)
29623 POST_IO
29624RET(22)
29625}
29626
29627// SUBDa
29628OPCODE(0x91A8)
29629{
29630 u32 adr, res;
29631 u32 src, dst;
29632
29633 src = DREGu32((Opcode >> 9) & 7);
29634 FETCH_SWORD(adr);
29635 adr += AREG((Opcode >> 0) & 7);
29636 PRE_IO
29637 READ_LONG_F(adr, dst)
29638 res = dst - src;
29639 flag_NotZ = res;
29640 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
29641 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
29642 flag_N = res >> 24;
29643 WRITE_LONG_F(adr, res)
29644 POST_IO
29645RET(24)
29646}
29647
29648// SUBDa
29649OPCODE(0x91B0)
29650{
29651 u32 adr, res;
29652 u32 src, dst;
29653
29654 src = DREGu32((Opcode >> 9) & 7);
29655 adr = AREG((Opcode >> 0) & 7);
29656 DECODE_EXT_WORD
29657 PRE_IO
29658 READ_LONG_F(adr, dst)
29659 res = dst - src;
29660 flag_NotZ = res;
29661 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
29662 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
29663 flag_N = res >> 24;
29664 WRITE_LONG_F(adr, res)
29665 POST_IO
29666RET(26)
29667}
29668
29669// SUBDa
29670OPCODE(0x91B8)
29671{
29672 u32 adr, res;
29673 u32 src, dst;
29674
29675 src = DREGu32((Opcode >> 9) & 7);
29676 FETCH_SWORD(adr);
29677 PRE_IO
29678 READ_LONG_F(adr, dst)
29679 res = dst - src;
29680 flag_NotZ = res;
29681 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
29682 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
29683 flag_N = res >> 24;
29684 WRITE_LONG_F(adr, res)
29685 POST_IO
29686RET(24)
29687}
29688
29689// SUBDa
29690OPCODE(0x91B9)
29691{
29692 u32 adr, res;
29693 u32 src, dst;
29694
29695 src = DREGu32((Opcode >> 9) & 7);
29696 FETCH_LONG(adr);
29697 PRE_IO
29698 READ_LONG_F(adr, dst)
29699 res = dst - src;
29700 flag_NotZ = res;
29701 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
29702 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
29703 flag_N = res >> 24;
29704 WRITE_LONG_F(adr, res)
29705 POST_IO
29706RET(28)
29707}
29708
29709// SUBDa
29710OPCODE(0x919F)
29711{
29712 u32 adr, res;
29713 u32 src, dst;
29714
29715 src = DREGu32((Opcode >> 9) & 7);
29716 adr = AREG(7);
29717 AREG(7) += 4;
29718 PRE_IO
29719 READ_LONG_F(adr, dst)
29720 res = dst - src;
29721 flag_NotZ = res;
29722 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
29723 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
29724 flag_N = res >> 24;
29725 WRITE_LONG_F(adr, res)
29726 POST_IO
29727RET(20)
29728}
29729
29730// SUBDa
29731OPCODE(0x91A7)
29732{
29733 u32 adr, res;
29734 u32 src, dst;
29735
29736 src = DREGu32((Opcode >> 9) & 7);
29737 adr = AREG(7) - 4;
29738 AREG(7) = adr;
29739 PRE_IO
29740 READ_LONG_F(adr, dst)
29741 res = dst - src;
29742 flag_NotZ = res;
29743 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
29744 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
29745 flag_N = res >> 24;
29746 WRITE_LONG_F(adr, res)
29747 POST_IO
29748RET(22)
29749}
29750
29751// SUBX
29752OPCODE(0x9100)
29753{
29754 u32 adr, res;
29755 u32 src, dst;
29756
29757 src = DREGu8((Opcode >> 0) & 7);
29758 dst = DREGu8((Opcode >> 9) & 7);
29759 res = dst - src - ((flag_X >> 8) & 1);
29760 flag_N = flag_X = flag_C = res;
29761 flag_V = (src ^ dst) & (res ^ dst);
29762 flag_NotZ |= res & 0xFF;
29763 DREGu8((Opcode >> 9) & 7) = res;
29764RET(4)
29765}
29766
29767// SUBX
29768OPCODE(0x9140)
29769{
29770 u32 adr, res;
29771 u32 src, dst;
29772
29773 src = DREGu16((Opcode >> 0) & 7);
29774 dst = DREGu16((Opcode >> 9) & 7);
29775 res = dst - src - ((flag_X >> 8) & 1);
29776 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
29777 flag_N = flag_X = flag_C = res >> 8;
29778 flag_NotZ |= res & 0xFFFF;
29779 DREGu16((Opcode >> 9) & 7) = res;
29780RET(4)
29781}
29782
29783// SUBX
29784OPCODE(0x9180)
29785{
29786 u32 adr, res;
29787 u32 src, dst;
29788
29789 src = DREGu32((Opcode >> 0) & 7);
29790 dst = DREGu32((Opcode >> 9) & 7);
29791 res = dst - src - ((flag_X >> 8) & 1);
29792 flag_NotZ |= res;
29793 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
29794 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
29795 flag_N = res >> 24;
29796 DREGu32((Opcode >> 9) & 7) = res;
29797RET(8)
29798}
29799
29800// SUBXM
29801OPCODE(0x9108)
29802{
29803 u32 adr, res;
29804 u32 src, dst;
29805
29806 adr = AREG((Opcode >> 0) & 7) - 1;
29807 AREG((Opcode >> 0) & 7) = adr;
29808 PRE_IO
29809 READ_BYTE_F(adr, src)
29810 adr = AREG((Opcode >> 9) & 7) - 1;
29811 AREG((Opcode >> 9) & 7) = adr;
29812 READ_BYTE_F(adr, dst)
29813 res = dst - src - ((flag_X >> 8) & 1);
29814 flag_N = flag_X = flag_C = res;
29815 flag_V = (src ^ dst) & (res ^ dst);
29816 flag_NotZ |= res & 0xFF;
29817 WRITE_BYTE_F(adr, res)
29818 POST_IO
29819RET(18)
29820}
29821
29822// SUBXM
29823OPCODE(0x9148)
29824{
29825 u32 adr, res;
29826 u32 src, dst;
29827
29828 adr = AREG((Opcode >> 0) & 7) - 2;
29829 AREG((Opcode >> 0) & 7) = adr;
29830 PRE_IO
29831 READ_WORD_F(adr, src)
29832 adr = AREG((Opcode >> 9) & 7) - 2;
29833 AREG((Opcode >> 9) & 7) = adr;
29834 READ_WORD_F(adr, dst)
29835 res = dst - src - ((flag_X >> 8) & 1);
29836 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
29837 flag_N = flag_X = flag_C = res >> 8;
29838 flag_NotZ |= res & 0xFFFF;
29839 WRITE_WORD_F(adr, res)
29840 POST_IO
29841RET(18)
29842}
29843
29844// SUBXM
29845OPCODE(0x9188)
29846{
29847 u32 adr, res;
29848 u32 src, dst;
29849
29850 adr = AREG((Opcode >> 0) & 7) - 4;
29851 AREG((Opcode >> 0) & 7) = adr;
29852 PRE_IO
29853 READ_LONG_F(adr, src)
29854 adr = AREG((Opcode >> 9) & 7) - 4;
29855 AREG((Opcode >> 9) & 7) = adr;
29856 READ_LONG_F(adr, dst)
29857 res = dst - src - ((flag_X >> 8) & 1);
29858 flag_NotZ |= res;
29859 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
29860 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
29861 flag_N = res >> 24;
29862 WRITE_LONG_F(adr, res)
29863 POST_IO
29864RET(30)
29865}
29866
29867// SUBX7M
29868OPCODE(0x910F)
29869{
29870 u32 adr, res;
29871 u32 src, dst;
29872
29873 adr = AREG(7) - 2;
29874 AREG(7) = adr;
29875 PRE_IO
29876 READ_BYTE_F(adr, src)
29877 adr = AREG((Opcode >> 9) & 7) - 1;
29878 AREG((Opcode >> 9) & 7) = adr;
29879 READ_BYTE_F(adr, dst)
29880 res = dst - src - ((flag_X >> 8) & 1);
29881 flag_N = flag_X = flag_C = res;
29882 flag_V = (src ^ dst) & (res ^ dst);
29883 flag_NotZ |= res & 0xFF;
29884 WRITE_BYTE_F(adr, res)
29885 POST_IO
29886RET(18)
29887}
29888
29889// SUBX7M
29890OPCODE(0x914F)
29891{
29892 u32 adr, res;
29893 u32 src, dst;
29894
29895 adr = AREG(7) - 2;
29896 AREG(7) = adr;
29897 PRE_IO
29898 READ_WORD_F(adr, src)
29899 adr = AREG((Opcode >> 9) & 7) - 2;
29900 AREG((Opcode >> 9) & 7) = adr;
29901 READ_WORD_F(adr, dst)
29902 res = dst - src - ((flag_X >> 8) & 1);
29903 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
29904 flag_N = flag_X = flag_C = res >> 8;
29905 flag_NotZ |= res & 0xFFFF;
29906 WRITE_WORD_F(adr, res)
29907 POST_IO
29908RET(18)
29909}
29910
29911// SUBX7M
29912OPCODE(0x918F)
29913{
29914 u32 adr, res;
29915 u32 src, dst;
29916
29917 adr = AREG(7) - 4;
29918 AREG(7) = adr;
29919 PRE_IO
29920 READ_LONG_F(adr, src)
29921 adr = AREG((Opcode >> 9) & 7) - 4;
29922 AREG((Opcode >> 9) & 7) = adr;
29923 READ_LONG_F(adr, dst)
29924 res = dst - src - ((flag_X >> 8) & 1);
29925 flag_NotZ |= res;
29926 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
29927 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
29928 flag_N = res >> 24;
29929 WRITE_LONG_F(adr, res)
29930 POST_IO
29931RET(30)
29932}
29933
29934// SUBXM7
29935OPCODE(0x9F08)
29936{
29937 u32 adr, res;
29938 u32 src, dst;
29939
29940 adr = AREG((Opcode >> 0) & 7) - 1;
29941 AREG((Opcode >> 0) & 7) = adr;
29942 PRE_IO
29943 READ_BYTE_F(adr, src)
29944 adr = AREG(7) - 2;
29945 AREG(7) = adr;
29946 READ_BYTE_F(adr, dst)
29947 res = dst - src - ((flag_X >> 8) & 1);
29948 flag_N = flag_X = flag_C = res;
29949 flag_V = (src ^ dst) & (res ^ dst);
29950 flag_NotZ |= res & 0xFF;
29951 WRITE_BYTE_F(adr, res)
29952 POST_IO
29953RET(18)
29954}
29955
29956// SUBXM7
29957OPCODE(0x9F48)
29958{
29959 u32 adr, res;
29960 u32 src, dst;
29961
29962 adr = AREG((Opcode >> 0) & 7) - 2;
29963 AREG((Opcode >> 0) & 7) = adr;
29964 PRE_IO
29965 READ_WORD_F(adr, src)
29966 adr = AREG(7) - 2;
29967 AREG(7) = adr;
29968 READ_WORD_F(adr, dst)
29969 res = dst - src - ((flag_X >> 8) & 1);
29970 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
29971 flag_N = flag_X = flag_C = res >> 8;
29972 flag_NotZ |= res & 0xFFFF;
29973 WRITE_WORD_F(adr, res)
29974 POST_IO
29975RET(18)
29976}
29977
29978// SUBXM7
29979OPCODE(0x9F88)
29980{
29981 u32 adr, res;
29982 u32 src, dst;
29983
29984 adr = AREG((Opcode >> 0) & 7) - 4;
29985 AREG((Opcode >> 0) & 7) = adr;
29986 PRE_IO
29987 READ_LONG_F(adr, src)
29988 adr = AREG(7) - 4;
29989 AREG(7) = adr;
29990 READ_LONG_F(adr, dst)
29991 res = dst - src - ((flag_X >> 8) & 1);
29992 flag_NotZ |= res;
29993 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
29994 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
29995 flag_N = res >> 24;
29996 WRITE_LONG_F(adr, res)
29997 POST_IO
29998RET(30)
29999}
30000
30001// SUBX7M7
30002OPCODE(0x9F0F)
30003{
30004 u32 adr, res;
30005 u32 src, dst;
30006
30007 adr = AREG(7) - 2;
30008 AREG(7) = adr;
30009 PRE_IO
30010 READ_BYTE_F(adr, src)
30011 adr = AREG(7) - 2;
30012 AREG(7) = adr;
30013 READ_BYTE_F(adr, dst)
30014 res = dst - src - ((flag_X >> 8) & 1);
30015 flag_N = flag_X = flag_C = res;
30016 flag_V = (src ^ dst) & (res ^ dst);
30017 flag_NotZ |= res & 0xFF;
30018 WRITE_BYTE_F(adr, res)
30019 POST_IO
30020RET(18)
30021}
30022
30023// SUBX7M7
30024OPCODE(0x9F4F)
30025{
30026 u32 adr, res;
30027 u32 src, dst;
30028
30029 adr = AREG(7) - 2;
30030 AREG(7) = adr;
30031 PRE_IO
30032 READ_WORD_F(adr, src)
30033 adr = AREG(7) - 2;
30034 AREG(7) = adr;
30035 READ_WORD_F(adr, dst)
30036 res = dst - src - ((flag_X >> 8) & 1);
30037 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
30038 flag_N = flag_X = flag_C = res >> 8;
30039 flag_NotZ |= res & 0xFFFF;
30040 WRITE_WORD_F(adr, res)
30041 POST_IO
30042RET(18)
30043}
30044
30045// SUBX7M7
30046OPCODE(0x9F8F)
30047{
30048 u32 adr, res;
30049 u32 src, dst;
30050
30051 adr = AREG(7) - 4;
30052 AREG(7) = adr;
30053 PRE_IO
30054 READ_LONG_F(adr, src)
30055 adr = AREG(7) - 4;
30056 AREG(7) = adr;
30057 READ_LONG_F(adr, dst)
30058 res = dst - src - ((flag_X >> 8) & 1);
30059 flag_NotZ |= res;
30060 flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
30061 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
30062 flag_N = res >> 24;
30063 WRITE_LONG_F(adr, res)
30064 POST_IO
30065RET(30)
30066}
30067
30068// SUBA
30069OPCODE(0x90C0)
30070{
30071 u32 adr, res;
30072 u32 src, dst;
30073
30074 src = (s32)DREGs16((Opcode >> 0) & 7);
30075 dst = AREGu32((Opcode >> 9) & 7);
30076 res = dst - src;
30077 AREG((Opcode >> 9) & 7) = res;
30078RET(8)
30079}
30080
30081// SUBA
30082OPCODE(0x90C8)
30083{
30084 u32 adr, res;
30085 u32 src, dst;
30086
30087 src = (s32)AREGs16((Opcode >> 0) & 7);
30088 dst = AREGu32((Opcode >> 9) & 7);
30089 res = dst - src;
30090 AREG((Opcode >> 9) & 7) = res;
30091RET(8)
30092}
30093
30094// SUBA
30095OPCODE(0x90D0)
30096{
30097 u32 adr, res;
30098 u32 src, dst;
30099
30100 adr = AREG((Opcode >> 0) & 7);
30101 PRE_IO
30102 READSX_WORD_F(adr, src)
30103 dst = AREGu32((Opcode >> 9) & 7);
30104 res = dst - src;
30105 AREG((Opcode >> 9) & 7) = res;
30106 POST_IO
9d917eea 30107#ifdef USE_CYCLONE_TIMING
30108RET(12)
30109#else
70357ce5 30110RET(10)
9d917eea 30111#endif
70357ce5 30112}
30113
30114// SUBA
30115OPCODE(0x90D8)
30116{
30117 u32 adr, res;
30118 u32 src, dst;
30119
30120 adr = AREG((Opcode >> 0) & 7);
30121 AREG((Opcode >> 0) & 7) += 2;
30122 PRE_IO
30123 READSX_WORD_F(adr, src)
30124 dst = AREGu32((Opcode >> 9) & 7);
30125 res = dst - src;
30126 AREG((Opcode >> 9) & 7) = res;
30127 POST_IO
9d917eea 30128#ifdef USE_CYCLONE_TIMING
30129RET(12)
30130#else
70357ce5 30131RET(10)
9d917eea 30132#endif
70357ce5 30133}
30134
30135// SUBA
30136OPCODE(0x90E0)
30137{
30138 u32 adr, res;
30139 u32 src, dst;
30140
30141 adr = AREG((Opcode >> 0) & 7) - 2;
30142 AREG((Opcode >> 0) & 7) = adr;
30143 PRE_IO
30144 READSX_WORD_F(adr, src)
30145 dst = AREGu32((Opcode >> 9) & 7);
30146 res = dst - src;
30147 AREG((Opcode >> 9) & 7) = res;
30148 POST_IO
9d917eea 30149#ifdef USE_CYCLONE_TIMING
30150RET(14)
30151#else
70357ce5 30152RET(12)
9d917eea 30153#endif
70357ce5 30154}
30155
30156// SUBA
30157OPCODE(0x90E8)
30158{
30159 u32 adr, res;
30160 u32 src, dst;
30161
30162 FETCH_SWORD(adr);
30163 adr += AREG((Opcode >> 0) & 7);
30164 PRE_IO
30165 READSX_WORD_F(adr, src)
30166 dst = AREGu32((Opcode >> 9) & 7);
30167 res = dst - src;
30168 AREG((Opcode >> 9) & 7) = res;
30169 POST_IO
9d917eea 30170#ifdef USE_CYCLONE_TIMING
30171RET(16)
30172#else
70357ce5 30173RET(14)
9d917eea 30174#endif
70357ce5 30175}
30176
30177// SUBA
30178OPCODE(0x90F0)
30179{
30180 u32 adr, res;
30181 u32 src, dst;
30182
30183 adr = AREG((Opcode >> 0) & 7);
30184 DECODE_EXT_WORD
30185 PRE_IO
30186 READSX_WORD_F(adr, src)
30187 dst = AREGu32((Opcode >> 9) & 7);
30188 res = dst - src;
30189 AREG((Opcode >> 9) & 7) = res;
30190 POST_IO
9d917eea 30191#ifdef USE_CYCLONE_TIMING
30192RET(18)
30193#else
70357ce5 30194RET(16)
9d917eea 30195#endif
70357ce5 30196}
30197
30198// SUBA
30199OPCODE(0x90F8)
30200{
30201 u32 adr, res;
30202 u32 src, dst;
30203
30204 FETCH_SWORD(adr);
30205 PRE_IO
30206 READSX_WORD_F(adr, src)
30207 dst = AREGu32((Opcode >> 9) & 7);
30208 res = dst - src;
30209 AREG((Opcode >> 9) & 7) = res;
30210 POST_IO
9d917eea 30211#ifdef USE_CYCLONE_TIMING
30212RET(16)
30213#else
70357ce5 30214RET(14)
9d917eea 30215#endif
70357ce5 30216}
30217
30218// SUBA
30219OPCODE(0x90F9)
30220{
30221 u32 adr, res;
30222 u32 src, dst;
30223
30224 FETCH_LONG(adr);
30225 PRE_IO
30226 READSX_WORD_F(adr, src)
30227 dst = AREGu32((Opcode >> 9) & 7);
30228 res = dst - src;
30229 AREG((Opcode >> 9) & 7) = res;
30230 POST_IO
9d917eea 30231#ifdef USE_CYCLONE_TIMING
30232RET(20)
30233#else
70357ce5 30234RET(18)
9d917eea 30235#endif
70357ce5 30236}
30237
30238// SUBA
30239OPCODE(0x90FA)
30240{
30241 u32 adr, res;
30242 u32 src, dst;
30243
be26eb23 30244 adr = GET_SWORD + GET_PC;
70357ce5 30245 PC++;
30246 PRE_IO
30247 READSX_WORD_F(adr, src)
30248 dst = AREGu32((Opcode >> 9) & 7);
30249 res = dst - src;
30250 AREG((Opcode >> 9) & 7) = res;
30251 POST_IO
9d917eea 30252#ifdef USE_CYCLONE_TIMING
30253RET(16)
30254#else
70357ce5 30255RET(14)
9d917eea 30256#endif
70357ce5 30257}
30258
30259// SUBA
30260OPCODE(0x90FB)
30261{
30262 u32 adr, res;
30263 u32 src, dst;
30264
be26eb23 30265 adr = GET_PC;
70357ce5 30266 DECODE_EXT_WORD
30267 PRE_IO
30268 READSX_WORD_F(adr, src)
30269 dst = AREGu32((Opcode >> 9) & 7);
30270 res = dst - src;
30271 AREG((Opcode >> 9) & 7) = res;
30272 POST_IO
9d917eea 30273#ifdef USE_CYCLONE_TIMING
30274RET(18)
30275#else
70357ce5 30276RET(16)
9d917eea 30277#endif
70357ce5 30278}
30279
30280// SUBA
30281OPCODE(0x90FC)
30282{
30283 u32 adr, res;
30284 u32 src, dst;
30285
30286 FETCH_SWORD(src);
30287 dst = AREGu32((Opcode >> 9) & 7);
30288 res = dst - src;
30289 AREG((Opcode >> 9) & 7) = res;
30290RET(12)
30291}
30292
30293// SUBA
30294OPCODE(0x90DF)
30295{
30296 u32 adr, res;
30297 u32 src, dst;
30298
30299 adr = AREG(7);
30300 AREG(7) += 2;
30301 PRE_IO
30302 READSX_WORD_F(adr, src)
30303 dst = AREGu32((Opcode >> 9) & 7);
30304 res = dst - src;
30305 AREG((Opcode >> 9) & 7) = res;
30306 POST_IO
9d917eea 30307#ifdef USE_CYCLONE_TIMING
30308RET(12)
30309#else
70357ce5 30310RET(10)
9d917eea 30311#endif
70357ce5 30312}
30313
30314// SUBA
30315OPCODE(0x90E7)
30316{
30317 u32 adr, res;
30318 u32 src, dst;
30319
30320 adr = AREG(7) - 2;
30321 AREG(7) = adr;
30322 PRE_IO
30323 READSX_WORD_F(adr, src)
30324 dst = AREGu32((Opcode >> 9) & 7);
30325 res = dst - src;
30326 AREG((Opcode >> 9) & 7) = res;
30327 POST_IO
9d917eea 30328#ifdef USE_CYCLONE_TIMING
30329RET(14)
30330#else
70357ce5 30331RET(12)
9d917eea 30332#endif
70357ce5 30333}
30334
30335// SUBA
30336OPCODE(0x91C0)
30337{
30338 u32 adr, res;
30339 u32 src, dst;
30340
30341 src = (s32)DREGs32((Opcode >> 0) & 7);
30342 dst = AREGu32((Opcode >> 9) & 7);
30343 res = dst - src;
30344 AREG((Opcode >> 9) & 7) = res;
30345#ifdef USE_CYCLONE_TIMING
30346RET(8)
30347#else
30348RET(6)
30349#endif
30350}
30351
30352// SUBA
30353OPCODE(0x91C8)
30354{
30355 u32 adr, res;
30356 u32 src, dst;
30357
30358 src = (s32)AREGs32((Opcode >> 0) & 7);
30359 dst = AREGu32((Opcode >> 9) & 7);
30360 res = dst - src;
30361 AREG((Opcode >> 9) & 7) = res;
30362#ifdef USE_CYCLONE_TIMING
30363RET(8)
30364#else
30365RET(6)
30366#endif
30367}
30368
30369// SUBA
30370OPCODE(0x91D0)
30371{
30372 u32 adr, res;
30373 u32 src, dst;
30374
30375 adr = AREG((Opcode >> 0) & 7);
30376 PRE_IO
30377 READSX_LONG_F(adr, src)
30378 dst = AREGu32((Opcode >> 9) & 7);
30379 res = dst - src;
30380 AREG((Opcode >> 9) & 7) = res;
30381 POST_IO
30382RET(14)
30383}
30384
30385// SUBA
30386OPCODE(0x91D8)
30387{
30388 u32 adr, res;
30389 u32 src, dst;
30390
30391 adr = AREG((Opcode >> 0) & 7);
30392 AREG((Opcode >> 0) & 7) += 4;
30393 PRE_IO
30394 READSX_LONG_F(adr, src)
30395 dst = AREGu32((Opcode >> 9) & 7);
30396 res = dst - src;
30397 AREG((Opcode >> 9) & 7) = res;
30398 POST_IO
30399RET(14)
30400}
30401
30402// SUBA
30403OPCODE(0x91E0)
30404{
30405 u32 adr, res;
30406 u32 src, dst;
30407
30408 adr = AREG((Opcode >> 0) & 7) - 4;
30409 AREG((Opcode >> 0) & 7) = adr;
30410 PRE_IO
30411 READSX_LONG_F(adr, src)
30412 dst = AREGu32((Opcode >> 9) & 7);
30413 res = dst - src;
30414 AREG((Opcode >> 9) & 7) = res;
30415 POST_IO
30416RET(16)
30417}
30418
30419// SUBA
30420OPCODE(0x91E8)
30421{
30422 u32 adr, res;
30423 u32 src, dst;
30424
30425 FETCH_SWORD(adr);
30426 adr += AREG((Opcode >> 0) & 7);
30427 PRE_IO
30428 READSX_LONG_F(adr, src)
30429 dst = AREGu32((Opcode >> 9) & 7);
30430 res = dst - src;
30431 AREG((Opcode >> 9) & 7) = res;
30432 POST_IO
30433RET(18)
30434}
30435
30436// SUBA
30437OPCODE(0x91F0)
30438{
30439 u32 adr, res;
30440 u32 src, dst;
30441
30442 adr = AREG((Opcode >> 0) & 7);
30443 DECODE_EXT_WORD
30444 PRE_IO
30445 READSX_LONG_F(adr, src)
30446 dst = AREGu32((Opcode >> 9) & 7);
30447 res = dst - src;
30448 AREG((Opcode >> 9) & 7) = res;
30449 POST_IO
30450RET(20)
30451}
30452
30453// SUBA
30454OPCODE(0x91F8)
30455{
30456 u32 adr, res;
30457 u32 src, dst;
30458
30459 FETCH_SWORD(adr);
30460 PRE_IO
30461 READSX_LONG_F(adr, src)
30462 dst = AREGu32((Opcode >> 9) & 7);
30463 res = dst - src;
30464 AREG((Opcode >> 9) & 7) = res;
30465 POST_IO
30466RET(18)
30467}
30468
30469// SUBA
30470OPCODE(0x91F9)
30471{
30472 u32 adr, res;
30473 u32 src, dst;
30474
30475 FETCH_LONG(adr);
30476 PRE_IO
30477 READSX_LONG_F(adr, src)
30478 dst = AREGu32((Opcode >> 9) & 7);
30479 res = dst - src;
30480 AREG((Opcode >> 9) & 7) = res;
30481 POST_IO
30482RET(22)
30483}
30484
30485// SUBA
30486OPCODE(0x91FA)
30487{
30488 u32 adr, res;
30489 u32 src, dst;
30490
be26eb23 30491 adr = GET_SWORD + GET_PC;
70357ce5 30492 PC++;
30493 PRE_IO
30494 READSX_LONG_F(adr, src)
30495 dst = AREGu32((Opcode >> 9) & 7);
30496 res = dst - src;
30497 AREG((Opcode >> 9) & 7) = res;
30498 POST_IO
30499RET(18)
30500}
30501
30502// SUBA
30503OPCODE(0x91FB)
30504{
30505 u32 adr, res;
30506 u32 src, dst;
30507
be26eb23 30508 adr = GET_PC;
70357ce5 30509 DECODE_EXT_WORD
30510 PRE_IO
30511 READSX_LONG_F(adr, src)
30512 dst = AREGu32((Opcode >> 9) & 7);
30513 res = dst - src;
30514 AREG((Opcode >> 9) & 7) = res;
30515 POST_IO
30516RET(20)
30517}
30518
30519// SUBA
30520OPCODE(0x91FC)
30521{
30522 u32 adr, res;
30523 u32 src, dst;
30524
30525 FETCH_LONG(src);
30526 dst = AREGu32((Opcode >> 9) & 7);
30527 res = dst - src;
30528 AREG((Opcode >> 9) & 7) = res;
30529#ifdef USE_CYCLONE_TIMING
30530RET(16)
30531#else
30532RET(14)
30533#endif
30534}
30535
30536// SUBA
30537OPCODE(0x91DF)
30538{
30539 u32 adr, res;
30540 u32 src, dst;
30541
30542 adr = AREG(7);
30543 AREG(7) += 4;
30544 PRE_IO
30545 READSX_LONG_F(adr, src)
30546 dst = AREGu32((Opcode >> 9) & 7);
30547 res = dst - src;
30548 AREG((Opcode >> 9) & 7) = res;
30549 POST_IO
30550RET(14)
30551}
30552
30553// SUBA
30554OPCODE(0x91E7)
30555{
30556 u32 adr, res;
30557 u32 src, dst;
30558
30559 adr = AREG(7) - 4;
30560 AREG(7) = adr;
30561 PRE_IO
30562 READSX_LONG_F(adr, src)
30563 dst = AREGu32((Opcode >> 9) & 7);
30564 res = dst - src;
30565 AREG((Opcode >> 9) & 7) = res;
30566 POST_IO
30567RET(16)
30568}
30569
30570// CMP
30571OPCODE(0xB000)
30572{
30573 u32 adr, res;
30574 u32 src, dst;
30575
30576 src = DREGu8((Opcode >> 0) & 7);
30577 dst = DREGu8((Opcode >> 9) & 7);
30578 res = dst - src;
30579 flag_N = flag_C = res;
30580 flag_V = (src ^ dst) & (res ^ dst);
30581 flag_NotZ = res & 0xFF;
30582RET(4)
30583}
30584
30585// CMP
03e4f2a3 30586#if 0
70357ce5 30587OPCODE(0xB008)
30588{
30589 u32 adr, res;
30590 u32 src, dst;
30591
30592 // can't read byte from Ax registers !
30593 m68kcontext.execinfo |= M68K_FAULTED;
30594 m68kcontext.io_cycle_counter = 0;
30595/*
30596 goto famec_Exec_End;
30597 dst = DREGu8((Opcode >> 9) & 7);
30598 res = dst - src;
30599 flag_N = flag_C = res;
30600 flag_V = (src ^ dst) & (res ^ dst);
30601 flag_NotZ = res & 0xFF;
30602*/
30603RET(4)
30604}
03e4f2a3 30605#endif
70357ce5 30606
30607// CMP
30608OPCODE(0xB010)
30609{
30610 u32 adr, res;
30611 u32 src, dst;
30612
30613 adr = AREG((Opcode >> 0) & 7);
30614 PRE_IO
30615 READ_BYTE_F(adr, src)
30616 dst = DREGu8((Opcode >> 9) & 7);
30617 res = dst - src;
30618 flag_N = flag_C = res;
30619 flag_V = (src ^ dst) & (res ^ dst);
30620 flag_NotZ = res & 0xFF;
30621 POST_IO
30622RET(8)
30623}
30624
30625// CMP
30626OPCODE(0xB018)
30627{
30628 u32 adr, res;
30629 u32 src, dst;
30630
30631 adr = AREG((Opcode >> 0) & 7);
30632 AREG((Opcode >> 0) & 7) += 1;
30633 PRE_IO
30634 READ_BYTE_F(adr, src)
30635 dst = DREGu8((Opcode >> 9) & 7);
30636 res = dst - src;
30637 flag_N = flag_C = res;
30638 flag_V = (src ^ dst) & (res ^ dst);
30639 flag_NotZ = res & 0xFF;
30640 POST_IO
30641RET(8)
30642}
30643
30644// CMP
30645OPCODE(0xB020)
30646{
30647 u32 adr, res;
30648 u32 src, dst;
30649
30650 adr = AREG((Opcode >> 0) & 7) - 1;
30651 AREG((Opcode >> 0) & 7) = adr;
30652 PRE_IO
30653 READ_BYTE_F(adr, src)
30654 dst = DREGu8((Opcode >> 9) & 7);
30655 res = dst - src;
30656 flag_N = flag_C = res;
30657 flag_V = (src ^ dst) & (res ^ dst);
30658 flag_NotZ = res & 0xFF;
30659 POST_IO
30660RET(10)
30661}
30662
30663// CMP
30664OPCODE(0xB028)
30665{
30666 u32 adr, res;
30667 u32 src, dst;
30668
30669 FETCH_SWORD(adr);
30670 adr += AREG((Opcode >> 0) & 7);
30671 PRE_IO
30672 READ_BYTE_F(adr, src)
30673 dst = DREGu8((Opcode >> 9) & 7);
30674 res = dst - src;
30675 flag_N = flag_C = res;
30676 flag_V = (src ^ dst) & (res ^ dst);
30677 flag_NotZ = res & 0xFF;
30678 POST_IO
30679RET(12)
30680}
30681
30682// CMP
30683OPCODE(0xB030)
30684{
30685 u32 adr, res;
30686 u32 src, dst;
30687
30688 adr = AREG((Opcode >> 0) & 7);
30689 DECODE_EXT_WORD
30690 PRE_IO
30691 READ_BYTE_F(adr, src)
30692 dst = DREGu8((Opcode >> 9) & 7);
30693 res = dst - src;
30694 flag_N = flag_C = res;
30695 flag_V = (src ^ dst) & (res ^ dst);
30696 flag_NotZ = res & 0xFF;
30697 POST_IO
30698RET(14)
30699}
30700
30701// CMP
30702OPCODE(0xB038)
30703{
30704 u32 adr, res;
30705 u32 src, dst;
30706
30707 FETCH_SWORD(adr);
30708 PRE_IO
30709 READ_BYTE_F(adr, src)
30710 dst = DREGu8((Opcode >> 9) & 7);
30711 res = dst - src;
30712 flag_N = flag_C = res;
30713 flag_V = (src ^ dst) & (res ^ dst);
30714 flag_NotZ = res & 0xFF;
30715 POST_IO
30716RET(12)
30717}
30718
30719// CMP
30720OPCODE(0xB039)
30721{
30722 u32 adr, res;
30723 u32 src, dst;
30724
30725 FETCH_LONG(adr);
30726 PRE_IO
30727 READ_BYTE_F(adr, src)
30728 dst = DREGu8((Opcode >> 9) & 7);
30729 res = dst - src;
30730 flag_N = flag_C = res;
30731 flag_V = (src ^ dst) & (res ^ dst);
30732 flag_NotZ = res & 0xFF;
30733 POST_IO
30734RET(16)
30735}
30736
30737// CMP
30738OPCODE(0xB03A)
30739{
30740 u32 adr, res;
30741 u32 src, dst;
30742
be26eb23 30743 adr = GET_SWORD + GET_PC;
70357ce5 30744 PC++;
30745 PRE_IO
30746 READ_BYTE_F(adr, src)
30747 dst = DREGu8((Opcode >> 9) & 7);
30748 res = dst - src;
30749 flag_N = flag_C = res;
30750 flag_V = (src ^ dst) & (res ^ dst);
30751 flag_NotZ = res & 0xFF;
30752 POST_IO
30753RET(12)
30754}
30755
30756// CMP
30757OPCODE(0xB03B)
30758{
30759 u32 adr, res;
30760 u32 src, dst;
30761
be26eb23 30762 adr = GET_PC;
70357ce5 30763 DECODE_EXT_WORD
30764 PRE_IO
30765 READ_BYTE_F(adr, src)
30766 dst = DREGu8((Opcode >> 9) & 7);
30767 res = dst - src;
30768 flag_N = flag_C = res;
30769 flag_V = (src ^ dst) & (res ^ dst);
30770 flag_NotZ = res & 0xFF;
30771 POST_IO
30772RET(14)
30773}
30774
30775// CMP
30776OPCODE(0xB03C)
30777{
30778 u32 adr, res;
30779 u32 src, dst;
30780
30781 FETCH_BYTE(src);
30782 dst = DREGu8((Opcode >> 9) & 7);
30783 res = dst - src;
30784 flag_N = flag_C = res;
30785 flag_V = (src ^ dst) & (res ^ dst);
30786 flag_NotZ = res & 0xFF;
30787RET(8)
30788}
30789
30790// CMP
30791OPCODE(0xB01F)
30792{
30793 u32 adr, res;
30794 u32 src, dst;
30795
30796 adr = AREG(7);
30797 AREG(7) += 2;
30798 PRE_IO
30799 READ_BYTE_F(adr, src)
30800 dst = DREGu8((Opcode >> 9) & 7);
30801 res = dst - src;
30802 flag_N = flag_C = res;
30803 flag_V = (src ^ dst) & (res ^ dst);
30804 flag_NotZ = res & 0xFF;
30805 POST_IO
30806RET(8)
30807}
30808
30809// CMP
30810OPCODE(0xB027)
30811{
30812 u32 adr, res;
30813 u32 src, dst;
30814
30815 adr = AREG(7) - 2;
30816 AREG(7) = adr;
30817 PRE_IO
30818 READ_BYTE_F(adr, src)
30819 dst = DREGu8((Opcode >> 9) & 7);
30820 res = dst - src;
30821 flag_N = flag_C = res;
30822 flag_V = (src ^ dst) & (res ^ dst);
30823 flag_NotZ = res & 0xFF;
30824 POST_IO
30825RET(10)
30826}
30827
30828// CMP
30829OPCODE(0xB040)
30830{
30831 u32 adr, res;
30832 u32 src, dst;
30833
30834 src = DREGu16((Opcode >> 0) & 7);
30835 dst = DREGu16((Opcode >> 9) & 7);
30836 res = dst - src;
30837 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
30838 flag_N = flag_C = res >> 8;
30839 flag_NotZ = res & 0xFFFF;
30840RET(4)
30841}
30842
30843// CMP
30844OPCODE(0xB048)
30845{
30846 u32 adr, res;
30847 u32 src, dst;
30848
30849 src = AREGu16((Opcode >> 0) & 7);
30850 dst = DREGu16((Opcode >> 9) & 7);
30851 res = dst - src;
30852 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
30853 flag_N = flag_C = res >> 8;
30854 flag_NotZ = res & 0xFFFF;
30855RET(4)
30856}
30857
30858// CMP
30859OPCODE(0xB050)
30860{
30861 u32 adr, res;
30862 u32 src, dst;
30863
30864 adr = AREG((Opcode >> 0) & 7);
30865 PRE_IO
30866 READ_WORD_F(adr, src)
30867 dst = DREGu16((Opcode >> 9) & 7);
30868 res = dst - src;
30869 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
30870 flag_N = flag_C = res >> 8;
30871 flag_NotZ = res & 0xFFFF;
30872 POST_IO
30873RET(8)
30874}
30875
30876// CMP
30877OPCODE(0xB058)
30878{
30879 u32 adr, res;
30880 u32 src, dst;
30881
30882 adr = AREG((Opcode >> 0) & 7);
30883 AREG((Opcode >> 0) & 7) += 2;
30884 PRE_IO
30885 READ_WORD_F(adr, src)
30886 dst = DREGu16((Opcode >> 9) & 7);
30887 res = dst - src;
30888 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
30889 flag_N = flag_C = res >> 8;
30890 flag_NotZ = res & 0xFFFF;
30891 POST_IO
30892RET(8)
30893}
30894
30895// CMP
30896OPCODE(0xB060)
30897{
30898 u32 adr, res;
30899 u32 src, dst;
30900
30901 adr = AREG((Opcode >> 0) & 7) - 2;
30902 AREG((Opcode >> 0) & 7) = adr;
30903 PRE_IO
30904 READ_WORD_F(adr, src)
30905 dst = DREGu16((Opcode >> 9) & 7);
30906 res = dst - src;
30907 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
30908 flag_N = flag_C = res >> 8;
30909 flag_NotZ = res & 0xFFFF;
30910 POST_IO
30911RET(10)
30912}
30913
30914// CMP
30915OPCODE(0xB068)
30916{
30917 u32 adr, res;
30918 u32 src, dst;
30919
30920 FETCH_SWORD(adr);
30921 adr += AREG((Opcode >> 0) & 7);
30922 PRE_IO
30923 READ_WORD_F(adr, src)
30924 dst = DREGu16((Opcode >> 9) & 7);
30925 res = dst - src;
30926 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
30927 flag_N = flag_C = res >> 8;
30928 flag_NotZ = res & 0xFFFF;
30929 POST_IO
30930RET(12)
30931}
30932
30933// CMP
30934OPCODE(0xB070)
30935{
30936 u32 adr, res;
30937 u32 src, dst;
30938
30939 adr = AREG((Opcode >> 0) & 7);
30940 DECODE_EXT_WORD
30941 PRE_IO
30942 READ_WORD_F(adr, src)
30943 dst = DREGu16((Opcode >> 9) & 7);
30944 res = dst - src;
30945 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
30946 flag_N = flag_C = res >> 8;
30947 flag_NotZ = res & 0xFFFF;
30948 POST_IO
30949RET(14)
30950}
30951
30952// CMP
30953OPCODE(0xB078)
30954{
30955 u32 adr, res;
30956 u32 src, dst;
30957
30958 FETCH_SWORD(adr);
30959 PRE_IO
30960 READ_WORD_F(adr, src)
30961 dst = DREGu16((Opcode >> 9) & 7);
30962 res = dst - src;
30963 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
30964 flag_N = flag_C = res >> 8;
30965 flag_NotZ = res & 0xFFFF;
30966 POST_IO
30967RET(12)
30968}
30969
30970// CMP
30971OPCODE(0xB079)
30972{
30973 u32 adr, res;
30974 u32 src, dst;
30975
30976 FETCH_LONG(adr);
30977 PRE_IO
30978 READ_WORD_F(adr, src)
30979 dst = DREGu16((Opcode >> 9) & 7);
30980 res = dst - src;
30981 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
30982 flag_N = flag_C = res >> 8;
30983 flag_NotZ = res & 0xFFFF;
30984 POST_IO
30985RET(16)
30986}
30987
30988// CMP
30989OPCODE(0xB07A)
30990{
30991 u32 adr, res;
30992 u32 src, dst;
30993
be26eb23 30994 adr = GET_SWORD + GET_PC;
70357ce5 30995 PC++;
30996 PRE_IO
30997 READ_WORD_F(adr, src)
30998 dst = DREGu16((Opcode >> 9) & 7);
30999 res = dst - src;
31000 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
31001 flag_N = flag_C = res >> 8;
31002 flag_NotZ = res & 0xFFFF;
31003 POST_IO
31004RET(12)
31005}
31006
31007// CMP
31008OPCODE(0xB07B)
31009{
31010 u32 adr, res;
31011 u32 src, dst;
31012
be26eb23 31013 adr = GET_PC;
70357ce5 31014 DECODE_EXT_WORD
31015 PRE_IO
31016 READ_WORD_F(adr, src)
31017 dst = DREGu16((Opcode >> 9) & 7);
31018 res = dst - src;
31019 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
31020 flag_N = flag_C = res >> 8;
31021 flag_NotZ = res & 0xFFFF;
31022 POST_IO
31023RET(14)
31024}
31025
31026// CMP
31027OPCODE(0xB07C)
31028{
31029 u32 adr, res;
31030 u32 src, dst;
31031
31032 FETCH_WORD(src);
31033 dst = DREGu16((Opcode >> 9) & 7);
31034 res = dst - src;
31035 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
31036 flag_N = flag_C = res >> 8;
31037 flag_NotZ = res & 0xFFFF;
31038RET(8)
31039}
31040
31041// CMP
31042OPCODE(0xB05F)
31043{
31044 u32 adr, res;
31045 u32 src, dst;
31046
31047 adr = AREG(7);
31048 AREG(7) += 2;
31049 PRE_IO
31050 READ_WORD_F(adr, src)
31051 dst = DREGu16((Opcode >> 9) & 7);
31052 res = dst - src;
31053 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
31054 flag_N = flag_C = res >> 8;
31055 flag_NotZ = res & 0xFFFF;
31056 POST_IO
31057RET(8)
31058}
31059
31060// CMP
31061OPCODE(0xB067)
31062{
31063 u32 adr, res;
31064 u32 src, dst;
31065
31066 adr = AREG(7) - 2;
31067 AREG(7) = adr;
31068 PRE_IO
31069 READ_WORD_F(adr, src)
31070 dst = DREGu16((Opcode >> 9) & 7);
31071 res = dst - src;
31072 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
31073 flag_N = flag_C = res >> 8;
31074 flag_NotZ = res & 0xFFFF;
31075 POST_IO
31076RET(10)
31077}
31078
31079// CMP
31080OPCODE(0xB080)
31081{
31082 u32 adr, res;
31083 u32 src, dst;
31084
31085 src = DREGu32((Opcode >> 0) & 7);
31086 dst = DREGu32((Opcode >> 9) & 7);
31087 res = dst - src;
31088 flag_NotZ = res;
31089 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
31090 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
31091 flag_N = res >> 24;
31092RET(6)
31093}
31094
31095// CMP
31096OPCODE(0xB088)
31097{
31098 u32 adr, res;
31099 u32 src, dst;
31100
31101 src = AREGu32((Opcode >> 0) & 7);
31102 dst = DREGu32((Opcode >> 9) & 7);
31103 res = dst - src;
31104 flag_NotZ = res;
31105 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
31106 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
31107 flag_N = res >> 24;
31108RET(6)
31109}
31110
31111// CMP
31112OPCODE(0xB090)
31113{
31114 u32 adr, res;
31115 u32 src, dst;
31116
31117 adr = AREG((Opcode >> 0) & 7);
31118 PRE_IO
31119 READ_LONG_F(adr, src)
31120 dst = DREGu32((Opcode >> 9) & 7);
31121 res = dst - src;
31122 flag_NotZ = res;
31123 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
31124 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
31125 flag_N = res >> 24;
31126 POST_IO
31127RET(14)
31128}
31129
31130// CMP
31131OPCODE(0xB098)
31132{
31133 u32 adr, res;
31134 u32 src, dst;
31135
31136 adr = AREG((Opcode >> 0) & 7);
31137 AREG((Opcode >> 0) & 7) += 4;
31138 PRE_IO
31139 READ_LONG_F(adr, src)
31140 dst = DREGu32((Opcode >> 9) & 7);
31141 res = dst - src;
31142 flag_NotZ = res;
31143 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
31144 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
31145 flag_N = res >> 24;
31146 POST_IO
31147RET(14)
31148}
31149
31150// CMP
31151OPCODE(0xB0A0)
31152{
31153 u32 adr, res;
31154 u32 src, dst;
31155
31156 adr = AREG((Opcode >> 0) & 7) - 4;
31157 AREG((Opcode >> 0) & 7) = adr;
31158 PRE_IO
31159 READ_LONG_F(adr, src)
31160 dst = DREGu32((Opcode >> 9) & 7);
31161 res = dst - src;
31162 flag_NotZ = res;
31163 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
31164 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
31165 flag_N = res >> 24;
31166 POST_IO
31167RET(16)
31168}
31169
31170// CMP
31171OPCODE(0xB0A8)
31172{
31173 u32 adr, res;
31174 u32 src, dst;
31175
31176 FETCH_SWORD(adr);
31177 adr += AREG((Opcode >> 0) & 7);
31178 PRE_IO
31179 READ_LONG_F(adr, src)
31180 dst = DREGu32((Opcode >> 9) & 7);
31181 res = dst - src;
31182 flag_NotZ = res;
31183 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
31184 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
31185 flag_N = res >> 24;
31186 POST_IO
31187RET(18)
31188}
31189
31190// CMP
31191OPCODE(0xB0B0)
31192{
31193 u32 adr, res;
31194 u32 src, dst;
31195
31196 adr = AREG((Opcode >> 0) & 7);
31197 DECODE_EXT_WORD
31198 PRE_IO
31199 READ_LONG_F(adr, src)
31200 dst = DREGu32((Opcode >> 9) & 7);
31201 res = dst - src;
31202 flag_NotZ = res;
31203 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
31204 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
31205 flag_N = res >> 24;
31206 POST_IO
31207RET(20)
31208}
31209
31210// CMP
31211OPCODE(0xB0B8)
31212{
31213 u32 adr, res;
31214 u32 src, dst;
31215
31216 FETCH_SWORD(adr);
31217 PRE_IO
31218 READ_LONG_F(adr, src)
31219 dst = DREGu32((Opcode >> 9) & 7);
31220 res = dst - src;
31221 flag_NotZ = res;
31222 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
31223 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
31224 flag_N = res >> 24;
31225 POST_IO
31226RET(18)
31227}
31228
31229// CMP
31230OPCODE(0xB0B9)
31231{
31232 u32 adr, res;
31233 u32 src, dst;
31234
31235 FETCH_LONG(adr);
31236 PRE_IO
31237 READ_LONG_F(adr, src)
31238 dst = DREGu32((Opcode >> 9) & 7);
31239 res = dst - src;
31240 flag_NotZ = res;
31241 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
31242 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
31243 flag_N = res >> 24;
31244 POST_IO
31245RET(22)
31246}
31247
31248// CMP
31249OPCODE(0xB0BA)
31250{
31251 u32 adr, res;
31252 u32 src, dst;
31253
be26eb23 31254 adr = GET_SWORD + GET_PC;
70357ce5 31255 PC++;
31256 PRE_IO
31257 READ_LONG_F(adr, src)
31258 dst = DREGu32((Opcode >> 9) & 7);
31259 res = dst - src;
31260 flag_NotZ = res;
31261 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
31262 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
31263 flag_N = res >> 24;
31264 POST_IO
31265RET(18)
31266}
31267
31268// CMP
31269OPCODE(0xB0BB)
31270{
31271 u32 adr, res;
31272 u32 src, dst;
31273
be26eb23 31274 adr = GET_PC;
70357ce5 31275 DECODE_EXT_WORD
31276 PRE_IO
31277 READ_LONG_F(adr, src)
31278 dst = DREGu32((Opcode >> 9) & 7);
31279 res = dst - src;
31280 flag_NotZ = res;
31281 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
31282 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
31283 flag_N = res >> 24;
31284 POST_IO
31285RET(20)
31286}
31287
31288// CMP
31289OPCODE(0xB0BC)
31290{
31291 u32 adr, res;
31292 u32 src, dst;
31293
31294 FETCH_LONG(src);
31295 dst = DREGu32((Opcode >> 9) & 7);
31296 res = dst - src;
31297 flag_NotZ = res;
31298 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
31299 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
31300 flag_N = res >> 24;
31301RET(14)
31302}
31303
31304// CMP
31305OPCODE(0xB09F)
31306{
31307 u32 adr, res;
31308 u32 src, dst;
31309
31310 adr = AREG(7);
31311 AREG(7) += 4;
31312 PRE_IO
31313 READ_LONG_F(adr, src)
31314 dst = DREGu32((Opcode >> 9) & 7);
31315 res = dst - src;
31316 flag_NotZ = res;
31317 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
31318 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
31319 flag_N = res >> 24;
31320 POST_IO
31321RET(14)
31322}
31323
31324// CMP
31325OPCODE(0xB0A7)
31326{
31327 u32 adr, res;
31328 u32 src, dst;
31329
31330 adr = AREG(7) - 4;
31331 AREG(7) = adr;
31332 PRE_IO
31333 READ_LONG_F(adr, src)
31334 dst = DREGu32((Opcode >> 9) & 7);
31335 res = dst - src;
31336 flag_NotZ = res;
31337 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
31338 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
31339 flag_N = res >> 24;
31340 POST_IO
31341RET(16)
31342}
31343
31344// CMPM
31345OPCODE(0xB108)
31346{
31347 u32 adr, res;
31348 u32 src, dst;
31349
31350 adr = AREG((Opcode >> 0) & 7);
31351 AREG((Opcode >> 0) & 7) += 1;
31352 PRE_IO
31353 READ_BYTE_F(adr, src)
31354 adr = AREG((Opcode >> 9) & 7);
31355 AREG((Opcode >> 9) & 7) += 1;
31356 READ_BYTE_F(adr, dst)
31357 res = dst - src;
31358 flag_N = flag_C = res;
31359 flag_V = (src ^ dst) & (res ^ dst);
31360 flag_NotZ = res & 0xFF;
31361 POST_IO
31362RET(12)
31363}
31364
31365// CMPM
31366OPCODE(0xB148)
31367{
31368 u32 adr, res;
31369 u32 src, dst;
31370
31371 adr = AREG((Opcode >> 0) & 7);
31372 AREG((Opcode >> 0) & 7) += 2;
31373 PRE_IO
31374 READ_WORD_F(adr, src)
31375 adr = AREG((Opcode >> 9) & 7);
31376 AREG((Opcode >> 9) & 7) += 2;
31377 READ_WORD_F(adr, dst)
31378 res = dst - src;
31379 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
31380 flag_N = flag_C = res >> 8;
31381 flag_NotZ = res & 0xFFFF;
31382 POST_IO
31383RET(12)
31384}
31385
31386// CMPM
31387OPCODE(0xB188)
31388{
31389 u32 adr, res;
31390 u32 src, dst;
31391
31392 adr = AREG((Opcode >> 0) & 7);
31393 AREG((Opcode >> 0) & 7) += 4;
31394 PRE_IO
31395 READ_LONG_F(adr, src)
31396 adr = AREG((Opcode >> 9) & 7);
31397 AREG((Opcode >> 9) & 7) += 4;
31398 READ_LONG_F(adr, dst)
31399 res = dst - src;
31400 flag_NotZ = res;
31401 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
31402 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
31403 flag_N = res >> 24;
31404 POST_IO
31405RET(20)
31406}
31407
31408// CMP7M
31409OPCODE(0xB10F)
31410{
31411 u32 adr, res;
31412 u32 src, dst;
31413
31414 adr = AREG(7);
31415 AREG(7) += 2;
31416 PRE_IO
31417 READ_BYTE_F(adr, src)
31418 adr = AREG((Opcode >> 9) & 7);
31419 AREG((Opcode >> 9) & 7) += 1;
31420 READ_BYTE_F(adr, dst)
31421 res = dst - src;
31422 flag_N = flag_C = res;
31423 flag_V = (src ^ dst) & (res ^ dst);
31424 flag_NotZ = res & 0xFF;
31425 POST_IO
31426RET(12)
31427}
31428
31429// CMP7M
31430OPCODE(0xB14F)
31431{
31432 u32 adr, res;
31433 u32 src, dst;
31434
31435 adr = AREG(7);
31436 AREG(7) += 2;
31437 PRE_IO
31438 READ_WORD_F(adr, src)
31439 adr = AREG((Opcode >> 9) & 7);
31440 AREG((Opcode >> 9) & 7) += 2;
31441 READ_WORD_F(adr, dst)
31442 res = dst - src;
31443 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
31444 flag_N = flag_C = res >> 8;
31445 flag_NotZ = res & 0xFFFF;
31446 POST_IO
31447RET(12)
31448}
31449
31450// CMP7M
31451OPCODE(0xB18F)
31452{
31453 u32 adr, res;
31454 u32 src, dst;
31455
31456 adr = AREG(7);
31457 AREG(7) += 4;
31458 PRE_IO
31459 READ_LONG_F(adr, src)
31460 adr = AREG((Opcode >> 9) & 7);
31461 AREG((Opcode >> 9) & 7) += 4;
31462 READ_LONG_F(adr, dst)
31463 res = dst - src;
31464 flag_NotZ = res;
31465 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
31466 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
31467 flag_N = res >> 24;
31468 POST_IO
31469RET(20)
31470}
31471
31472// CMPM7
31473OPCODE(0xBF08)
31474{
31475 u32 adr, res;
31476 u32 src, dst;
31477
31478 adr = AREG((Opcode >> 0) & 7);
31479 AREG((Opcode >> 0) & 7) += 1;
31480 PRE_IO
31481 READ_BYTE_F(adr, src)
31482 adr = AREG(7);
31483 AREG(7) += 2;
31484 READ_BYTE_F(adr, dst)
31485 res = dst - src;
31486 flag_N = flag_C = res;
31487 flag_V = (src ^ dst) & (res ^ dst);
31488 flag_NotZ = res & 0xFF;
31489 POST_IO
31490RET(12)
31491}
31492
31493// CMPM7
31494OPCODE(0xBF48)
31495{
31496 u32 adr, res;
31497 u32 src, dst;
31498
31499 adr = AREG((Opcode >> 0) & 7);
31500 AREG((Opcode >> 0) & 7) += 2;
31501 PRE_IO
31502 READ_WORD_F(adr, src)
31503 adr = AREG(7);
31504 AREG(7) += 2;
31505 READ_WORD_F(adr, dst)
31506 res = dst - src;
31507 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
31508 flag_N = flag_C = res >> 8;
31509 flag_NotZ = res & 0xFFFF;
31510 POST_IO
31511RET(12)
31512}
31513
31514// CMPM7
31515OPCODE(0xBF88)
31516{
31517 u32 adr, res;
31518 u32 src, dst;
31519
31520 adr = AREG((Opcode >> 0) & 7);
31521 AREG((Opcode >> 0) & 7) += 4;
31522 PRE_IO
31523 READ_LONG_F(adr, src)
31524 adr = AREG(7);
31525 AREG(7) += 4;
31526 READ_LONG_F(adr, dst)
31527 res = dst - src;
31528 flag_NotZ = res;
31529 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
31530 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
31531 flag_N = res >> 24;
31532 POST_IO
31533RET(20)
31534}
31535
31536// CMP7M7
31537OPCODE(0xBF0F)
31538{
31539 u32 adr, res;
31540 u32 src, dst;
31541
31542 adr = AREG(7);
31543 AREG(7) += 2;
31544 PRE_IO
31545 READ_BYTE_F(adr, src)
31546 adr = AREG(7);
31547 AREG(7) += 2;
31548 READ_BYTE_F(adr, dst)
31549 res = dst - src;
31550 flag_N = flag_C = res;
31551 flag_V = (src ^ dst) & (res ^ dst);
31552 flag_NotZ = res & 0xFF;
31553 POST_IO
31554RET(12)
31555}
31556
31557// CMP7M7
31558OPCODE(0xBF4F)
31559{
31560 u32 adr, res;
31561 u32 src, dst;
31562
31563 adr = AREG(7);
31564 AREG(7) += 2;
31565 PRE_IO
31566 READ_WORD_F(adr, src)
31567 adr = AREG(7);
31568 AREG(7) += 2;
31569 READ_WORD_F(adr, dst)
31570 res = dst - src;
31571 flag_V = ((src ^ dst) & (res ^ dst)) >> 8;
31572 flag_N = flag_C = res >> 8;
31573 flag_NotZ = res & 0xFFFF;
31574 POST_IO
31575RET(12)
31576}
31577
31578// CMP7M7
31579OPCODE(0xBF8F)
31580{
31581 u32 adr, res;
31582 u32 src, dst;
31583
31584 adr = AREG(7);
31585 AREG(7) += 4;
31586 PRE_IO
31587 READ_LONG_F(adr, src)
31588 adr = AREG(7);
31589 AREG(7) += 4;
31590 READ_LONG_F(adr, dst)
31591 res = dst - src;
31592 flag_NotZ = res;
31593 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
31594 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
31595 flag_N = res >> 24;
31596 POST_IO
31597RET(20)
31598}
31599
31600// EORDa
31601OPCODE(0xB100)
31602{
31603 u32 adr, res;
31604 u32 src, dst;
31605
31606 src = DREGu8((Opcode >> 9) & 7);
31607 res = DREGu8((Opcode >> 0) & 7);
31608 res ^= src;
31609 flag_C = 0;
31610 flag_V = 0;
31611 flag_NotZ = res;
31612 flag_N = res;
31613 DREGu8((Opcode >> 0) & 7) = res;
31614RET(4)
31615}
31616
31617// EORDa
31618OPCODE(0xB110)
31619{
31620 u32 adr, res;
31621 u32 src, dst;
31622
31623 src = DREGu8((Opcode >> 9) & 7);
31624 adr = AREG((Opcode >> 0) & 7);
31625 PRE_IO
31626 READ_BYTE_F(adr, res)
31627 res ^= src;
31628 flag_C = 0;
31629 flag_V = 0;
31630 flag_NotZ = res;
31631 flag_N = res;
31632 WRITE_BYTE_F(adr, res)
31633 POST_IO
31634RET(12)
31635}
31636
31637// EORDa
31638OPCODE(0xB118)
31639{
31640 u32 adr, res;
31641 u32 src, dst;
31642
31643 src = DREGu8((Opcode >> 9) & 7);
31644 adr = AREG((Opcode >> 0) & 7);
31645 AREG((Opcode >> 0) & 7) += 1;
31646 PRE_IO
31647 READ_BYTE_F(adr, res)
31648 res ^= src;
31649 flag_C = 0;
31650 flag_V = 0;
31651 flag_NotZ = res;
31652 flag_N = res;
31653 WRITE_BYTE_F(adr, res)
31654 POST_IO
31655RET(12)
31656}
31657
31658// EORDa
31659OPCODE(0xB120)
31660{
31661 u32 adr, res;
31662 u32 src, dst;
31663
31664 src = DREGu8((Opcode >> 9) & 7);
31665 adr = AREG((Opcode >> 0) & 7) - 1;
31666 AREG((Opcode >> 0) & 7) = adr;
31667 PRE_IO
31668 READ_BYTE_F(adr, res)
31669 res ^= src;
31670 flag_C = 0;
31671 flag_V = 0;
31672 flag_NotZ = res;
31673 flag_N = res;
31674 WRITE_BYTE_F(adr, res)
31675 POST_IO
31676RET(14)
31677}
31678
31679// EORDa
31680OPCODE(0xB128)
31681{
31682 u32 adr, res;
31683 u32 src, dst;
31684
31685 src = DREGu8((Opcode >> 9) & 7);
31686 FETCH_SWORD(adr);
31687 adr += AREG((Opcode >> 0) & 7);
31688 PRE_IO
31689 READ_BYTE_F(adr, res)
31690 res ^= src;
31691 flag_C = 0;
31692 flag_V = 0;
31693 flag_NotZ = res;
31694 flag_N = res;
31695 WRITE_BYTE_F(adr, res)
31696 POST_IO
31697RET(16)
31698}
31699
31700// EORDa
31701OPCODE(0xB130)
31702{
31703 u32 adr, res;
31704 u32 src, dst;
31705
31706 src = DREGu8((Opcode >> 9) & 7);
31707 adr = AREG((Opcode >> 0) & 7);
31708 DECODE_EXT_WORD
31709 PRE_IO
31710 READ_BYTE_F(adr, res)
31711 res ^= src;
31712 flag_C = 0;
31713 flag_V = 0;
31714 flag_NotZ = res;
31715 flag_N = res;
31716 WRITE_BYTE_F(adr, res)
31717 POST_IO
31718RET(18)
31719}
31720
31721// EORDa
31722OPCODE(0xB138)
31723{
31724 u32 adr, res;
31725 u32 src, dst;
31726
31727 src = DREGu8((Opcode >> 9) & 7);
31728 FETCH_SWORD(adr);
31729 PRE_IO
31730 READ_BYTE_F(adr, res)
31731 res ^= src;
31732 flag_C = 0;
31733 flag_V = 0;
31734 flag_NotZ = res;
31735 flag_N = res;
31736 WRITE_BYTE_F(adr, res)
31737 POST_IO
31738RET(16)
31739}
31740
31741// EORDa
31742OPCODE(0xB139)
31743{
31744 u32 adr, res;
31745 u32 src, dst;
31746
31747 src = DREGu8((Opcode >> 9) & 7);
31748 FETCH_LONG(adr);
31749 PRE_IO
31750 READ_BYTE_F(adr, res)
31751 res ^= src;
31752 flag_C = 0;
31753 flag_V = 0;
31754 flag_NotZ = res;
31755 flag_N = res;
31756 WRITE_BYTE_F(adr, res)
31757 POST_IO
31758RET(20)
31759}
31760
31761// EORDa
31762OPCODE(0xB11F)
31763{
31764 u32 adr, res;
31765 u32 src, dst;
31766
31767 src = DREGu8((Opcode >> 9) & 7);
31768 adr = AREG(7);
31769 AREG(7) += 2;
31770 PRE_IO
31771 READ_BYTE_F(adr, res)
31772 res ^= src;
31773 flag_C = 0;
31774 flag_V = 0;
31775 flag_NotZ = res;
31776 flag_N = res;
31777 WRITE_BYTE_F(adr, res)
31778 POST_IO
31779RET(12)
31780}
31781
31782// EORDa
31783OPCODE(0xB127)
31784{
31785 u32 adr, res;
31786 u32 src, dst;
31787
31788 src = DREGu8((Opcode >> 9) & 7);
31789 adr = AREG(7) - 2;
31790 AREG(7) = adr;
31791 PRE_IO
31792 READ_BYTE_F(adr, res)
31793 res ^= src;
31794 flag_C = 0;
31795 flag_V = 0;
31796 flag_NotZ = res;
31797 flag_N = res;
31798 WRITE_BYTE_F(adr, res)
31799 POST_IO
31800RET(14)
31801}
31802
31803// EORDa
31804OPCODE(0xB140)
31805{
31806 u32 adr, res;
31807 u32 src, dst;
31808
31809 src = DREGu16((Opcode >> 9) & 7);
31810 res = DREGu16((Opcode >> 0) & 7);
31811 res ^= src;
31812 flag_C = 0;
31813 flag_V = 0;
31814 flag_NotZ = res;
31815 flag_N = res >> 8;
31816 DREGu16((Opcode >> 0) & 7) = res;
31817RET(4)
31818}
31819
31820// EORDa
31821OPCODE(0xB150)
31822{
31823 u32 adr, res;
31824 u32 src, dst;
31825
31826 src = DREGu16((Opcode >> 9) & 7);
31827 adr = AREG((Opcode >> 0) & 7);
31828 PRE_IO
31829 READ_WORD_F(adr, res)
31830 res ^= src;
31831 flag_C = 0;
31832 flag_V = 0;
31833 flag_NotZ = res;
31834 flag_N = res >> 8;
31835 WRITE_WORD_F(adr, res)
31836 POST_IO
31837RET(12)
31838}
31839
31840// EORDa
31841OPCODE(0xB158)
31842{
31843 u32 adr, res;
31844 u32 src, dst;
31845
31846 src = DREGu16((Opcode >> 9) & 7);
31847 adr = AREG((Opcode >> 0) & 7);
31848 AREG((Opcode >> 0) & 7) += 2;
31849 PRE_IO
31850 READ_WORD_F(adr, res)
31851 res ^= src;
31852 flag_C = 0;
31853 flag_V = 0;
31854 flag_NotZ = res;
31855 flag_N = res >> 8;
31856 WRITE_WORD_F(adr, res)
31857 POST_IO
31858RET(12)
31859}
31860
31861// EORDa
31862OPCODE(0xB160)
31863{
31864 u32 adr, res;
31865 u32 src, dst;
31866
31867 src = DREGu16((Opcode >> 9) & 7);
31868 adr = AREG((Opcode >> 0) & 7) - 2;
31869 AREG((Opcode >> 0) & 7) = adr;
31870 PRE_IO
31871 READ_WORD_F(adr, res)
31872 res ^= src;
31873 flag_C = 0;
31874 flag_V = 0;
31875 flag_NotZ = res;
31876 flag_N = res >> 8;
31877 WRITE_WORD_F(adr, res)
31878 POST_IO
31879RET(14)
31880}
31881
31882// EORDa
31883OPCODE(0xB168)
31884{
31885 u32 adr, res;
31886 u32 src, dst;
31887
31888 src = DREGu16((Opcode >> 9) & 7);
31889 FETCH_SWORD(adr);
31890 adr += AREG((Opcode >> 0) & 7);
31891 PRE_IO
31892 READ_WORD_F(adr, res)
31893 res ^= src;
31894 flag_C = 0;
31895 flag_V = 0;
31896 flag_NotZ = res;
31897 flag_N = res >> 8;
31898 WRITE_WORD_F(adr, res)
31899 POST_IO
31900RET(16)
31901}
31902
31903// EORDa
31904OPCODE(0xB170)
31905{
31906 u32 adr, res;
31907 u32 src, dst;
31908
31909 src = DREGu16((Opcode >> 9) & 7);
31910 adr = AREG((Opcode >> 0) & 7);
31911 DECODE_EXT_WORD
31912 PRE_IO
31913 READ_WORD_F(adr, res)
31914 res ^= src;
31915 flag_C = 0;
31916 flag_V = 0;
31917 flag_NotZ = res;
31918 flag_N = res >> 8;
31919 WRITE_WORD_F(adr, res)
31920 POST_IO
31921RET(18)
31922}
31923
31924// EORDa
31925OPCODE(0xB178)
31926{
31927 u32 adr, res;
31928 u32 src, dst;
31929
31930 src = DREGu16((Opcode >> 9) & 7);
31931 FETCH_SWORD(adr);
31932 PRE_IO
31933 READ_WORD_F(adr, res)
31934 res ^= src;
31935 flag_C = 0;
31936 flag_V = 0;
31937 flag_NotZ = res;
31938 flag_N = res >> 8;
31939 WRITE_WORD_F(adr, res)
31940 POST_IO
31941RET(16)
31942}
31943
31944// EORDa
31945OPCODE(0xB179)
31946{
31947 u32 adr, res;
31948 u32 src, dst;
31949
31950 src = DREGu16((Opcode >> 9) & 7);
31951 FETCH_LONG(adr);
31952 PRE_IO
31953 READ_WORD_F(adr, res)
31954 res ^= src;
31955 flag_C = 0;
31956 flag_V = 0;
31957 flag_NotZ = res;
31958 flag_N = res >> 8;
31959 WRITE_WORD_F(adr, res)
31960 POST_IO
31961RET(20)
31962}
31963
31964// EORDa
31965OPCODE(0xB15F)
31966{
31967 u32 adr, res;
31968 u32 src, dst;
31969
31970 src = DREGu16((Opcode >> 9) & 7);
31971 adr = AREG(7);
31972 AREG(7) += 2;
31973 PRE_IO
31974 READ_WORD_F(adr, res)
31975 res ^= src;
31976 flag_C = 0;
31977 flag_V = 0;
31978 flag_NotZ = res;
31979 flag_N = res >> 8;
31980 WRITE_WORD_F(adr, res)
31981 POST_IO
31982RET(12)
31983}
31984
31985// EORDa
31986OPCODE(0xB167)
31987{
31988 u32 adr, res;
31989 u32 src, dst;
31990
31991 src = DREGu16((Opcode >> 9) & 7);
31992 adr = AREG(7) - 2;
31993 AREG(7) = adr;
31994 PRE_IO
31995 READ_WORD_F(adr, res)
31996 res ^= src;
31997 flag_C = 0;
31998 flag_V = 0;
31999 flag_NotZ = res;
32000 flag_N = res >> 8;
32001 WRITE_WORD_F(adr, res)
32002 POST_IO
32003RET(14)
32004}
32005
32006// EORDa
32007OPCODE(0xB180)
32008{
32009 u32 adr, res;
32010 u32 src, dst;
32011
32012 src = DREGu32((Opcode >> 9) & 7);
32013 res = DREGu32((Opcode >> 0) & 7);
32014 res ^= src;
32015 flag_C = 0;
32016 flag_V = 0;
32017 flag_NotZ = res;
32018 flag_N = res >> 24;
32019 DREGu32((Opcode >> 0) & 7) = res;
32020RET(8)
32021}
32022
32023// EORDa
32024OPCODE(0xB190)
32025{
32026 u32 adr, res;
32027 u32 src, dst;
32028
32029 src = DREGu32((Opcode >> 9) & 7);
32030 adr = AREG((Opcode >> 0) & 7);
32031 PRE_IO
32032 READ_LONG_F(adr, res)
32033 res ^= src;
32034 flag_C = 0;
32035 flag_V = 0;
32036 flag_NotZ = res;
32037 flag_N = res >> 24;
32038 WRITE_LONG_F(adr, res)
32039 POST_IO
32040RET(20)
32041}
32042
32043// EORDa
32044OPCODE(0xB198)
32045{
32046 u32 adr, res;
32047 u32 src, dst;
32048
32049 src = DREGu32((Opcode >> 9) & 7);
32050 adr = AREG((Opcode >> 0) & 7);
32051 AREG((Opcode >> 0) & 7) += 4;
32052 PRE_IO
32053 READ_LONG_F(adr, res)
32054 res ^= src;
32055 flag_C = 0;
32056 flag_V = 0;
32057 flag_NotZ = res;
32058 flag_N = res >> 24;
32059 WRITE_LONG_F(adr, res)
32060 POST_IO
32061RET(20)
32062}
32063
32064// EORDa
32065OPCODE(0xB1A0)
32066{
32067 u32 adr, res;
32068 u32 src, dst;
32069
32070 src = DREGu32((Opcode >> 9) & 7);
32071 adr = AREG((Opcode >> 0) & 7) - 4;
32072 AREG((Opcode >> 0) & 7) = adr;
32073 PRE_IO
32074 READ_LONG_F(adr, res)
32075 res ^= src;
32076 flag_C = 0;
32077 flag_V = 0;
32078 flag_NotZ = res;
32079 flag_N = res >> 24;
32080 WRITE_LONG_F(adr, res)
32081 POST_IO
32082RET(22)
32083}
32084
32085// EORDa
32086OPCODE(0xB1A8)
32087{
32088 u32 adr, res;
32089 u32 src, dst;
32090
32091 src = DREGu32((Opcode >> 9) & 7);
32092 FETCH_SWORD(adr);
32093 adr += AREG((Opcode >> 0) & 7);
32094 PRE_IO
32095 READ_LONG_F(adr, res)
32096 res ^= src;
32097 flag_C = 0;
32098 flag_V = 0;
32099 flag_NotZ = res;
32100 flag_N = res >> 24;
32101 WRITE_LONG_F(adr, res)
32102 POST_IO
32103RET(24)
32104}
32105
32106// EORDa
32107OPCODE(0xB1B0)
32108{
32109 u32 adr, res;
32110 u32 src, dst;
32111
32112 src = DREGu32((Opcode >> 9) & 7);
32113 adr = AREG((Opcode >> 0) & 7);
32114 DECODE_EXT_WORD
32115 PRE_IO
32116 READ_LONG_F(adr, res)
32117 res ^= src;
32118 flag_C = 0;
32119 flag_V = 0;
32120 flag_NotZ = res;
32121 flag_N = res >> 24;
32122 WRITE_LONG_F(adr, res)
32123 POST_IO
32124RET(26)
32125}
32126
32127// EORDa
32128OPCODE(0xB1B8)
32129{
32130 u32 adr, res;
32131 u32 src, dst;
32132
32133 src = DREGu32((Opcode >> 9) & 7);
32134 FETCH_SWORD(adr);
32135 PRE_IO
32136 READ_LONG_F(adr, res)
32137 res ^= src;
32138 flag_C = 0;
32139 flag_V = 0;
32140 flag_NotZ = res;
32141 flag_N = res >> 24;
32142 WRITE_LONG_F(adr, res)
32143 POST_IO
32144RET(24)
32145}
32146
32147// EORDa
32148OPCODE(0xB1B9)
32149{
32150 u32 adr, res;
32151 u32 src, dst;
32152
32153 src = DREGu32((Opcode >> 9) & 7);
32154 FETCH_LONG(adr);
32155 PRE_IO
32156 READ_LONG_F(adr, res)
32157 res ^= src;
32158 flag_C = 0;
32159 flag_V = 0;
32160 flag_NotZ = res;
32161 flag_N = res >> 24;
32162 WRITE_LONG_F(adr, res)
32163 POST_IO
32164RET(28)
32165}
32166
32167// EORDa
32168OPCODE(0xB19F)
32169{
32170 u32 adr, res;
32171 u32 src, dst;
32172
32173 src = DREGu32((Opcode >> 9) & 7);
32174 adr = AREG(7);
32175 AREG(7) += 4;
32176 PRE_IO
32177 READ_LONG_F(adr, res)
32178 res ^= src;
32179 flag_C = 0;
32180 flag_V = 0;
32181 flag_NotZ = res;
32182 flag_N = res >> 24;
32183 WRITE_LONG_F(adr, res)
32184 POST_IO
32185RET(20)
32186}
32187
32188// EORDa
32189OPCODE(0xB1A7)
32190{
32191 u32 adr, res;
32192 u32 src, dst;
32193
32194 src = DREGu32((Opcode >> 9) & 7);
32195 adr = AREG(7) - 4;
32196 AREG(7) = adr;
32197 PRE_IO
32198 READ_LONG_F(adr, res)
32199 res ^= src;
32200 flag_C = 0;
32201 flag_V = 0;
32202 flag_NotZ = res;
32203 flag_N = res >> 24;
32204 WRITE_LONG_F(adr, res)
32205 POST_IO
32206RET(22)
32207}
32208
32209// CMPA
32210OPCODE(0xB0C0)
32211{
32212 u32 adr, res;
32213 u32 src, dst;
32214
32215 src = (s32)DREGs16((Opcode >> 0) & 7);
32216 dst = AREGu32((Opcode >> 9) & 7);
32217 res = dst - src;
32218 flag_NotZ = res;
32219 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32220 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32221 flag_N = res >> 24;
32222RET(6)
32223}
32224
32225// CMPA
32226OPCODE(0xB0C8)
32227{
32228 u32 adr, res;
32229 u32 src, dst;
32230
32231 src = (s32)AREGs16((Opcode >> 0) & 7);
32232 dst = AREGu32((Opcode >> 9) & 7);
32233 res = dst - src;
32234 flag_NotZ = res;
32235 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32236 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32237 flag_N = res >> 24;
32238RET(6)
32239}
32240
32241// CMPA
32242OPCODE(0xB0D0)
32243{
32244 u32 adr, res;
32245 u32 src, dst;
32246
32247 adr = AREG((Opcode >> 0) & 7);
32248 PRE_IO
32249 READSX_WORD_F(adr, src)
32250 dst = AREGu32((Opcode >> 9) & 7);
32251 res = dst - src;
32252 flag_NotZ = res;
32253 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32254 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32255 flag_N = res >> 24;
32256 POST_IO
32257RET(10)
32258}
32259
32260// CMPA
32261OPCODE(0xB0D8)
32262{
32263 u32 adr, res;
32264 u32 src, dst;
32265
32266 adr = AREG((Opcode >> 0) & 7);
32267 AREG((Opcode >> 0) & 7) += 2;
32268 PRE_IO
32269 READSX_WORD_F(adr, src)
32270 dst = AREGu32((Opcode >> 9) & 7);
32271 res = dst - src;
32272 flag_NotZ = res;
32273 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32274 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32275 flag_N = res >> 24;
32276 POST_IO
32277RET(10)
32278}
32279
32280// CMPA
32281OPCODE(0xB0E0)
32282{
32283 u32 adr, res;
32284 u32 src, dst;
32285
32286 adr = AREG((Opcode >> 0) & 7) - 2;
32287 AREG((Opcode >> 0) & 7) = adr;
32288 PRE_IO
32289 READSX_WORD_F(adr, src)
32290 dst = AREGu32((Opcode >> 9) & 7);
32291 res = dst - src;
32292 flag_NotZ = res;
32293 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32294 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32295 flag_N = res >> 24;
32296 POST_IO
32297RET(12)
32298}
32299
32300// CMPA
32301OPCODE(0xB0E8)
32302{
32303 u32 adr, res;
32304 u32 src, dst;
32305
32306 FETCH_SWORD(adr);
32307 adr += AREG((Opcode >> 0) & 7);
32308 PRE_IO
32309 READSX_WORD_F(adr, src)
32310 dst = AREGu32((Opcode >> 9) & 7);
32311 res = dst - src;
32312 flag_NotZ = res;
32313 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32314 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32315 flag_N = res >> 24;
32316 POST_IO
32317RET(14)
32318}
32319
32320// CMPA
32321OPCODE(0xB0F0)
32322{
32323 u32 adr, res;
32324 u32 src, dst;
32325
32326 adr = AREG((Opcode >> 0) & 7);
32327 DECODE_EXT_WORD
32328 PRE_IO
32329 READSX_WORD_F(adr, src)
32330 dst = AREGu32((Opcode >> 9) & 7);
32331 res = dst - src;
32332 flag_NotZ = res;
32333 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32334 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32335 flag_N = res >> 24;
32336 POST_IO
32337RET(16)
32338}
32339
32340// CMPA
32341OPCODE(0xB0F8)
32342{
32343 u32 adr, res;
32344 u32 src, dst;
32345
32346 FETCH_SWORD(adr);
32347 PRE_IO
32348 READSX_WORD_F(adr, src)
32349 dst = AREGu32((Opcode >> 9) & 7);
32350 res = dst - src;
32351 flag_NotZ = res;
32352 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32353 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32354 flag_N = res >> 24;
32355 POST_IO
32356RET(14)
32357}
32358
32359// CMPA
32360OPCODE(0xB0F9)
32361{
32362 u32 adr, res;
32363 u32 src, dst;
32364
32365 FETCH_LONG(adr);
32366 PRE_IO
32367 READSX_WORD_F(adr, src)
32368 dst = AREGu32((Opcode >> 9) & 7);
32369 res = dst - src;
32370 flag_NotZ = res;
32371 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32372 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32373 flag_N = res >> 24;
32374 POST_IO
32375RET(18)
32376}
32377
32378// CMPA
32379OPCODE(0xB0FA)
32380{
32381 u32 adr, res;
32382 u32 src, dst;
32383
be26eb23 32384 adr = GET_SWORD + GET_PC;
70357ce5 32385 PC++;
32386 PRE_IO
32387 READSX_WORD_F(adr, src)
32388 dst = AREGu32((Opcode >> 9) & 7);
32389 res = dst - src;
32390 flag_NotZ = res;
32391 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32392 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32393 flag_N = res >> 24;
32394 POST_IO
32395RET(14)
32396}
32397
32398// CMPA
32399OPCODE(0xB0FB)
32400{
32401 u32 adr, res;
32402 u32 src, dst;
32403
be26eb23 32404 adr = GET_PC;
70357ce5 32405 DECODE_EXT_WORD
32406 PRE_IO
32407 READSX_WORD_F(adr, src)
32408 dst = AREGu32((Opcode >> 9) & 7);
32409 res = dst - src;
32410 flag_NotZ = res;
32411 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32412 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32413 flag_N = res >> 24;
32414 POST_IO
32415RET(16)
32416}
32417
32418// CMPA
32419OPCODE(0xB0FC)
32420{
32421 u32 adr, res;
32422 u32 src, dst;
32423
32424 FETCH_SWORD(src);
32425 dst = AREGu32((Opcode >> 9) & 7);
32426 res = dst - src;
32427 flag_NotZ = res;
32428 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32429 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32430 flag_N = res >> 24;
32431RET(10)
32432}
32433
32434// CMPA
32435OPCODE(0xB0DF)
32436{
32437 u32 adr, res;
32438 u32 src, dst;
32439
32440 adr = AREG(7);
32441 AREG(7) += 2;
32442 PRE_IO
32443 READSX_WORD_F(adr, src)
32444 dst = AREGu32((Opcode >> 9) & 7);
32445 res = dst - src;
32446 flag_NotZ = res;
32447 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32448 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32449 flag_N = res >> 24;
32450 POST_IO
32451RET(10)
32452}
32453
32454// CMPA
32455OPCODE(0xB0E7)
32456{
32457 u32 adr, res;
32458 u32 src, dst;
32459
32460 adr = AREG(7) - 2;
32461 AREG(7) = adr;
32462 PRE_IO
32463 READSX_WORD_F(adr, src)
32464 dst = AREGu32((Opcode >> 9) & 7);
32465 res = dst - src;
32466 flag_NotZ = res;
32467 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32468 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32469 flag_N = res >> 24;
32470 POST_IO
32471RET(12)
32472}
32473
32474// CMPA
32475OPCODE(0xB1C0)
32476{
32477 u32 adr, res;
32478 u32 src, dst;
32479
32480 src = (s32)DREGs32((Opcode >> 0) & 7);
32481 dst = AREGu32((Opcode >> 9) & 7);
32482 res = dst - src;
32483 flag_NotZ = res;
32484 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32485 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32486 flag_N = res >> 24;
32487RET(6)
32488}
32489
32490// CMPA
32491OPCODE(0xB1C8)
32492{
32493 u32 adr, res;
32494 u32 src, dst;
32495
32496 src = (s32)AREGs32((Opcode >> 0) & 7);
32497 dst = AREGu32((Opcode >> 9) & 7);
32498 res = dst - src;
32499 flag_NotZ = res;
32500 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32501 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32502 flag_N = res >> 24;
32503RET(6)
32504}
32505
32506// CMPA
32507OPCODE(0xB1D0)
32508{
32509 u32 adr, res;
32510 u32 src, dst;
32511
32512 adr = AREG((Opcode >> 0) & 7);
32513 PRE_IO
32514 READSX_LONG_F(adr, src)
32515 dst = AREGu32((Opcode >> 9) & 7);
32516 res = dst - src;
32517 flag_NotZ = res;
32518 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32519 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32520 flag_N = res >> 24;
32521 POST_IO
32522RET(14)
32523}
32524
32525// CMPA
32526OPCODE(0xB1D8)
32527{
32528 u32 adr, res;
32529 u32 src, dst;
32530
32531 adr = AREG((Opcode >> 0) & 7);
32532 AREG((Opcode >> 0) & 7) += 4;
32533 PRE_IO
32534 READSX_LONG_F(adr, src)
32535 dst = AREGu32((Opcode >> 9) & 7);
32536 res = dst - src;
32537 flag_NotZ = res;
32538 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32539 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32540 flag_N = res >> 24;
32541 POST_IO
32542RET(14)
32543}
32544
32545// CMPA
32546OPCODE(0xB1E0)
32547{
32548 u32 adr, res;
32549 u32 src, dst;
32550
32551 adr = AREG((Opcode >> 0) & 7) - 4;
32552 AREG((Opcode >> 0) & 7) = adr;
32553 PRE_IO
32554 READSX_LONG_F(adr, src)
32555 dst = AREGu32((Opcode >> 9) & 7);
32556 res = dst - src;
32557 flag_NotZ = res;
32558 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32559 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32560 flag_N = res >> 24;
32561 POST_IO
32562RET(16)
32563}
32564
32565// CMPA
32566OPCODE(0xB1E8)
32567{
32568 u32 adr, res;
32569 u32 src, dst;
32570
32571 FETCH_SWORD(adr);
32572 adr += AREG((Opcode >> 0) & 7);
32573 PRE_IO
32574 READSX_LONG_F(adr, src)
32575 dst = AREGu32((Opcode >> 9) & 7);
32576 res = dst - src;
32577 flag_NotZ = res;
32578 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32579 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32580 flag_N = res >> 24;
32581 POST_IO
32582RET(18)
32583}
32584
32585// CMPA
32586OPCODE(0xB1F0)
32587{
32588 u32 adr, res;
32589 u32 src, dst;
32590
32591 adr = AREG((Opcode >> 0) & 7);
32592 DECODE_EXT_WORD
32593 PRE_IO
32594 READSX_LONG_F(adr, src)
32595 dst = AREGu32((Opcode >> 9) & 7);
32596 res = dst - src;
32597 flag_NotZ = res;
32598 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32599 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32600 flag_N = res >> 24;
32601 POST_IO
32602RET(20)
32603}
32604
32605// CMPA
32606OPCODE(0xB1F8)
32607{
32608 u32 adr, res;
32609 u32 src, dst;
32610
32611 FETCH_SWORD(adr);
32612 PRE_IO
32613 READSX_LONG_F(adr, src)
32614 dst = AREGu32((Opcode >> 9) & 7);
32615 res = dst - src;
32616 flag_NotZ = res;
32617 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32618 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32619 flag_N = res >> 24;
32620 POST_IO
32621RET(18)
32622}
32623
32624// CMPA
32625OPCODE(0xB1F9)
32626{
32627 u32 adr, res;
32628 u32 src, dst;
32629
32630 FETCH_LONG(adr);
32631 PRE_IO
32632 READSX_LONG_F(adr, src)
32633 dst = AREGu32((Opcode >> 9) & 7);
32634 res = dst - src;
32635 flag_NotZ = res;
32636 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32637 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32638 flag_N = res >> 24;
32639 POST_IO
32640RET(22)
32641}
32642
32643// CMPA
32644OPCODE(0xB1FA)
32645{
32646 u32 adr, res;
32647 u32 src, dst;
32648
be26eb23 32649 adr = GET_SWORD + GET_PC;
70357ce5 32650 PC++;
32651 PRE_IO
32652 READSX_LONG_F(adr, src)
32653 dst = AREGu32((Opcode >> 9) & 7);
32654 res = dst - src;
32655 flag_NotZ = res;
32656 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32657 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32658 flag_N = res >> 24;
32659 POST_IO
32660RET(18)
32661}
32662
32663// CMPA
32664OPCODE(0xB1FB)
32665{
32666 u32 adr, res;
32667 u32 src, dst;
32668
be26eb23 32669 adr = GET_PC;
70357ce5 32670 DECODE_EXT_WORD
32671 PRE_IO
32672 READSX_LONG_F(adr, src)
32673 dst = AREGu32((Opcode >> 9) & 7);
32674 res = dst - src;
32675 flag_NotZ = res;
32676 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32677 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32678 flag_N = res >> 24;
32679 POST_IO
32680RET(20)
32681}
32682
32683// CMPA
32684OPCODE(0xB1FC)
32685{
32686 u32 adr, res;
32687 u32 src, dst;
32688
32689 FETCH_LONG(src);
32690 dst = AREGu32((Opcode >> 9) & 7);
32691 res = dst - src;
32692 flag_NotZ = res;
32693 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32694 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32695 flag_N = res >> 24;
32696RET(14)
32697}
32698
32699// CMPA
32700OPCODE(0xB1DF)
32701{
32702 u32 adr, res;
32703 u32 src, dst;
32704
32705 adr = AREG(7);
32706 AREG(7) += 4;
32707 PRE_IO
32708 READSX_LONG_F(adr, src)
32709 dst = AREGu32((Opcode >> 9) & 7);
32710 res = dst - src;
32711 flag_NotZ = res;
32712 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32713 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32714 flag_N = res >> 24;
32715 POST_IO
32716RET(14)
32717}
32718
32719// CMPA
32720OPCODE(0xB1E7)
32721{
32722 u32 adr, res;
32723 u32 src, dst;
32724
32725 adr = AREG(7) - 4;
32726 AREG(7) = adr;
32727 PRE_IO
32728 READSX_LONG_F(adr, src)
32729 dst = AREGu32((Opcode >> 9) & 7);
32730 res = dst - src;
32731 flag_NotZ = res;
32732 flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23;
32733 flag_V = ((src ^ dst) & (res ^ dst)) >> 24;
32734 flag_N = res >> 24;
32735 POST_IO
32736RET(16)
32737}
32738
32739// ANDaD
32740OPCODE(0xC000)
32741{
32742 u32 adr, res;
32743 u32 src, dst;
32744
32745 src = DREGu8((Opcode >> 0) & 7);
32746 res = DREGu8((Opcode >> 9) & 7);
32747 res &= src;
32748 flag_C = 0;
32749 flag_V = 0;
32750 flag_NotZ = res;
32751 flag_N = res;
32752 DREGu8((Opcode >> 9) & 7) = res;
32753RET(4)
32754}
32755
32756// ANDaD
32757OPCODE(0xC010)
32758{
32759 u32 adr, res;
32760 u32 src, dst;
32761
32762 adr = AREG((Opcode >> 0) & 7);
32763 PRE_IO
32764 READ_BYTE_F(adr, src)
32765 res = DREGu8((Opcode >> 9) & 7);
32766 res &= src;
32767 flag_C = 0;
32768 flag_V = 0;
32769 flag_NotZ = res;
32770 flag_N = res;
32771 DREGu8((Opcode >> 9) & 7) = res;
32772 POST_IO
32773RET(8)
32774}
32775
32776// ANDaD
32777OPCODE(0xC018)
32778{
32779 u32 adr, res;
32780 u32 src, dst;
32781
32782 adr = AREG((Opcode >> 0) & 7);
32783 AREG((Opcode >> 0) & 7) += 1;
32784 PRE_IO
32785 READ_BYTE_F(adr, src)
32786 res = DREGu8((Opcode >> 9) & 7);
32787 res &= src;
32788 flag_C = 0;
32789 flag_V = 0;
32790 flag_NotZ = res;
32791 flag_N = res;
32792 DREGu8((Opcode >> 9) & 7) = res;
32793 POST_IO
32794RET(8)
32795}
32796
32797// ANDaD
32798OPCODE(0xC020)
32799{
32800 u32 adr, res;
32801 u32 src, dst;
32802
32803 adr = AREG((Opcode >> 0) & 7) - 1;
32804 AREG((Opcode >> 0) & 7) = adr;
32805 PRE_IO
32806 READ_BYTE_F(adr, src)
32807 res = DREGu8((Opcode >> 9) & 7);
32808 res &= src;
32809 flag_C = 0;
32810 flag_V = 0;
32811 flag_NotZ = res;
32812 flag_N = res;
32813 DREGu8((Opcode >> 9) & 7) = res;
32814 POST_IO
32815RET(10)
32816}
32817
32818// ANDaD
32819OPCODE(0xC028)
32820{
32821 u32 adr, res;
32822 u32 src, dst;
32823
32824 FETCH_SWORD(adr);
32825 adr += AREG((Opcode >> 0) & 7);
32826 PRE_IO
32827 READ_BYTE_F(adr, src)
32828 res = DREGu8((Opcode >> 9) & 7);
32829 res &= src;
32830 flag_C = 0;
32831 flag_V = 0;
32832 flag_NotZ = res;
32833 flag_N = res;
32834 DREGu8((Opcode >> 9) & 7) = res;
32835 POST_IO
32836RET(12)
32837}
32838
32839// ANDaD
32840OPCODE(0xC030)
32841{
32842 u32 adr, res;
32843 u32 src, dst;
32844
32845 adr = AREG((Opcode >> 0) & 7);
32846 DECODE_EXT_WORD
32847 PRE_IO
32848 READ_BYTE_F(adr, src)
32849 res = DREGu8((Opcode >> 9) & 7);
32850 res &= src;
32851 flag_C = 0;
32852 flag_V = 0;
32853 flag_NotZ = res;
32854 flag_N = res;
32855 DREGu8((Opcode >> 9) & 7) = res;
32856 POST_IO
32857RET(14)
32858}
32859
32860// ANDaD
32861OPCODE(0xC038)
32862{
32863 u32 adr, res;
32864 u32 src, dst;
32865
32866 FETCH_SWORD(adr);
32867 PRE_IO
32868 READ_BYTE_F(adr, src)
32869 res = DREGu8((Opcode >> 9) & 7);
32870 res &= src;
32871 flag_C = 0;
32872 flag_V = 0;
32873 flag_NotZ = res;
32874 flag_N = res;
32875 DREGu8((Opcode >> 9) & 7) = res;
32876 POST_IO
32877RET(12)
32878}
32879
32880// ANDaD
32881OPCODE(0xC039)
32882{
32883 u32 adr, res;
32884 u32 src, dst;
32885
32886 FETCH_LONG(adr);
32887 PRE_IO
32888 READ_BYTE_F(adr, src)
32889 res = DREGu8((Opcode >> 9) & 7);
32890 res &= src;
32891 flag_C = 0;
32892 flag_V = 0;
32893 flag_NotZ = res;
32894 flag_N = res;
32895 DREGu8((Opcode >> 9) & 7) = res;
32896 POST_IO
32897RET(16)
32898}
32899
32900// ANDaD
32901OPCODE(0xC03A)
32902{
32903 u32 adr, res;
32904 u32 src, dst;
32905
be26eb23 32906 adr = GET_SWORD + GET_PC;
70357ce5 32907 PC++;
32908 PRE_IO
32909 READ_BYTE_F(adr, src)
32910 res = DREGu8((Opcode >> 9) & 7);
32911 res &= src;
32912 flag_C = 0;
32913 flag_V = 0;
32914 flag_NotZ = res;
32915 flag_N = res;
32916 DREGu8((Opcode >> 9) & 7) = res;
32917 POST_IO
32918RET(12)
32919}
32920
32921// ANDaD
32922OPCODE(0xC03B)
32923{
32924 u32 adr, res;
32925 u32 src, dst;
32926
be26eb23 32927 adr = GET_PC;
70357ce5 32928 DECODE_EXT_WORD
32929 PRE_IO
32930 READ_BYTE_F(adr, src)
32931 res = DREGu8((Opcode >> 9) & 7);
32932 res &= src;
32933 flag_C = 0;
32934 flag_V = 0;
32935 flag_NotZ = res;
32936 flag_N = res;
32937 DREGu8((Opcode >> 9) & 7) = res;
32938 POST_IO
32939RET(14)
32940}
32941
32942// ANDaD
32943OPCODE(0xC03C)
32944{
32945 u32 adr, res;
32946 u32 src, dst;
32947
32948 FETCH_BYTE(src);
32949 res = DREGu8((Opcode >> 9) & 7);
32950 res &= src;
32951 flag_C = 0;
32952 flag_V = 0;
32953 flag_NotZ = res;
32954 flag_N = res;
32955 DREGu8((Opcode >> 9) & 7) = res;
32956RET(8)
32957}
32958
32959// ANDaD
32960OPCODE(0xC01F)
32961{
32962 u32 adr, res;
32963 u32 src, dst;
32964
32965 adr = AREG(7);
32966 AREG(7) += 2;
32967 PRE_IO
32968 READ_BYTE_F(adr, src)
32969 res = DREGu8((Opcode >> 9) & 7);
32970 res &= src;
32971 flag_C = 0;
32972 flag_V = 0;
32973 flag_NotZ = res;
32974 flag_N = res;
32975 DREGu8((Opcode >> 9) & 7) = res;
32976 POST_IO
32977RET(8)
32978}
32979
32980// ANDaD
32981OPCODE(0xC027)
32982{
32983 u32 adr, res;
32984 u32 src, dst;
32985
32986 adr = AREG(7) - 2;
32987 AREG(7) = adr;
32988 PRE_IO
32989 READ_BYTE_F(adr, src)
32990 res = DREGu8((Opcode >> 9) & 7);
32991 res &= src;
32992 flag_C = 0;
32993 flag_V = 0;
32994 flag_NotZ = res;
32995 flag_N = res;
32996 DREGu8((Opcode >> 9) & 7) = res;
32997 POST_IO
32998RET(10)
32999}
33000
33001// ANDaD
33002OPCODE(0xC040)
33003{
33004 u32 adr, res;
33005 u32 src, dst;
33006
33007 src = DREGu16((Opcode >> 0) & 7);
33008 res = DREGu16((Opcode >> 9) & 7);
33009 res &= src;
33010 flag_C = 0;
33011 flag_V = 0;
33012 flag_NotZ = res;
33013 flag_N = res >> 8;
33014 DREGu16((Opcode >> 9) & 7) = res;
33015RET(4)
33016}
33017
33018// ANDaD
33019OPCODE(0xC050)
33020{
33021 u32 adr, res;
33022 u32 src, dst;
33023
33024 adr = AREG((Opcode >> 0) & 7);
33025 PRE_IO
33026 READ_WORD_F(adr, src)
33027 res = DREGu16((Opcode >> 9) & 7);
33028 res &= src;
33029 flag_C = 0;
33030 flag_V = 0;
33031 flag_NotZ = res;
33032 flag_N = res >> 8;
33033 DREGu16((Opcode >> 9) & 7) = res;
33034 POST_IO
33035RET(8)
33036}
33037
33038// ANDaD
33039OPCODE(0xC058)
33040{
33041 u32 adr, res;
33042 u32 src, dst;
33043
33044 adr = AREG((Opcode >> 0) & 7);
33045 AREG((Opcode >> 0) & 7) += 2;
33046 PRE_IO
33047 READ_WORD_F(adr, src)
33048 res = DREGu16((Opcode >> 9) & 7);
33049 res &= src;
33050 flag_C = 0;
33051 flag_V = 0;
33052 flag_NotZ = res;
33053 flag_N = res >> 8;
33054 DREGu16((Opcode >> 9) & 7) = res;
33055 POST_IO
33056RET(8)
33057}
33058
33059// ANDaD
33060OPCODE(0xC060)
33061{
33062 u32 adr, res;
33063 u32 src, dst;
33064
33065 adr = AREG((Opcode >> 0) & 7) - 2;
33066 AREG((Opcode >> 0) & 7) = adr;
33067 PRE_IO
33068 READ_WORD_F(adr, src)
33069 res = DREGu16((Opcode >> 9) & 7);
33070 res &= src;
33071 flag_C = 0;
33072 flag_V = 0;
33073 flag_NotZ = res;
33074 flag_N = res >> 8;
33075 DREGu16((Opcode >> 9) & 7) = res;
33076 POST_IO
33077RET(10)
33078}
33079
33080// ANDaD
33081OPCODE(0xC068)
33082{
33083 u32 adr, res;
33084 u32 src, dst;
33085
33086 FETCH_SWORD(adr);
33087 adr += AREG((Opcode >> 0) & 7);
33088 PRE_IO
33089 READ_WORD_F(adr, src)
33090 res = DREGu16((Opcode >> 9) & 7);
33091 res &= src;
33092 flag_C = 0;
33093 flag_V = 0;
33094 flag_NotZ = res;
33095 flag_N = res >> 8;
33096 DREGu16((Opcode >> 9) & 7) = res;
33097 POST_IO
33098RET(12)
33099}
33100
33101// ANDaD
33102OPCODE(0xC070)
33103{
33104 u32 adr, res;
33105 u32 src, dst;
33106
33107 adr = AREG((Opcode >> 0) & 7);
33108 DECODE_EXT_WORD
33109 PRE_IO
33110 READ_WORD_F(adr, src)
33111 res = DREGu16((Opcode >> 9) & 7);
33112 res &= src;
33113 flag_C = 0;
33114 flag_V = 0;
33115 flag_NotZ = res;
33116 flag_N = res >> 8;
33117 DREGu16((Opcode >> 9) & 7) = res;
33118 POST_IO
33119RET(14)
33120}
33121
33122// ANDaD
33123OPCODE(0xC078)
33124{
33125 u32 adr, res;
33126 u32 src, dst;
33127
33128 FETCH_SWORD(adr);
33129 PRE_IO
33130 READ_WORD_F(adr, src)
33131 res = DREGu16((Opcode >> 9) & 7);
33132 res &= src;
33133 flag_C = 0;
33134 flag_V = 0;
33135 flag_NotZ = res;
33136 flag_N = res >> 8;
33137 DREGu16((Opcode >> 9) & 7) = res;
33138 POST_IO
33139RET(12)
33140}
33141
33142// ANDaD
33143OPCODE(0xC079)
33144{
33145 u32 adr, res;
33146 u32 src, dst;
33147
33148 FETCH_LONG(adr);
33149 PRE_IO
33150 READ_WORD_F(adr, src)
33151 res = DREGu16((Opcode >> 9) & 7);
33152 res &= src;
33153 flag_C = 0;
33154 flag_V = 0;
33155 flag_NotZ = res;
33156 flag_N = res >> 8;
33157 DREGu16((Opcode >> 9) & 7) = res;
33158 POST_IO
33159RET(16)
33160}
33161
33162// ANDaD
33163OPCODE(0xC07A)
33164{
33165 u32 adr, res;
33166 u32 src, dst;
33167
be26eb23 33168 adr = GET_SWORD + GET_PC;
70357ce5 33169 PC++;
33170 PRE_IO
33171 READ_WORD_F(adr, src)
33172 res = DREGu16((Opcode >> 9) & 7);
33173 res &= src;
33174 flag_C = 0;
33175 flag_V = 0;
33176 flag_NotZ = res;
33177 flag_N = res >> 8;
33178 DREGu16((Opcode >> 9) & 7) = res;
33179 POST_IO
33180RET(12)
33181}
33182
33183// ANDaD
33184OPCODE(0xC07B)
33185{
33186 u32 adr, res;
33187 u32 src, dst;
33188
be26eb23 33189 adr = GET_PC;
70357ce5 33190 DECODE_EXT_WORD
33191 PRE_IO
33192 READ_WORD_F(adr, src)
33193 res = DREGu16((Opcode >> 9) & 7);
33194 res &= src;
33195 flag_C = 0;
33196 flag_V = 0;
33197 flag_NotZ = res;
33198 flag_N = res >> 8;
33199 DREGu16((Opcode >> 9) & 7) = res;
33200 POST_IO
33201RET(14)
33202}
33203
33204// ANDaD
33205OPCODE(0xC07C)
33206{
33207 u32 adr, res;
33208 u32 src, dst;
33209
33210 FETCH_WORD(src);
33211 res = DREGu16((Opcode >> 9) & 7);
33212 res &= src;
33213 flag_C = 0;
33214 flag_V = 0;
33215 flag_NotZ = res;
33216 flag_N = res >> 8;
33217 DREGu16((Opcode >> 9) & 7) = res;
33218RET(8)
33219}
33220
33221// ANDaD
33222OPCODE(0xC05F)
33223{
33224 u32 adr, res;
33225 u32 src, dst;
33226
33227 adr = AREG(7);
33228 AREG(7) += 2;
33229 PRE_IO
33230 READ_WORD_F(adr, src)
33231 res = DREGu16((Opcode >> 9) & 7);
33232 res &= src;
33233 flag_C = 0;
33234 flag_V = 0;
33235 flag_NotZ = res;
33236 flag_N = res >> 8;
33237 DREGu16((Opcode >> 9) & 7) = res;
33238 POST_IO
33239RET(8)
33240}
33241
33242// ANDaD
33243OPCODE(0xC067)
33244{
33245 u32 adr, res;
33246 u32 src, dst;
33247
33248 adr = AREG(7) - 2;
33249 AREG(7) = adr;
33250 PRE_IO
33251 READ_WORD_F(adr, src)
33252 res = DREGu16((Opcode >> 9) & 7);
33253 res &= src;
33254 flag_C = 0;
33255 flag_V = 0;
33256 flag_NotZ = res;
33257 flag_N = res >> 8;
33258 DREGu16((Opcode >> 9) & 7) = res;
33259 POST_IO
33260RET(10)
33261}
33262
33263// ANDaD
33264OPCODE(0xC080)
33265{
33266 u32 adr, res;
33267 u32 src, dst;
33268
33269 src = DREGu32((Opcode >> 0) & 7);
33270 res = DREGu32((Opcode >> 9) & 7);
33271 res &= src;
33272 flag_C = 0;
33273 flag_V = 0;
33274 flag_NotZ = res;
33275 flag_N = res >> 24;
33276 DREGu32((Opcode >> 9) & 7) = res;
33277RET(8)
33278}
33279
33280// ANDaD
33281OPCODE(0xC090)
33282{
33283 u32 adr, res;
33284 u32 src, dst;
33285
33286 adr = AREG((Opcode >> 0) & 7);
33287 PRE_IO
33288 READ_LONG_F(adr, src)
33289 res = DREGu32((Opcode >> 9) & 7);
33290 res &= src;
33291 flag_C = 0;
33292 flag_V = 0;
33293 flag_NotZ = res;
33294 flag_N = res >> 24;
33295 DREGu32((Opcode >> 9) & 7) = res;
33296 POST_IO
33297RET(14)
33298}
33299
33300// ANDaD
33301OPCODE(0xC098)
33302{
33303 u32 adr, res;
33304 u32 src, dst;
33305
33306 adr = AREG((Opcode >> 0) & 7);
33307 AREG((Opcode >> 0) & 7) += 4;
33308 PRE_IO
33309 READ_LONG_F(adr, src)
33310 res = DREGu32((Opcode >> 9) & 7);
33311 res &= src;
33312 flag_C = 0;
33313 flag_V = 0;
33314 flag_NotZ = res;
33315 flag_N = res >> 24;
33316 DREGu32((Opcode >> 9) & 7) = res;
33317 POST_IO
33318RET(14)
33319}
33320
33321// ANDaD
33322OPCODE(0xC0A0)
33323{
33324 u32 adr, res;
33325 u32 src, dst;
33326
33327 adr = AREG((Opcode >> 0) & 7) - 4;
33328 AREG((Opcode >> 0) & 7) = adr;
33329 PRE_IO
33330 READ_LONG_F(adr, src)
33331 res = DREGu32((Opcode >> 9) & 7);
33332 res &= src;
33333 flag_C = 0;
33334 flag_V = 0;
33335 flag_NotZ = res;
33336 flag_N = res >> 24;
33337 DREGu32((Opcode >> 9) & 7) = res;
33338 POST_IO
33339RET(16)
33340}
33341
33342// ANDaD
33343OPCODE(0xC0A8)
33344{
33345 u32 adr, res;
33346 u32 src, dst;
33347
33348 FETCH_SWORD(adr);
33349 adr += AREG((Opcode >> 0) & 7);
33350 PRE_IO
33351 READ_LONG_F(adr, src)
33352 res = DREGu32((Opcode >> 9) & 7);
33353 res &= src;
33354 flag_C = 0;
33355 flag_V = 0;
33356 flag_NotZ = res;
33357 flag_N = res >> 24;
33358 DREGu32((Opcode >> 9) & 7) = res;
33359 POST_IO
33360RET(18)
33361}
33362
33363// ANDaD
33364OPCODE(0xC0B0)
33365{
33366 u32 adr, res;
33367 u32 src, dst;
33368
33369 adr = AREG((Opcode >> 0) & 7);
33370 DECODE_EXT_WORD
33371 PRE_IO
33372 READ_LONG_F(adr, src)
33373 res = DREGu32((Opcode >> 9) & 7);
33374 res &= src;
33375 flag_C = 0;
33376 flag_V = 0;
33377 flag_NotZ = res;
33378 flag_N = res >> 24;
33379 DREGu32((Opcode >> 9) & 7) = res;
33380 POST_IO
33381RET(20)
33382}
33383
33384// ANDaD
33385OPCODE(0xC0B8)
33386{
33387 u32 adr, res;
33388 u32 src, dst;
33389
33390 FETCH_SWORD(adr);
33391 PRE_IO
33392 READ_LONG_F(adr, src)
33393 res = DREGu32((Opcode >> 9) & 7);
33394 res &= src;
33395 flag_C = 0;
33396 flag_V = 0;
33397 flag_NotZ = res;
33398 flag_N = res >> 24;
33399 DREGu32((Opcode >> 9) & 7) = res;
33400 POST_IO
33401RET(18)
33402}
33403
33404// ANDaD
33405OPCODE(0xC0B9)
33406{
33407 u32 adr, res;
33408 u32 src, dst;
33409
33410 FETCH_LONG(adr);
33411 PRE_IO
33412 READ_LONG_F(adr, src)
33413 res = DREGu32((Opcode >> 9) & 7);
33414 res &= src;
33415 flag_C = 0;
33416 flag_V = 0;
33417 flag_NotZ = res;
33418 flag_N = res >> 24;
33419 DREGu32((Opcode >> 9) & 7) = res;
33420 POST_IO
33421RET(22)
33422}
33423
33424// ANDaD
33425OPCODE(0xC0BA)
33426{
33427 u32 adr, res;
33428 u32 src, dst;
33429
be26eb23 33430 adr = GET_SWORD + GET_PC;
70357ce5 33431 PC++;
33432 PRE_IO
33433 READ_LONG_F(adr, src)
33434 res = DREGu32((Opcode >> 9) & 7);
33435 res &= src;
33436 flag_C = 0;
33437 flag_V = 0;
33438 flag_NotZ = res;
33439 flag_N = res >> 24;
33440 DREGu32((Opcode >> 9) & 7) = res;
33441 POST_IO
33442RET(18)
33443}
33444
33445// ANDaD
33446OPCODE(0xC0BB)
33447{
33448 u32 adr, res;
33449 u32 src, dst;
33450
be26eb23 33451 adr = GET_PC;
70357ce5 33452 DECODE_EXT_WORD
33453 PRE_IO
33454 READ_LONG_F(adr, src)
33455 res = DREGu32((Opcode >> 9) & 7);
33456 res &= src;
33457 flag_C = 0;
33458 flag_V = 0;
33459 flag_NotZ = res;
33460 flag_N = res >> 24;
33461 DREGu32((Opcode >> 9) & 7) = res;
33462 POST_IO
33463RET(20)
33464}
33465
33466// ANDaD
33467OPCODE(0xC0BC)
33468{
33469 u32 adr, res;
33470 u32 src, dst;
33471
33472 FETCH_LONG(src);
33473 res = DREGu32((Opcode >> 9) & 7);
33474 res &= src;
33475 flag_C = 0;
33476 flag_V = 0;
33477 flag_NotZ = res;
33478 flag_N = res >> 24;
33479 DREGu32((Opcode >> 9) & 7) = res;
33480RET(16)
33481}
33482
33483// ANDaD
33484OPCODE(0xC09F)
33485{
33486 u32 adr, res;
33487 u32 src, dst;
33488
33489 adr = AREG(7);
33490 AREG(7) += 4;
33491 PRE_IO
33492 READ_LONG_F(adr, src)
33493 res = DREGu32((Opcode >> 9) & 7);
33494 res &= src;
33495 flag_C = 0;
33496 flag_V = 0;
33497 flag_NotZ = res;
33498 flag_N = res >> 24;
33499 DREGu32((Opcode >> 9) & 7) = res;
33500 POST_IO
33501RET(14)
33502}
33503
33504// ANDaD
33505OPCODE(0xC0A7)
33506{
33507 u32 adr, res;
33508 u32 src, dst;
33509
33510 adr = AREG(7) - 4;
33511 AREG(7) = adr;
33512 PRE_IO
33513 READ_LONG_F(adr, src)
33514 res = DREGu32((Opcode >> 9) & 7);
33515 res &= src;
33516 flag_C = 0;
33517 flag_V = 0;
33518 flag_NotZ = res;
33519 flag_N = res >> 24;
33520 DREGu32((Opcode >> 9) & 7) = res;
33521 POST_IO
33522RET(16)
33523}
33524
33525// ANDDa
33526OPCODE(0xC110)
33527{
33528 u32 adr, res;
33529 u32 src, dst;
33530
33531 src = DREGu8((Opcode >> 9) & 7);
33532 adr = AREG((Opcode >> 0) & 7);
33533 PRE_IO
33534 READ_BYTE_F(adr, res)
33535 res &= src;
33536 flag_C = 0;
33537 flag_V = 0;
33538 flag_NotZ = res;
33539 flag_N = res;
33540 WRITE_BYTE_F(adr, res)
33541 POST_IO
33542RET(12)
33543}
33544
33545// ANDDa
33546OPCODE(0xC118)
33547{
33548 u32 adr, res;
33549 u32 src, dst;
33550
33551 src = DREGu8((Opcode >> 9) & 7);
33552 adr = AREG((Opcode >> 0) & 7);
33553 AREG((Opcode >> 0) & 7) += 1;
33554 PRE_IO
33555 READ_BYTE_F(adr, res)
33556 res &= src;
33557 flag_C = 0;
33558 flag_V = 0;
33559 flag_NotZ = res;
33560 flag_N = res;
33561 WRITE_BYTE_F(adr, res)
33562 POST_IO
33563RET(12)
33564}
33565
33566// ANDDa
33567OPCODE(0xC120)
33568{
33569 u32 adr, res;
33570 u32 src, dst;
33571
33572 src = DREGu8((Opcode >> 9) & 7);
33573 adr = AREG((Opcode >> 0) & 7) - 1;
33574 AREG((Opcode >> 0) & 7) = adr;
33575 PRE_IO
33576 READ_BYTE_F(adr, res)
33577 res &= src;
33578 flag_C = 0;
33579 flag_V = 0;
33580 flag_NotZ = res;
33581 flag_N = res;
33582 WRITE_BYTE_F(adr, res)
33583 POST_IO
33584RET(14)
33585}
33586
33587// ANDDa
33588OPCODE(0xC128)
33589{
33590 u32 adr, res;
33591 u32 src, dst;
33592
33593 src = DREGu8((Opcode >> 9) & 7);
33594 FETCH_SWORD(adr);
33595 adr += AREG((Opcode >> 0) & 7);
33596 PRE_IO
33597 READ_BYTE_F(adr, res)
33598 res &= src;
33599 flag_C = 0;
33600 flag_V = 0;
33601 flag_NotZ = res;
33602 flag_N = res;
33603 WRITE_BYTE_F(adr, res)
33604 POST_IO
33605RET(16)
33606}
33607
33608// ANDDa
33609OPCODE(0xC130)
33610{
33611 u32 adr, res;
33612 u32 src, dst;
33613
33614 src = DREGu8((Opcode >> 9) & 7);
33615 adr = AREG((Opcode >> 0) & 7);
33616 DECODE_EXT_WORD
33617 PRE_IO
33618 READ_BYTE_F(adr, res)
33619 res &= src;
33620 flag_C = 0;
33621 flag_V = 0;
33622 flag_NotZ = res;
33623 flag_N = res;
33624 WRITE_BYTE_F(adr, res)
33625 POST_IO
33626RET(18)
33627}
33628
33629// ANDDa
33630OPCODE(0xC138)
33631{
33632 u32 adr, res;
33633 u32 src, dst;
33634
33635 src = DREGu8((Opcode >> 9) & 7);
33636 FETCH_SWORD(adr);
33637 PRE_IO
33638 READ_BYTE_F(adr, res)
33639 res &= src;
33640 flag_C = 0;
33641 flag_V = 0;
33642 flag_NotZ = res;
33643 flag_N = res;
33644 WRITE_BYTE_F(adr, res)
33645 POST_IO
33646RET(16)
33647}
33648
33649// ANDDa
33650OPCODE(0xC139)
33651{
33652 u32 adr, res;
33653 u32 src, dst;
33654
33655 src = DREGu8((Opcode >> 9) & 7);
33656 FETCH_LONG(adr);
33657 PRE_IO
33658 READ_BYTE_F(adr, res)
33659 res &= src;
33660 flag_C = 0;
33661 flag_V = 0;
33662 flag_NotZ = res;
33663 flag_N = res;
33664 WRITE_BYTE_F(adr, res)
33665 POST_IO
33666RET(20)
33667}
33668
33669// ANDDa
33670OPCODE(0xC11F)
33671{
33672 u32 adr, res;
33673 u32 src, dst;
33674
33675 src = DREGu8((Opcode >> 9) & 7);
33676 adr = AREG(7);
33677 AREG(7) += 2;
33678 PRE_IO
33679 READ_BYTE_F(adr, res)
33680 res &= src;
33681 flag_C = 0;
33682 flag_V = 0;
33683 flag_NotZ = res;
33684 flag_N = res;
33685 WRITE_BYTE_F(adr, res)
33686 POST_IO
33687RET(12)
33688}
33689
33690// ANDDa
33691OPCODE(0xC127)
33692{
33693 u32 adr, res;
33694 u32 src, dst;
33695
33696 src = DREGu8((Opcode >> 9) & 7);
33697 adr = AREG(7) - 2;
33698 AREG(7) = adr;
33699 PRE_IO
33700 READ_BYTE_F(adr, res)
33701 res &= src;
33702 flag_C = 0;
33703 flag_V = 0;
33704 flag_NotZ = res;
33705 flag_N = res;
33706 WRITE_BYTE_F(adr, res)
33707 POST_IO
33708RET(14)
33709}
33710
33711// ANDDa
33712OPCODE(0xC150)
33713{
33714 u32 adr, res;
33715 u32 src, dst;
33716
33717 src = DREGu16((Opcode >> 9) & 7);
33718 adr = AREG((Opcode >> 0) & 7);
33719 PRE_IO
33720 READ_WORD_F(adr, res)
33721 res &= src;
33722 flag_C = 0;
33723 flag_V = 0;
33724 flag_NotZ = res;
33725 flag_N = res >> 8;
33726 WRITE_WORD_F(adr, res)
33727 POST_IO
33728RET(12)
33729}
33730
33731// ANDDa
33732OPCODE(0xC158)
33733{
33734 u32 adr, res;
33735 u32 src, dst;
33736
33737 src = DREGu16((Opcode >> 9) & 7);
33738 adr = AREG((Opcode >> 0) & 7);
33739 AREG((Opcode >> 0) & 7) += 2;
33740 PRE_IO
33741 READ_WORD_F(adr, res)
33742 res &= src;
33743 flag_C = 0;
33744 flag_V = 0;
33745 flag_NotZ = res;
33746 flag_N = res >> 8;
33747 WRITE_WORD_F(adr, res)
33748 POST_IO
33749RET(12)
33750}
33751
33752// ANDDa
33753OPCODE(0xC160)
33754{
33755 u32 adr, res;
33756 u32 src, dst;
33757
33758 src = DREGu16((Opcode >> 9) & 7);
33759 adr = AREG((Opcode >> 0) & 7) - 2;
33760 AREG((Opcode >> 0) & 7) = adr;
33761 PRE_IO
33762 READ_WORD_F(adr, res)
33763 res &= src;
33764 flag_C = 0;
33765 flag_V = 0;
33766 flag_NotZ = res;
33767 flag_N = res >> 8;
33768 WRITE_WORD_F(adr, res)
33769 POST_IO
33770RET(14)
33771}
33772
33773// ANDDa
33774OPCODE(0xC168)
33775{
33776 u32 adr, res;
33777 u32 src, dst;
33778
33779 src = DREGu16((Opcode >> 9) & 7);
33780 FETCH_SWORD(adr);
33781 adr += AREG((Opcode >> 0) & 7);
33782 PRE_IO
33783 READ_WORD_F(adr, res)
33784 res &= src;
33785 flag_C = 0;
33786 flag_V = 0;
33787 flag_NotZ = res;
33788 flag_N = res >> 8;
33789 WRITE_WORD_F(adr, res)
33790 POST_IO
33791RET(16)
33792}
33793
33794// ANDDa
33795OPCODE(0xC170)
33796{
33797 u32 adr, res;
33798 u32 src, dst;
33799
33800 src = DREGu16((Opcode >> 9) & 7);
33801 adr = AREG((Opcode >> 0) & 7);
33802 DECODE_EXT_WORD
33803 PRE_IO
33804 READ_WORD_F(adr, res)
33805 res &= src;
33806 flag_C = 0;
33807 flag_V = 0;
33808 flag_NotZ = res;
33809 flag_N = res >> 8;
33810 WRITE_WORD_F(adr, res)
33811 POST_IO
33812RET(18)
33813}
33814
33815// ANDDa
33816OPCODE(0xC178)
33817{
33818 u32 adr, res;
33819 u32 src, dst;
33820
33821 src = DREGu16((Opcode >> 9) & 7);
33822 FETCH_SWORD(adr);
33823 PRE_IO
33824 READ_WORD_F(adr, res)
33825 res &= src;
33826 flag_C = 0;
33827 flag_V = 0;
33828 flag_NotZ = res;
33829 flag_N = res >> 8;
33830 WRITE_WORD_F(adr, res)
33831 POST_IO
33832RET(16)
33833}
33834
33835// ANDDa
33836OPCODE(0xC179)
33837{
33838 u32 adr, res;
33839 u32 src, dst;
33840
33841 src = DREGu16((Opcode >> 9) & 7);
33842 FETCH_LONG(adr);
33843 PRE_IO
33844 READ_WORD_F(adr, res)
33845 res &= src;
33846 flag_C = 0;
33847 flag_V = 0;
33848 flag_NotZ = res;
33849 flag_N = res >> 8;
33850 WRITE_WORD_F(adr, res)
33851 POST_IO
33852RET(20)
33853}
33854
33855// ANDDa
33856OPCODE(0xC15F)
33857{
33858 u32 adr, res;
33859 u32 src, dst;
33860
33861 src = DREGu16((Opcode >> 9) & 7);
33862 adr = AREG(7);
33863 AREG(7) += 2;
33864 PRE_IO
33865 READ_WORD_F(adr, res)
33866 res &= src;
33867 flag_C = 0;
33868 flag_V = 0;
33869 flag_NotZ = res;
33870 flag_N = res >> 8;
33871 WRITE_WORD_F(adr, res)
33872 POST_IO
33873RET(12)
33874}
33875
33876// ANDDa
33877OPCODE(0xC167)
33878{
33879 u32 adr, res;
33880 u32 src, dst;
33881
33882 src = DREGu16((Opcode >> 9) & 7);
33883 adr = AREG(7) - 2;
33884 AREG(7) = adr;
33885 PRE_IO
33886 READ_WORD_F(adr, res)
33887 res &= src;
33888 flag_C = 0;
33889 flag_V = 0;
33890 flag_NotZ = res;
33891 flag_N = res >> 8;
33892 WRITE_WORD_F(adr, res)
33893 POST_IO
33894RET(14)
33895}
33896
33897// ANDDa
33898OPCODE(0xC190)
33899{
33900 u32 adr, res;
33901 u32 src, dst;
33902
33903 src = DREGu32((Opcode >> 9) & 7);
33904 adr = AREG((Opcode >> 0) & 7);
33905 PRE_IO
33906 READ_LONG_F(adr, res)
33907 res &= src;
33908 flag_C = 0;
33909 flag_V = 0;
33910 flag_NotZ = res;
33911 flag_N = res >> 24;
33912 WRITE_LONG_F(adr, res)
33913 POST_IO
33914RET(20)
33915}
33916
33917// ANDDa
33918OPCODE(0xC198)
33919{
33920 u32 adr, res;
33921 u32 src, dst;
33922
33923 src = DREGu32((Opcode >> 9) & 7);
33924 adr = AREG((Opcode >> 0) & 7);
33925 AREG((Opcode >> 0) & 7) += 4;
33926 PRE_IO
33927 READ_LONG_F(adr, res)
33928 res &= src;
33929 flag_C = 0;
33930 flag_V = 0;
33931 flag_NotZ = res;
33932 flag_N = res >> 24;
33933 WRITE_LONG_F(adr, res)
33934 POST_IO
33935RET(20)
33936}
33937
33938// ANDDa
33939OPCODE(0xC1A0)
33940{
33941 u32 adr, res;
33942 u32 src, dst;
33943
33944 src = DREGu32((Opcode >> 9) & 7);
33945 adr = AREG((Opcode >> 0) & 7) - 4;
33946 AREG((Opcode >> 0) & 7) = adr;
33947 PRE_IO
33948 READ_LONG_F(adr, res)
33949 res &= src;
33950 flag_C = 0;
33951 flag_V = 0;
33952 flag_NotZ = res;
33953 flag_N = res >> 24;
33954 WRITE_LONG_F(adr, res)
33955 POST_IO
33956RET(22)
33957}
33958
33959// ANDDa
33960OPCODE(0xC1A8)
33961{
33962 u32 adr, res;
33963 u32 src, dst;
33964
33965 src = DREGu32((Opcode >> 9) & 7);
33966 FETCH_SWORD(adr);
33967 adr += AREG((Opcode >> 0) & 7);
33968 PRE_IO
33969 READ_LONG_F(adr, res)
33970 res &= src;
33971 flag_C = 0;
33972 flag_V = 0;
33973 flag_NotZ = res;
33974 flag_N = res >> 24;
33975 WRITE_LONG_F(adr, res)
33976 POST_IO
33977RET(24)
33978}
33979
33980// ANDDa
33981OPCODE(0xC1B0)
33982{
33983 u32 adr, res;
33984 u32 src, dst;
33985
33986 src = DREGu32((Opcode >> 9) & 7);
33987 adr = AREG((Opcode >> 0) & 7);
33988 DECODE_EXT_WORD
33989 PRE_IO
33990 READ_LONG_F(adr, res)
33991 res &= src;
33992 flag_C = 0;
33993 flag_V = 0;
33994 flag_NotZ = res;
33995 flag_N = res >> 24;
33996 WRITE_LONG_F(adr, res)
33997 POST_IO
33998RET(26)
33999}
34000
34001// ANDDa
34002OPCODE(0xC1B8)
34003{
34004 u32 adr, res;
34005 u32 src, dst;
34006
34007 src = DREGu32((Opcode >> 9) & 7);
34008 FETCH_SWORD(adr);
34009 PRE_IO
34010 READ_LONG_F(adr, res)
34011 res &= src;
34012 flag_C = 0;
34013 flag_V = 0;
34014 flag_NotZ = res;
34015 flag_N = res >> 24;
34016 WRITE_LONG_F(adr, res)
34017 POST_IO
34018RET(24)
34019}
34020
34021// ANDDa
34022OPCODE(0xC1B9)
34023{
34024 u32 adr, res;
34025 u32 src, dst;
34026
34027 src = DREGu32((Opcode >> 9) & 7);
34028 FETCH_LONG(adr);
34029 PRE_IO
34030 READ_LONG_F(adr, res)
34031 res &= src;
34032 flag_C = 0;
34033 flag_V = 0;
34034 flag_NotZ = res;
34035 flag_N = res >> 24;
34036 WRITE_LONG_F(adr, res)
34037 POST_IO
34038RET(28)
34039}
34040
34041// ANDDa
34042OPCODE(0xC19F)
34043{
34044 u32 adr, res;
34045 u32 src, dst;
34046
34047 src = DREGu32((Opcode >> 9) & 7);
34048 adr = AREG(7);
34049 AREG(7) += 4;
34050 PRE_IO
34051 READ_LONG_F(adr, res)
34052 res &= src;
34053 flag_C = 0;
34054 flag_V = 0;
34055 flag_NotZ = res;
34056 flag_N = res >> 24;
34057 WRITE_LONG_F(adr, res)
34058 POST_IO
34059RET(20)
34060}
34061
34062// ANDDa
34063OPCODE(0xC1A7)
34064{
34065 u32 adr, res;
34066 u32 src, dst;
34067
34068 src = DREGu32((Opcode >> 9) & 7);
34069 adr = AREG(7) - 4;
34070 AREG(7) = adr;
34071 PRE_IO
34072 READ_LONG_F(adr, res)
34073 res &= src;
34074 flag_C = 0;
34075 flag_V = 0;
34076 flag_NotZ = res;
34077 flag_N = res >> 24;
34078 WRITE_LONG_F(adr, res)
34079 POST_IO
34080RET(22)
34081}
34082
34083// ABCD
34084OPCODE(0xC100)
34085{
34086 u32 adr, res;
34087 u32 src, dst;
34088
34089 src = DREGu8((Opcode >> 0) & 7);
34090 dst = DREGu8((Opcode >> 9) & 7);
34091 res = (dst & 0xF) + (src & 0xF) + ((flag_X >> M68K_SR_X_SFT) & 1);
34092 if (res > 9) res += 6;
34093 res += (dst & 0xF0) + (src & 0xF0);
34094 if (res > 0x99)
34095 {
34096 res -= 0xA0;
34097 flag_X = flag_C = M68K_SR_C;
34098 }
34099 else flag_X = flag_C = 0;
34100 flag_NotZ |= res & 0xFF;
34101 flag_N = res;
34102 DREGu8((Opcode >> 9) & 7) = res;
34103RET(6)
34104}
34105
34106// ABCDM
34107OPCODE(0xC108)
34108{
34109 u32 adr, res;
34110 u32 src, dst;
34111
34112 adr = AREG((Opcode >> 0) & 7) - 1;
34113 AREG((Opcode >> 0) & 7) = adr;
34114 PRE_IO
34115 READ_BYTE_F(adr, src)
34116 adr = AREG((Opcode >> 9) & 7) - 1;
34117 AREG((Opcode >> 9) & 7) = adr;
34118 READ_BYTE_F(adr, dst)
34119 res = (dst & 0xF) + (src & 0xF) + ((flag_X >> M68K_SR_X_SFT) & 1);
34120 if (res > 9) res += 6;
34121 res += (dst & 0xF0) + (src & 0xF0);
34122 if (res > 0x99)
34123 {
34124 res -= 0xA0;
34125 flag_X = flag_C = M68K_SR_C;
34126 }
34127 else flag_X = flag_C = 0;
34128 flag_NotZ |= res & 0xFF;
34129 flag_N = res;
34130 WRITE_BYTE_F(adr, res)
34131 POST_IO
34132RET(18)
34133}
34134
34135// ABCD7M
34136OPCODE(0xC10F)
34137{
34138 u32 adr, res;
34139 u32 src, dst;
34140
34141 adr = AREG(7) - 2;
34142 AREG(7) = adr;
34143 PRE_IO
34144 READ_BYTE_F(adr, src)
34145 adr = AREG((Opcode >> 9) & 7) - 1;
34146 AREG((Opcode >> 9) & 7) = adr;
34147 READ_BYTE_F(adr, dst)
34148 res = (dst & 0xF) + (src & 0xF) + ((flag_X >> M68K_SR_X_SFT) & 1);
34149 if (res > 9) res += 6;
34150 res += (dst & 0xF0) + (src & 0xF0);
34151 if (res > 0x99)
34152 {
34153 res -= 0xA0;
34154 flag_X = flag_C = M68K_SR_C;
34155 }
34156 else flag_X = flag_C = 0;
34157 flag_NotZ |= res & 0xFF;
34158 flag_N = res;
34159 WRITE_BYTE_F(adr, res)
34160 POST_IO
34161RET(18)
34162}
34163
34164// ABCDM7
34165OPCODE(0xCF08)
34166{
34167 u32 adr, res;
34168 u32 src, dst;
34169
34170 adr = AREG((Opcode >> 0) & 7) - 1;
34171 AREG((Opcode >> 0) & 7) = adr;
34172 PRE_IO
34173 READ_BYTE_F(adr, src)
34174 adr = AREG(7) - 2;
34175 AREG(7) = adr;
34176 READ_BYTE_F(adr, dst)
34177 res = (dst & 0xF) + (src & 0xF) + ((flag_X >> M68K_SR_X_SFT) & 1);
34178 if (res > 9) res += 6;
34179 res += (dst & 0xF0) + (src & 0xF0);
34180 if (res > 0x99)
34181 {
34182 res -= 0xA0;
34183 flag_X = flag_C = M68K_SR_C;
34184 }
34185 else flag_X = flag_C = 0;
34186 flag_NotZ |= res & 0xFF;
34187 flag_N = res;
34188 WRITE_BYTE_F(adr, res)
34189 POST_IO
34190RET(18)
34191}
34192
34193// ABCD7M7
34194OPCODE(0xCF0F)
34195{
34196 u32 adr, res;
34197 u32 src, dst;
34198
34199 adr = AREG(7) - 2;
34200 AREG(7) = adr;
34201 PRE_IO
34202 READ_BYTE_F(adr, src)
34203 adr = AREG(7) - 2;
34204 AREG(7) = adr;
34205 READ_BYTE_F(adr, dst)
34206 res = (dst & 0xF) + (src & 0xF) + ((flag_X >> M68K_SR_X_SFT) & 1);
34207 if (res > 9) res += 6;
34208 res += (dst & 0xF0) + (src & 0xF0);
34209 if (res > 0x99)
34210 {
34211 res -= 0xA0;
34212 flag_X = flag_C = M68K_SR_C;
34213 }
34214 else flag_X = flag_C = 0;
34215 flag_NotZ |= res & 0xFF;
34216 flag_N = res;
34217 WRITE_BYTE_F(adr, res)
34218 POST_IO
34219RET(18)
34220}
34221
34222// MULU
34223OPCODE(0xC0C0)
34224{
34225 u32 adr, res;
34226 u32 src, dst;
34227
34228 src = DREGu16((Opcode >> 0) & 7);
34229 res = DREGu16((Opcode >> 9) & 7);
34230 res *= src;
34231 flag_N = res >> 24;
34232 flag_NotZ = res;
34233 flag_V = flag_C = 0;
34234 DREGu32((Opcode >> 9) & 7) = res;
34235#ifdef USE_CYCLONE_TIMING
34236RET(54)
34237#else
34238RET(50)
34239#endif
34240}
34241
34242// MULU
34243OPCODE(0xC0D0)
34244{
34245 u32 adr, res;
34246 u32 src, dst;
34247
34248 adr = AREG((Opcode >> 0) & 7);
34249 PRE_IO
34250 READ_WORD_F(adr, src)
34251 res = DREGu16((Opcode >> 9) & 7);
34252 res *= src;
34253 flag_N = res >> 24;
34254 flag_NotZ = res;
34255 flag_V = flag_C = 0;
34256 DREGu32((Opcode >> 9) & 7) = res;
34257 POST_IO
34258#ifdef USE_CYCLONE_TIMING
34259RET(58)
34260#else
34261RET(54)
34262#endif
34263}
34264
34265// MULU
34266OPCODE(0xC0D8)
34267{
34268 u32 adr, res;
34269 u32 src, dst;
34270
34271 adr = AREG((Opcode >> 0) & 7);
34272 AREG((Opcode >> 0) & 7) += 2;
34273 PRE_IO
34274 READ_WORD_F(adr, src)
34275 res = DREGu16((Opcode >> 9) & 7);
34276 res *= src;
34277 flag_N = res >> 24;
34278 flag_NotZ = res;
34279 flag_V = flag_C = 0;
34280 DREGu32((Opcode >> 9) & 7) = res;
34281 POST_IO
34282#ifdef USE_CYCLONE_TIMING
34283RET(58)
34284#else
34285RET(54)
34286#endif
34287}
34288
34289// MULU
34290OPCODE(0xC0E0)
34291{
34292 u32 adr, res;
34293 u32 src, dst;
34294
34295 adr = AREG((Opcode >> 0) & 7) - 2;
34296 AREG((Opcode >> 0) & 7) = adr;
34297 PRE_IO
34298 READ_WORD_F(adr, src)
34299 res = DREGu16((Opcode >> 9) & 7);
34300 res *= src;
34301 flag_N = res >> 24;
34302 flag_NotZ = res;
34303 flag_V = flag_C = 0;
34304 DREGu32((Opcode >> 9) & 7) = res;
34305 POST_IO
34306#ifdef USE_CYCLONE_TIMING
34307RET(60)
34308#else
34309RET(56)
34310#endif
34311}
34312
34313// MULU
34314OPCODE(0xC0E8)
34315{
34316 u32 adr, res;
34317 u32 src, dst;
34318
34319 FETCH_SWORD(adr);
34320 adr += AREG((Opcode >> 0) & 7);
34321 PRE_IO
34322 READ_WORD_F(adr, src)
34323 res = DREGu16((Opcode >> 9) & 7);
34324 res *= src;
34325 flag_N = res >> 24;
34326 flag_NotZ = res;
34327 flag_V = flag_C = 0;
34328 DREGu32((Opcode >> 9) & 7) = res;
34329 POST_IO
34330#ifdef USE_CYCLONE_TIMING
34331RET(62)
34332#else
34333RET(58)
34334#endif
34335}
34336
34337// MULU
34338OPCODE(0xC0F0)
34339{
34340 u32 adr, res;
34341 u32 src, dst;
34342
34343 adr = AREG((Opcode >> 0) & 7);
34344 DECODE_EXT_WORD
34345 PRE_IO
34346 READ_WORD_F(adr, src)
34347 res = DREGu16((Opcode >> 9) & 7);
34348 res *= src;
34349 flag_N = res >> 24;
34350 flag_NotZ = res;
34351 flag_V = flag_C = 0;
34352 DREGu32((Opcode >> 9) & 7) = res;
34353 POST_IO
34354#ifdef USE_CYCLONE_TIMING
34355RET(64)
34356#else
34357RET(60)
34358#endif
34359}
34360
34361// MULU
34362OPCODE(0xC0F8)
34363{
34364 u32 adr, res;
34365 u32 src, dst;
34366
34367 FETCH_SWORD(adr);
34368 PRE_IO
34369 READ_WORD_F(adr, src)
34370 res = DREGu16((Opcode >> 9) & 7);
34371 res *= src;
34372 flag_N = res >> 24;
34373 flag_NotZ = res;
34374 flag_V = flag_C = 0;
34375 DREGu32((Opcode >> 9) & 7) = res;
34376 POST_IO
34377#ifdef USE_CYCLONE_TIMING
34378RET(62)
34379#else
34380RET(58)
34381#endif
34382}
34383
34384// MULU
34385OPCODE(0xC0F9)
34386{
34387 u32 adr, res;
34388 u32 src, dst;
34389
34390 FETCH_LONG(adr);
34391 PRE_IO
34392 READ_WORD_F(adr, src)
34393 res = DREGu16((Opcode >> 9) & 7);
34394 res *= src;
34395 flag_N = res >> 24;
34396 flag_NotZ = res;
34397 flag_V = flag_C = 0;
34398 DREGu32((Opcode >> 9) & 7) = res;
34399 POST_IO
34400#ifdef USE_CYCLONE_TIMING
34401RET(66)
34402#else
34403RET(62)
34404#endif
34405}
34406
34407// MULU
34408OPCODE(0xC0FA)
34409{
34410 u32 adr, res;
34411 u32 src, dst;
34412
be26eb23 34413 adr = GET_SWORD + GET_PC;
70357ce5 34414 PC++;
34415 PRE_IO
34416 READ_WORD_F(adr, src)
34417 res = DREGu16((Opcode >> 9) & 7);
34418 res *= src;
34419 flag_N = res >> 24;
34420 flag_NotZ = res;
34421 flag_V = flag_C = 0;
34422 DREGu32((Opcode >> 9) & 7) = res;
34423 POST_IO
34424#ifdef USE_CYCLONE_TIMING
34425RET(62)
34426#else
34427RET(58)
34428#endif
34429}
34430
34431// MULU
34432OPCODE(0xC0FB)
34433{
34434 u32 adr, res;
34435 u32 src, dst;
34436
be26eb23 34437 adr = GET_PC;
70357ce5 34438 DECODE_EXT_WORD
34439 PRE_IO
34440 READ_WORD_F(adr, src)
34441 res = DREGu16((Opcode >> 9) & 7);
34442 res *= src;
34443 flag_N = res >> 24;
34444 flag_NotZ = res;
34445 flag_V = flag_C = 0;
34446 DREGu32((Opcode >> 9) & 7) = res;
34447 POST_IO
34448#ifdef USE_CYCLONE_TIMING
34449RET(64)
34450#else
34451RET(60)
34452#endif
34453}
34454
34455// MULU
34456OPCODE(0xC0FC)
34457{
34458 u32 adr, res;
34459 u32 src, dst;
34460
34461 FETCH_WORD(src);
34462 res = DREGu16((Opcode >> 9) & 7);
34463 res *= src;
34464 flag_N = res >> 24;
34465 flag_NotZ = res;
34466 flag_V = flag_C = 0;
34467 DREGu32((Opcode >> 9) & 7) = res;
34468#ifdef USE_CYCLONE_TIMING
34469RET(58)
34470#else
34471RET(54)
34472#endif
34473}
34474
34475// MULU
34476OPCODE(0xC0DF)
34477{
34478 u32 adr, res;
34479 u32 src, dst;
34480
34481 adr = AREG(7);
34482 AREG(7) += 2;
34483 PRE_IO
34484 READ_WORD_F(adr, src)
34485 res = DREGu16((Opcode >> 9) & 7);
34486 res *= src;
34487 flag_N = res >> 24;
34488 flag_NotZ = res;
34489 flag_V = flag_C = 0;
34490 DREGu32((Opcode >> 9) & 7) = res;
34491 POST_IO
34492#ifdef USE_CYCLONE_TIMING
34493RET(58)
34494#else
34495RET(54)
34496#endif
34497}
34498
34499// MULU
34500OPCODE(0xC0E7)
34501{
34502 u32 adr, res;
34503 u32 src, dst;
34504
34505 adr = AREG(7) - 2;
34506 AREG(7) = adr;
34507 PRE_IO
34508 READ_WORD_F(adr, src)
34509 res = DREGu16((Opcode >> 9) & 7);
34510 res *= src;
34511 flag_N = res >> 24;
34512 flag_NotZ = res;
34513 flag_V = flag_C = 0;
34514 DREGu32((Opcode >> 9) & 7) = res;
34515 POST_IO
34516#ifdef USE_CYCLONE_TIMING
34517RET(60)
34518#else
34519RET(56)
34520#endif
34521}
34522
34523// MULS
34524OPCODE(0xC1C0)
34525{
34526 u32 adr, res;
34527 u32 src, dst;
34528
34529 src = (s32)DREGs16((Opcode >> 0) & 7);
34530 res = (s32)DREGs16((Opcode >> 9) & 7);
34531 res = ((s32)res) * ((s32)src);
34532 flag_N = res >> 24;
34533 flag_NotZ = res;
34534 flag_V = flag_C = 0;
34535 DREGu32((Opcode >> 9) & 7) = res;
34536#ifdef USE_CYCLONE_TIMING
34537RET(54)
34538#else
34539RET(50)
34540#endif
34541}
34542
34543// MULS
34544OPCODE(0xC1D0)
34545{
34546 u32 adr, res;
34547 u32 src, dst;
34548
34549 adr = AREG((Opcode >> 0) & 7);
34550 PRE_IO
34551 READSX_WORD_F(adr, src)
34552 res = (s32)DREGs16((Opcode >> 9) & 7);
34553 res = ((s32)res) * ((s32)src);
34554 flag_N = res >> 24;
34555 flag_NotZ = res;
34556 flag_V = flag_C = 0;
34557 DREGu32((Opcode >> 9) & 7) = res;
34558 POST_IO
34559#ifdef USE_CYCLONE_TIMING
34560RET(58)
34561#else
34562RET(54)
34563#endif
34564}
34565
34566// MULS
34567OPCODE(0xC1D8)
34568{
34569 u32 adr, res;
34570 u32 src, dst;
34571
34572 adr = AREG((Opcode >> 0) & 7);
34573 AREG((Opcode >> 0) & 7) += 2;
34574 PRE_IO
34575 READSX_WORD_F(adr, src)
34576 res = (s32)DREGs16((Opcode >> 9) & 7);
34577 res = ((s32)res) * ((s32)src);
34578 flag_N = res >> 24;
34579 flag_NotZ = res;
34580 flag_V = flag_C = 0;
34581 DREGu32((Opcode >> 9) & 7) = res;
34582 POST_IO
34583#ifdef USE_CYCLONE_TIMING
34584RET(58)
34585#else
34586RET(54)
34587#endif
34588}
34589
34590// MULS
34591OPCODE(0xC1E0)
34592{
34593 u32 adr, res;
34594 u32 src, dst;
34595
34596 adr = AREG((Opcode >> 0) & 7) - 2;
34597 AREG((Opcode >> 0) & 7) = adr;
34598 PRE_IO
34599 READSX_WORD_F(adr, src)
34600 res = (s32)DREGs16((Opcode >> 9) & 7);
34601 res = ((s32)res) * ((s32)src);
34602 flag_N = res >> 24;
34603 flag_NotZ = res;
34604 flag_V = flag_C = 0;
34605 DREGu32((Opcode >> 9) & 7) = res;
34606 POST_IO
34607#ifdef USE_CYCLONE_TIMING
34608RET(60)
34609#else
34610RET(56)
34611#endif
34612}
34613
34614// MULS
34615OPCODE(0xC1E8)
34616{
34617 u32 adr, res;
34618 u32 src, dst;
34619
34620 FETCH_SWORD(adr);
34621 adr += AREG((Opcode >> 0) & 7);
34622 PRE_IO
34623 READSX_WORD_F(adr, src)
34624 res = (s32)DREGs16((Opcode >> 9) & 7);
34625 res = ((s32)res) * ((s32)src);
34626 flag_N = res >> 24;
34627 flag_NotZ = res;
34628 flag_V = flag_C = 0;
34629 DREGu32((Opcode >> 9) & 7) = res;
34630 POST_IO
34631#ifdef USE_CYCLONE_TIMING
34632RET(62)
34633#else
34634RET(58)
34635#endif
34636}
34637
34638// MULS
34639OPCODE(0xC1F0)
34640{
34641 u32 adr, res;
34642 u32 src, dst;
34643
34644 adr = AREG((Opcode >> 0) & 7);
34645 DECODE_EXT_WORD
34646 PRE_IO
34647 READSX_WORD_F(adr, src)
34648 res = (s32)DREGs16((Opcode >> 9) & 7);
34649 res = ((s32)res) * ((s32)src);
34650 flag_N = res >> 24;
34651 flag_NotZ = res;
34652 flag_V = flag_C = 0;
34653 DREGu32((Opcode >> 9) & 7) = res;
34654 POST_IO
34655#ifdef USE_CYCLONE_TIMING
34656RET(64)
34657#else
34658RET(60)
34659#endif
34660}
34661
34662// MULS
34663OPCODE(0xC1F8)
34664{
34665 u32 adr, res;
34666 u32 src, dst;
34667
34668 FETCH_SWORD(adr);
34669 PRE_IO
34670 READSX_WORD_F(adr, src)
34671 res = (s32)DREGs16((Opcode >> 9) & 7);
34672 res = ((s32)res) * ((s32)src);
34673 flag_N = res >> 24;
34674 flag_NotZ = res;
34675 flag_V = flag_C = 0;
34676 DREGu32((Opcode >> 9) & 7) = res;
34677 POST_IO
34678#ifdef USE_CYCLONE_TIMING
34679RET(62)
34680#else
34681RET(58)
34682#endif
34683}
34684
34685// MULS
34686OPCODE(0xC1F9)
34687{
34688 u32 adr, res;
34689 u32 src, dst;
34690
34691 FETCH_LONG(adr);
34692 PRE_IO
34693 READSX_WORD_F(adr, src)
34694 res = (s32)DREGs16((Opcode >> 9) & 7);
34695 res = ((s32)res) * ((s32)src);
34696 flag_N = res >> 24;
34697 flag_NotZ = res;
34698 flag_V = flag_C = 0;
34699 DREGu32((Opcode >> 9) & 7) = res;
34700 POST_IO
34701#ifdef USE_CYCLONE_TIMING
34702RET(66)
34703#else
34704RET(62)
34705#endif
34706}
34707
34708// MULS
34709OPCODE(0xC1FA)
34710{
34711 u32 adr, res;
34712 u32 src, dst;
34713
be26eb23 34714 adr = GET_SWORD + GET_PC;
70357ce5 34715 PC++;
34716 PRE_IO
34717 READSX_WORD_F(adr, src)
34718 res = (s32)DREGs16((Opcode >> 9) & 7);
34719 res = ((s32)res) * ((s32)src);
34720 flag_N = res >> 24;
34721 flag_NotZ = res;
34722 flag_V = flag_C = 0;
34723 DREGu32((Opcode >> 9) & 7) = res;
34724 POST_IO
34725#ifdef USE_CYCLONE_TIMING
34726RET(62)
34727#else
34728RET(58)
34729#endif
34730}
34731
34732// MULS
34733OPCODE(0xC1FB)
34734{
34735 u32 adr, res;
34736 u32 src, dst;
34737
be26eb23 34738 adr = GET_PC;
70357ce5 34739 DECODE_EXT_WORD
34740 PRE_IO
34741 READSX_WORD_F(adr, src)
34742 res = (s32)DREGs16((Opcode >> 9) & 7);
34743 res = ((s32)res) * ((s32)src);
34744 flag_N = res >> 24;
34745 flag_NotZ = res;
34746 flag_V = flag_C = 0;
34747 DREGu32((Opcode >> 9) & 7) = res;
34748 POST_IO
34749#ifdef USE_CYCLONE_TIMING
34750RET(64)
34751#else
34752RET(60)
34753#endif
34754}
34755
34756// MULS
34757OPCODE(0xC1FC)
34758{
34759 u32 adr, res;
34760 u32 src, dst;
34761
34762 FETCH_SWORD(src);
34763 res = (s32)DREGs16((Opcode >> 9) & 7);
34764 res = ((s32)res) * ((s32)src);
34765 flag_N = res >> 24;
34766 flag_NotZ = res;
34767 flag_V = flag_C = 0;
34768 DREGu32((Opcode >> 9) & 7) = res;
34769#ifdef USE_CYCLONE_TIMING
34770RET(58)
34771#else
34772RET(54)
34773#endif
34774}
34775
34776// MULS
34777OPCODE(0xC1DF)
34778{
34779 u32 adr, res;
34780 u32 src, dst;
34781
34782 adr = AREG(7);
34783 AREG(7) += 2;
34784 PRE_IO
34785 READSX_WORD_F(adr, src)
34786 res = (s32)DREGs16((Opcode >> 9) & 7);
34787 res = ((s32)res) * ((s32)src);
34788 flag_N = res >> 24;
34789 flag_NotZ = res;
34790 flag_V = flag_C = 0;
34791 DREGu32((Opcode >> 9) & 7) = res;
34792 POST_IO
34793#ifdef USE_CYCLONE_TIMING
34794RET(58)
34795#else
34796RET(54)
34797#endif
34798}
34799
34800// MULS
34801OPCODE(0xC1E7)
34802{
34803 u32 adr, res;
34804 u32 src, dst;
34805
34806 adr = AREG(7) - 2;
34807 AREG(7) = adr;
34808 PRE_IO
34809 READSX_WORD_F(adr, src)
34810 res = (s32)DREGs16((Opcode >> 9) & 7);
34811 res = ((s32)res) * ((s32)src);
34812 flag_N = res >> 24;
34813 flag_NotZ = res;
34814 flag_V = flag_C = 0;
34815 DREGu32((Opcode >> 9) & 7) = res;
34816 POST_IO
34817#ifdef USE_CYCLONE_TIMING
34818RET(60)
34819#else
34820RET(56)
34821#endif
34822}
34823
34824// EXGDD
34825OPCODE(0xC140)
34826{
34827 u32 adr, res;
34828 u32 src, dst;
34829
34830 res = DREGu32((Opcode >> 0) & 7);
34831 src = DREGu32((Opcode >> 9) & 7);
34832 DREGu32((Opcode >> 9) & 7) = res;
34833 res = src;
34834 DREGu32((Opcode >> 0) & 7) = res;
34835RET(6)
34836}
34837
34838// EXGAA
34839OPCODE(0xC148)
34840{
34841 u32 adr, res;
34842 u32 src, dst;
34843
34844 res = AREGu32((Opcode >> 0) & 7);
34845 src = AREGu32((Opcode >> 9) & 7);
34846 AREG((Opcode >> 9) & 7) = res;
34847 res = src;
34848 AREG((Opcode >> 0) & 7) = res;
34849RET(6)
34850}
34851
34852// EXGAD
34853OPCODE(0xC188)
34854{
34855 u32 adr, res;
34856 u32 src, dst;
34857
34858 res = AREGu32((Opcode >> 0) & 7);
34859 src = DREGu32((Opcode >> 9) & 7);
34860 DREGu32((Opcode >> 9) & 7) = res;
34861 res = src;
34862 AREG((Opcode >> 0) & 7) = res;
34863RET(6)
34864}
34865
34866// ADDaD
34867OPCODE(0xD000)
34868{
34869 u32 adr, res;
34870 u32 src, dst;
34871
34872 src = DREGu8((Opcode >> 0) & 7);
34873 dst = DREGu8((Opcode >> 9) & 7);
34874 res = dst + src;
34875 flag_N = flag_X = flag_C = res;
34876 flag_V = (src ^ res) & (dst ^ res);
34877 flag_NotZ = res & 0xFF;
34878 DREGu8((Opcode >> 9) & 7) = res;
34879RET(4)
34880}
34881
34882// ADDaD
03e4f2a3 34883#if 0
70357ce5 34884OPCODE(0xD008)
34885{
34886 u32 adr, res;
34887 u32 src, dst;
34888
34889 // can't read byte from Ax registers !
34890 m68kcontext.execinfo |= M68K_FAULTED;
34891 m68kcontext.io_cycle_counter = 0;
34892/*
34893 goto famec_Exec_End;
34894 dst = DREGu8((Opcode >> 9) & 7);
34895 res = dst + src;
34896 flag_N = flag_X = flag_C = res;
34897 flag_V = (src ^ res) & (dst ^ res);
34898 flag_NotZ = res & 0xFF;
34899 DREGu8((Opcode >> 9) & 7) = res;
34900*/
34901RET(4)
34902}
03e4f2a3 34903#endif
70357ce5 34904
34905// ADDaD
34906OPCODE(0xD010)
34907{
34908 u32 adr, res;
34909 u32 src, dst;
34910
34911 adr = AREG((Opcode >> 0) & 7);
34912 PRE_IO
34913 READ_BYTE_F(adr, src)
34914 dst = DREGu8((Opcode >> 9) & 7);
34915 res = dst + src;
34916 flag_N = flag_X = flag_C = res;
34917 flag_V = (src ^ res) & (dst ^ res);
34918 flag_NotZ = res & 0xFF;
34919 DREGu8((Opcode >> 9) & 7) = res;
34920 POST_IO
34921RET(8)
34922}
34923
34924// ADDaD
34925OPCODE(0xD018)
34926{
34927 u32 adr, res;
34928 u32 src, dst;
34929
34930 adr = AREG((Opcode >> 0) & 7);
34931 AREG((Opcode >> 0) & 7) += 1;
34932 PRE_IO
34933 READ_BYTE_F(adr, src)
34934 dst = DREGu8((Opcode >> 9) & 7);
34935 res = dst + src;
34936 flag_N = flag_X = flag_C = res;
34937 flag_V = (src ^ res) & (dst ^ res);
34938 flag_NotZ = res & 0xFF;
34939 DREGu8((Opcode >> 9) & 7) = res;
34940 POST_IO
34941RET(8)
34942}
34943
34944// ADDaD
34945OPCODE(0xD020)
34946{
34947 u32 adr, res;
34948 u32 src, dst;
34949
34950 adr = AREG((Opcode >> 0) & 7) - 1;
34951 AREG((Opcode >> 0) & 7) = adr;
34952 PRE_IO
34953 READ_BYTE_F(adr, src)
34954 dst = DREGu8((Opcode >> 9) & 7);
34955 res = dst + src;
34956 flag_N = flag_X = flag_C = res;
34957 flag_V = (src ^ res) & (dst ^ res);
34958 flag_NotZ = res & 0xFF;
34959 DREGu8((Opcode >> 9) & 7) = res;
34960 POST_IO
34961RET(10)
34962}
34963
34964// ADDaD
34965OPCODE(0xD028)
34966{
34967 u32 adr, res;
34968 u32 src, dst;
34969
34970 FETCH_SWORD(adr);
34971 adr += AREG((Opcode >> 0) & 7);
34972 PRE_IO
34973 READ_BYTE_F(adr, src)
34974 dst = DREGu8((Opcode >> 9) & 7);
34975 res = dst + src;
34976 flag_N = flag_X = flag_C = res;
34977 flag_V = (src ^ res) & (dst ^ res);
34978 flag_NotZ = res & 0xFF;
34979 DREGu8((Opcode >> 9) & 7) = res;
34980 POST_IO
34981RET(12)
34982}
34983
34984// ADDaD
34985OPCODE(0xD030)
34986{
34987 u32 adr, res;
34988 u32 src, dst;
34989
34990 adr = AREG((Opcode >> 0) & 7);
34991 DECODE_EXT_WORD
34992 PRE_IO
34993 READ_BYTE_F(adr, src)
34994 dst = DREGu8((Opcode >> 9) & 7);
34995 res = dst + src;
34996 flag_N = flag_X = flag_C = res;
34997 flag_V = (src ^ res) & (dst ^ res);
34998 flag_NotZ = res & 0xFF;
34999 DREGu8((Opcode >> 9) & 7) = res;
35000 POST_IO
35001RET(14)
35002}
35003
35004// ADDaD
35005OPCODE(0xD038)
35006{
35007 u32 adr, res;
35008 u32 src, dst;
35009
35010 FETCH_SWORD(adr);
35011 PRE_IO
35012 READ_BYTE_F(adr, src)
35013 dst = DREGu8((Opcode >> 9) & 7);
35014 res = dst + src;
35015 flag_N = flag_X = flag_C = res;
35016 flag_V = (src ^ res) & (dst ^ res);
35017 flag_NotZ = res & 0xFF;
35018 DREGu8((Opcode >> 9) & 7) = res;
35019 POST_IO
35020RET(12)
35021}
35022
35023// ADDaD
35024OPCODE(0xD039)
35025{
35026 u32 adr, res;
35027 u32 src, dst;
35028
35029 FETCH_LONG(adr);
35030 PRE_IO
35031 READ_BYTE_F(adr, src)
35032 dst = DREGu8((Opcode >> 9) & 7);
35033 res = dst + src;
35034 flag_N = flag_X = flag_C = res;
35035 flag_V = (src ^ res) & (dst ^ res);
35036 flag_NotZ = res & 0xFF;
35037 DREGu8((Opcode >> 9) & 7) = res;
35038 POST_IO
35039RET(16)
35040}
35041
35042// ADDaD
35043OPCODE(0xD03A)
35044{
35045 u32 adr, res;
35046 u32 src, dst;
35047
be26eb23 35048 adr = GET_SWORD + GET_PC;
70357ce5 35049 PC++;
35050 PRE_IO
35051 READ_BYTE_F(adr, src)
35052 dst = DREGu8((Opcode >> 9) & 7);
35053 res = dst + src;
35054 flag_N = flag_X = flag_C = res;
35055 flag_V = (src ^ res) & (dst ^ res);
35056 flag_NotZ = res & 0xFF;
35057 DREGu8((Opcode >> 9) & 7) = res;
35058 POST_IO
35059RET(12)
35060}
35061
35062// ADDaD
35063OPCODE(0xD03B)
35064{
35065 u32 adr, res;
35066 u32 src, dst;
35067
be26eb23 35068 adr = GET_PC;
70357ce5 35069 DECODE_EXT_WORD
35070 PRE_IO
35071 READ_BYTE_F(adr, src)
35072 dst = DREGu8((Opcode >> 9) & 7);
35073 res = dst + src;
35074 flag_N = flag_X = flag_C = res;
35075 flag_V = (src ^ res) & (dst ^ res);
35076 flag_NotZ = res & 0xFF;
35077 DREGu8((Opcode >> 9) & 7) = res;
35078 POST_IO
35079RET(14)
35080}
35081
35082// ADDaD
35083OPCODE(0xD03C)
35084{
35085 u32 adr, res;
35086 u32 src, dst;
35087
35088 FETCH_BYTE(src);
35089 dst = DREGu8((Opcode >> 9) & 7);
35090 res = dst + src;
35091 flag_N = flag_X = flag_C = res;
35092 flag_V = (src ^ res) & (dst ^ res);
35093 flag_NotZ = res & 0xFF;
35094 DREGu8((Opcode >> 9) & 7) = res;
35095RET(8)
35096}
35097
35098// ADDaD
35099OPCODE(0xD01F)
35100{
35101 u32 adr, res;
35102 u32 src, dst;
35103
35104 adr = AREG(7);
35105 AREG(7) += 2;
35106 PRE_IO
35107 READ_BYTE_F(adr, src)
35108 dst = DREGu8((Opcode >> 9) & 7);
35109 res = dst + src;
35110 flag_N = flag_X = flag_C = res;
35111 flag_V = (src ^ res) & (dst ^ res);
35112 flag_NotZ = res & 0xFF;
35113 DREGu8((Opcode >> 9) & 7) = res;
35114 POST_IO
35115RET(8)
35116}
35117
35118// ADDaD
35119OPCODE(0xD027)
35120{
35121 u32 adr, res;
35122 u32 src, dst;
35123
35124 adr = AREG(7) - 2;
35125 AREG(7) = adr;
35126 PRE_IO
35127 READ_BYTE_F(adr, src)
35128 dst = DREGu8((Opcode >> 9) & 7);
35129 res = dst + src;
35130 flag_N = flag_X = flag_C = res;
35131 flag_V = (src ^ res) & (dst ^ res);
35132 flag_NotZ = res & 0xFF;
35133 DREGu8((Opcode >> 9) & 7) = res;
35134 POST_IO
35135RET(10)
35136}
35137
35138// ADDaD
35139OPCODE(0xD040)
35140{
35141 u32 adr, res;
35142 u32 src, dst;
35143
35144 src = DREGu16((Opcode >> 0) & 7);
35145 dst = DREGu16((Opcode >> 9) & 7);
35146 res = dst + src;
35147 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
35148 flag_N = flag_X = flag_C = res >> 8;
35149 flag_NotZ = res & 0xFFFF;
35150 DREGu16((Opcode >> 9) & 7) = res;
35151RET(4)
35152}
35153
35154// ADDaD
35155OPCODE(0xD048)
35156{
35157 u32 adr, res;
35158 u32 src, dst;
35159
35160 src = AREGu16((Opcode >> 0) & 7);
35161 dst = DREGu16((Opcode >> 9) & 7);
35162 res = dst + src;
35163 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
35164 flag_N = flag_X = flag_C = res >> 8;
35165 flag_NotZ = res & 0xFFFF;
35166 DREGu16((Opcode >> 9) & 7) = res;
35167RET(4)
35168}
35169
35170// ADDaD
35171OPCODE(0xD050)
35172{
35173 u32 adr, res;
35174 u32 src, dst;
35175
35176 adr = AREG((Opcode >> 0) & 7);
35177 PRE_IO
35178 READ_WORD_F(adr, src)
35179 dst = DREGu16((Opcode >> 9) & 7);
35180 res = dst + src;
35181 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
35182 flag_N = flag_X = flag_C = res >> 8;
35183 flag_NotZ = res & 0xFFFF;
35184 DREGu16((Opcode >> 9) & 7) = res;
35185 POST_IO
35186RET(8)
35187}
35188
35189// ADDaD
35190OPCODE(0xD058)
35191{
35192 u32 adr, res;
35193 u32 src, dst;
35194
35195 adr = AREG((Opcode >> 0) & 7);
35196 AREG((Opcode >> 0) & 7) += 2;
35197 PRE_IO
35198 READ_WORD_F(adr, src)
35199 dst = DREGu16((Opcode >> 9) & 7);
35200 res = dst + src;
35201 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
35202 flag_N = flag_X = flag_C = res >> 8;
35203 flag_NotZ = res & 0xFFFF;
35204 DREGu16((Opcode >> 9) & 7) = res;
35205 POST_IO
35206RET(8)
35207}
35208
35209// ADDaD
35210OPCODE(0xD060)
35211{
35212 u32 adr, res;
35213 u32 src, dst;
35214
35215 adr = AREG((Opcode >> 0) & 7) - 2;
35216 AREG((Opcode >> 0) & 7) = adr;
35217 PRE_IO
35218 READ_WORD_F(adr, src)
35219 dst = DREGu16((Opcode >> 9) & 7);
35220 res = dst + src;
35221 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
35222 flag_N = flag_X = flag_C = res >> 8;
35223 flag_NotZ = res & 0xFFFF;
35224 DREGu16((Opcode >> 9) & 7) = res;
35225 POST_IO
35226RET(10)
35227}
35228
35229// ADDaD
35230OPCODE(0xD068)
35231{
35232 u32 adr, res;
35233 u32 src, dst;
35234
35235 FETCH_SWORD(adr);
35236 adr += AREG((Opcode >> 0) & 7);
35237 PRE_IO
35238 READ_WORD_F(adr, src)
35239 dst = DREGu16((Opcode >> 9) & 7);
35240 res = dst + src;
35241 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
35242 flag_N = flag_X = flag_C = res >> 8;
35243 flag_NotZ = res & 0xFFFF;
35244 DREGu16((Opcode >> 9) & 7) = res;
35245 POST_IO
35246RET(12)
35247}
35248
35249// ADDaD
35250OPCODE(0xD070)
35251{
35252 u32 adr, res;
35253 u32 src, dst;
35254
35255 adr = AREG((Opcode >> 0) & 7);
35256 DECODE_EXT_WORD
35257 PRE_IO
35258 READ_WORD_F(adr, src)
35259 dst = DREGu16((Opcode >> 9) & 7);
35260 res = dst + src;
35261 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
35262 flag_N = flag_X = flag_C = res >> 8;
35263 flag_NotZ = res & 0xFFFF;
35264 DREGu16((Opcode >> 9) & 7) = res;
35265 POST_IO
35266RET(14)
35267}
35268
35269// ADDaD
35270OPCODE(0xD078)
35271{
35272 u32 adr, res;
35273 u32 src, dst;
35274
35275 FETCH_SWORD(adr);
35276 PRE_IO
35277 READ_WORD_F(adr, src)
35278 dst = DREGu16((Opcode >> 9) & 7);
35279 res = dst + src;
35280 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
35281 flag_N = flag_X = flag_C = res >> 8;
35282 flag_NotZ = res & 0xFFFF;
35283 DREGu16((Opcode >> 9) & 7) = res;
35284 POST_IO
35285RET(12)
35286}
35287
35288// ADDaD
35289OPCODE(0xD079)
35290{
35291 u32 adr, res;
35292 u32 src, dst;
35293
35294 FETCH_LONG(adr);
35295 PRE_IO
35296 READ_WORD_F(adr, src)
35297 dst = DREGu16((Opcode >> 9) & 7);
35298 res = dst + src;
35299 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
35300 flag_N = flag_X = flag_C = res >> 8;
35301 flag_NotZ = res & 0xFFFF;
35302 DREGu16((Opcode >> 9) & 7) = res;
35303 POST_IO
35304RET(16)
35305}
35306
35307// ADDaD
35308OPCODE(0xD07A)
35309{
35310 u32 adr, res;
35311 u32 src, dst;
35312
be26eb23 35313 adr = GET_SWORD + GET_PC;
70357ce5 35314 PC++;
35315 PRE_IO
35316 READ_WORD_F(adr, src)
35317 dst = DREGu16((Opcode >> 9) & 7);
35318 res = dst + src;
35319 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
35320 flag_N = flag_X = flag_C = res >> 8;
35321 flag_NotZ = res & 0xFFFF;
35322 DREGu16((Opcode >> 9) & 7) = res;
35323 POST_IO
35324RET(12)
35325}
35326
35327// ADDaD
35328OPCODE(0xD07B)
35329{
35330 u32 adr, res;
35331 u32 src, dst;
35332
be26eb23 35333 adr = GET_PC;
70357ce5 35334 DECODE_EXT_WORD
35335 PRE_IO
35336 READ_WORD_F(adr, src)
35337 dst = DREGu16((Opcode >> 9) & 7);
35338 res = dst + src;
35339 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
35340 flag_N = flag_X = flag_C = res >> 8;
35341 flag_NotZ = res & 0xFFFF;
35342 DREGu16((Opcode >> 9) & 7) = res;
35343 POST_IO
35344RET(14)
35345}
35346
35347// ADDaD
35348OPCODE(0xD07C)
35349{
35350 u32 adr, res;
35351 u32 src, dst;
35352
35353 FETCH_WORD(src);
35354 dst = DREGu16((Opcode >> 9) & 7);
35355 res = dst + src;
35356 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
35357 flag_N = flag_X = flag_C = res >> 8;
35358 flag_NotZ = res & 0xFFFF;
35359 DREGu16((Opcode >> 9) & 7) = res;
35360RET(8)
35361}
35362
35363// ADDaD
35364OPCODE(0xD05F)
35365{
35366 u32 adr, res;
35367 u32 src, dst;
35368
35369 adr = AREG(7);
35370 AREG(7) += 2;
35371 PRE_IO
35372 READ_WORD_F(adr, src)
35373 dst = DREGu16((Opcode >> 9) & 7);
35374 res = dst + src;
35375 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
35376 flag_N = flag_X = flag_C = res >> 8;
35377 flag_NotZ = res & 0xFFFF;
35378 DREGu16((Opcode >> 9) & 7) = res;
35379 POST_IO
35380RET(8)
35381}
35382
35383// ADDaD
35384OPCODE(0xD067)
35385{
35386 u32 adr, res;
35387 u32 src, dst;
35388
35389 adr = AREG(7) - 2;
35390 AREG(7) = adr;
35391 PRE_IO
35392 READ_WORD_F(adr, src)
35393 dst = DREGu16((Opcode >> 9) & 7);
35394 res = dst + src;
35395 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
35396 flag_N = flag_X = flag_C = res >> 8;
35397 flag_NotZ = res & 0xFFFF;
35398 DREGu16((Opcode >> 9) & 7) = res;
35399 POST_IO
35400RET(10)
35401}
35402
35403// ADDaD
35404OPCODE(0xD080)
35405{
35406 u32 adr, res;
35407 u32 src, dst;
35408
35409 src = DREGu32((Opcode >> 0) & 7);
35410 dst = DREGu32((Opcode >> 9) & 7);
35411 res = dst + src;
35412 flag_NotZ = res;
35413 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
35414 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
35415 flag_N = res >> 24;
35416 DREGu32((Opcode >> 9) & 7) = res;
35417RET(8)
35418}
35419
35420// ADDaD
35421OPCODE(0xD088)
35422{
35423 u32 adr, res;
35424 u32 src, dst;
35425
35426 src = AREGu32((Opcode >> 0) & 7);
35427 dst = DREGu32((Opcode >> 9) & 7);
35428 res = dst + src;
35429 flag_NotZ = res;
35430 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
35431 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
35432 flag_N = res >> 24;
35433 DREGu32((Opcode >> 9) & 7) = res;
35434RET(8)
35435}
35436
35437// ADDaD
35438OPCODE(0xD090)
35439{
35440 u32 adr, res;
35441 u32 src, dst;
35442
35443 adr = AREG((Opcode >> 0) & 7);
35444 PRE_IO
35445 READ_LONG_F(adr, src)
35446 dst = DREGu32((Opcode >> 9) & 7);
35447 res = dst + src;
35448 flag_NotZ = res;
35449 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
35450 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
35451 flag_N = res >> 24;
35452 DREGu32((Opcode >> 9) & 7) = res;
35453 POST_IO
35454RET(14)
35455}
35456
35457// ADDaD
35458OPCODE(0xD098)
35459{
35460 u32 adr, res;
35461 u32 src, dst;
35462
35463 adr = AREG((Opcode >> 0) & 7);
35464 AREG((Opcode >> 0) & 7) += 4;
35465 PRE_IO
35466 READ_LONG_F(adr, src)
35467 dst = DREGu32((Opcode >> 9) & 7);
35468 res = dst + src;
35469 flag_NotZ = res;
35470 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
35471 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
35472 flag_N = res >> 24;
35473 DREGu32((Opcode >> 9) & 7) = res;
35474 POST_IO
35475RET(14)
35476}
35477
35478// ADDaD
35479OPCODE(0xD0A0)
35480{
35481 u32 adr, res;
35482 u32 src, dst;
35483
35484 adr = AREG((Opcode >> 0) & 7) - 4;
35485 AREG((Opcode >> 0) & 7) = adr;
35486 PRE_IO
35487 READ_LONG_F(adr, src)
35488 dst = DREGu32((Opcode >> 9) & 7);
35489 res = dst + src;
35490 flag_NotZ = res;
35491 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
35492 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
35493 flag_N = res >> 24;
35494 DREGu32((Opcode >> 9) & 7) = res;
35495 POST_IO
35496RET(16)
35497}
35498
35499// ADDaD
35500OPCODE(0xD0A8)
35501{
35502 u32 adr, res;
35503 u32 src, dst;
35504
35505 FETCH_SWORD(adr);
35506 adr += AREG((Opcode >> 0) & 7);
35507 PRE_IO
35508 READ_LONG_F(adr, src)
35509 dst = DREGu32((Opcode >> 9) & 7);
35510 res = dst + src;
35511 flag_NotZ = res;
35512 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
35513 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
35514 flag_N = res >> 24;
35515 DREGu32((Opcode >> 9) & 7) = res;
35516 POST_IO
35517RET(18)
35518}
35519
35520// ADDaD
35521OPCODE(0xD0B0)
35522{
35523 u32 adr, res;
35524 u32 src, dst;
35525
35526 adr = AREG((Opcode >> 0) & 7);
35527 DECODE_EXT_WORD
35528 PRE_IO
35529 READ_LONG_F(adr, src)
35530 dst = DREGu32((Opcode >> 9) & 7);
35531 res = dst + src;
35532 flag_NotZ = res;
35533 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
35534 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
35535 flag_N = res >> 24;
35536 DREGu32((Opcode >> 9) & 7) = res;
35537 POST_IO
35538RET(20)
35539}
35540
35541// ADDaD
35542OPCODE(0xD0B8)
35543{
35544 u32 adr, res;
35545 u32 src, dst;
35546
35547 FETCH_SWORD(adr);
35548 PRE_IO
35549 READ_LONG_F(adr, src)
35550 dst = DREGu32((Opcode >> 9) & 7);
35551 res = dst + src;
35552 flag_NotZ = res;
35553 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
35554 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
35555 flag_N = res >> 24;
35556 DREGu32((Opcode >> 9) & 7) = res;
35557 POST_IO
35558RET(18)
35559}
35560
35561// ADDaD
35562OPCODE(0xD0B9)
35563{
35564 u32 adr, res;
35565 u32 src, dst;
35566
35567 FETCH_LONG(adr);
35568 PRE_IO
35569 READ_LONG_F(adr, src)
35570 dst = DREGu32((Opcode >> 9) & 7);
35571 res = dst + src;
35572 flag_NotZ = res;
35573 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
35574 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
35575 flag_N = res >> 24;
35576 DREGu32((Opcode >> 9) & 7) = res;
35577 POST_IO
35578RET(22)
35579}
35580
35581// ADDaD
35582OPCODE(0xD0BA)
35583{
35584 u32 adr, res;
35585 u32 src, dst;
35586
be26eb23 35587 adr = GET_SWORD + GET_PC;
70357ce5 35588 PC++;
35589 PRE_IO
35590 READ_LONG_F(adr, src)
35591 dst = DREGu32((Opcode >> 9) & 7);
35592 res = dst + src;
35593 flag_NotZ = res;
35594 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
35595 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
35596 flag_N = res >> 24;
35597 DREGu32((Opcode >> 9) & 7) = res;
35598 POST_IO
35599RET(18)
35600}
35601
35602// ADDaD
35603OPCODE(0xD0BB)
35604{
35605 u32 adr, res;
35606 u32 src, dst;
35607
be26eb23 35608 adr = GET_PC;
70357ce5 35609 DECODE_EXT_WORD
35610 PRE_IO
35611 READ_LONG_F(adr, src)
35612 dst = DREGu32((Opcode >> 9) & 7);
35613 res = dst + src;
35614 flag_NotZ = res;
35615 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
35616 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
35617 flag_N = res >> 24;
35618 DREGu32((Opcode >> 9) & 7) = res;
35619 POST_IO
35620RET(20)
35621}
35622
35623// ADDaD
35624OPCODE(0xD0BC)
35625{
35626 u32 adr, res;
35627 u32 src, dst;
35628
35629 FETCH_LONG(src);
35630 dst = DREGu32((Opcode >> 9) & 7);
35631 res = dst + src;
35632 flag_NotZ = res;
35633 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
35634 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
35635 flag_N = res >> 24;
35636 DREGu32((Opcode >> 9) & 7) = res;
35637RET(16)
35638}
35639
35640// ADDaD
35641OPCODE(0xD09F)
35642{
35643 u32 adr, res;
35644 u32 src, dst;
35645
35646 adr = AREG(7);
35647 AREG(7) += 4;
35648 PRE_IO
35649 READ_LONG_F(adr, src)
35650 dst = DREGu32((Opcode >> 9) & 7);
35651 res = dst + src;
35652 flag_NotZ = res;
35653 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
35654 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
35655 flag_N = res >> 24;
35656 DREGu32((Opcode >> 9) & 7) = res;
35657 POST_IO
35658RET(14)
35659}
35660
35661// ADDaD
35662OPCODE(0xD0A7)
35663{
35664 u32 adr, res;
35665 u32 src, dst;
35666
35667 adr = AREG(7) - 4;
35668 AREG(7) = adr;
35669 PRE_IO
35670 READ_LONG_F(adr, src)
35671 dst = DREGu32((Opcode >> 9) & 7);
35672 res = dst + src;
35673 flag_NotZ = res;
35674 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
35675 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
35676 flag_N = res >> 24;
35677 DREGu32((Opcode >> 9) & 7) = res;
35678 POST_IO
35679RET(16)
35680}
35681
35682// ADDDa
35683OPCODE(0xD110)
35684{
35685 u32 adr, res;
35686 u32 src, dst;
35687
35688 src = DREGu8((Opcode >> 9) & 7);
35689 adr = AREG((Opcode >> 0) & 7);
35690 PRE_IO
35691 READ_BYTE_F(adr, dst)
35692 res = dst + src;
35693 flag_N = flag_X = flag_C = res;
35694 flag_V = (src ^ res) & (dst ^ res);
35695 flag_NotZ = res & 0xFF;
35696 WRITE_BYTE_F(adr, res)
35697 POST_IO
35698RET(12)
35699}
35700
35701// ADDDa
35702OPCODE(0xD118)
35703{
35704 u32 adr, res;
35705 u32 src, dst;
35706
35707 src = DREGu8((Opcode >> 9) & 7);
35708 adr = AREG((Opcode >> 0) & 7);
35709 AREG((Opcode >> 0) & 7) += 1;
35710 PRE_IO
35711 READ_BYTE_F(adr, dst)
35712 res = dst + src;
35713 flag_N = flag_X = flag_C = res;
35714 flag_V = (src ^ res) & (dst ^ res);
35715 flag_NotZ = res & 0xFF;
35716 WRITE_BYTE_F(adr, res)
35717 POST_IO
35718RET(12)
35719}
35720
35721// ADDDa
35722OPCODE(0xD120)
35723{
35724 u32 adr, res;
35725 u32 src, dst;
35726
35727 src = DREGu8((Opcode >> 9) & 7);
35728 adr = AREG((Opcode >> 0) & 7) - 1;
35729 AREG((Opcode >> 0) & 7) = adr;
35730 PRE_IO
35731 READ_BYTE_F(adr, dst)
35732 res = dst + src;
35733 flag_N = flag_X = flag_C = res;
35734 flag_V = (src ^ res) & (dst ^ res);
35735 flag_NotZ = res & 0xFF;
35736 WRITE_BYTE_F(adr, res)
35737 POST_IO
35738RET(14)
35739}
35740
35741// ADDDa
35742OPCODE(0xD128)
35743{
35744 u32 adr, res;
35745 u32 src, dst;
35746
35747 src = DREGu8((Opcode >> 9) & 7);
35748 FETCH_SWORD(adr);
35749 adr += AREG((Opcode >> 0) & 7);
35750 PRE_IO
35751 READ_BYTE_F(adr, dst)
35752 res = dst + src;
35753 flag_N = flag_X = flag_C = res;
35754 flag_V = (src ^ res) & (dst ^ res);
35755 flag_NotZ = res & 0xFF;
35756 WRITE_BYTE_F(adr, res)
35757 POST_IO
35758RET(16)
35759}
35760
35761// ADDDa
35762OPCODE(0xD130)
35763{
35764 u32 adr, res;
35765 u32 src, dst;
35766
35767 src = DREGu8((Opcode >> 9) & 7);
35768 adr = AREG((Opcode >> 0) & 7);
35769 DECODE_EXT_WORD
35770 PRE_IO
35771 READ_BYTE_F(adr, dst)
35772 res = dst + src;
35773 flag_N = flag_X = flag_C = res;
35774 flag_V = (src ^ res) & (dst ^ res);
35775 flag_NotZ = res & 0xFF;
35776 WRITE_BYTE_F(adr, res)
35777 POST_IO
35778RET(18)
35779}
35780
35781// ADDDa
35782OPCODE(0xD138)
35783{
35784 u32 adr, res;
35785 u32 src, dst;
35786
35787 src = DREGu8((Opcode >> 9) & 7);
35788 FETCH_SWORD(adr);
35789 PRE_IO
35790 READ_BYTE_F(adr, dst)
35791 res = dst + src;
35792 flag_N = flag_X = flag_C = res;
35793 flag_V = (src ^ res) & (dst ^ res);
35794 flag_NotZ = res & 0xFF;
35795 WRITE_BYTE_F(adr, res)
35796 POST_IO
35797RET(16)
35798}
35799
35800// ADDDa
35801OPCODE(0xD139)
35802{
35803 u32 adr, res;
35804 u32 src, dst;
35805
35806 src = DREGu8((Opcode >> 9) & 7);
35807 FETCH_LONG(adr);
35808 PRE_IO
35809 READ_BYTE_F(adr, dst)
35810 res = dst + src;
35811 flag_N = flag_X = flag_C = res;
35812 flag_V = (src ^ res) & (dst ^ res);
35813 flag_NotZ = res & 0xFF;
35814 WRITE_BYTE_F(adr, res)
35815 POST_IO
35816RET(20)
35817}
35818
35819// ADDDa
35820OPCODE(0xD11F)
35821{
35822 u32 adr, res;
35823 u32 src, dst;
35824
35825 src = DREGu8((Opcode >> 9) & 7);
35826 adr = AREG(7);
35827 AREG(7) += 2;
35828 PRE_IO
35829 READ_BYTE_F(adr, dst)
35830 res = dst + src;
35831 flag_N = flag_X = flag_C = res;
35832 flag_V = (src ^ res) & (dst ^ res);
35833 flag_NotZ = res & 0xFF;
35834 WRITE_BYTE_F(adr, res)
35835 POST_IO
35836RET(12)
35837}
35838
35839// ADDDa
35840OPCODE(0xD127)
35841{
35842 u32 adr, res;
35843 u32 src, dst;
35844
35845 src = DREGu8((Opcode >> 9) & 7);
35846 adr = AREG(7) - 2;
35847 AREG(7) = adr;
35848 PRE_IO
35849 READ_BYTE_F(adr, dst)
35850 res = dst + src;
35851 flag_N = flag_X = flag_C = res;
35852 flag_V = (src ^ res) & (dst ^ res);
35853 flag_NotZ = res & 0xFF;
35854 WRITE_BYTE_F(adr, res)
35855 POST_IO
35856RET(14)
35857}
35858
35859// ADDDa
35860OPCODE(0xD150)
35861{
35862 u32 adr, res;
35863 u32 src, dst;
35864
35865 src = DREGu16((Opcode >> 9) & 7);
35866 adr = AREG((Opcode >> 0) & 7);
35867 PRE_IO
35868 READ_WORD_F(adr, dst)
35869 res = dst + src;
35870 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
35871 flag_N = flag_X = flag_C = res >> 8;
35872 flag_NotZ = res & 0xFFFF;
35873 WRITE_WORD_F(adr, res)
35874 POST_IO
35875RET(12)
35876}
35877
35878// ADDDa
35879OPCODE(0xD158)
35880{
35881 u32 adr, res;
35882 u32 src, dst;
35883
35884 src = DREGu16((Opcode >> 9) & 7);
35885 adr = AREG((Opcode >> 0) & 7);
35886 AREG((Opcode >> 0) & 7) += 2;
35887 PRE_IO
35888 READ_WORD_F(adr, dst)
35889 res = dst + src;
35890 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
35891 flag_N = flag_X = flag_C = res >> 8;
35892 flag_NotZ = res & 0xFFFF;
35893 WRITE_WORD_F(adr, res)
35894 POST_IO
35895RET(12)
35896}
35897
35898// ADDDa
35899OPCODE(0xD160)
35900{
35901 u32 adr, res;
35902 u32 src, dst;
35903
35904 src = DREGu16((Opcode >> 9) & 7);
35905 adr = AREG((Opcode >> 0) & 7) - 2;
35906 AREG((Opcode >> 0) & 7) = adr;
35907 PRE_IO
35908 READ_WORD_F(adr, dst)
35909 res = dst + src;
35910 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
35911 flag_N = flag_X = flag_C = res >> 8;
35912 flag_NotZ = res & 0xFFFF;
35913 WRITE_WORD_F(adr, res)
35914 POST_IO
35915RET(14)
35916}
35917
35918// ADDDa
35919OPCODE(0xD168)
35920{
35921 u32 adr, res;
35922 u32 src, dst;
35923
35924 src = DREGu16((Opcode >> 9) & 7);
35925 FETCH_SWORD(adr);
35926 adr += AREG((Opcode >> 0) & 7);
35927 PRE_IO
35928 READ_WORD_F(adr, dst)
35929 res = dst + src;
35930 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
35931 flag_N = flag_X = flag_C = res >> 8;
35932 flag_NotZ = res & 0xFFFF;
35933 WRITE_WORD_F(adr, res)
35934 POST_IO
35935RET(16)
35936}
35937
35938// ADDDa
35939OPCODE(0xD170)
35940{
35941 u32 adr, res;
35942 u32 src, dst;
35943
35944 src = DREGu16((Opcode >> 9) & 7);
35945 adr = AREG((Opcode >> 0) & 7);
35946 DECODE_EXT_WORD
35947 PRE_IO
35948 READ_WORD_F(adr, dst)
35949 res = dst + src;
35950 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
35951 flag_N = flag_X = flag_C = res >> 8;
35952 flag_NotZ = res & 0xFFFF;
35953 WRITE_WORD_F(adr, res)
35954 POST_IO
35955RET(18)
35956}
35957
35958// ADDDa
35959OPCODE(0xD178)
35960{
35961 u32 adr, res;
35962 u32 src, dst;
35963
35964 src = DREGu16((Opcode >> 9) & 7);
35965 FETCH_SWORD(adr);
35966 PRE_IO
35967 READ_WORD_F(adr, dst)
35968 res = dst + src;
35969 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
35970 flag_N = flag_X = flag_C = res >> 8;
35971 flag_NotZ = res & 0xFFFF;
35972 WRITE_WORD_F(adr, res)
35973 POST_IO
35974RET(16)
35975}
35976
35977// ADDDa
35978OPCODE(0xD179)
35979{
35980 u32 adr, res;
35981 u32 src, dst;
35982
35983 src = DREGu16((Opcode >> 9) & 7);
35984 FETCH_LONG(adr);
35985 PRE_IO
35986 READ_WORD_F(adr, dst)
35987 res = dst + src;
35988 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
35989 flag_N = flag_X = flag_C = res >> 8;
35990 flag_NotZ = res & 0xFFFF;
35991 WRITE_WORD_F(adr, res)
35992 POST_IO
35993RET(20)
35994}
35995
35996// ADDDa
35997OPCODE(0xD15F)
35998{
35999 u32 adr, res;
36000 u32 src, dst;
36001
36002 src = DREGu16((Opcode >> 9) & 7);
36003 adr = AREG(7);
36004 AREG(7) += 2;
36005 PRE_IO
36006 READ_WORD_F(adr, dst)
36007 res = dst + src;
36008 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
36009 flag_N = flag_X = flag_C = res >> 8;
36010 flag_NotZ = res & 0xFFFF;
36011 WRITE_WORD_F(adr, res)
36012 POST_IO
36013RET(12)
36014}
36015
36016// ADDDa
36017OPCODE(0xD167)
36018{
36019 u32 adr, res;
36020 u32 src, dst;
36021
36022 src = DREGu16((Opcode >> 9) & 7);
36023 adr = AREG(7) - 2;
36024 AREG(7) = adr;
36025 PRE_IO
36026 READ_WORD_F(adr, dst)
36027 res = dst + src;
36028 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
36029 flag_N = flag_X = flag_C = res >> 8;
36030 flag_NotZ = res & 0xFFFF;
36031 WRITE_WORD_F(adr, res)
36032 POST_IO
36033RET(14)
36034}
36035
36036// ADDDa
36037OPCODE(0xD190)
36038{
36039 u32 adr, res;
36040 u32 src, dst;
36041
36042 src = DREGu32((Opcode >> 9) & 7);
36043 adr = AREG((Opcode >> 0) & 7);
36044 PRE_IO
36045 READ_LONG_F(adr, dst)
36046 res = dst + src;
36047 flag_NotZ = res;
36048 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
36049 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
36050 flag_N = res >> 24;
36051 WRITE_LONG_F(adr, res)
36052 POST_IO
36053RET(20)
36054}
36055
36056// ADDDa
36057OPCODE(0xD198)
36058{
36059 u32 adr, res;
36060 u32 src, dst;
36061
36062 src = DREGu32((Opcode >> 9) & 7);
36063 adr = AREG((Opcode >> 0) & 7);
36064 AREG((Opcode >> 0) & 7) += 4;
36065 PRE_IO
36066 READ_LONG_F(adr, dst)
36067 res = dst + src;
36068 flag_NotZ = res;
36069 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
36070 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
36071 flag_N = res >> 24;
36072 WRITE_LONG_F(adr, res)
36073 POST_IO
36074RET(20)
36075}
36076
36077// ADDDa
36078OPCODE(0xD1A0)
36079{
36080 u32 adr, res;
36081 u32 src, dst;
36082
36083 src = DREGu32((Opcode >> 9) & 7);
36084 adr = AREG((Opcode >> 0) & 7) - 4;
36085 AREG((Opcode >> 0) & 7) = adr;
36086 PRE_IO
36087 READ_LONG_F(adr, dst)
36088 res = dst + src;
36089 flag_NotZ = res;
36090 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
36091 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
36092 flag_N = res >> 24;
36093 WRITE_LONG_F(adr, res)
36094 POST_IO
36095RET(22)
36096}
36097
36098// ADDDa
36099OPCODE(0xD1A8)
36100{
36101 u32 adr, res;
36102 u32 src, dst;
36103
36104 src = DREGu32((Opcode >> 9) & 7);
36105 FETCH_SWORD(adr);
36106 adr += AREG((Opcode >> 0) & 7);
36107 PRE_IO
36108 READ_LONG_F(adr, dst)
36109 res = dst + src;
36110 flag_NotZ = res;
36111 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
36112 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
36113 flag_N = res >> 24;
36114 WRITE_LONG_F(adr, res)
36115 POST_IO
36116RET(24)
36117}
36118
36119// ADDDa
36120OPCODE(0xD1B0)
36121{
36122 u32 adr, res;
36123 u32 src, dst;
36124
36125 src = DREGu32((Opcode >> 9) & 7);
36126 adr = AREG((Opcode >> 0) & 7);
36127 DECODE_EXT_WORD
36128 PRE_IO
36129 READ_LONG_F(adr, dst)
36130 res = dst + src;
36131 flag_NotZ = res;
36132 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
36133 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
36134 flag_N = res >> 24;
36135 WRITE_LONG_F(adr, res)
36136 POST_IO
36137RET(26)
36138}
36139
36140// ADDDa
36141OPCODE(0xD1B8)
36142{
36143 u32 adr, res;
36144 u32 src, dst;
36145
36146 src = DREGu32((Opcode >> 9) & 7);
36147 FETCH_SWORD(adr);
36148 PRE_IO
36149 READ_LONG_F(adr, dst)
36150 res = dst + src;
36151 flag_NotZ = res;
36152 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
36153 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
36154 flag_N = res >> 24;
36155 WRITE_LONG_F(adr, res)
36156 POST_IO
36157RET(24)
36158}
36159
36160// ADDDa
36161OPCODE(0xD1B9)
36162{
36163 u32 adr, res;
36164 u32 src, dst;
36165
36166 src = DREGu32((Opcode >> 9) & 7);
36167 FETCH_LONG(adr);
36168 PRE_IO
36169 READ_LONG_F(adr, dst)
36170 res = dst + src;
36171 flag_NotZ = res;
36172 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
36173 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
36174 flag_N = res >> 24;
36175 WRITE_LONG_F(adr, res)
36176 POST_IO
36177RET(28)
36178}
36179
36180// ADDDa
36181OPCODE(0xD19F)
36182{
36183 u32 adr, res;
36184 u32 src, dst;
36185
36186 src = DREGu32((Opcode >> 9) & 7);
36187 adr = AREG(7);
36188 AREG(7) += 4;
36189 PRE_IO
36190 READ_LONG_F(adr, dst)
36191 res = dst + src;
36192 flag_NotZ = res;
36193 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
36194 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
36195 flag_N = res >> 24;
36196 WRITE_LONG_F(adr, res)
36197 POST_IO
36198RET(20)
36199}
36200
36201// ADDDa
36202OPCODE(0xD1A7)
36203{
36204 u32 adr, res;
36205 u32 src, dst;
36206
36207 src = DREGu32((Opcode >> 9) & 7);
36208 adr = AREG(7) - 4;
36209 AREG(7) = adr;
36210 PRE_IO
36211 READ_LONG_F(adr, dst)
36212 res = dst + src;
36213 flag_NotZ = res;
36214 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
36215 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
36216 flag_N = res >> 24;
36217 WRITE_LONG_F(adr, res)
36218 POST_IO
36219RET(22)
36220}
36221
36222// ADDX
36223OPCODE(0xD100)
36224{
36225 u32 adr, res;
36226 u32 src, dst;
36227
36228 src = DREGu8((Opcode >> 0) & 7);
36229 dst = DREGu8((Opcode >> 9) & 7);
36230 res = dst + src + ((flag_X >> 8) & 1);
36231 flag_N = flag_X = flag_C = res;
36232 flag_V = (src ^ res) & (dst ^ res);
36233 flag_NotZ |= res & 0xFF;
36234 DREGu8((Opcode >> 9) & 7) = res;
36235RET(4)
36236}
36237
36238// ADDX
36239OPCODE(0xD140)
36240{
36241 u32 adr, res;
36242 u32 src, dst;
36243
36244 src = DREGu16((Opcode >> 0) & 7);
36245 dst = DREGu16((Opcode >> 9) & 7);
36246 res = dst + src + ((flag_X >> 8) & 1);
36247 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
36248 flag_N = flag_X = flag_C = res >> 8;
36249 flag_NotZ |= res & 0xFFFF;
36250 DREGu16((Opcode >> 9) & 7) = res;
36251RET(4)
36252}
36253
36254// ADDX
36255OPCODE(0xD180)
36256{
36257 u32 adr, res;
36258 u32 src, dst;
36259
36260 src = DREGu32((Opcode >> 0) & 7);
36261 dst = DREGu32((Opcode >> 9) & 7);
36262 res = dst + src + ((flag_X >> 8) & 1);
36263 flag_NotZ |= res;
36264 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
36265 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
36266 flag_N = res >> 24;
36267 DREGu32((Opcode >> 9) & 7) = res;
36268RET(8)
36269}
36270
36271// ADDXM
36272OPCODE(0xD108)
36273{
36274 u32 adr, res;
36275 u32 src, dst;
36276
36277 adr = AREG((Opcode >> 0) & 7) - 1;
36278 AREG((Opcode >> 0) & 7) = adr;
36279 PRE_IO
36280 READ_BYTE_F(adr, src)
36281 adr = AREG((Opcode >> 9) & 7) - 1;
36282 AREG((Opcode >> 9) & 7) = adr;
36283 READ_BYTE_F(adr, dst)
36284 res = dst + src + ((flag_X >> 8) & 1);
36285 flag_N = flag_X = flag_C = res;
36286 flag_V = (src ^ res) & (dst ^ res);
36287 flag_NotZ |= res & 0xFF;
36288 WRITE_BYTE_F(adr, res)
36289 POST_IO
36290RET(18)
36291}
36292
36293// ADDXM
36294OPCODE(0xD148)
36295{
36296 u32 adr, res;
36297 u32 src, dst;
36298
36299 adr = AREG((Opcode >> 0) & 7) - 2;
36300 AREG((Opcode >> 0) & 7) = adr;
36301 PRE_IO
36302 READ_WORD_F(adr, src)
36303 adr = AREG((Opcode >> 9) & 7) - 2;
36304 AREG((Opcode >> 9) & 7) = adr;
36305 READ_WORD_F(adr, dst)
36306 res = dst + src + ((flag_X >> 8) & 1);
36307 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
36308 flag_N = flag_X = flag_C = res >> 8;
36309 flag_NotZ |= res & 0xFFFF;
36310 WRITE_WORD_F(adr, res)
36311 POST_IO
36312RET(18)
36313}
36314
36315// ADDXM
36316OPCODE(0xD188)
36317{
36318 u32 adr, res;
36319 u32 src, dst;
36320
36321 adr = AREG((Opcode >> 0) & 7) - 4;
36322 AREG((Opcode >> 0) & 7) = adr;
36323 PRE_IO
36324 READ_LONG_F(adr, src)
36325 adr = AREG((Opcode >> 9) & 7) - 4;
36326 AREG((Opcode >> 9) & 7) = adr;
36327 READ_LONG_F(adr, dst)
36328 res = dst + src + ((flag_X >> 8) & 1);
36329 flag_NotZ |= res;
36330 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
36331 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
36332 flag_N = res >> 24;
36333 WRITE_LONG_F(adr, res)
36334 POST_IO
36335RET(30)
36336}
36337
36338// ADDX7M
36339OPCODE(0xD10F)
36340{
36341 u32 adr, res;
36342 u32 src, dst;
36343
36344 adr = AREG(7) - 2;
36345 AREG(7) = adr;
36346 PRE_IO
36347 READ_BYTE_F(adr, src)
36348 adr = AREG((Opcode >> 9) & 7) - 1;
36349 AREG((Opcode >> 9) & 7) = adr;
36350 READ_BYTE_F(adr, dst)
36351 res = dst + src + ((flag_X >> 8) & 1);
36352 flag_N = flag_X = flag_C = res;
36353 flag_V = (src ^ res) & (dst ^ res);
36354 flag_NotZ |= res & 0xFF;
36355 WRITE_BYTE_F(adr, res)
36356 POST_IO
36357RET(18)
36358}
36359
36360// ADDX7M
36361OPCODE(0xD14F)
36362{
36363 u32 adr, res;
36364 u32 src, dst;
36365
36366 adr = AREG(7) - 2;
36367 AREG(7) = adr;
36368 PRE_IO
36369 READ_WORD_F(adr, src)
36370 adr = AREG((Opcode >> 9) & 7) - 2;
36371 AREG((Opcode >> 9) & 7) = adr;
36372 READ_WORD_F(adr, dst)
36373 res = dst + src + ((flag_X >> 8) & 1);
36374 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
36375 flag_N = flag_X = flag_C = res >> 8;
36376 flag_NotZ |= res & 0xFFFF;
36377 WRITE_WORD_F(adr, res)
36378 POST_IO
36379RET(18)
36380}
36381
36382// ADDX7M
36383OPCODE(0xD18F)
36384{
36385 u32 adr, res;
36386 u32 src, dst;
36387
36388 adr = AREG(7) - 4;
36389 AREG(7) = adr;
36390 PRE_IO
36391 READ_LONG_F(adr, src)
36392 adr = AREG((Opcode >> 9) & 7) - 4;
36393 AREG((Opcode >> 9) & 7) = adr;
36394 READ_LONG_F(adr, dst)
36395 res = dst + src + ((flag_X >> 8) & 1);
36396 flag_NotZ |= res;
36397 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
36398 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
36399 flag_N = res >> 24;
36400 WRITE_LONG_F(adr, res)
36401 POST_IO
36402RET(30)
36403}
36404
36405// ADDXM7
36406OPCODE(0xDF08)
36407{
36408 u32 adr, res;
36409 u32 src, dst;
36410
36411 adr = AREG((Opcode >> 0) & 7) - 1;
36412 AREG((Opcode >> 0) & 7) = adr;
36413 PRE_IO
36414 READ_BYTE_F(adr, src)
36415 adr = AREG(7) - 2;
36416 AREG(7) = adr;
36417 READ_BYTE_F(adr, dst)
36418 res = dst + src + ((flag_X >> 8) & 1);
36419 flag_N = flag_X = flag_C = res;
36420 flag_V = (src ^ res) & (dst ^ res);
36421 flag_NotZ |= res & 0xFF;
36422 WRITE_BYTE_F(adr, res)
36423 POST_IO
36424RET(18)
36425}
36426
36427// ADDXM7
36428OPCODE(0xDF48)
36429{
36430 u32 adr, res;
36431 u32 src, dst;
36432
36433 adr = AREG((Opcode >> 0) & 7) - 2;
36434 AREG((Opcode >> 0) & 7) = adr;
36435 PRE_IO
36436 READ_WORD_F(adr, src)
36437 adr = AREG(7) - 2;
36438 AREG(7) = adr;
36439 READ_WORD_F(adr, dst)
36440 res = dst + src + ((flag_X >> 8) & 1);
36441 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
36442 flag_N = flag_X = flag_C = res >> 8;
36443 flag_NotZ |= res & 0xFFFF;
36444 WRITE_WORD_F(adr, res)
36445 POST_IO
36446RET(18)
36447}
36448
36449// ADDXM7
36450OPCODE(0xDF88)
36451{
36452 u32 adr, res;
36453 u32 src, dst;
36454
36455 adr = AREG((Opcode >> 0) & 7) - 4;
36456 AREG((Opcode >> 0) & 7) = adr;
36457 PRE_IO
36458 READ_LONG_F(adr, src)
36459 adr = AREG(7) - 4;
36460 AREG(7) = adr;
36461 READ_LONG_F(adr, dst)
36462 res = dst + src + ((flag_X >> 8) & 1);
36463 flag_NotZ |= res;
36464 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
36465 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
36466 flag_N = res >> 24;
36467 WRITE_LONG_F(adr, res)
36468 POST_IO
36469RET(30)
36470}
36471
36472// ADDX7M7
36473OPCODE(0xDF0F)
36474{
36475 u32 adr, res;
36476 u32 src, dst;
36477
36478 adr = AREG(7) - 2;
36479 AREG(7) = adr;
36480 PRE_IO
36481 READ_BYTE_F(adr, src)
36482 adr = AREG(7) - 2;
36483 AREG(7) = adr;
36484 READ_BYTE_F(adr, dst)
36485 res = dst + src + ((flag_X >> 8) & 1);
36486 flag_N = flag_X = flag_C = res;
36487 flag_V = (src ^ res) & (dst ^ res);
36488 flag_NotZ |= res & 0xFF;
36489 WRITE_BYTE_F(adr, res)
36490 POST_IO
36491RET(18)
36492}
36493
36494// ADDX7M7
36495OPCODE(0xDF4F)
36496{
36497 u32 adr, res;
36498 u32 src, dst;
36499
36500 adr = AREG(7) - 2;
36501 AREG(7) = adr;
36502 PRE_IO
36503 READ_WORD_F(adr, src)
36504 adr = AREG(7) - 2;
36505 AREG(7) = adr;
36506 READ_WORD_F(adr, dst)
36507 res = dst + src + ((flag_X >> 8) & 1);
36508 flag_V = ((src ^ res) & (dst ^ res)) >> 8;
36509 flag_N = flag_X = flag_C = res >> 8;
36510 flag_NotZ |= res & 0xFFFF;
36511 WRITE_WORD_F(adr, res)
36512 POST_IO
36513RET(18)
36514}
36515
36516// ADDX7M7
36517OPCODE(0xDF8F)
36518{
36519 u32 adr, res;
36520 u32 src, dst;
36521
36522 adr = AREG(7) - 4;
36523 AREG(7) = adr;
36524 PRE_IO
36525 READ_LONG_F(adr, src)
36526 adr = AREG(7) - 4;
36527 AREG(7) = adr;
36528 READ_LONG_F(adr, dst)
36529 res = dst + src + ((flag_X >> 8) & 1);
36530 flag_NotZ |= res;
36531 flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23;
36532 flag_V = ((src ^ res) & (dst ^ res)) >> 24;
36533 flag_N = res >> 24;
36534 WRITE_LONG_F(adr, res)
36535 POST_IO
36536RET(30)
36537}
36538
36539// ADDA
36540OPCODE(0xD0C0)
36541{
36542 u32 adr, res;
36543 u32 src, dst;
36544
36545 src = (s32)DREGs16((Opcode >> 0) & 7);
36546 dst = AREGu32((Opcode >> 9) & 7);
36547 res = dst + src;
36548 AREG((Opcode >> 9) & 7) = res;
36549RET(8)
36550}
36551
36552// ADDA
36553OPCODE(0xD0C8)
36554{
36555 u32 adr, res;
36556 u32 src, dst;
36557
36558 src = (s32)AREGs16((Opcode >> 0) & 7);
36559 dst = AREGu32((Opcode >> 9) & 7);
36560 res = dst + src;
36561 AREG((Opcode >> 9) & 7) = res;
36562RET(8)
36563}
36564
36565// ADDA
36566OPCODE(0xD0D0)
36567{
36568 u32 adr, res;
36569 u32 src, dst;
36570
36571 adr = AREG((Opcode >> 0) & 7);
36572 PRE_IO
36573 READSX_WORD_F(adr, src)
36574 dst = AREGu32((Opcode >> 9) & 7);
36575 res = dst + src;
36576 AREG((Opcode >> 9) & 7) = res;
36577 POST_IO
03e4f2a3 36578#ifdef USE_CYCLONE_TIMING
36579RET(12)
36580#else
70357ce5 36581RET(10)
03e4f2a3 36582#endif
70357ce5 36583}
36584
36585// ADDA
36586OPCODE(0xD0D8)
36587{
36588 u32 adr, res;
36589 u32 src, dst;
36590
36591 adr = AREG((Opcode >> 0) & 7);
36592 AREG((Opcode >> 0) & 7) += 2;
36593 PRE_IO
36594 READSX_WORD_F(adr, src)
36595 dst = AREGu32((Opcode >> 9) & 7);
36596 res = dst + src;
36597 AREG((Opcode >> 9) & 7) = res;
36598 POST_IO
03e4f2a3 36599#ifdef USE_CYCLONE_TIMING
36600RET(12)
36601#else
70357ce5 36602RET(10)
03e4f2a3 36603#endif
70357ce5 36604}
36605
36606// ADDA
36607OPCODE(0xD0E0)
36608{
36609 u32 adr, res;
36610 u32 src, dst;
36611
36612 adr = AREG((Opcode >> 0) & 7) - 2;
36613 AREG((Opcode >> 0) & 7) = adr;
36614 PRE_IO
36615 READSX_WORD_F(adr, src)
36616 dst = AREGu32((Opcode >> 9) & 7);
36617 res = dst + src;
36618 AREG((Opcode >> 9) & 7) = res;
36619 POST_IO
03e4f2a3 36620#ifdef USE_CYCLONE_TIMING
36621RET(14)
36622#else
70357ce5 36623RET(12)
03e4f2a3 36624#endif
70357ce5 36625}
36626
36627// ADDA
36628OPCODE(0xD0E8)
36629{
36630 u32 adr, res;
36631 u32 src, dst;
36632
36633 FETCH_SWORD(adr);
36634 adr += AREG((Opcode >> 0) & 7);
36635 PRE_IO
36636 READSX_WORD_F(adr, src)
36637 dst = AREGu32((Opcode >> 9) & 7);
36638 res = dst + src;
36639 AREG((Opcode >> 9) & 7) = res;
36640 POST_IO
03e4f2a3 36641#ifdef USE_CYCLONE_TIMING
36642RET(16)
36643#else
70357ce5 36644RET(14)
03e4f2a3 36645#endif
70357ce5 36646}
36647
36648// ADDA
36649OPCODE(0xD0F0)
36650{
36651 u32 adr, res;
36652 u32 src, dst;
36653
36654 adr = AREG((Opcode >> 0) & 7);
36655 DECODE_EXT_WORD
36656 PRE_IO
36657 READSX_WORD_F(adr, src)
36658 dst = AREGu32((Opcode >> 9) & 7);
36659 res = dst + src;
36660 AREG((Opcode >> 9) & 7) = res;
36661 POST_IO
03e4f2a3 36662#ifdef USE_CYCLONE_TIMING
36663RET(18)
36664#else
70357ce5 36665RET(16)
03e4f2a3 36666#endif
70357ce5 36667}
36668
36669// ADDA
36670OPCODE(0xD0F8)
36671{
36672 u32 adr, res;
36673 u32 src, dst;
36674
36675 FETCH_SWORD(adr);
36676 PRE_IO
36677 READSX_WORD_F(adr, src)
36678 dst = AREGu32((Opcode >> 9) & 7);
36679 res = dst + src;
36680 AREG((Opcode >> 9) & 7) = res;
36681 POST_IO
03e4f2a3 36682#ifdef USE_CYCLONE_TIMING
36683RET(16)
36684#else
70357ce5 36685RET(14)
03e4f2a3 36686#endif
70357ce5 36687}
36688
36689// ADDA
36690OPCODE(0xD0F9)
36691{
36692 u32 adr, res;
36693 u32 src, dst;
36694
36695 FETCH_LONG(adr);
36696 PRE_IO
36697 READSX_WORD_F(adr, src)
36698 dst = AREGu32((Opcode >> 9) & 7);
36699 res = dst + src;
36700 AREG((Opcode >> 9) & 7) = res;
36701 POST_IO
03e4f2a3 36702#ifdef USE_CYCLONE_TIMING
36703RET(20)
36704#else
70357ce5 36705RET(18)
03e4f2a3 36706#endif
70357ce5 36707}
36708
36709// ADDA
36710OPCODE(0xD0FA)
36711{
36712 u32 adr, res;
36713 u32 src, dst;
36714
be26eb23 36715 adr = GET_SWORD + GET_PC;
70357ce5 36716 PC++;
36717 PRE_IO
36718 READSX_WORD_F(adr, src)
36719 dst = AREGu32((Opcode >> 9) & 7);
36720 res = dst + src;
36721 AREG((Opcode >> 9) & 7) = res;
36722 POST_IO
03e4f2a3 36723#ifdef USE_CYCLONE_TIMING
36724RET(16)
36725#else
70357ce5 36726RET(14)
03e4f2a3 36727#endif
70357ce5 36728}
36729
36730// ADDA
36731OPCODE(0xD0FB)
36732{
36733 u32 adr, res;
36734 u32 src, dst;
36735
be26eb23 36736 adr = GET_PC;
70357ce5 36737 DECODE_EXT_WORD
36738 PRE_IO
36739 READSX_WORD_F(adr, src)
36740 dst = AREGu32((Opcode >> 9) & 7);
36741 res = dst + src;
36742 AREG((Opcode >> 9) & 7) = res;
36743 POST_IO
03e4f2a3 36744#ifdef USE_CYCLONE_TIMING
36745RET(18)
36746#else
70357ce5 36747RET(16)
03e4f2a3 36748#endif
70357ce5 36749}
36750
36751// ADDA
36752OPCODE(0xD0FC)
36753{
36754 u32 adr, res;
36755 u32 src, dst;
36756
36757 FETCH_SWORD(src);
36758 dst = AREGu32((Opcode >> 9) & 7);
36759 res = dst + src;
36760 AREG((Opcode >> 9) & 7) = res;
36761RET(12)
36762}
36763
36764// ADDA
36765OPCODE(0xD0DF)
36766{
36767 u32 adr, res;
36768 u32 src, dst;
36769
36770 adr = AREG(7);
36771 AREG(7) += 2;
36772 PRE_IO
36773 READSX_WORD_F(adr, src)
36774 dst = AREGu32((Opcode >> 9) & 7);
36775 res = dst + src;
36776 AREG((Opcode >> 9) & 7) = res;
36777 POST_IO
03e4f2a3 36778#ifdef USE_CYCLONE_TIMING
36779RET(12)
36780#else
70357ce5 36781RET(10)
03e4f2a3 36782#endif
70357ce5 36783}
36784
36785// ADDA
36786OPCODE(0xD0E7)
36787{
36788 u32 adr, res;
36789 u32 src, dst;
36790
36791 adr = AREG(7) - 2;
36792 AREG(7) = adr;
36793 PRE_IO
36794 READSX_WORD_F(adr, src)
36795 dst = AREGu32((Opcode >> 9) & 7);
36796 res = dst + src;
36797 AREG((Opcode >> 9) & 7) = res;
36798 POST_IO
03e4f2a3 36799#ifdef USE_CYCLONE_TIMING
36800RET(14)
36801#else
70357ce5 36802RET(12)
03e4f2a3 36803#endif
70357ce5 36804}
36805
36806// ADDA
36807OPCODE(0xD1C0)
36808{
36809 u32 adr, res;
36810 u32 src, dst;
36811
36812 src = (s32)DREGs32((Opcode >> 0) & 7);
36813 dst = AREGu32((Opcode >> 9) & 7);
36814 res = dst + src;
36815 AREG((Opcode >> 9) & 7) = res;
36816#ifdef USE_CYCLONE_TIMING
36817RET(8)
36818#else
36819RET(6)
36820#endif
36821}
36822
36823// ADDA
36824OPCODE(0xD1C8)
36825{
36826 u32 adr, res;
36827 u32 src, dst;
36828
36829 src = (s32)AREGs32((Opcode >> 0) & 7);
36830 dst = AREGu32((Opcode >> 9) & 7);
36831 res = dst + src;
36832 AREG((Opcode >> 9) & 7) = res;
36833#ifdef USE_CYCLONE_TIMING
36834RET(8)
36835#else
36836RET(6)
36837#endif
36838}
36839
36840// ADDA
36841OPCODE(0xD1D0)
36842{
36843 u32 adr, res;
36844 u32 src, dst;
36845
36846 adr = AREG((Opcode >> 0) & 7);
36847 PRE_IO
36848 READSX_LONG_F(adr, src)
36849 dst = AREGu32((Opcode >> 9) & 7);
36850 res = dst + src;
36851 AREG((Opcode >> 9) & 7) = res;
36852 POST_IO
36853RET(14)
36854}
36855
36856// ADDA
36857OPCODE(0xD1D8)
36858{
36859 u32 adr, res;
36860 u32 src, dst;
36861
36862 adr = AREG((Opcode >> 0) & 7);
36863 AREG((Opcode >> 0) & 7) += 4;
36864 PRE_IO
36865 READSX_LONG_F(adr, src)
36866 dst = AREGu32((Opcode >> 9) & 7);
36867 res = dst + src;
36868 AREG((Opcode >> 9) & 7) = res;
36869 POST_IO
36870RET(14)
36871}
36872
36873// ADDA
36874OPCODE(0xD1E0)
36875{
36876 u32 adr, res;
36877 u32 src, dst;
36878
36879 adr = AREG((Opcode >> 0) & 7) - 4;
36880 AREG((Opcode >> 0) & 7) = adr;
36881 PRE_IO
36882 READSX_LONG_F(adr, src)
36883 dst = AREGu32((Opcode >> 9) & 7);
36884 res = dst + src;
36885 AREG((Opcode >> 9) & 7) = res;
36886 POST_IO
36887RET(16)
36888}
36889
36890// ADDA
36891OPCODE(0xD1E8)
36892{
36893 u32 adr, res;
36894 u32 src, dst;
36895
36896 FETCH_SWORD(adr);
36897 adr += AREG((Opcode >> 0) & 7);
36898 PRE_IO
36899 READSX_LONG_F(adr, src)
36900 dst = AREGu32((Opcode >> 9) & 7);
36901 res = dst + src;
36902 AREG((Opcode >> 9) & 7) = res;
36903 POST_IO
36904RET(18)
36905}
36906
36907// ADDA
36908OPCODE(0xD1F0)
36909{
36910 u32 adr, res;
36911 u32 src, dst;
36912
36913 adr = AREG((Opcode >> 0) & 7);
36914 DECODE_EXT_WORD
36915 PRE_IO
36916 READSX_LONG_F(adr, src)
36917 dst = AREGu32((Opcode >> 9) & 7);
36918 res = dst + src;
36919 AREG((Opcode >> 9) & 7) = res;
36920 POST_IO
36921RET(20)
36922}
36923
36924// ADDA
36925OPCODE(0xD1F8)
36926{
36927 u32 adr, res;
36928 u32 src, dst;
36929
36930 FETCH_SWORD(adr);
36931 PRE_IO
36932 READSX_LONG_F(adr, src)
36933 dst = AREGu32((Opcode >> 9) & 7);
36934 res = dst + src;
36935 AREG((Opcode >> 9) & 7) = res;
36936 POST_IO
36937RET(18)
36938}
36939
36940// ADDA
36941OPCODE(0xD1F9)
36942{
36943 u32 adr, res;
36944 u32 src, dst;
36945
36946 FETCH_LONG(adr);
36947 PRE_IO
36948 READSX_LONG_F(adr, src)
36949 dst = AREGu32((Opcode >> 9) & 7);
36950 res = dst + src;
36951 AREG((Opcode >> 9) & 7) = res;
36952 POST_IO
36953RET(22)
36954}
36955
36956// ADDA
36957OPCODE(0xD1FA)
36958{
36959 u32 adr, res;
36960 u32 src, dst;
36961
be26eb23 36962 adr = GET_SWORD + GET_PC;
70357ce5 36963 PC++;
36964 PRE_IO
36965 READSX_LONG_F(adr, src)
36966 dst = AREGu32((Opcode >> 9) & 7);
36967 res = dst + src;
36968 AREG((Opcode >> 9) & 7) = res;
36969 POST_IO
36970RET(18)
36971}
36972
36973// ADDA
36974OPCODE(0xD1FB)
36975{
36976 u32 adr, res;
36977 u32 src, dst;
36978
be26eb23 36979 adr = GET_PC;
70357ce5 36980 DECODE_EXT_WORD
36981 PRE_IO
36982 READSX_LONG_F(adr, src)
36983 dst = AREGu32((Opcode >> 9) & 7);
36984 res = dst + src;
36985 AREG((Opcode >> 9) & 7) = res;
36986 POST_IO
36987RET(20)
36988}
36989
36990// ADDA
36991OPCODE(0xD1FC)
36992{
36993 u32 adr, res;
36994 u32 src, dst;
36995
36996 FETCH_LONG(src);
36997 dst = AREGu32((Opcode >> 9) & 7);
36998 res = dst + src;
36999 AREG((Opcode >> 9) & 7) = res;
37000#ifdef USE_CYCLONE_TIMING
37001RET(16)
37002#else
37003RET(14)
37004#endif
37005}
37006
37007// ADDA
37008OPCODE(0xD1DF)
37009{
37010 u32 adr, res;
37011 u32 src, dst;
37012
37013 adr = AREG(7);
37014 AREG(7) += 4;
37015 PRE_IO
37016 READSX_LONG_F(adr, src)
37017 dst = AREGu32((Opcode >> 9) & 7);
37018 res = dst + src;
37019 AREG((Opcode >> 9) & 7) = res;
37020 POST_IO
37021RET(14)
37022}
37023
37024// ADDA
37025OPCODE(0xD1E7)
37026{
37027 u32 adr, res;
37028 u32 src, dst;
37029
37030 adr = AREG(7) - 4;
37031 AREG(7) = adr;
37032 PRE_IO
37033 READSX_LONG_F(adr, src)
37034 dst = AREGu32((Opcode >> 9) & 7);
37035 res = dst + src;
37036 AREG((Opcode >> 9) & 7) = res;
37037 POST_IO
37038RET(16)
37039}
37040
37041// ASRk
37042OPCODE(0xE000)
37043{
37044 u32 adr, res;
37045 u32 src, dst;
37046
37047 u32 sft;
37048
37049 sft = (((Opcode >> 9) - 1) & 7) + 1;
37050 m68kcontext.io_cycle_counter -= sft * 2;
37051 src = (s32)DREGs8((Opcode >> 0) & 7);
37052 flag_V = 0;
37053 flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
37054 res = ((s32)src) >> sft;
37055 flag_N = res >> 0;
37056 flag_NotZ = res;
37057 DREGu8((Opcode >> 0) & 7) = res;
37058RET(6)
37059}
37060
37061// ASRk
37062OPCODE(0xE040)
37063{
37064 u32 adr, res;
37065 u32 src, dst;
37066
37067 u32 sft;
37068
37069 sft = (((Opcode >> 9) - 1) & 7) + 1;
37070 m68kcontext.io_cycle_counter -= sft * 2;
37071 src = (s32)DREGs16((Opcode >> 0) & 7);
37072 flag_V = 0;
37073 flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
37074 res = ((s32)src) >> sft;
37075 flag_N = res >> 8;
37076 flag_NotZ = res;
37077 DREGu16((Opcode >> 0) & 7) = res;
37078RET(6)
37079}
37080
37081// ASRk
37082OPCODE(0xE080)
37083{
37084 u32 adr, res;
37085 u32 src, dst;
37086
37087 u32 sft;
37088
37089 sft = (((Opcode >> 9) - 1) & 7) + 1;
37090 m68kcontext.io_cycle_counter -= sft * 2;
37091 src = (s32)DREGs32((Opcode >> 0) & 7);
37092 flag_V = 0;
37093 flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
37094 res = ((s32)src) >> sft;
37095 flag_N = res >> 24;
37096 flag_NotZ = res;
37097 DREGu32((Opcode >> 0) & 7) = res;
37098RET(8)
37099}
37100
37101// LSRk
37102OPCODE(0xE008)
37103{
37104 u32 adr, res;
37105 u32 src, dst;
37106
37107 u32 sft;
37108
37109 sft = (((Opcode >> 9) - 1) & 7) + 1;
37110 m68kcontext.io_cycle_counter -= sft * 2;
37111 src = DREGu8((Opcode >> 0) & 7);
37112 flag_N = flag_V = 0;
37113 flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
37114 res = src >> sft;
37115 flag_NotZ = res;
37116 DREGu8((Opcode >> 0) & 7) = res;
37117RET(6)
37118}
37119
37120// LSRk
37121OPCODE(0xE048)
37122{
37123 u32 adr, res;
37124 u32 src, dst;
37125
37126 u32 sft;
37127
37128 sft = (((Opcode >> 9) - 1) & 7) + 1;
37129 m68kcontext.io_cycle_counter -= sft * 2;
37130 src = DREGu16((Opcode >> 0) & 7);
37131 flag_N = flag_V = 0;
37132 flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
37133 res = src >> sft;
37134 flag_NotZ = res;
37135 DREGu16((Opcode >> 0) & 7) = res;
37136RET(6)
37137}
37138
37139// LSRk
37140OPCODE(0xE088)
37141{
37142 u32 adr, res;
37143 u32 src, dst;
37144
37145 u32 sft;
37146
37147 sft = (((Opcode >> 9) - 1) & 7) + 1;
37148 m68kcontext.io_cycle_counter -= sft * 2;
37149 src = DREGu32((Opcode >> 0) & 7);
37150 flag_N = flag_V = 0;
37151 flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
37152 res = src >> sft;
37153 flag_NotZ = res;
37154 DREGu32((Opcode >> 0) & 7) = res;
37155RET(8)
37156}
37157
37158// ROXRk
37159OPCODE(0xE010)
37160{
37161 u32 adr, res;
37162 u32 src, dst;
37163
37164 u32 sft;
37165
37166 sft = (((Opcode >> 9) - 1) & 7) + 1;
37167 m68kcontext.io_cycle_counter -= sft * 2;
37168 src = DREGu8((Opcode >> 0) & 7);
37169 src |= (flag_X & M68K_SR_X) << 0;
37170 res = (src >> sft) | (src << (9 - sft));
37171 flag_X = flag_C = res >> 0;
37172 flag_V = 0;
37173 flag_N = res >> 0;
37174 flag_NotZ = res & 0x000000FF;
37175 DREGu8((Opcode >> 0) & 7) = res;
37176RET(6)
37177}
37178
37179// ROXRk
37180OPCODE(0xE050)
37181{
37182 u32 adr, res;
37183 u32 src, dst;
37184
37185 u32 sft;
37186
37187 sft = (((Opcode >> 9) - 1) & 7) + 1;
37188 m68kcontext.io_cycle_counter -= sft * 2;
37189 src = DREGu16((Opcode >> 0) & 7);
37190 src |= (flag_X & M68K_SR_X) << 8;
37191 res = (src >> sft) | (src << (17 - sft));
37192 flag_X = flag_C = res >> 8;
37193 flag_V = 0;
37194 flag_N = res >> 8;
37195 flag_NotZ = res & 0x0000FFFF;
37196 DREGu16((Opcode >> 0) & 7) = res;
37197RET(6)
37198}
37199
37200// ROXRk
37201OPCODE(0xE090)
37202{
37203 u32 adr, res;
37204 u32 src, dst;
37205
37206 u32 sft;
37207
37208 sft = (((Opcode >> 9) - 1) & 7) + 1;
37209 m68kcontext.io_cycle_counter -= sft * 2;
37210 src = DREGu32((Opcode >> 0) & 7);
37211 flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
37212 if (sft == 1) res = (src >> 1) | ((flag_X & M68K_SR_X) << (32 - (M68K_SR_X_SFT + 1)));
37213 else res = (src >> sft) | (src << (33 - sft)) | ((flag_X & M68K_SR_X) << (32 - (M68K_SR_X_SFT + sft)));
37214 flag_X = flag_C;
37215 flag_V = 0;
37216 flag_N = res >> 24;
37217 flag_NotZ = res;
37218 DREGu32((Opcode >> 0) & 7) = res;
37219RET(8)
37220}
37221
37222// RORk
37223OPCODE(0xE018)
37224{
37225 u32 adr, res;
37226 u32 src, dst;
37227
37228 u32 sft;
37229
37230 sft = (((Opcode >> 9) - 1) & 7) + 1;
37231 m68kcontext.io_cycle_counter -= sft * 2;
37232 src = DREGu8((Opcode >> 0) & 7);
37233 flag_V = 0;
37234 flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
37235 res = (src >> sft) | (src << (8 - sft));
37236 flag_N = res >> 0;
37237 flag_NotZ = res & 0x000000FF;
37238 DREGu8((Opcode >> 0) & 7) = res;
37239RET(6)
37240}
37241
37242// RORk
37243OPCODE(0xE058)
37244{
37245 u32 adr, res;
37246 u32 src, dst;
37247
37248 u32 sft;
37249
37250 sft = (((Opcode >> 9) - 1) & 7) + 1;
37251 m68kcontext.io_cycle_counter -= sft * 2;
37252 src = DREGu16((Opcode >> 0) & 7);
37253 flag_V = 0;
37254 flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
37255 res = (src >> sft) | (src << (16 - sft));
37256 flag_N = res >> 8;
37257 flag_NotZ = res & 0x0000FFFF;
37258 DREGu16((Opcode >> 0) & 7) = res;
37259RET(6)
37260}
37261
37262// RORk
37263OPCODE(0xE098)
37264{
37265 u32 adr, res;
37266 u32 src, dst;
37267
37268 u32 sft;
37269
37270 sft = (((Opcode >> 9) - 1) & 7) + 1;
37271 m68kcontext.io_cycle_counter -= sft * 2;
37272 src = DREGu32((Opcode >> 0) & 7);
37273 flag_V = 0;
37274 flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
37275 res = (src >> sft) | (src << (32 - sft));
37276 flag_N = res >> 24;
37277 flag_NotZ = res;
37278 DREGu32((Opcode >> 0) & 7) = res;
37279RET(8)
37280}
37281
37282// ASLk
37283OPCODE(0xE100)
37284{
37285 u32 adr, res;
37286 u32 src, dst;
37287
37288 u32 sft;
37289
37290 sft = (((Opcode >> 9) - 1) & 7) + 1;
37291 m68kcontext.io_cycle_counter -= sft * 2;
37292 src = DREGu8((Opcode >> 0) & 7);
37293 if (sft < 8)
37294 {
37295 flag_X = flag_C = src << (0 + sft);
37296 res = src << sft;
37297 flag_N = res >> 0;
37298 flag_NotZ = res & 0x000000FF;
37299 DREGu8((Opcode >> 0) & 7) = res;
37300 flag_V = 0;
37301 if ((sft > 7) && (src)) flag_V = M68K_SR_V;
37302 else
37303 {
37304 u32 msk = (((s32)0x80000000) >> (sft + 24)) & 0x000000FF;
37305 src &= msk;
37306 if ((src) && (src != msk)) flag_V = M68K_SR_V;
37307 }
37308 RET(6)
37309 }
37310
37311 if (src) flag_V = M68K_SR_V;
37312 else flag_V = 0;
37313 flag_X = flag_C = src << M68K_SR_C_SFT;
37314 res = 0;
37315 DREGu8((Opcode >> 0) & 7) = res;
37316 flag_N = 0;
37317 flag_NotZ = 0;
37318RET(6)
37319}
37320
37321// ASLk
37322OPCODE(0xE140)
37323{
37324 u32 adr, res;
37325 u32 src, dst;
37326
37327 u32 sft;
37328
37329 sft = (((Opcode >> 9) - 1) & 7) + 1;
37330 m68kcontext.io_cycle_counter -= sft * 2;
37331 src = DREGu16((Opcode >> 0) & 7);
37332 flag_X = flag_C = src >> (8 - sft);
37333 res = src << sft;
37334 flag_N = res >> 8;
37335 flag_NotZ = res & 0x0000FFFF;
37336 DREGu16((Opcode >> 0) & 7) = res;
37337 flag_V = 0;
37338 {
37339 u32 msk = (((s32)0x80000000) >> (sft + 16)) & 0x0000FFFF;
37340 src &= msk;
37341 if ((src) && (src != msk)) flag_V = M68K_SR_V;
37342 }
37343RET(6)
37344}
37345
37346// ASLk
37347OPCODE(0xE180)
37348{
37349 u32 adr, res;
37350 u32 src, dst;
37351
37352 u32 sft;
37353
37354 sft = (((Opcode >> 9) - 1) & 7) + 1;
37355 m68kcontext.io_cycle_counter -= sft * 2;
37356 src = DREGu32((Opcode >> 0) & 7);
37357 flag_X = flag_C = src >> (24 - sft);
37358 res = src << sft;
37359 flag_N = res >> 24;
37360 flag_NotZ = res & 0xFFFFFFFF;
37361 DREGu32((Opcode >> 0) & 7) = res;
37362 flag_V = 0;
37363 {
37364 u32 msk = (((s32)0x80000000) >> (sft + 0)) & 0xFFFFFFFF;
37365 src &= msk;
37366 if ((src) && (src != msk)) flag_V = M68K_SR_V;
37367 }
37368RET(8)
37369}
37370
37371// LSLk
37372OPCODE(0xE108)
37373{
37374 u32 adr, res;
37375 u32 src, dst;
37376
37377 u32 sft;
37378
37379 sft = (((Opcode >> 9) - 1) & 7) + 1;
37380 m68kcontext.io_cycle_counter -= sft * 2;
37381 src = DREGu8((Opcode >> 0) & 7);
37382 flag_V = 0;
37383 flag_X = flag_C = src << (0 + sft);
37384 res = src << sft;
37385 flag_N = res >> 0;
37386 flag_NotZ = res & 0x000000FF;
37387 DREGu8((Opcode >> 0) & 7) = res;
37388RET(6)
37389}
37390
37391// LSLk
37392OPCODE(0xE148)
37393{
37394 u32 adr, res;
37395 u32 src, dst;
37396
37397 u32 sft;
37398
37399 sft = (((Opcode >> 9) - 1) & 7) + 1;
37400 m68kcontext.io_cycle_counter -= sft * 2;
37401 src = DREGu16((Opcode >> 0) & 7);
37402 flag_V = 0;
37403 flag_X = flag_C = src >> (8 - sft);
37404 res = src << sft;
37405 flag_N = res >> 8;
37406 flag_NotZ = res & 0x0000FFFF;
37407 DREGu16((Opcode >> 0) & 7) = res;
37408RET(6)
37409}
37410
37411// LSLk
37412OPCODE(0xE188)
37413{
37414 u32 adr, res;
37415 u32 src, dst;
37416
37417 u32 sft;
37418
37419 sft = (((Opcode >> 9) - 1) & 7) + 1;
37420 m68kcontext.io_cycle_counter -= sft * 2;
37421 src = DREGu32((Opcode >> 0) & 7);
37422 flag_V = 0;
37423 flag_X = flag_C = src >> (24 - sft);
37424 res = src << sft;
37425 flag_N = res >> 24;
37426 flag_NotZ = res & 0xFFFFFFFF;
37427 DREGu32((Opcode >> 0) & 7) = res;
37428RET(8)
37429}
37430
37431// ROXLk
37432OPCODE(0xE110)
37433{
37434 u32 adr, res;
37435 u32 src, dst;
37436
37437 u32 sft;
37438
37439 sft = (((Opcode >> 9) - 1) & 7) + 1;
37440 m68kcontext.io_cycle_counter -= sft * 2;
37441 src = DREGu8((Opcode >> 0) & 7);
37442 src |= (flag_X & M68K_SR_X) << 0;
37443 res = (src << sft) | (src >> (9 - sft));
37444 flag_X = flag_C = res >> 0;
37445 flag_V = 0;
37446 flag_N = res >> 0;
37447 flag_NotZ = res & 0x000000FF;
37448 DREGu8((Opcode >> 0) & 7) = res;
37449RET(6)
37450}
37451
37452// ROXLk
37453OPCODE(0xE150)
37454{
37455 u32 adr, res;
37456 u32 src, dst;
37457
37458 u32 sft;
37459
37460 sft = (((Opcode >> 9) - 1) & 7) + 1;
37461 m68kcontext.io_cycle_counter -= sft * 2;
37462 src = DREGu16((Opcode >> 0) & 7);
37463 src |= (flag_X & M68K_SR_X) << 8;
37464 res = (src << sft) | (src >> (17 - sft));
37465 flag_X = flag_C = res >> 8;
37466 flag_V = 0;
37467 flag_N = res >> 8;
37468 flag_NotZ = res & 0x0000FFFF;
37469 DREGu16((Opcode >> 0) & 7) = res;
37470RET(6)
37471}
37472
37473// ROXLk
37474OPCODE(0xE190)
37475{
37476 u32 adr, res;
37477 u32 src, dst;
37478
37479 u32 sft;
37480
37481 sft = (((Opcode >> 9) - 1) & 7) + 1;
37482 m68kcontext.io_cycle_counter -= sft * 2;
37483 src = DREGu32((Opcode >> 0) & 7);
37484 flag_C = src >> ((32 - M68K_SR_C_SFT) - sft);
37485 if (sft == 1) res = (src << 1) | ((flag_X & M68K_SR_X) >> ((M68K_SR_X_SFT + 1) - 1));
37486 else res = (src << sft) | (src >> (33 - sft)) | ((flag_X & M68K_SR_X) >> ((M68K_SR_X_SFT + 1) - sft));
37487 flag_X = flag_C;
37488 flag_V = 0;
37489 flag_N = res >> 24;
37490 flag_NotZ = res;
37491 DREGu32((Opcode >> 0) & 7) = res;
37492RET(8)
37493}
37494
37495// ROLk
37496OPCODE(0xE118)
37497{
37498 u32 adr, res;
37499 u32 src, dst;
37500
37501 u32 sft;
37502
37503 sft = (((Opcode >> 9) - 1) & 7) + 1;
37504 m68kcontext.io_cycle_counter -= sft * 2;
37505 src = DREGu8((Opcode >> 0) & 7);
37506 flag_V = 0;
37507 flag_C = src << (0 + sft);
37508 res = (src << sft) | (src >> (8 - sft));
37509 flag_N = res >> 0;
37510 flag_NotZ = res & 0x000000FF;
37511 DREGu8((Opcode >> 0) & 7) = res;
37512RET(6)
37513}
37514
37515// ROLk
37516OPCODE(0xE158)
37517{
37518 u32 adr, res;
37519 u32 src, dst;
37520
37521 u32 sft;
37522
37523 sft = (((Opcode >> 9) - 1) & 7) + 1;
37524 m68kcontext.io_cycle_counter -= sft * 2;
37525 src = DREGu16((Opcode >> 0) & 7);
37526 flag_V = 0;
37527 flag_C = src >> (8 - sft);
37528 res = (src << sft) | (src >> (16 - sft));
37529 flag_N = res >> 8;
37530 flag_NotZ = res & 0x0000FFFF;
37531 DREGu16((Opcode >> 0) & 7) = res;
37532RET(6)
37533}
37534
37535// ROLk
37536OPCODE(0xE198)
37537{
37538 u32 adr, res;
37539 u32 src, dst;
37540
37541 u32 sft;
37542
37543 sft = (((Opcode >> 9) - 1) & 7) + 1;
37544 m68kcontext.io_cycle_counter -= sft * 2;
37545 src = DREGu32((Opcode >> 0) & 7);
37546 flag_V = 0;
37547 flag_C = src >> (24 - sft);
37548 res = (src << sft) | (src >> (32 - sft));
37549 flag_N = res >> 24;
37550 flag_NotZ = res;
37551 DREGu32((Opcode >> 0) & 7) = res;
37552RET(8)
37553}
37554
37555// ASRD
37556OPCODE(0xE020)
37557{
37558 u32 adr, res;
37559 u32 src, dst;
37560
37561 u32 sft;
37562
37563 sft = DREG((Opcode >> 9) & 7) & 0x3F;
37564 src = (s32)DREGs8((Opcode >> 0) & 7);
37565 if (sft)
37566 {
37567 m68kcontext.io_cycle_counter -= sft * 2;
37568 if (sft < 8)
37569 {
37570 flag_V = 0;
37571 flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
37572 res = ((s32)src) >> sft;
37573 flag_N = res >> 0;
37574 flag_NotZ = res;
37575 DREGu8((Opcode >> 0) & 7) = res;
37576 RET(6)
37577 }
37578
37579 if (src & (1 << 7))
37580 {
37581 flag_N = M68K_SR_N;
37582 flag_NotZ = 1;
37583 flag_V = 0;
37584 flag_C = M68K_SR_C;
37585 flag_X = M68K_SR_X;
37586 res = 0x000000FF;
37587 DREGu8((Opcode >> 0) & 7) = res;
37588 RET(6)
37589 }
37590
37591 flag_N = 0;
37592 flag_NotZ = 0;
37593 flag_V = 0;
37594 flag_C = 0;
37595 flag_X = 0;
37596 res = 0;
37597 DREGu8((Opcode >> 0) & 7) = res;
37598 RET(6)
37599 }
37600
37601 flag_V = 0;
37602 flag_C = 0;
37603 flag_N = src >> 0;
37604 flag_NotZ = src;
37605RET(6)
37606}
37607
37608// ASRD
37609OPCODE(0xE060)
37610{
37611 u32 adr, res;
37612 u32 src, dst;
37613
37614 u32 sft;
37615
37616 sft = DREG((Opcode >> 9) & 7) & 0x3F;
37617 src = (s32)DREGs16((Opcode >> 0) & 7);
37618 if (sft)
37619 {
37620 m68kcontext.io_cycle_counter -= sft * 2;
37621 if (sft < 16)
37622 {
37623 flag_V = 0;
37624 flag_X = flag_C = (src >> (sft - 1)) << M68K_SR_C_SFT;
37625 res = ((s32)src) >> sft;
37626 flag_N = res >> 8;
37627 flag_NotZ = res;
37628 DREGu16((Opcode >> 0) & 7) = res;
37629 RET(6)
37630 }
37631
37632 if (src & (1 << 15))
37633 {
37634 flag_N = M68K_SR_N;
37635 flag_NotZ = 1;
37636 flag_V = 0;
37637 flag_C = M68K_SR_C;
37638 flag_X = M68K_SR_X;
37639 res = 0x0000FFFF;
37640 DREGu16((Opcode >> 0) & 7) = res;
37641 RET(6)
37642 }
37643
37644 flag_N = 0;
37645 flag_NotZ = 0;
37646 flag_V = 0;
37647 flag_C = 0;
37648 flag_X = 0;
37649 res = 0;
37650 DREGu16((Opcode >> 0) & 7) = res;
37651 RET(6)
37652 }
37653
37654 flag_V = 0;
37655 flag_C = 0;
37656 flag_N = src >> 8;
37657 flag_NotZ = src;
37658RET(6)
37659}
37660
37661// ASRD
37662OPCODE(0xE0A0)
37663{
37664#ifdef USE_CYCLONE_TIMING
37665#define CYC 8
37666#else
37667#define CYC 6
37668#endif
37669 u32 adr, res;
37670 u32 src, dst;
37671
37672 u32 sft;
37673
37674 sft = DREG((Opcode >> 9) & 7) & 0x3F;
37675 src = (s32)DREGs32((Opcode >> 0) & 7);
37676 if (sft)
37677 {
37678 m68kcontext.io_cycle_counter -= sft * 2;
37679 if (sft < 32)
37680 {
37681 flag_V = 0;
37682 flag_X = flag_C = (src >> (sft - 1)) << M68K_SR_C_SFT;
37683 res = ((s32)src) >> sft;
37684 flag_N = res >> 24;
37685 flag_NotZ = res;
37686 DREGu32((Opcode >> 0) & 7) = res;
37687 RET(CYC)
37688 }
37689
37690 if (src & (1 << 31))
37691 {
37692 flag_N = M68K_SR_N;
37693 flag_NotZ = 1;
37694 flag_V = 0;
37695 flag_C = M68K_SR_C;
37696 flag_X = M68K_SR_X;
37697 res = 0xFFFFFFFF;
37698 DREGu32((Opcode >> 0) & 7) = res;
37699 RET(CYC)
37700 }
37701
37702 flag_N = 0;
37703 flag_NotZ = 0;
37704 flag_V = 0;
37705 flag_C = 0;
37706 flag_X = 0;
37707 res = 0;
37708 DREGu32((Opcode >> 0) & 7) = res;
37709 RET(CYC)
37710 }
37711
37712 flag_V = 0;
37713 flag_C = 0;
37714 flag_N = src >> 24;
37715 flag_NotZ = src;
37716RET(CYC)
37717#undef CYC
37718}
37719
37720// LSRD
37721OPCODE(0xE028)
37722{
37723 u32 adr, res;
37724 u32 src, dst;
37725
37726 u32 sft;
37727
37728 sft = DREG((Opcode >> 9) & 7) & 0x3F;
37729 src = DREGu8((Opcode >> 0) & 7);
37730 if (sft)
37731 {
37732 m68kcontext.io_cycle_counter -= sft * 2;
37733 if (sft <= 8)
37734 {
37735 flag_N = flag_V = 0;
37736 flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft);
37737 res = src >> sft;
37738 flag_NotZ = res;
37739 DREGu8((Opcode >> 0) & 7) = res;
37740 RET(6)
37741 }
37742
37743 flag_X = flag_C = 0;
37744 flag_N = 0;
37745 flag_NotZ = 0;
37746 flag_V = 0;
37747 res = 0;
37748 DREGu8((Opcode >> 0) & 7) = res;
37749 RET(6)
37750 }
37751
37752 flag_V = 0;
37753 flag_C = 0;
37754 flag_N = src >> 0;
37755 flag_NotZ = src;
37756RET(6)
37757}
37758
37759// LSRD
37760OPCODE(0xE068)
37761{
37762 u32 adr, res;
37763 u32 src, dst;
37764
37765 u32 sft;
37766
37767 sft = DREG((Opcode >> 9) & 7) & 0x3F;
37768 src = DREGu16((Opcode >> 0) & 7);
37769 if (sft)
37770 {
37771 m68kcontext.io_cycle_counter -= sft * 2;
37772 if (sft <= 16)
37773 {
37774 flag_N = flag_V = 0;
37775 flag_X = flag_C = (src >> (sft - 1)) << M68K_SR_C_SFT;
37776 res = src >> sft;
37777 flag_NotZ = res;
37778 DREGu16((Opcode >> 0) & 7) = res;
37779 RET(6)
37780 }
37781
37782 flag_X = flag_C = 0;
37783 flag_N = 0;
37784 flag_NotZ = 0;
37785 flag_V = 0;
37786 res = 0;
37787 DREGu16((Opcode >> 0) & 7) = res;
37788 RET(6)
37789 }
37790
37791 flag_V = 0;
37792 flag_C = 0;
37793 flag_N = src >> 8;
37794 flag_NotZ = src;
37795RET(6)
37796}
37797
37798// LSRD
37799OPCODE(0xE0A8)
37800{
37801#ifdef USE_CYCLONE_TIMING
37802#define CYC 8
37803#else
37804#define CYC 6
37805#endif
37806 u32 adr, res;
37807 u32 src, dst;
37808
37809 u32 sft;
37810
37811 sft = DREG((Opcode >> 9) & 7) & 0x3F;
37812 src = DREGu32((Opcode >> 0) & 7);
37813 if (sft)
37814 {
37815 m68kcontext.io_cycle_counter -= sft * 2;
37816 if (sft < 32)
37817 {
37818 flag_N = flag_V = 0;
37819 flag_X = flag_C = (src >> (sft - 1)) << M68K_SR_C_SFT;
37820 res = src >> sft;
37821 flag_NotZ = res;
37822 DREGu32((Opcode >> 0) & 7) = res;
37823 RET(CYC)
37824 }
37825
37826 if (sft == 32) flag_C = src >> (31 - M68K_SR_C_SFT);
37827 else flag_C = 0;
37828 flag_X = flag_C;
37829 flag_N = 0;
37830 flag_NotZ = 0;
37831 flag_V = 0;
37832 res = 0;
37833 DREGu32((Opcode >> 0) & 7) = res;
37834 RET(CYC)
37835 }
37836
37837 flag_V = 0;
37838 flag_C = 0;
37839 flag_N = src >> 24;
37840 flag_NotZ = src;
37841RET(CYC)
37842#undef CYC
37843}
37844
37845// ROXRD
37846OPCODE(0xE030)
37847{
37848 u32 adr, res;
37849 u32 src, dst;
37850
37851 u32 sft;
37852
37853 sft = DREG((Opcode >> 9) & 7) & 0x3F;
37854 src = DREGu8((Opcode >> 0) & 7);
37855 if (sft)
37856 {
37857 m68kcontext.io_cycle_counter -= sft * 2;
37858 sft %= 9;
37859
37860 src |= (flag_X & M68K_SR_X) << 0;
37861 res = (src >> sft) | (src << (9 - sft));
37862 flag_X = flag_C = res >> 0;
37863 flag_V = 0;
37864 flag_N = res >> 0;
37865 flag_NotZ = res & 0x000000FF;
37866 DREGu8((Opcode >> 0) & 7) = res;
37867 RET(6)
37868 }
37869
37870 flag_V = 0;
37871 flag_C = flag_X;
37872 flag_N = src >> 0;
37873 flag_NotZ = src;
37874RET(6)
37875}
37876
37877// ROXRD
37878OPCODE(0xE070)
37879{
37880 u32 adr, res;
37881 u32 src, dst;
37882
37883 u32 sft;
37884
37885 sft = DREG((Opcode >> 9) & 7) & 0x3F;
37886 src = DREGu16((Opcode >> 0) & 7);
37887 if (sft)
37888 {
37889 m68kcontext.io_cycle_counter -= sft * 2;
37890 sft %= 17;
37891
37892 src |= (flag_X & M68K_SR_X) << 8;
37893 res = (src >> sft) | (src << (17 - sft));
37894 flag_X = flag_C = res >> 8;
37895 flag_V = 0;
37896 flag_N = res >> 8;
37897 flag_NotZ = res & 0x0000FFFF;
37898 DREGu16((Opcode >> 0) & 7) = res;
37899 RET(6)
37900 }
37901
37902 flag_V = 0;
37903 flag_C = flag_X;
37904 flag_N = src >> 8;
37905 flag_NotZ = src;
37906RET(6)
37907}
37908
37909// ROXRD
37910OPCODE(0xE0B0)
37911{
37912#ifdef USE_CYCLONE_TIMING
37913#define CYC 8
37914#else
37915#define CYC 6
37916#endif
37917 u32 adr, res;
37918 u32 src, dst;
37919
37920 u32 sft;
37921
37922 sft = DREG((Opcode >> 9) & 7) & 0x3F;
37923 src = DREGu32((Opcode >> 0) & 7);
37924 if (sft)
37925 {
37926 m68kcontext.io_cycle_counter -= sft * 2;
37927 sft %= 33;
37928
37929 if (sft != 0)
37930 {
37931 if (sft == 1) res = (src >> 1) | ((flag_X & M68K_SR_X) << (32 - (M68K_SR_X_SFT + 1)));
37932 else res = (src >> sft) | (src << (33 - sft)) | (((flag_X & M68K_SR_X) << (32 - (M68K_SR_X_SFT + 1))) >> (sft - 1));
37933 flag_X = (src >> (32 - sft)) << M68K_SR_X_SFT;
37934 }
37935 else res = src;
37936 flag_C = flag_X;
37937 flag_V = 0;
37938 flag_N = res >> 24;
37939 flag_NotZ = res;
37940 DREGu32((Opcode >> 0) & 7) = res;
37941 RET(CYC)
37942 }
37943
37944 flag_V = 0;
37945 flag_C = flag_X;
37946 flag_N = src >> 24;
37947 flag_NotZ = src;
37948RET(CYC)
37949#undef CYC
37950}
37951
37952// RORD
37953OPCODE(0xE038)
37954{
37955 u32 adr, res;
37956 u32 src, dst;
37957
37958 u32 sft;
37959
37960 sft = DREG((Opcode >> 9) & 7) & 0x3F;
37961 src = DREGu8((Opcode >> 0) & 7);
37962 if (sft)
37963 {
37964 m68kcontext.io_cycle_counter -= sft * 2;
37965 sft &= 0x07;
37966
37967 flag_C = src << (M68K_SR_C_SFT - ((sft - 1) & 7));
37968 res = (src >> sft) | (src << (8 - sft));
37969 flag_V = 0;
37970 flag_N = res >> 0;
37971 flag_NotZ = res & 0x000000FF;
37972 DREGu8((Opcode >> 0) & 7) = res;
37973 RET(6)
37974 }
37975
37976 flag_V = 0;
37977 flag_C = 0;
37978 flag_N = src >> 0;
37979 flag_NotZ = src;
37980RET(6)
37981}
37982
37983// RORD
37984OPCODE(0xE078)
37985{
37986 u32 adr, res;
37987 u32 src, dst;
37988
37989 u32 sft;
37990
37991 sft = DREG((Opcode >> 9) & 7) & 0x3F;
37992 src = DREGu16((Opcode >> 0) & 7);
37993 if (sft)
37994 {
37995 m68kcontext.io_cycle_counter -= sft * 2;
37996 sft &= 0x0F;
37997
37998 flag_C = (src >> ((sft - 1) & 15)) << M68K_SR_C_SFT;
37999 res = (src >> sft) | (src << (16 - sft));
38000 flag_V = 0;
38001 flag_N = res >> 8;
38002 flag_NotZ = res & 0x0000FFFF;
38003 DREGu16((Opcode >> 0) & 7) = res;
38004 RET(6)
38005 }
38006
38007 flag_V = 0;
38008 flag_C = 0;
38009 flag_N = src >> 8;
38010 flag_NotZ = src;
38011RET(6)
38012}
38013
38014// RORD
38015OPCODE(0xE0B8)
38016{
38017#ifdef USE_CYCLONE_TIMING
38018#define CYC 8
38019#else
38020#define CYC 6
38021#endif
38022 u32 adr, res;
38023 u32 src, dst;
38024
38025 u32 sft;
38026
38027 sft = DREG((Opcode >> 9) & 7) & 0x3F;
38028 src = DREGu32((Opcode >> 0) & 7);
38029 if (sft)
38030 {
38031 m68kcontext.io_cycle_counter -= sft * 2;
38032 sft &= 0x1F;
38033
38034 flag_C = (src >> ((sft - 1) & 31)) << M68K_SR_C_SFT;
38035 res = (src >> sft) | (src << (32 - sft));
38036 flag_V = 0;
38037 flag_N = res >> 24;
38038 flag_NotZ = res;
38039 DREGu32((Opcode >> 0) & 7) = res;
38040 RET(CYC)
38041 }
38042
38043 flag_V = 0;
38044 flag_C = 0;
38045 flag_N = src >> 24;
38046 flag_NotZ = src;
38047RET(CYC)
38048#undef CYC
38049}
38050
38051// ASLD
38052OPCODE(0xE120)
38053{
38054 u32 adr, res;
38055 u32 src, dst;
38056
38057 u32 sft;
38058
38059 sft = DREG((Opcode >> 9) & 7) & 0x3F;
38060 src = DREGu8((Opcode >> 0) & 7);
38061 if (sft)
38062 {
38063 m68kcontext.io_cycle_counter -= sft * 2;
38064 if (sft < 8)
38065 {
38066 flag_X = flag_C = (src << sft) >> 0;
38067 res = (src << sft) & 0x000000FF;
38068 flag_N = res >> 0;
38069 flag_NotZ = res;
38070 DREGu8((Opcode >> 0) & 7) = res;
38071 flag_V = 0;
38072 {
38073 u32 msk = (((s32)0x80000000) >> (sft + 24)) & 0x000000FF;
38074 src &= msk;
38075 if ((src) && (src != msk)) flag_V = M68K_SR_V;
38076 }
38077 RET(6)
38078 }
38079
38080 if (sft == 256) flag_C = src << M68K_SR_C_SFT;
38081 else flag_C = 0;
38082 flag_X = flag_C;
38083 if (src) flag_V = M68K_SR_V;
38084 else flag_V = 0;
38085 res = 0;
38086 DREGu8((Opcode >> 0) & 7) = res;
38087 flag_N = 0;
38088 flag_NotZ = 0;
38089 RET(6)
38090 }
38091
38092 flag_V = 0;
38093 flag_C = 0;
38094 flag_N = src >> 0;
38095 flag_NotZ = src;
38096RET(6)
38097}
38098
38099// ASLD
38100OPCODE(0xE160)
38101{
38102 u32 adr, res;
38103 u32 src, dst;
38104
38105 u32 sft;
38106
38107 sft = DREG((Opcode >> 9) & 7) & 0x3F;
38108 src = DREGu16((Opcode >> 0) & 7);
38109 if (sft)
38110 {
38111 m68kcontext.io_cycle_counter -= sft * 2;
38112 if (sft < 16)
38113 {
38114 flag_X = flag_C = (src << sft) >> 8;
38115 res = (src << sft) & 0x0000FFFF;
38116 flag_N = res >> 8;
38117 flag_NotZ = res;
38118 DREGu16((Opcode >> 0) & 7) = res;
38119 flag_V = 0;
38120 {
38121 u32 msk = (((s32)0x80000000) >> (sft + 16)) & 0x0000FFFF;
38122 src &= msk;
38123 if ((src) && (src != msk)) flag_V = M68K_SR_V;
38124 }
38125 RET(6)
38126 }
38127
38128 if (sft == 65536) flag_C = src << M68K_SR_C_SFT;
38129 else flag_C = 0;
38130 flag_X = flag_C;
38131 if (src) flag_V = M68K_SR_V;
38132 else flag_V = 0;
38133 res = 0;
38134 DREGu16((Opcode >> 0) & 7) = res;
38135 flag_N = 0;
38136 flag_NotZ = 0;
38137 RET(6)
38138 }
38139
38140 flag_V = 0;
38141 flag_C = 0;
38142 flag_N = src >> 8;
38143 flag_NotZ = src;
38144RET(6)
38145}
38146
38147// ASLD
38148OPCODE(0xE1A0)
38149{
38150#ifdef USE_CYCLONE_TIMING
38151#define CYC 8
38152#else
38153#define CYC 6
38154#endif
38155 u32 adr, res;
38156 u32 src, dst;
38157
38158 u32 sft;
38159
38160 sft = DREG((Opcode >> 9) & 7) & 0x3F;
38161 src = DREGu32((Opcode >> 0) & 7);
38162 if (sft)
38163 {
38164 m68kcontext.io_cycle_counter -= sft * 2;
38165 if (sft < 32)
38166 {
38167 flag_X = flag_C = (src >> (32 - sft)) << M68K_SR_C_SFT;
38168 res = src << sft;
38169 flag_N = res >> 24;
38170 flag_NotZ = res;
38171 DREGu32((Opcode >> 0) & 7) = res;
38172 flag_V = 0;
38173 {
38174 u32 msk = (((s32)0x80000000) >> (sft + 0)) & 0xFFFFFFFF;
38175 src &= msk;
38176 if ((src) && (src != msk)) flag_V = M68K_SR_V;
38177 }
38178 RET(CYC)
38179 }
38180
38181 if (sft == 0) flag_C = src << M68K_SR_C_SFT;
38182 else flag_C = 0;
38183 flag_X = flag_C;
38184 if (src) flag_V = M68K_SR_V;
38185 else flag_V = 0;
38186 res = 0;
38187 DREGu32((Opcode >> 0) & 7) = res;
38188 flag_N = 0;
38189 flag_NotZ = 0;
38190 RET(CYC)
38191 }
38192
38193 flag_V = 0;
38194 flag_C = 0;
38195 flag_N = src >> 24;
38196 flag_NotZ = src;
38197RET(CYC)
38198#undef CYC
38199}
38200
38201// LSLD
38202OPCODE(0xE128)
38203{
38204 u32 adr, res;
38205 u32 src, dst;
38206
38207 u32 sft;
38208
38209 sft = DREG((Opcode >> 9) & 7) & 0x3F;
38210 src = DREGu8((Opcode >> 0) & 7);
38211 if (sft)
38212 {
38213 m68kcontext.io_cycle_counter -= sft * 2;
38214 if (sft <= 8)
38215 {
38216 flag_X = flag_C = (src << sft) >> 0;
38217 res = (src << sft) & 0x000000FF;
38218 flag_V = 0;
38219 flag_N = res >> 0;
38220 flag_NotZ = res;
38221 DREGu8((Opcode >> 0) & 7) = res;
38222 RET(6)
38223 }
38224
38225 flag_X = flag_C = 0;
38226 flag_N = 0;
38227 flag_NotZ = 0;
38228 flag_V = 0;
38229 res = 0;
38230 DREGu8((Opcode >> 0) & 7) = res;
38231 RET(6)
38232 }
38233
38234 flag_V = 0;
38235 flag_C = 0;
38236 flag_N = src >> 0;
38237 flag_NotZ = src;
38238RET(6)
38239}
38240
38241// LSLD
38242OPCODE(0xE168)
38243{
38244 u32 adr, res;
38245 u32 src, dst;
38246
38247 u32 sft;
38248
38249 sft = DREG((Opcode >> 9) & 7) & 0x3F;
38250 src = DREGu16((Opcode >> 0) & 7);
38251 if (sft)
38252 {
38253 m68kcontext.io_cycle_counter -= sft * 2;
38254 if (sft <= 16)
38255 {
38256 flag_X = flag_C = (src << sft) >> 8;
38257 res = (src << sft) & 0x0000FFFF;
38258 flag_V = 0;
38259 flag_N = res >> 8;
38260 flag_NotZ = res;
38261 DREGu16((Opcode >> 0) & 7) = res;
38262 RET(6)
38263 }
38264
38265 flag_X = flag_C = 0;
38266 flag_N = 0;
38267 flag_NotZ = 0;
38268 flag_V = 0;
38269 res = 0;
38270 DREGu16((Opcode >> 0) & 7) = res;
38271 RET(6)
38272 }
38273
38274 flag_V = 0;
38275 flag_C = 0;
38276 flag_N = src >> 8;
38277 flag_NotZ = src;
38278RET(6)
38279}
38280
38281// LSLD
38282OPCODE(0xE1A8)
38283{
38284#ifdef USE_CYCLONE_TIMING
38285#define CYC 8
38286#else
38287#define CYC 6
38288#endif
38289 u32 adr, res;
38290 u32 src, dst;
38291
38292 u32 sft;
38293
38294 sft = DREG((Opcode >> 9) & 7) & 0x3F;
38295 src = DREGu32((Opcode >> 0) & 7);
38296 if (sft)
38297 {
38298 m68kcontext.io_cycle_counter -= sft * 2;
38299 if (sft < 32)
38300 {
38301 flag_X = flag_C = (src >> (32 - sft)) << M68K_SR_C_SFT;
38302 res = src << sft;
38303 flag_V = 0;
38304 flag_N = res >> 24;
38305 flag_NotZ = res;
38306 DREGu32((Opcode >> 0) & 7) = res;
38307 RET(CYC)
38308 }
38309
38310 if (sft == 32) flag_C = src << M68K_SR_C_SFT;
38311 else flag_C = 0;
38312 flag_X = flag_C;
38313 flag_N = 0;
38314 flag_NotZ = 0;
38315 flag_V = 0;
38316 res = 0;
38317 DREGu32((Opcode >> 0) & 7) = res;
38318 RET(CYC)
38319 }
38320
38321 flag_V = 0;
38322 flag_C = 0;
38323 flag_N = src >> 24;
38324 flag_NotZ = src;
38325RET(CYC)
38326#undef CYC
38327}
38328
38329// ROXLD
38330OPCODE(0xE130)
38331{
38332 u32 adr, res;
38333 u32 src, dst;
38334
38335 u32 sft;
38336
38337 sft = DREG((Opcode >> 9) & 7) & 0x3F;
38338 src = DREGu8((Opcode >> 0) & 7);
38339 if (sft)
38340 {
38341 m68kcontext.io_cycle_counter -= sft * 2;
38342 sft %= 9;
38343
38344 src |= (flag_X & M68K_SR_X) << 0;
38345 res = (src << sft) | (src >> (9 - sft));
38346 flag_X = flag_C = res >> 0;
38347 flag_V = 0;
38348 flag_N = res >> 0;
38349 flag_NotZ = res & 0x000000FF;
38350 DREGu8((Opcode >> 0) & 7) = res;
38351 RET(6)
38352 }
38353
38354 flag_V = 0;
38355 flag_C = flag_X;
38356 flag_N = src >> 0;
38357 flag_NotZ = src;
38358RET(6)
38359}
38360
38361// ROXLD
38362OPCODE(0xE170)
38363{
38364 u32 adr, res;
38365 u32 src, dst;
38366
38367 u32 sft;
38368
38369 sft = DREG((Opcode >> 9) & 7) & 0x3F;
38370 src = DREGu16((Opcode >> 0) & 7);
38371 if (sft)
38372 {
38373 m68kcontext.io_cycle_counter -= sft * 2;
38374 sft %= 17;
38375
38376 src |= (flag_X & M68K_SR_X) << 8;
38377 res = (src << sft) | (src >> (17 - sft));
38378 flag_X = flag_C = res >> 8;
38379 flag_V = 0;
38380 flag_N = res >> 8;
38381 flag_NotZ = res & 0x0000FFFF;
38382 DREGu16((Opcode >> 0) & 7) = res;
38383 RET(6)
38384 }
38385
38386 flag_V = 0;
38387 flag_C = flag_X;
38388 flag_N = src >> 8;
38389 flag_NotZ = src;
38390RET(6)
38391}
38392
38393// ROXLD
38394OPCODE(0xE1B0)
38395{
38396#ifdef USE_CYCLONE_TIMING
38397#define CYC 8
38398#else
38399#define CYC 6
38400#endif
38401 u32 adr, res;
38402 u32 src, dst;
38403
38404 u32 sft;
38405
38406 sft = DREG((Opcode >> 9) & 7) & 0x3F;
38407 src = DREGu32((Opcode >> 0) & 7);
38408 if (sft)
38409 {
38410 m68kcontext.io_cycle_counter -= sft * 2;
38411 sft %= 33;
38412
38413 if (sft != 0)
38414 {
38415 if (sft == 1) res = (src << 1) | ((flag_X >> ((M68K_SR_X_SFT + 1) - 1)) & 1);
38416 else res = (src << sft) | (src >> (33 - sft)) | (((flag_X >> ((M68K_SR_X_SFT + 1) - 1)) & 1) << (sft - 1));
38417 flag_X = (src >> (32 - sft)) << M68K_SR_X_SFT;
38418 }
38419 else res = src;
38420 flag_C = flag_X;
38421 flag_V = 0;
38422 flag_N = res >> 24;
38423 flag_NotZ = res;
38424 DREGu32((Opcode >> 0) & 7) = res;
38425 RET(CYC)
38426 }
38427
38428 flag_V = 0;
38429 flag_C = flag_X;
38430 flag_N = src >> 24;
38431 flag_NotZ = src;
38432RET(CYC)
38433#undef CYC
38434}
38435
38436// ROLD
38437OPCODE(0xE138)
38438{
38439 u32 adr, res;
38440 u32 src, dst;
38441
38442 u32 sft;
38443
38444 sft = DREG((Opcode >> 9) & 7) & 0x3F;
38445 src = DREGu8((Opcode >> 0) & 7);
38446 if (sft)
38447 {
38448 m68kcontext.io_cycle_counter -= sft * 2;
38449 if (sft &= 0x07)
38450 {
38451 flag_C = (src << sft) >> 0;
38452 res = ((src << sft) | (src >> (8 - sft))) & 0x000000FF;
38453 flag_V = 0;
38454 flag_N = res >> 0;
38455 flag_NotZ = res;
38456 DREGu8((Opcode >> 0) & 7) = res;
38457 RET(6)
38458 }
38459
38460 flag_V = 0;
38461 flag_C = src << M68K_SR_C_SFT;
38462 flag_N = src >> 0;
38463 flag_NotZ = src;
38464 RET(6)
38465 }
38466
38467 flag_V = 0;
38468 flag_C = 0;
38469 flag_N = src >> 0;
38470 flag_NotZ = src;
38471RET(6)
38472}
38473
38474// ROLD
38475OPCODE(0xE178)
38476{
38477 u32 adr, res;
38478 u32 src, dst;
38479
38480 u32 sft;
38481
38482 sft = DREG((Opcode >> 9) & 7) & 0x3F;
38483 src = DREGu16((Opcode >> 0) & 7);
38484 if (sft)
38485 {
38486 m68kcontext.io_cycle_counter -= sft * 2;
38487 if (sft &= 0x0F)
38488 {
38489 flag_C = (src << sft) >> 8;
38490 res = ((src << sft) | (src >> (16 - sft))) & 0x0000FFFF;
38491 flag_V = 0;
38492 flag_N = res >> 8;
38493 flag_NotZ = res;
38494 DREGu16((Opcode >> 0) & 7) = res;
38495 RET(6)
38496 }
38497
38498 flag_V = 0;
38499 flag_C = src << M68K_SR_C_SFT;
38500 flag_N = src >> 8;
38501 flag_NotZ = src;
38502 RET(6)
38503 }
38504
38505 flag_V = 0;
38506 flag_C = 0;
38507 flag_N = src >> 8;
38508 flag_NotZ = src;
38509RET(6)
38510}
38511
38512// ROLD
38513OPCODE(0xE1B8)
38514{
38515#ifdef USE_CYCLONE_TIMING
38516#define CYC 8
38517#else
38518#define CYC 6
38519#endif
38520 u32 adr, res;
38521 u32 src, dst;
38522
38523 u32 sft;
38524
38525 sft = DREG((Opcode >> 9) & 7) & 0x3F;
38526 src = DREGu32((Opcode >> 0) & 7);
38527 if (sft)
38528 {
38529 m68kcontext.io_cycle_counter -= sft * 2;
38530 if (sft &= 0x1F)
38531 {
38532 flag_C = (src >> (32 - sft)) << M68K_SR_C_SFT;
38533 res = (src << sft) | (src >> (32 - sft));
38534 flag_V = 0;
38535 flag_N = res >> 24;
38536 flag_NotZ = res;
38537 DREGu32((Opcode >> 0) & 7) = res;
38538 RET(CYC)
38539 }
38540
38541 flag_V = 0;
38542 flag_C = src << M68K_SR_C_SFT;
38543 flag_N = src >> 24;
38544 flag_NotZ = src;
38545 RET(CYC)
38546 }
38547
38548 flag_V = 0;
38549 flag_C = 0;
38550 flag_N = src >> 24;
38551 flag_NotZ = src;
38552RET(CYC)
38553#undef CYC
38554}
38555
38556// ASR
38557OPCODE(0xE0D0)
38558{
38559 u32 adr, res;
38560 u32 src, dst;
38561
38562 adr = AREG((Opcode >> 0) & 7);
38563 PRE_IO
38564 READ_WORD_F(adr, src)
38565 flag_V = 0;
38566 flag_X = flag_C = src << M68K_SR_C_SFT;
38567 res = (src >> 1) | (src & (1 << 15));
38568 flag_N = res >> 8;
38569 flag_NotZ = res;
38570 WRITE_WORD_F(adr, res)
38571 POST_IO
38572RET(12)
38573}
38574
38575// ASR
38576OPCODE(0xE0D8)
38577{
38578 u32 adr, res;
38579 u32 src, dst;
38580
38581 adr = AREG((Opcode >> 0) & 7);
38582 AREG((Opcode >> 0) & 7) += 2;
38583 PRE_IO
38584 READ_WORD_F(adr, src)
38585 flag_V = 0;
38586 flag_X = flag_C = src << M68K_SR_C_SFT;
38587 res = (src >> 1) | (src & (1 << 15));
38588 flag_N = res >> 8;
38589 flag_NotZ = res;
38590 WRITE_WORD_F(adr, res)
38591 POST_IO
38592RET(12)
38593}
38594
38595// ASR
38596OPCODE(0xE0E0)
38597{
38598 u32 adr, res;
38599 u32 src, dst;
38600
38601 adr = AREG((Opcode >> 0) & 7) - 2;
38602 AREG((Opcode >> 0) & 7) = adr;
38603 PRE_IO
38604 READ_WORD_F(adr, src)
38605 flag_V = 0;
38606 flag_X = flag_C = src << M68K_SR_C_SFT;
38607 res = (src >> 1) | (src & (1 << 15));
38608 flag_N = res >> 8;
38609 flag_NotZ = res;
38610 WRITE_WORD_F(adr, res)
38611 POST_IO
38612RET(14)
38613}
38614
38615// ASR
38616OPCODE(0xE0E8)
38617{
38618 u32 adr, res;
38619 u32 src, dst;
38620
38621 FETCH_SWORD(adr);
38622 adr += AREG((Opcode >> 0) & 7);
38623 PRE_IO
38624 READ_WORD_F(adr, src)
38625 flag_V = 0;
38626 flag_X = flag_C = src << M68K_SR_C_SFT;
38627 res = (src >> 1) | (src & (1 << 15));
38628 flag_N = res >> 8;
38629 flag_NotZ = res;
38630 WRITE_WORD_F(adr, res)
38631 POST_IO
38632RET(16)
38633}
38634
38635// ASR
38636OPCODE(0xE0F0)
38637{
38638 u32 adr, res;
38639 u32 src, dst;
38640
38641 adr = AREG((Opcode >> 0) & 7);
38642 DECODE_EXT_WORD
38643 PRE_IO
38644 READ_WORD_F(adr, src)
38645 flag_V = 0;
38646 flag_X = flag_C = src << M68K_SR_C_SFT;
38647 res = (src >> 1) | (src & (1 << 15));
38648 flag_N = res >> 8;
38649 flag_NotZ = res;
38650 WRITE_WORD_F(adr, res)
38651 POST_IO
38652RET(18)
38653}
38654
38655// ASR
38656OPCODE(0xE0F8)
38657{
38658 u32 adr, res;
38659 u32 src, dst;
38660
38661 FETCH_SWORD(adr);
38662 PRE_IO
38663 READ_WORD_F(adr, src)
38664 flag_V = 0;
38665 flag_X = flag_C = src << M68K_SR_C_SFT;
38666 res = (src >> 1) | (src & (1 << 15));
38667 flag_N = res >> 8;
38668 flag_NotZ = res;
38669 WRITE_WORD_F(adr, res)
38670 POST_IO
38671RET(16)
38672}
38673
38674// ASR
38675OPCODE(0xE0F9)
38676{
38677 u32 adr, res;
38678 u32 src, dst;
38679
38680 FETCH_LONG(adr);
38681 PRE_IO
38682 READ_WORD_F(adr, src)
38683 flag_V = 0;
38684 flag_X = flag_C = src << M68K_SR_C_SFT;
38685 res = (src >> 1) | (src & (1 << 15));
38686 flag_N = res >> 8;
38687 flag_NotZ = res;
38688 WRITE_WORD_F(adr, res)
38689 POST_IO
38690RET(20)
38691}
38692
38693// ASR
38694OPCODE(0xE0DF)
38695{
38696 u32 adr, res;
38697 u32 src, dst;
38698
38699 adr = AREG(7);
38700 AREG(7) += 2;
38701 PRE_IO
38702 READ_WORD_F(adr, src)
38703 flag_V = 0;
38704 flag_X = flag_C = src << M68K_SR_C_SFT;
38705 res = (src >> 1) | (src & (1 << 15));
38706 flag_N = res >> 8;
38707 flag_NotZ = res;
38708 WRITE_WORD_F(adr, res)
38709 POST_IO
38710RET(12)
38711}
38712
38713// ASR
38714OPCODE(0xE0E7)
38715{
38716 u32 adr, res;
38717 u32 src, dst;
38718
38719 adr = AREG(7) - 2;
38720 AREG(7) = adr;
38721 PRE_IO
38722 READ_WORD_F(adr, src)
38723 flag_V = 0;
38724 flag_X = flag_C = src << M68K_SR_C_SFT;
38725 res = (src >> 1) | (src & (1 << 15));
38726 flag_N = res >> 8;
38727 flag_NotZ = res;
38728 WRITE_WORD_F(adr, res)
38729 POST_IO
38730RET(14)
38731}
38732
38733// LSR
38734OPCODE(0xE2D0)
38735{
38736 u32 adr, res;
38737 u32 src, dst;
38738
38739 adr = AREG((Opcode >> 0) & 7);
38740 PRE_IO
38741 READ_WORD_F(adr, src)
38742 flag_N = flag_V = 0;
38743 flag_X = flag_C = src << M68K_SR_C_SFT;
38744 res = src >> 1;
38745 flag_NotZ = res;
38746 WRITE_WORD_F(adr, res)
38747 POST_IO
38748RET(12)
38749}
38750
38751// LSR
38752OPCODE(0xE2D8)
38753{
38754 u32 adr, res;
38755 u32 src, dst;
38756
38757 adr = AREG((Opcode >> 0) & 7);
38758 AREG((Opcode >> 0) & 7) += 2;
38759 PRE_IO
38760 READ_WORD_F(adr, src)
38761 flag_N = flag_V = 0;
38762 flag_X = flag_C = src << M68K_SR_C_SFT;
38763 res = src >> 1;
38764 flag_NotZ = res;
38765 WRITE_WORD_F(adr, res)
38766 POST_IO
38767RET(12)
38768}
38769
38770// LSR
38771OPCODE(0xE2E0)
38772{
38773 u32 adr, res;
38774 u32 src, dst;
38775
38776 adr = AREG((Opcode >> 0) & 7) - 2;
38777 AREG((Opcode >> 0) & 7) = adr;
38778 PRE_IO
38779 READ_WORD_F(adr, src)
38780 flag_N = flag_V = 0;
38781 flag_X = flag_C = src << M68K_SR_C_SFT;
38782 res = src >> 1;
38783 flag_NotZ = res;
38784 WRITE_WORD_F(adr, res)
38785 POST_IO
38786RET(14)
38787}
38788
38789// LSR
38790OPCODE(0xE2E8)
38791{
38792 u32 adr, res;
38793 u32 src, dst;
38794
38795 FETCH_SWORD(adr);
38796 adr += AREG((Opcode >> 0) & 7);
38797 PRE_IO
38798 READ_WORD_F(adr, src)
38799 flag_N = flag_V = 0;
38800 flag_X = flag_C = src << M68K_SR_C_SFT;
38801 res = src >> 1;
38802 flag_NotZ = res;
38803 WRITE_WORD_F(adr, res)
38804 POST_IO
38805RET(16)
38806}
38807
38808// LSR
38809OPCODE(0xE2F0)
38810{
38811 u32 adr, res;
38812 u32 src, dst;
38813
38814 adr = AREG((Opcode >> 0) & 7);
38815 DECODE_EXT_WORD
38816 PRE_IO
38817 READ_WORD_F(adr, src)
38818 flag_N = flag_V = 0;
38819 flag_X = flag_C = src << M68K_SR_C_SFT;
38820 res = src >> 1;
38821 flag_NotZ = res;
38822 WRITE_WORD_F(adr, res)
38823 POST_IO
38824RET(18)
38825}
38826
38827// LSR
38828OPCODE(0xE2F8)
38829{
38830 u32 adr, res;
38831 u32 src, dst;
38832
38833 FETCH_SWORD(adr);
38834 PRE_IO
38835 READ_WORD_F(adr, src)
38836 flag_N = flag_V = 0;
38837 flag_X = flag_C = src << M68K_SR_C_SFT;
38838 res = src >> 1;
38839 flag_NotZ = res;
38840 WRITE_WORD_F(adr, res)
38841 POST_IO
38842RET(16)
38843}
38844
38845// LSR
38846OPCODE(0xE2F9)
38847{
38848 u32 adr, res;
38849 u32 src, dst;
38850
38851 FETCH_LONG(adr);
38852 PRE_IO
38853 READ_WORD_F(adr, src)
38854 flag_N = flag_V = 0;
38855 flag_X = flag_C = src << M68K_SR_C_SFT;
38856 res = src >> 1;
38857 flag_NotZ = res;
38858 WRITE_WORD_F(adr, res)
38859 POST_IO
38860RET(20)
38861}
38862
38863// LSR
38864OPCODE(0xE2DF)
38865{
38866 u32 adr, res;
38867 u32 src, dst;
38868
38869 adr = AREG(7);
38870 AREG(7) += 2;
38871 PRE_IO
38872 READ_WORD_F(adr, src)
38873 flag_N = flag_V = 0;
38874 flag_X = flag_C = src << M68K_SR_C_SFT;
38875 res = src >> 1;
38876 flag_NotZ = res;
38877 WRITE_WORD_F(adr, res)
38878 POST_IO
38879RET(12)
38880}
38881
38882// LSR
38883OPCODE(0xE2E7)
38884{
38885 u32 adr, res;
38886 u32 src, dst;
38887
38888 adr = AREG(7) - 2;
38889 AREG(7) = adr;
38890 PRE_IO
38891 READ_WORD_F(adr, src)
38892 flag_N = flag_V = 0;
38893 flag_X = flag_C = src << M68K_SR_C_SFT;
38894 res = src >> 1;
38895 flag_NotZ = res;
38896 WRITE_WORD_F(adr, res)
38897 POST_IO
38898RET(14)
38899}
38900
38901// ROXR
38902OPCODE(0xE4D0)
38903{
38904 u32 adr, res;
38905 u32 src, dst;
38906
38907 adr = AREG((Opcode >> 0) & 7);
38908 PRE_IO
38909 READ_WORD_F(adr, src)
38910 flag_V = 0;
38911 res = (src >> 1) | ((flag_X & M68K_SR_X) << 7);
38912 flag_C = flag_X = src << M68K_SR_C_SFT;
38913 flag_N = res >> 8;
38914 flag_NotZ = res;
38915 WRITE_WORD_F(adr, res)
38916 POST_IO
38917RET(12)
38918}
38919
38920// ROXR
38921OPCODE(0xE4D8)
38922{
38923 u32 adr, res;
38924 u32 src, dst;
38925
38926 adr = AREG((Opcode >> 0) & 7);
38927 AREG((Opcode >> 0) & 7) += 2;
38928 PRE_IO
38929 READ_WORD_F(adr, src)
38930 flag_V = 0;
38931 res = (src >> 1) | ((flag_X & M68K_SR_X) << 7);
38932 flag_C = flag_X = src << M68K_SR_C_SFT;
38933 flag_N = res >> 8;
38934 flag_NotZ = res;
38935 WRITE_WORD_F(adr, res)
38936 POST_IO
38937RET(12)
38938}
38939
38940// ROXR
38941OPCODE(0xE4E0)
38942{
38943 u32 adr, res;
38944 u32 src, dst;
38945
38946 adr = AREG((Opcode >> 0) & 7) - 2;
38947 AREG((Opcode >> 0) & 7) = adr;
38948 PRE_IO
38949 READ_WORD_F(adr, src)
38950 flag_V = 0;
38951 res = (src >> 1) | ((flag_X & M68K_SR_X) << 7);
38952 flag_C = flag_X = src << M68K_SR_C_SFT;
38953 flag_N = res >> 8;
38954 flag_NotZ = res;
38955 WRITE_WORD_F(adr, res)
38956 POST_IO
38957RET(14)
38958}
38959
38960// ROXR
38961OPCODE(0xE4E8)
38962{
38963 u32 adr, res;
38964 u32 src, dst;
38965
38966 FETCH_SWORD(adr);
38967 adr += AREG((Opcode >> 0) & 7);
38968 PRE_IO
38969 READ_WORD_F(adr, src)
38970 flag_V = 0;
38971 res = (src >> 1) | ((flag_X & M68K_SR_X) << 7);
38972 flag_C = flag_X = src << M68K_SR_C_SFT;
38973 flag_N = res >> 8;
38974 flag_NotZ = res;
38975 WRITE_WORD_F(adr, res)
38976 POST_IO
38977RET(16)
38978}
38979
38980// ROXR
38981OPCODE(0xE4F0)
38982{
38983 u32 adr, res;
38984 u32 src, dst;
38985
38986 adr = AREG((Opcode >> 0) & 7);
38987 DECODE_EXT_WORD
38988 PRE_IO
38989 READ_WORD_F(adr, src)
38990 flag_V = 0;
38991 res = (src >> 1) | ((flag_X & M68K_SR_X) << 7);
38992 flag_C = flag_X = src << M68K_SR_C_SFT;
38993 flag_N = res >> 8;
38994 flag_NotZ = res;
38995 WRITE_WORD_F(adr, res)
38996 POST_IO
38997RET(18)
38998}
38999
39000// ROXR
39001OPCODE(0xE4F8)
39002{
39003 u32 adr, res;
39004 u32 src, dst;
39005
39006 FETCH_SWORD(adr);
39007 PRE_IO
39008 READ_WORD_F(adr, src)
39009 flag_V = 0;
39010 res = (src >> 1) | ((flag_X & M68K_SR_X) << 7);
39011 flag_C = flag_X = src << M68K_SR_C_SFT;
39012 flag_N = res >> 8;
39013 flag_NotZ = res;
39014 WRITE_WORD_F(adr, res)
39015 POST_IO
39016RET(16)
39017}
39018
39019// ROXR
39020OPCODE(0xE4F9)
39021{
39022 u32 adr, res;
39023 u32 src, dst;
39024
39025 FETCH_LONG(adr);
39026 PRE_IO
39027 READ_WORD_F(adr, src)
39028 flag_V = 0;
39029 res = (src >> 1) | ((flag_X & M68K_SR_X) << 7);
39030 flag_C = flag_X = src << M68K_SR_C_SFT;
39031 flag_N = res >> 8;
39032 flag_NotZ = res;
39033 WRITE_WORD_F(adr, res)
39034 POST_IO
39035RET(20)
39036}
39037
39038// ROXR
39039OPCODE(0xE4DF)
39040{
39041 u32 adr, res;
39042 u32 src, dst;
39043
39044 adr = AREG(7);
39045 AREG(7) += 2;
39046 PRE_IO
39047 READ_WORD_F(adr, src)
39048 flag_V = 0;
39049 res = (src >> 1) | ((flag_X & M68K_SR_X) << 7);
39050 flag_C = flag_X = src << M68K_SR_C_SFT;
39051 flag_N = res >> 8;
39052 flag_NotZ = res;
39053 WRITE_WORD_F(adr, res)
39054 POST_IO
39055RET(12)
39056}
39057
39058// ROXR
39059OPCODE(0xE4E7)
39060{
39061 u32 adr, res;
39062 u32 src, dst;
39063
39064 adr = AREG(7) - 2;
39065 AREG(7) = adr;
39066 PRE_IO
39067 READ_WORD_F(adr, src)
39068 flag_V = 0;
39069 res = (src >> 1) | ((flag_X & M68K_SR_X) << 7);
39070 flag_C = flag_X = src << M68K_SR_C_SFT;
39071 flag_N = res >> 8;
39072 flag_NotZ = res;
39073 WRITE_WORD_F(adr, res)
39074 POST_IO
39075RET(14)
39076}
39077
39078// ROR
39079OPCODE(0xE6D0)
39080{
39081 u32 adr, res;
39082 u32 src, dst;
39083
39084 adr = AREG((Opcode >> 0) & 7);
39085 PRE_IO
39086 READ_WORD_F(adr, src)
39087 flag_V = 0;
39088 flag_C = src << M68K_SR_C_SFT;
39089 res = (src >> 1) | (src << 15);
39090 flag_N = res >> 8;
39091 flag_NotZ = res & 0x0000FFFF;
39092 WRITE_WORD_F(adr, res)
39093 POST_IO
39094RET(12)
39095}
39096
39097// ROR
39098OPCODE(0xE6D8)
39099{
39100 u32 adr, res;
39101 u32 src, dst;
39102
39103 adr = AREG((Opcode >> 0) & 7);
39104 AREG((Opcode >> 0) & 7) += 2;
39105 PRE_IO
39106 READ_WORD_F(adr, src)
39107 flag_V = 0;
39108 flag_C = src << M68K_SR_C_SFT;
39109 res = (src >> 1) | (src << 15);
39110 flag_N = res >> 8;
39111 flag_NotZ = res & 0x0000FFFF;
39112 WRITE_WORD_F(adr, res)
39113 POST_IO
39114RET(12)
39115}
39116
39117// ROR
39118OPCODE(0xE6E0)
39119{
39120 u32 adr, res;
39121 u32 src, dst;
39122
39123 adr = AREG((Opcode >> 0) & 7) - 2;
39124 AREG((Opcode >> 0) & 7) = adr;
39125 PRE_IO
39126 READ_WORD_F(adr, src)
39127 flag_V = 0;
39128 flag_C = src << M68K_SR_C_SFT;
39129 res = (src >> 1) | (src << 15);
39130 flag_N = res >> 8;
39131 flag_NotZ = res & 0x0000FFFF;
39132 WRITE_WORD_F(adr, res)
39133 POST_IO
39134RET(14)
39135}
39136
39137// ROR
39138OPCODE(0xE6E8)
39139{
39140 u32 adr, res;
39141 u32 src, dst;
39142
39143 FETCH_SWORD(adr);
39144 adr += AREG((Opcode >> 0) & 7);
39145 PRE_IO
39146 READ_WORD_F(adr, src)
39147 flag_V = 0;
39148 flag_C = src << M68K_SR_C_SFT;
39149 res = (src >> 1) | (src << 15);
39150 flag_N = res >> 8;
39151 flag_NotZ = res & 0x0000FFFF;
39152 WRITE_WORD_F(adr, res)
39153 POST_IO
39154RET(16)
39155}
39156
39157// ROR
39158OPCODE(0xE6F0)
39159{
39160 u32 adr, res;
39161 u32 src, dst;
39162
39163 adr = AREG((Opcode >> 0) & 7);
39164 DECODE_EXT_WORD
39165 PRE_IO
39166 READ_WORD_F(adr, src)
39167 flag_V = 0;
39168 flag_C = src << M68K_SR_C_SFT;
39169 res = (src >> 1) | (src << 15);
39170 flag_N = res >> 8;
39171 flag_NotZ = res & 0x0000FFFF;
39172 WRITE_WORD_F(adr, res)
39173 POST_IO
39174RET(18)
39175}
39176
39177// ROR
39178OPCODE(0xE6F8)
39179{
39180 u32 adr, res;
39181 u32 src, dst;
39182
39183 FETCH_SWORD(adr);
39184 PRE_IO
39185 READ_WORD_F(adr, src)
39186 flag_V = 0;
39187 flag_C = src << M68K_SR_C_SFT;
39188 res = (src >> 1) | (src << 15);
39189 flag_N = res >> 8;
39190 flag_NotZ = res & 0x0000FFFF;
39191 WRITE_WORD_F(adr, res)
39192 POST_IO
39193RET(16)
39194}
39195
39196// ROR
39197OPCODE(0xE6F9)
39198{
39199 u32 adr, res;
39200 u32 src, dst;
39201
39202 FETCH_LONG(adr);
39203 PRE_IO
39204 READ_WORD_F(adr, src)
39205 flag_V = 0;
39206 flag_C = src << M68K_SR_C_SFT;
39207 res = (src >> 1) | (src << 15);
39208 flag_N = res >> 8;
39209 flag_NotZ = res & 0x0000FFFF;
39210 WRITE_WORD_F(adr, res)
39211 POST_IO
39212RET(20)
39213}
39214
39215// ROR
39216OPCODE(0xE6DF)
39217{
39218 u32 adr, res;
39219 u32 src, dst;
39220
39221 adr = AREG(7);
39222 AREG(7) += 2;
39223 PRE_IO
39224 READ_WORD_F(adr, src)
39225 flag_V = 0;
39226 flag_C = src << M68K_SR_C_SFT;
39227 res = (src >> 1) | (src << 15);
39228 flag_N = res >> 8;
39229 flag_NotZ = res & 0x0000FFFF;
39230 WRITE_WORD_F(adr, res)
39231 POST_IO
39232RET(12)
39233}
39234
39235// ROR
39236OPCODE(0xE6E7)
39237{
39238 u32 adr, res;
39239 u32 src, dst;
39240
39241 adr = AREG(7) - 2;
39242 AREG(7) = adr;
39243 PRE_IO
39244 READ_WORD_F(adr, src)
39245 flag_V = 0;
39246 flag_C = src << M68K_SR_C_SFT;
39247 res = (src >> 1) | (src << 15);
39248 flag_N = res >> 8;
39249 flag_NotZ = res & 0x0000FFFF;
39250 WRITE_WORD_F(adr, res)
39251 POST_IO
39252RET(14)
39253}
39254
39255// ASL
39256OPCODE(0xE1D0)
39257{
39258 u32 adr, res;
39259 u32 src, dst;
39260
39261 adr = AREG((Opcode >> 0) & 7);
39262 PRE_IO
39263 READ_WORD_F(adr, src)
39264 flag_X = flag_C = src >> 7;
39265 res = src << 1;
39266 flag_V = (src ^ res) >> 8;
39267 flag_N = res >> 8;
39268 flag_NotZ = res & 0x0000FFFF;
39269 WRITE_WORD_F(adr, res)
39270 POST_IO
39271RET(12)
39272}
39273
39274// ASL
39275OPCODE(0xE1D8)
39276{
39277 u32 adr, res;
39278 u32 src, dst;
39279
39280 adr = AREG((Opcode >> 0) & 7);
39281 AREG((Opcode >> 0) & 7) += 2;
39282 PRE_IO
39283 READ_WORD_F(adr, src)
39284 flag_X = flag_C = src >> 7;
39285 res = src << 1;
39286 flag_V = (src ^ res) >> 8;
39287 flag_N = res >> 8;
39288 flag_NotZ = res & 0x0000FFFF;
39289 WRITE_WORD_F(adr, res)
39290 POST_IO
39291RET(12)
39292}
39293
39294// ASL
39295OPCODE(0xE1E0)
39296{
39297 u32 adr, res;
39298 u32 src, dst;
39299
39300 adr = AREG((Opcode >> 0) & 7) - 2;
39301 AREG((Opcode >> 0) & 7) = adr;
39302 PRE_IO
39303 READ_WORD_F(adr, src)
39304 flag_X = flag_C = src >> 7;
39305 res = src << 1;
39306 flag_V = (src ^ res) >> 8;
39307 flag_N = res >> 8;
39308 flag_NotZ = res & 0x0000FFFF;
39309 WRITE_WORD_F(adr, res)
39310 POST_IO
39311RET(14)
39312}
39313
39314// ASL
39315OPCODE(0xE1E8)
39316{
39317 u32 adr, res;
39318 u32 src, dst;
39319
39320 FETCH_SWORD(adr);
39321 adr += AREG((Opcode >> 0) & 7);
39322 PRE_IO
39323 READ_WORD_F(adr, src)
39324 flag_X = flag_C = src >> 7;
39325 res = src << 1;
39326 flag_V = (src ^ res) >> 8;
39327 flag_N = res >> 8;
39328 flag_NotZ = res & 0x0000FFFF;
39329 WRITE_WORD_F(adr, res)
39330 POST_IO
39331RET(16)
39332}
39333
39334// ASL
39335OPCODE(0xE1F0)
39336{
39337 u32 adr, res;
39338 u32 src, dst;
39339
39340 adr = AREG((Opcode >> 0) & 7);
39341 DECODE_EXT_WORD
39342 PRE_IO
39343 READ_WORD_F(adr, src)
39344 flag_X = flag_C = src >> 7;
39345 res = src << 1;
39346 flag_V = (src ^ res) >> 8;
39347 flag_N = res >> 8;
39348 flag_NotZ = res & 0x0000FFFF;
39349 WRITE_WORD_F(adr, res)
39350 POST_IO
39351RET(18)
39352}
39353
39354// ASL
39355OPCODE(0xE1F8)
39356{
39357 u32 adr, res;
39358 u32 src, dst;
39359
39360 FETCH_SWORD(adr);
39361 PRE_IO
39362 READ_WORD_F(adr, src)
39363 flag_X = flag_C = src >> 7;
39364 res = src << 1;
39365 flag_V = (src ^ res) >> 8;
39366 flag_N = res >> 8;
39367 flag_NotZ = res & 0x0000FFFF;
39368 WRITE_WORD_F(adr, res)
39369 POST_IO
39370RET(16)
39371}
39372
39373// ASL
39374OPCODE(0xE1F9)
39375{
39376 u32 adr, res;
39377 u32 src, dst;
39378
39379 FETCH_LONG(adr);
39380 PRE_IO
39381 READ_WORD_F(adr, src)
39382 flag_X = flag_C = src >> 7;
39383 res = src << 1;
39384 flag_V = (src ^ res) >> 8;
39385 flag_N = res >> 8;
39386 flag_NotZ = res & 0x0000FFFF;
39387 WRITE_WORD_F(adr, res)
39388 POST_IO
39389RET(20)
39390}
39391
39392// ASL
39393OPCODE(0xE1DF)
39394{
39395 u32 adr, res;
39396 u32 src, dst;
39397
39398 adr = AREG(7);
39399 AREG(7) += 2;
39400 PRE_IO
39401 READ_WORD_F(adr, src)
39402 flag_X = flag_C = src >> 7;
39403 res = src << 1;
39404 flag_V = (src ^ res) >> 8;
39405 flag_N = res >> 8;
39406 flag_NotZ = res & 0x0000FFFF;
39407 WRITE_WORD_F(adr, res)
39408 POST_IO
39409RET(12)
39410}
39411
39412// ASL
39413OPCODE(0xE1E7)
39414{
39415 u32 adr, res;
39416 u32 src, dst;
39417
39418 adr = AREG(7) - 2;
39419 AREG(7) = adr;
39420 PRE_IO
39421 READ_WORD_F(adr, src)
39422 flag_X = flag_C = src >> 7;
39423 res = src << 1;
39424 flag_V = (src ^ res) >> 8;
39425 flag_N = res >> 8;
39426 flag_NotZ = res & 0x0000FFFF;
39427 WRITE_WORD_F(adr, res)
39428 POST_IO
39429RET(14)
39430}
39431
39432// LSL
39433OPCODE(0xE3D0)
39434{
39435 u32 adr, res;
39436 u32 src, dst;
39437
39438 adr = AREG((Opcode >> 0) & 7);
39439 PRE_IO
39440 READ_WORD_F(adr, src)
39441 flag_V = 0;
39442 flag_X = flag_C = src >> 7;
39443 res = src << 1;
39444 flag_N = res >> 8;
39445 flag_NotZ = res & 0x0000FFFF;
39446 WRITE_WORD_F(adr, res)
39447 POST_IO
39448RET(12)
39449}
39450
39451// LSL
39452OPCODE(0xE3D8)
39453{
39454 u32 adr, res;
39455 u32 src, dst;
39456
39457 adr = AREG((Opcode >> 0) & 7);
39458 AREG((Opcode >> 0) & 7) += 2;
39459 PRE_IO
39460 READ_WORD_F(adr, src)
39461 flag_V = 0;
39462 flag_X = flag_C = src >> 7;
39463 res = src << 1;
39464 flag_N = res >> 8;
39465 flag_NotZ = res & 0x0000FFFF;
39466 WRITE_WORD_F(adr, res)
39467 POST_IO
39468RET(12)
39469}
39470
39471// LSL
39472OPCODE(0xE3E0)
39473{
39474 u32 adr, res;
39475 u32 src, dst;
39476
39477 adr = AREG((Opcode >> 0) & 7) - 2;
39478 AREG((Opcode >> 0) & 7) = adr;
39479 PRE_IO
39480 READ_WORD_F(adr, src)
39481 flag_V = 0;
39482 flag_X = flag_C = src >> 7;
39483 res = src << 1;
39484 flag_N = res >> 8;
39485 flag_NotZ = res & 0x0000FFFF;
39486 WRITE_WORD_F(adr, res)
39487 POST_IO
39488RET(14)
39489}
39490
39491// LSL
39492OPCODE(0xE3E8)
39493{
39494 u32 adr, res;
39495 u32 src, dst;
39496
39497 FETCH_SWORD(adr);
39498 adr += AREG((Opcode >> 0) & 7);
39499 PRE_IO
39500 READ_WORD_F(adr, src)
39501 flag_V = 0;
39502 flag_X = flag_C = src >> 7;
39503 res = src << 1;
39504 flag_N = res >> 8;
39505 flag_NotZ = res & 0x0000FFFF;
39506 WRITE_WORD_F(adr, res)
39507 POST_IO
39508RET(16)
39509}
39510
39511// LSL
39512OPCODE(0xE3F0)
39513{
39514 u32 adr, res;
39515 u32 src, dst;
39516
39517 adr = AREG((Opcode >> 0) & 7);
39518 DECODE_EXT_WORD
39519 PRE_IO
39520 READ_WORD_F(adr, src)
39521 flag_V = 0;
39522 flag_X = flag_C = src >> 7;
39523 res = src << 1;
39524 flag_N = res >> 8;
39525 flag_NotZ = res & 0x0000FFFF;
39526 WRITE_WORD_F(adr, res)
39527 POST_IO
39528RET(18)
39529}
39530
39531// LSL
39532OPCODE(0xE3F8)
39533{
39534 u32 adr, res;
39535 u32 src, dst;
39536
39537 FETCH_SWORD(adr);
39538 PRE_IO
39539 READ_WORD_F(adr, src)
39540 flag_V = 0;
39541 flag_X = flag_C = src >> 7;
39542 res = src << 1;
39543 flag_N = res >> 8;
39544 flag_NotZ = res & 0x0000FFFF;
39545 WRITE_WORD_F(adr, res)
39546 POST_IO
39547RET(16)
39548}
39549
39550// LSL
39551OPCODE(0xE3F9)
39552{
39553 u32 adr, res;
39554 u32 src, dst;
39555
39556 FETCH_LONG(adr);
39557 PRE_IO
39558 READ_WORD_F(adr, src)
39559 flag_V = 0;
39560 flag_X = flag_C = src >> 7;
39561 res = src << 1;
39562 flag_N = res >> 8;
39563 flag_NotZ = res & 0x0000FFFF;
39564 WRITE_WORD_F(adr, res)
39565 POST_IO
39566RET(20)
39567}
39568
39569// LSL
39570OPCODE(0xE3DF)
39571{
39572 u32 adr, res;
39573 u32 src, dst;
39574
39575 adr = AREG(7);
39576 AREG(7) += 2;
39577 PRE_IO
39578 READ_WORD_F(adr, src)
39579 flag_V = 0;
39580 flag_X = flag_C = src >> 7;
39581 res = src << 1;
39582 flag_N = res >> 8;
39583 flag_NotZ = res & 0x0000FFFF;
39584 WRITE_WORD_F(adr, res)
39585 POST_IO
39586RET(12)
39587}
39588
39589// LSL
39590OPCODE(0xE3E7)
39591{
39592 u32 adr, res;
39593 u32 src, dst;
39594
39595 adr = AREG(7) - 2;
39596 AREG(7) = adr;
39597 PRE_IO
39598 READ_WORD_F(adr, src)
39599 flag_V = 0;
39600 flag_X = flag_C = src >> 7;
39601 res = src << 1;
39602 flag_N = res >> 8;
39603 flag_NotZ = res & 0x0000FFFF;
39604 WRITE_WORD_F(adr, res)
39605 POST_IO
39606RET(14)
39607}
39608
39609// ROXL
39610OPCODE(0xE5D0)
39611{
39612 u32 adr, res;
39613 u32 src, dst;
39614
39615 adr = AREG((Opcode >> 0) & 7);
39616 PRE_IO
39617 READ_WORD_F(adr, src)
39618 flag_V = 0;
39619 res = (src << 1) | ((flag_X & M68K_SR_X) >> 8);
39620 flag_X = flag_C = src >> 7;
39621 flag_N = res >> 8;
39622 flag_NotZ = res & 0x0000FFFF;
39623 WRITE_WORD_F(adr, res)
39624 POST_IO
39625RET(12)
39626}
39627
39628// ROXL
39629OPCODE(0xE5D8)
39630{
39631 u32 adr, res;
39632 u32 src, dst;
39633
39634 adr = AREG((Opcode >> 0) & 7);
39635 AREG((Opcode >> 0) & 7) += 2;
39636 PRE_IO
39637 READ_WORD_F(adr, src)
39638 flag_V = 0;
39639 res = (src << 1) | ((flag_X & M68K_SR_X) >> 8);
39640 flag_X = flag_C = src >> 7;
39641 flag_N = res >> 8;
39642 flag_NotZ = res & 0x0000FFFF;
39643 WRITE_WORD_F(adr, res)
39644 POST_IO
39645RET(12)
39646}
39647
39648// ROXL
39649OPCODE(0xE5E0)
39650{
39651 u32 adr, res;
39652 u32 src, dst;
39653
39654 adr = AREG((Opcode >> 0) & 7) - 2;
39655 AREG((Opcode >> 0) & 7) = adr;
39656 PRE_IO
39657 READ_WORD_F(adr, src)
39658 flag_V = 0;
39659 res = (src << 1) | ((flag_X & M68K_SR_X) >> 8);
39660 flag_X = flag_C = src >> 7;
39661 flag_N = res >> 8;
39662 flag_NotZ = res & 0x0000FFFF;
39663 WRITE_WORD_F(adr, res)
39664 POST_IO
39665RET(14)
39666}
39667
39668// ROXL
39669OPCODE(0xE5E8)
39670{
39671 u32 adr, res;
39672 u32 src, dst;
39673
39674 FETCH_SWORD(adr);
39675 adr += AREG((Opcode >> 0) & 7);
39676 PRE_IO
39677 READ_WORD_F(adr, src)
39678 flag_V = 0;
39679 res = (src << 1) | ((flag_X & M68K_SR_X) >> 8);
39680 flag_X = flag_C = src >> 7;
39681 flag_N = res >> 8;
39682 flag_NotZ = res & 0x0000FFFF;
39683 WRITE_WORD_F(adr, res)
39684 POST_IO
39685RET(16)
39686}
39687
39688// ROXL
39689OPCODE(0xE5F0)
39690{
39691 u32 adr, res;
39692 u32 src, dst;
39693
39694 adr = AREG((Opcode >> 0) & 7);
39695 DECODE_EXT_WORD
39696 PRE_IO
39697 READ_WORD_F(adr, src)
39698 flag_V = 0;
39699 res = (src << 1) | ((flag_X & M68K_SR_X) >> 8);
39700 flag_X = flag_C = src >> 7;
39701 flag_N = res >> 8;
39702 flag_NotZ = res & 0x0000FFFF;
39703 WRITE_WORD_F(adr, res)
39704 POST_IO
39705RET(18)
39706}
39707
39708// ROXL
39709OPCODE(0xE5F8)
39710{
39711 u32 adr, res;
39712 u32 src, dst;
39713
39714 FETCH_SWORD(adr);
39715 PRE_IO
39716 READ_WORD_F(adr, src)
39717 flag_V = 0;
39718 res = (src << 1) | ((flag_X & M68K_SR_X) >> 8);
39719 flag_X = flag_C = src >> 7;
39720 flag_N = res >> 8;
39721 flag_NotZ = res & 0x0000FFFF;
39722 WRITE_WORD_F(adr, res)
39723 POST_IO
39724RET(16)
39725}
39726
39727// ROXL
39728OPCODE(0xE5F9)
39729{
39730 u32 adr, res;
39731 u32 src, dst;
39732
39733 FETCH_LONG(adr);
39734 PRE_IO
39735 READ_WORD_F(adr, src)
39736 flag_V = 0;
39737 res = (src << 1) | ((flag_X & M68K_SR_X) >> 8);
39738 flag_X = flag_C = src >> 7;
39739 flag_N = res >> 8;
39740 flag_NotZ = res & 0x0000FFFF;
39741 WRITE_WORD_F(adr, res)
39742 POST_IO
39743RET(20)
39744}
39745
39746// ROXL
39747OPCODE(0xE5DF)
39748{
39749 u32 adr, res;
39750 u32 src, dst;
39751
39752 adr = AREG(7);
39753 AREG(7) += 2;
39754 PRE_IO
39755 READ_WORD_F(adr, src)
39756 flag_V = 0;
39757 res = (src << 1) | ((flag_X & M68K_SR_X) >> 8);
39758 flag_X = flag_C = src >> 7;
39759 flag_N = res >> 8;
39760 flag_NotZ = res & 0x0000FFFF;
39761 WRITE_WORD_F(adr, res)
39762 POST_IO
39763RET(12)
39764}
39765
39766// ROXL
39767OPCODE(0xE5E7)
39768{
39769 u32 adr, res;
39770 u32 src, dst;
39771
39772 adr = AREG(7) - 2;
39773 AREG(7) = adr;
39774 PRE_IO
39775 READ_WORD_F(adr, src)
39776 flag_V = 0;
39777 res = (src << 1) | ((flag_X & M68K_SR_X) >> 8);
39778 flag_X = flag_C = src >> 7;
39779 flag_N = res >> 8;
39780 flag_NotZ = res & 0x0000FFFF;
39781 WRITE_WORD_F(adr, res)
39782 POST_IO
39783RET(14)
39784}
39785
39786// ROL
39787OPCODE(0xE7D0)
39788{
39789 u32 adr, res;
39790 u32 src, dst;
39791
39792 adr = AREG((Opcode >> 0) & 7);
39793 PRE_IO
39794 READ_WORD_F(adr, src)
39795 flag_V = 0;
39796 flag_C = src >> 7;
39797 res = (src << 1) | (src >> 15);
39798 flag_N = res >> 8;
39799 flag_NotZ = res & 0x0000FFFF;
39800 WRITE_WORD_F(adr, res)
39801 POST_IO
39802RET(12)
39803}
39804
39805// ROL
39806OPCODE(0xE7D8)
39807{
39808 u32 adr, res;
39809 u32 src, dst;
39810
39811 adr = AREG((Opcode >> 0) & 7);
39812 AREG((Opcode >> 0) & 7) += 2;
39813 PRE_IO
39814 READ_WORD_F(adr, src)
39815 flag_V = 0;
39816 flag_C = src >> 7;
39817 res = (src << 1) | (src >> 15);
39818 flag_N = res >> 8;
39819 flag_NotZ = res & 0x0000FFFF;
39820 WRITE_WORD_F(adr, res)
39821 POST_IO
39822RET(12)
39823}
39824
39825// ROL
39826OPCODE(0xE7E0)
39827{
39828 u32 adr, res;
39829 u32 src, dst;
39830
39831 adr = AREG((Opcode >> 0) & 7) - 2;
39832 AREG((Opcode >> 0) & 7) = adr;
39833 PRE_IO
39834 READ_WORD_F(adr, src)
39835 flag_V = 0;
39836 flag_C = src >> 7;
39837 res = (src << 1) | (src >> 15);
39838 flag_N = res >> 8;
39839 flag_NotZ = res & 0x0000FFFF;
39840 WRITE_WORD_F(adr, res)
39841 POST_IO
39842RET(14)
39843}
39844
39845// ROL
39846OPCODE(0xE7E8)
39847{
39848 u32 adr, res;
39849 u32 src, dst;
39850
39851 FETCH_SWORD(adr);
39852 adr += AREG((Opcode >> 0) & 7);
39853 PRE_IO
39854 READ_WORD_F(adr, src)
39855 flag_V = 0;
39856 flag_C = src >> 7;
39857 res = (src << 1) | (src >> 15);
39858 flag_N = res >> 8;
39859 flag_NotZ = res & 0x0000FFFF;
39860 WRITE_WORD_F(adr, res)
39861 POST_IO
39862RET(16)
39863}
39864
39865// ROL
39866OPCODE(0xE7F0)
39867{
39868 u32 adr, res;
39869 u32 src, dst;
39870
39871 adr = AREG((Opcode >> 0) & 7);
39872 DECODE_EXT_WORD
39873 PRE_IO
39874 READ_WORD_F(adr, src)
39875 flag_V = 0;
39876 flag_C = src >> 7;
39877 res = (src << 1) | (src >> 15);
39878 flag_N = res >> 8;
39879 flag_NotZ = res & 0x0000FFFF;
39880 WRITE_WORD_F(adr, res)
39881 POST_IO
39882RET(18)
39883}
39884
39885// ROL
39886OPCODE(0xE7F8)
39887{
39888 u32 adr, res;
39889 u32 src, dst;
39890
39891 FETCH_SWORD(adr);
39892 PRE_IO
39893 READ_WORD_F(adr, src)
39894 flag_V = 0;
39895 flag_C = src >> 7;
39896 res = (src << 1) | (src >> 15);
39897 flag_N = res >> 8;
39898 flag_NotZ = res & 0x0000FFFF;
39899 WRITE_WORD_F(adr, res)
39900 POST_IO
39901RET(16)
39902}
39903
39904// ROL
39905OPCODE(0xE7F9)
39906{
39907 u32 adr, res;
39908 u32 src, dst;
39909
39910 FETCH_LONG(adr);
39911 PRE_IO
39912 READ_WORD_F(adr, src)
39913 flag_V = 0;
39914 flag_C = src >> 7;
39915 res = (src << 1) | (src >> 15);
39916 flag_N = res >> 8;
39917 flag_NotZ = res & 0x0000FFFF;
39918 WRITE_WORD_F(adr, res)
39919 POST_IO
39920RET(20)
39921}
39922
39923// ROL
39924OPCODE(0xE7DF)
39925{
39926 u32 adr, res;
39927 u32 src, dst;
39928
39929 adr = AREG(7);
39930 AREG(7) += 2;
39931 PRE_IO
39932 READ_WORD_F(adr, src)
39933 flag_V = 0;
39934 flag_C = src >> 7;
39935 res = (src << 1) | (src >> 15);
39936 flag_N = res >> 8;
39937 flag_NotZ = res & 0x0000FFFF;
39938 WRITE_WORD_F(adr, res)
39939 POST_IO
39940RET(12)
39941}
39942
39943// ROL
39944OPCODE(0xE7E7)
39945{
39946 u32 adr, res;
39947 u32 src, dst;
39948
39949 adr = AREG(7) - 2;
39950 AREG(7) = adr;
39951 PRE_IO
39952 READ_WORD_F(adr, src)
39953 flag_V = 0;
39954 flag_C = src >> 7;
39955 res = (src << 1) | (src >> 15);
39956 flag_N = res >> 8;
39957 flag_NotZ = res & 0x0000FFFF;
39958 WRITE_WORD_F(adr, res)
39959 POST_IO
39960RET(14)
39961}
39962
c060a9ab 39963#ifdef PICODRIVE_HACK
8187ba84 39964#if 0
39965#define UPDATE_IDLE_COUNT { \
39966 extern int idle_hit_counter; \
39967 idle_hit_counter++; \
39968}
39969#else
39970#define UPDATE_IDLE_COUNT
39971#endif
39972
c060a9ab 39973// BRA
39974OPCODE(0x6001_idle)
39975{
39976#ifdef FAMEC_CHECK_BRANCHES
be26eb23 39977 u32 newPC = GET_PC;
c060a9ab 39978 s8 offs=Opcode;
39979 newPC += offs;
39980 SET_PC(newPC);
39981 CHECK_BRANCH_EXCEPTION(offs)
39982#else
39983 PC += ((s8)(Opcode & 0xFE)) >> 1;
39984#endif
8187ba84 39985 UPDATE_IDLE_COUNT
fcf94fcc 39986RET0()
c060a9ab 39987}
39988
39989// BCC
39990OPCODE(0x6601_idle)
39991{
39992 if (flag_NotZ)
39993 {
8187ba84 39994 UPDATE_IDLE_COUNT
c060a9ab 39995 PC += ((s8)(Opcode & 0xFE)) >> 1;
fcf94fcc 39996 //if (idle_hit)
39997 RET0()
c060a9ab 39998 }
39999RET(8)
40000}
40001
40002OPCODE(0x6701_idle)
40003{
40004 if (!flag_NotZ)
40005 {
8187ba84 40006 UPDATE_IDLE_COUNT
c060a9ab 40007 PC += ((s8)(Opcode & 0xFE)) >> 1;
fcf94fcc 40008 //if (idle_hit)
40009 RET0()
c060a9ab 40010 }
40011RET(8)
40012}
40013
40014
40015extern int SekIsIdleCode(unsigned short *dst, int bytes);
5ed2a20e 40016extern int SekRegisterIdlePatch(unsigned int pc, int oldop, int newop, void *ctx);
c060a9ab 40017
40018OPCODE(idle_detector_bcc8)
40019{
40020 extern int idledet_start_frame;
40021 extern char Pico[];
40022 int frame_count, cond_true, bytes, ret, newop;
40023 u16 *dest_pc;
40024
40025 dest_pc = PC + (((s8)(Opcode & 0xFE)) >> 1);
40026
40027 frame_count = *(int *)(Pico+0x22208+0x1c); // Pico.m.frame_count
40028 if (frame_count < idledet_start_frame)
40029 goto end;
40030
40031 bytes = 0 - (s8)(Opcode & 0xFE) - 2;
40032 ret = SekIsIdleCode(dest_pc, bytes);
40033 newop = (Opcode & 0xfe) | 0x7100;
40034 if (!ret) newop |= 0x200;
5ed2a20e 40035 if ( Opcode & 0x0100) newop |= 0x400; // beq
40036 if (!(Opcode & 0x0f00)) newop |= 0xc00; // bra
c060a9ab 40037
5ed2a20e 40038 ret = SekRegisterIdlePatch(GET_PC - 2, Opcode, newop, &m68kcontext);
c060a9ab 40039 switch (ret)
40040 {
40041 case 0: PC[-1] = newop; break;
40042 case 1: break;
5ed2a20e 40043 case 2: JumpTable[Opcode] = (Opcode & 0x0f00) ?
40044 ((Opcode & 0x0100) ? CAST_OP(0x6701) : CAST_OP(0x6601)) :
40045 CAST_OP(0x6001); break;
c060a9ab 40046 }
40047
40048end:
5ed2a20e 40049 if ((Opcode & 0xff00) == 0x6000) cond_true = 1;
40050 else cond_true = (Opcode & 0x0100) ? !flag_NotZ : flag_NotZ; // beq?
c060a9ab 40051 if (cond_true)
40052 {
40053 PC = dest_pc;
40054 m68kcontext.io_cycle_counter -= 2;
40055 }
40056RET(8)
40057}
40058
c060a9ab 40059#endif // PICODRIVE_HACK