3 /* ======================================================================== */
\r
4 /* ========================= INSTRUCTION HANDLERS ========================= */
\r
5 /* ======================================================================== */
\r
8 void m68k_op_nbcd_8_d(void)
\r
12 uint res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1());
\r
16 FLAG_V = ~res; /* Undefined V behavior */
\r
18 if((res & 0x0f) == 0xa)
\r
19 res = (res & 0xf0) + 0x10;
\r
21 res = MASK_OUT_ABOVE_8(res);
\r
23 FLAG_V &= res; /* Undefined V behavior part II */
\r
25 *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
\r
33 FLAG_V = VFLAG_CLEAR;
\r
34 FLAG_C = CFLAG_CLEAR;
\r
35 FLAG_X = XFLAG_CLEAR;
\r
37 FLAG_N = NFLAG_8(res); /* Undefined N behavior */
\r
41 void m68k_op_nbcd_8_ai(void)
\r
43 uint ea = EA_AY_AI_8();
\r
44 uint dst = m68ki_read_8(ea);
\r
45 uint res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1());
\r
49 FLAG_V = ~res; /* Undefined V behavior */
\r
51 if((res & 0x0f) == 0xa)
\r
52 res = (res & 0xf0) + 0x10;
\r
54 res = MASK_OUT_ABOVE_8(res);
\r
56 FLAG_V &= res; /* Undefined V behavior part II */
\r
58 m68ki_write_8(ea, MASK_OUT_ABOVE_8(res));
\r
66 FLAG_V = VFLAG_CLEAR;
\r
67 FLAG_C = CFLAG_CLEAR;
\r
68 FLAG_X = XFLAG_CLEAR;
\r
70 FLAG_N = NFLAG_8(res); /* Undefined N behavior */
\r
74 void m68k_op_nbcd_8_pi(void)
\r
76 uint ea = EA_AY_PI_8();
\r
77 uint dst = m68ki_read_8(ea);
\r
78 uint res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1());
\r
82 FLAG_V = ~res; /* Undefined V behavior */
\r
84 if((res & 0x0f) == 0xa)
\r
85 res = (res & 0xf0) + 0x10;
\r
87 res = MASK_OUT_ABOVE_8(res);
\r
89 FLAG_V &= res; /* Undefined V behavior part II */
\r
91 m68ki_write_8(ea, MASK_OUT_ABOVE_8(res));
\r
99 FLAG_V = VFLAG_CLEAR;
\r
100 FLAG_C = CFLAG_CLEAR;
\r
101 FLAG_X = XFLAG_CLEAR;
\r
103 FLAG_N = NFLAG_8(res); /* Undefined N behavior */
\r
107 void m68k_op_nbcd_8_pi7(void)
\r
109 uint ea = EA_A7_PI_8();
\r
110 uint dst = m68ki_read_8(ea);
\r
111 uint res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1());
\r
115 FLAG_V = ~res; /* Undefined V behavior */
\r
117 if((res & 0x0f) == 0xa)
\r
118 res = (res & 0xf0) + 0x10;
\r
120 res = MASK_OUT_ABOVE_8(res);
\r
122 FLAG_V &= res; /* Undefined V behavior part II */
\r
124 m68ki_write_8(ea, MASK_OUT_ABOVE_8(res));
\r
127 FLAG_C = CFLAG_SET;
\r
128 FLAG_X = XFLAG_SET;
\r
132 FLAG_V = VFLAG_CLEAR;
\r
133 FLAG_C = CFLAG_CLEAR;
\r
134 FLAG_X = XFLAG_CLEAR;
\r
136 FLAG_N = NFLAG_8(res); /* Undefined N behavior */
\r
140 void m68k_op_nbcd_8_pd(void)
\r
142 uint ea = EA_AY_PD_8();
\r
143 uint dst = m68ki_read_8(ea);
\r
144 uint res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1());
\r
148 FLAG_V = ~res; /* Undefined V behavior */
\r
150 if((res & 0x0f) == 0xa)
\r
151 res = (res & 0xf0) + 0x10;
\r
153 res = MASK_OUT_ABOVE_8(res);
\r
155 FLAG_V &= res; /* Undefined V behavior part II */
\r
157 m68ki_write_8(ea, MASK_OUT_ABOVE_8(res));
\r
160 FLAG_C = CFLAG_SET;
\r
161 FLAG_X = XFLAG_SET;
\r
165 FLAG_V = VFLAG_CLEAR;
\r
166 FLAG_C = CFLAG_CLEAR;
\r
167 FLAG_X = XFLAG_CLEAR;
\r
169 FLAG_N = NFLAG_8(res); /* Undefined N behavior */
\r
173 void m68k_op_nbcd_8_pd7(void)
\r
175 uint ea = EA_A7_PD_8();
\r
176 uint dst = m68ki_read_8(ea);
\r
177 uint res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1());
\r
181 FLAG_V = ~res; /* Undefined V behavior */
\r
183 if((res & 0x0f) == 0xa)
\r
184 res = (res & 0xf0) + 0x10;
\r
186 res = MASK_OUT_ABOVE_8(res);
\r
188 FLAG_V &= res; /* Undefined V behavior part II */
\r
190 m68ki_write_8(ea, MASK_OUT_ABOVE_8(res));
\r
193 FLAG_C = CFLAG_SET;
\r
194 FLAG_X = XFLAG_SET;
\r
198 FLAG_V = VFLAG_CLEAR;
\r
199 FLAG_C = CFLAG_CLEAR;
\r
200 FLAG_X = XFLAG_CLEAR;
\r
202 FLAG_N = NFLAG_8(res); /* Undefined N behavior */
\r
206 void m68k_op_nbcd_8_di(void)
\r
208 uint ea = EA_AY_DI_8();
\r
209 uint dst = m68ki_read_8(ea);
\r
210 uint res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1());
\r
214 FLAG_V = ~res; /* Undefined V behavior */
\r
216 if((res & 0x0f) == 0xa)
\r
217 res = (res & 0xf0) + 0x10;
\r
219 res = MASK_OUT_ABOVE_8(res);
\r
221 FLAG_V &= res; /* Undefined V behavior part II */
\r
223 m68ki_write_8(ea, MASK_OUT_ABOVE_8(res));
\r
226 FLAG_C = CFLAG_SET;
\r
227 FLAG_X = XFLAG_SET;
\r
231 FLAG_V = VFLAG_CLEAR;
\r
232 FLAG_C = CFLAG_CLEAR;
\r
233 FLAG_X = XFLAG_CLEAR;
\r
235 FLAG_N = NFLAG_8(res); /* Undefined N behavior */
\r
239 void m68k_op_nbcd_8_ix(void)
\r
241 uint ea = EA_AY_IX_8();
\r
242 uint dst = m68ki_read_8(ea);
\r
243 uint res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1());
\r
247 FLAG_V = ~res; /* Undefined V behavior */
\r
249 if((res & 0x0f) == 0xa)
\r
250 res = (res & 0xf0) + 0x10;
\r
252 res = MASK_OUT_ABOVE_8(res);
\r
254 FLAG_V &= res; /* Undefined V behavior part II */
\r
256 m68ki_write_8(ea, MASK_OUT_ABOVE_8(res));
\r
259 FLAG_C = CFLAG_SET;
\r
260 FLAG_X = XFLAG_SET;
\r
264 FLAG_V = VFLAG_CLEAR;
\r
265 FLAG_C = CFLAG_CLEAR;
\r
266 FLAG_X = XFLAG_CLEAR;
\r
268 FLAG_N = NFLAG_8(res); /* Undefined N behavior */
\r
272 void m68k_op_nbcd_8_aw(void)
\r
274 uint ea = EA_AW_8();
\r
275 uint dst = m68ki_read_8(ea);
\r
276 uint res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1());
\r
280 FLAG_V = ~res; /* Undefined V behavior */
\r
282 if((res & 0x0f) == 0xa)
\r
283 res = (res & 0xf0) + 0x10;
\r
285 res = MASK_OUT_ABOVE_8(res);
\r
287 FLAG_V &= res; /* Undefined V behavior part II */
\r
289 m68ki_write_8(ea, MASK_OUT_ABOVE_8(res));
\r
292 FLAG_C = CFLAG_SET;
\r
293 FLAG_X = XFLAG_SET;
\r
297 FLAG_V = VFLAG_CLEAR;
\r
298 FLAG_C = CFLAG_CLEAR;
\r
299 FLAG_X = XFLAG_CLEAR;
\r
301 FLAG_N = NFLAG_8(res); /* Undefined N behavior */
\r
305 void m68k_op_nbcd_8_al(void)
\r
307 uint ea = EA_AL_8();
\r
308 uint dst = m68ki_read_8(ea);
\r
309 uint res = MASK_OUT_ABOVE_8(0x9a - dst - XFLAG_AS_1());
\r
313 FLAG_V = ~res; /* Undefined V behavior */
\r
315 if((res & 0x0f) == 0xa)
\r
316 res = (res & 0xf0) + 0x10;
\r
318 res = MASK_OUT_ABOVE_8(res);
\r
320 FLAG_V &= res; /* Undefined V behavior part II */
\r
322 m68ki_write_8(ea, MASK_OUT_ABOVE_8(res));
\r
325 FLAG_C = CFLAG_SET;
\r
326 FLAG_X = XFLAG_SET;
\r
330 FLAG_V = VFLAG_CLEAR;
\r
331 FLAG_C = CFLAG_CLEAR;
\r
332 FLAG_X = XFLAG_CLEAR;
\r
334 FLAG_N = NFLAG_8(res); /* Undefined N behavior */
\r
338 void m68k_op_neg_8_d(void)
\r
341 uint res = 0 - MASK_OUT_ABOVE_8(*r_dst);
\r
343 FLAG_N = NFLAG_8(res);
\r
344 FLAG_C = FLAG_X = CFLAG_8(res);
\r
345 FLAG_V = *r_dst & res;
\r
346 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
348 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
352 void m68k_op_neg_8_ai(void)
\r
354 uint ea = EA_AY_AI_8();
\r
355 uint src = m68ki_read_8(ea);
\r
356 uint res = 0 - src;
\r
358 FLAG_N = NFLAG_8(res);
\r
359 FLAG_C = FLAG_X = CFLAG_8(res);
\r
360 FLAG_V = src & res;
\r
361 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
363 m68ki_write_8(ea, FLAG_Z);
\r
367 void m68k_op_neg_8_pi(void)
\r
369 uint ea = EA_AY_PI_8();
\r
370 uint src = m68ki_read_8(ea);
\r
371 uint res = 0 - src;
\r
373 FLAG_N = NFLAG_8(res);
\r
374 FLAG_C = FLAG_X = CFLAG_8(res);
\r
375 FLAG_V = src & res;
\r
376 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
378 m68ki_write_8(ea, FLAG_Z);
\r
382 void m68k_op_neg_8_pi7(void)
\r
384 uint ea = EA_A7_PI_8();
\r
385 uint src = m68ki_read_8(ea);
\r
386 uint res = 0 - src;
\r
388 FLAG_N = NFLAG_8(res);
\r
389 FLAG_C = FLAG_X = CFLAG_8(res);
\r
390 FLAG_V = src & res;
\r
391 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
393 m68ki_write_8(ea, FLAG_Z);
\r
397 void m68k_op_neg_8_pd(void)
\r
399 uint ea = EA_AY_PD_8();
\r
400 uint src = m68ki_read_8(ea);
\r
401 uint res = 0 - src;
\r
403 FLAG_N = NFLAG_8(res);
\r
404 FLAG_C = FLAG_X = CFLAG_8(res);
\r
405 FLAG_V = src & res;
\r
406 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
408 m68ki_write_8(ea, FLAG_Z);
\r
412 void m68k_op_neg_8_pd7(void)
\r
414 uint ea = EA_A7_PD_8();
\r
415 uint src = m68ki_read_8(ea);
\r
416 uint res = 0 - src;
\r
418 FLAG_N = NFLAG_8(res);
\r
419 FLAG_C = FLAG_X = CFLAG_8(res);
\r
420 FLAG_V = src & res;
\r
421 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
423 m68ki_write_8(ea, FLAG_Z);
\r
427 void m68k_op_neg_8_di(void)
\r
429 uint ea = EA_AY_DI_8();
\r
430 uint src = m68ki_read_8(ea);
\r
431 uint res = 0 - src;
\r
433 FLAG_N = NFLAG_8(res);
\r
434 FLAG_C = FLAG_X = CFLAG_8(res);
\r
435 FLAG_V = src & res;
\r
436 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
438 m68ki_write_8(ea, FLAG_Z);
\r
442 void m68k_op_neg_8_ix(void)
\r
444 uint ea = EA_AY_IX_8();
\r
445 uint src = m68ki_read_8(ea);
\r
446 uint res = 0 - src;
\r
448 FLAG_N = NFLAG_8(res);
\r
449 FLAG_C = FLAG_X = CFLAG_8(res);
\r
450 FLAG_V = src & res;
\r
451 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
453 m68ki_write_8(ea, FLAG_Z);
\r
457 void m68k_op_neg_8_aw(void)
\r
459 uint ea = EA_AW_8();
\r
460 uint src = m68ki_read_8(ea);
\r
461 uint res = 0 - src;
\r
463 FLAG_N = NFLAG_8(res);
\r
464 FLAG_C = FLAG_X = CFLAG_8(res);
\r
465 FLAG_V = src & res;
\r
466 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
468 m68ki_write_8(ea, FLAG_Z);
\r
472 void m68k_op_neg_8_al(void)
\r
474 uint ea = EA_AL_8();
\r
475 uint src = m68ki_read_8(ea);
\r
476 uint res = 0 - src;
\r
478 FLAG_N = NFLAG_8(res);
\r
479 FLAG_C = FLAG_X = CFLAG_8(res);
\r
480 FLAG_V = src & res;
\r
481 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
483 m68ki_write_8(ea, FLAG_Z);
\r
487 void m68k_op_neg_16_d(void)
\r
490 uint res = 0 - MASK_OUT_ABOVE_16(*r_dst);
\r
492 FLAG_N = NFLAG_16(res);
\r
493 FLAG_C = FLAG_X = CFLAG_16(res);
\r
494 FLAG_V = (*r_dst & res)>>8;
\r
495 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
497 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
501 void m68k_op_neg_16_ai(void)
\r
503 uint ea = EA_AY_AI_16();
\r
504 uint src = m68ki_read_16(ea);
\r
505 uint res = 0 - src;
\r
507 FLAG_N = NFLAG_16(res);
\r
508 FLAG_C = FLAG_X = CFLAG_16(res);
\r
509 FLAG_V = (src & res)>>8;
\r
510 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
512 m68ki_write_16(ea, FLAG_Z);
\r
516 void m68k_op_neg_16_pi(void)
\r
518 uint ea = EA_AY_PI_16();
\r
519 uint src = m68ki_read_16(ea);
\r
520 uint res = 0 - src;
\r
522 FLAG_N = NFLAG_16(res);
\r
523 FLAG_C = FLAG_X = CFLAG_16(res);
\r
524 FLAG_V = (src & res)>>8;
\r
525 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
527 m68ki_write_16(ea, FLAG_Z);
\r
531 void m68k_op_neg_16_pd(void)
\r
533 uint ea = EA_AY_PD_16();
\r
534 uint src = m68ki_read_16(ea);
\r
535 uint res = 0 - src;
\r
537 FLAG_N = NFLAG_16(res);
\r
538 FLAG_C = FLAG_X = CFLAG_16(res);
\r
539 FLAG_V = (src & res)>>8;
\r
540 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
542 m68ki_write_16(ea, FLAG_Z);
\r
546 void m68k_op_neg_16_di(void)
\r
548 uint ea = EA_AY_DI_16();
\r
549 uint src = m68ki_read_16(ea);
\r
550 uint res = 0 - src;
\r
552 FLAG_N = NFLAG_16(res);
\r
553 FLAG_C = FLAG_X = CFLAG_16(res);
\r
554 FLAG_V = (src & res)>>8;
\r
555 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
557 m68ki_write_16(ea, FLAG_Z);
\r
561 void m68k_op_neg_16_ix(void)
\r
563 uint ea = EA_AY_IX_16();
\r
564 uint src = m68ki_read_16(ea);
\r
565 uint res = 0 - src;
\r
567 FLAG_N = NFLAG_16(res);
\r
568 FLAG_C = FLAG_X = CFLAG_16(res);
\r
569 FLAG_V = (src & res)>>8;
\r
570 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
572 m68ki_write_16(ea, FLAG_Z);
\r
576 void m68k_op_neg_16_aw(void)
\r
578 uint ea = EA_AW_16();
\r
579 uint src = m68ki_read_16(ea);
\r
580 uint res = 0 - src;
\r
582 FLAG_N = NFLAG_16(res);
\r
583 FLAG_C = FLAG_X = CFLAG_16(res);
\r
584 FLAG_V = (src & res)>>8;
\r
585 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
587 m68ki_write_16(ea, FLAG_Z);
\r
591 void m68k_op_neg_16_al(void)
\r
593 uint ea = EA_AL_16();
\r
594 uint src = m68ki_read_16(ea);
\r
595 uint res = 0 - src;
\r
597 FLAG_N = NFLAG_16(res);
\r
598 FLAG_C = FLAG_X = CFLAG_16(res);
\r
599 FLAG_V = (src & res)>>8;
\r
600 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
602 m68ki_write_16(ea, FLAG_Z);
\r
606 void m68k_op_neg_32_d(void)
\r
609 uint res = 0 - *r_dst;
\r
611 FLAG_N = NFLAG_32(res);
\r
612 FLAG_C = FLAG_X = CFLAG_SUB_32(*r_dst, 0, res);
\r
613 FLAG_V = (*r_dst & res)>>24;
\r
614 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
620 void m68k_op_neg_32_ai(void)
\r
622 uint ea = EA_AY_AI_32();
\r
623 uint src = m68ki_read_32(ea);
\r
624 uint res = 0 - src;
\r
626 FLAG_N = NFLAG_32(res);
\r
627 FLAG_C = FLAG_X = CFLAG_SUB_32(src, 0, res);
\r
628 FLAG_V = (src & res)>>24;
\r
629 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
631 m68ki_write_32(ea, FLAG_Z);
\r
635 void m68k_op_neg_32_pi(void)
\r
637 uint ea = EA_AY_PI_32();
\r
638 uint src = m68ki_read_32(ea);
\r
639 uint res = 0 - src;
\r
641 FLAG_N = NFLAG_32(res);
\r
642 FLAG_C = FLAG_X = CFLAG_SUB_32(src, 0, res);
\r
643 FLAG_V = (src & res)>>24;
\r
644 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
646 m68ki_write_32(ea, FLAG_Z);
\r
650 void m68k_op_neg_32_pd(void)
\r
652 uint ea = EA_AY_PD_32();
\r
653 uint src = m68ki_read_32(ea);
\r
654 uint res = 0 - src;
\r
656 FLAG_N = NFLAG_32(res);
\r
657 FLAG_C = FLAG_X = CFLAG_SUB_32(src, 0, res);
\r
658 FLAG_V = (src & res)>>24;
\r
659 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
661 m68ki_write_32(ea, FLAG_Z);
\r
665 void m68k_op_neg_32_di(void)
\r
667 uint ea = EA_AY_DI_32();
\r
668 uint src = m68ki_read_32(ea);
\r
669 uint res = 0 - src;
\r
671 FLAG_N = NFLAG_32(res);
\r
672 FLAG_C = FLAG_X = CFLAG_SUB_32(src, 0, res);
\r
673 FLAG_V = (src & res)>>24;
\r
674 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
676 m68ki_write_32(ea, FLAG_Z);
\r
680 void m68k_op_neg_32_ix(void)
\r
682 uint ea = EA_AY_IX_32();
\r
683 uint src = m68ki_read_32(ea);
\r
684 uint res = 0 - src;
\r
686 FLAG_N = NFLAG_32(res);
\r
687 FLAG_C = FLAG_X = CFLAG_SUB_32(src, 0, res);
\r
688 FLAG_V = (src & res)>>24;
\r
689 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
691 m68ki_write_32(ea, FLAG_Z);
\r
695 void m68k_op_neg_32_aw(void)
\r
697 uint ea = EA_AW_32();
\r
698 uint src = m68ki_read_32(ea);
\r
699 uint res = 0 - src;
\r
701 FLAG_N = NFLAG_32(res);
\r
702 FLAG_C = FLAG_X = CFLAG_SUB_32(src, 0, res);
\r
703 FLAG_V = (src & res)>>24;
\r
704 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
706 m68ki_write_32(ea, FLAG_Z);
\r
710 void m68k_op_neg_32_al(void)
\r
712 uint ea = EA_AL_32();
\r
713 uint src = m68ki_read_32(ea);
\r
714 uint res = 0 - src;
\r
716 FLAG_N = NFLAG_32(res);
\r
717 FLAG_C = FLAG_X = CFLAG_SUB_32(src, 0, res);
\r
718 FLAG_V = (src & res)>>24;
\r
719 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
721 m68ki_write_32(ea, FLAG_Z);
\r
725 void m68k_op_negx_8_d(void)
\r
728 uint res = 0 - MASK_OUT_ABOVE_8(*r_dst) - XFLAG_AS_1();
\r
730 FLAG_N = NFLAG_8(res);
\r
731 FLAG_X = FLAG_C = CFLAG_8(res);
\r
732 FLAG_V = *r_dst & res;
\r
734 res = MASK_OUT_ABOVE_8(res);
\r
737 *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
\r
741 void m68k_op_negx_8_ai(void)
\r
743 uint ea = EA_AY_AI_8();
\r
744 uint src = m68ki_read_8(ea);
\r
745 uint res = 0 - src - XFLAG_AS_1();
\r
747 FLAG_N = NFLAG_8(res);
\r
748 FLAG_X = FLAG_C = CFLAG_8(res);
\r
749 FLAG_V = src & res;
\r
751 res = MASK_OUT_ABOVE_8(res);
\r
754 m68ki_write_8(ea, res);
\r
758 void m68k_op_negx_8_pi(void)
\r
760 uint ea = EA_AY_PI_8();
\r
761 uint src = m68ki_read_8(ea);
\r
762 uint res = 0 - src - XFLAG_AS_1();
\r
764 FLAG_N = NFLAG_8(res);
\r
765 FLAG_X = FLAG_C = CFLAG_8(res);
\r
766 FLAG_V = src & res;
\r
768 res = MASK_OUT_ABOVE_8(res);
\r
771 m68ki_write_8(ea, res);
\r
775 void m68k_op_negx_8_pi7(void)
\r
777 uint ea = EA_A7_PI_8();
\r
778 uint src = m68ki_read_8(ea);
\r
779 uint res = 0 - src - XFLAG_AS_1();
\r
781 FLAG_N = NFLAG_8(res);
\r
782 FLAG_X = FLAG_C = CFLAG_8(res);
\r
783 FLAG_V = src & res;
\r
785 res = MASK_OUT_ABOVE_8(res);
\r
788 m68ki_write_8(ea, res);
\r
792 void m68k_op_negx_8_pd(void)
\r
794 uint ea = EA_AY_PD_8();
\r
795 uint src = m68ki_read_8(ea);
\r
796 uint res = 0 - src - XFLAG_AS_1();
\r
798 FLAG_N = NFLAG_8(res);
\r
799 FLAG_X = FLAG_C = CFLAG_8(res);
\r
800 FLAG_V = src & res;
\r
802 res = MASK_OUT_ABOVE_8(res);
\r
805 m68ki_write_8(ea, res);
\r
809 void m68k_op_negx_8_pd7(void)
\r
811 uint ea = EA_A7_PD_8();
\r
812 uint src = m68ki_read_8(ea);
\r
813 uint res = 0 - src - XFLAG_AS_1();
\r
815 FLAG_N = NFLAG_8(res);
\r
816 FLAG_X = FLAG_C = CFLAG_8(res);
\r
817 FLAG_V = src & res;
\r
819 res = MASK_OUT_ABOVE_8(res);
\r
822 m68ki_write_8(ea, res);
\r
826 void m68k_op_negx_8_di(void)
\r
828 uint ea = EA_AY_DI_8();
\r
829 uint src = m68ki_read_8(ea);
\r
830 uint res = 0 - src - XFLAG_AS_1();
\r
832 FLAG_N = NFLAG_8(res);
\r
833 FLAG_X = FLAG_C = CFLAG_8(res);
\r
834 FLAG_V = src & res;
\r
836 res = MASK_OUT_ABOVE_8(res);
\r
839 m68ki_write_8(ea, res);
\r
843 void m68k_op_negx_8_ix(void)
\r
845 uint ea = EA_AY_IX_8();
\r
846 uint src = m68ki_read_8(ea);
\r
847 uint res = 0 - src - XFLAG_AS_1();
\r
849 FLAG_N = NFLAG_8(res);
\r
850 FLAG_X = FLAG_C = CFLAG_8(res);
\r
851 FLAG_V = src & res;
\r
853 res = MASK_OUT_ABOVE_8(res);
\r
856 m68ki_write_8(ea, res);
\r
860 void m68k_op_negx_8_aw(void)
\r
862 uint ea = EA_AW_8();
\r
863 uint src = m68ki_read_8(ea);
\r
864 uint res = 0 - src - XFLAG_AS_1();
\r
866 FLAG_N = NFLAG_8(res);
\r
867 FLAG_X = FLAG_C = CFLAG_8(res);
\r
868 FLAG_V = src & res;
\r
870 res = MASK_OUT_ABOVE_8(res);
\r
873 m68ki_write_8(ea, res);
\r
877 void m68k_op_negx_8_al(void)
\r
879 uint ea = EA_AL_8();
\r
880 uint src = m68ki_read_8(ea);
\r
881 uint res = 0 - src - XFLAG_AS_1();
\r
883 FLAG_N = NFLAG_8(res);
\r
884 FLAG_X = FLAG_C = CFLAG_8(res);
\r
885 FLAG_V = src & res;
\r
887 res = MASK_OUT_ABOVE_8(res);
\r
890 m68ki_write_8(ea, res);
\r
894 void m68k_op_negx_16_d(void)
\r
897 uint res = 0 - MASK_OUT_ABOVE_16(*r_dst) - XFLAG_AS_1();
\r
899 FLAG_N = NFLAG_16(res);
\r
900 FLAG_X = FLAG_C = CFLAG_16(res);
\r
901 FLAG_V = (*r_dst & res)>>8;
\r
903 res = MASK_OUT_ABOVE_16(res);
\r
906 *r_dst = MASK_OUT_BELOW_16(*r_dst) | res;
\r
910 void m68k_op_negx_16_ai(void)
\r
912 uint ea = EA_AY_AI_16();
\r
913 uint src = m68ki_read_16(ea);
\r
914 uint res = 0 - MASK_OUT_ABOVE_16(src) - XFLAG_AS_1();
\r
916 FLAG_N = NFLAG_16(res);
\r
917 FLAG_X = FLAG_C = CFLAG_16(res);
\r
918 FLAG_V = (src & res)>>8;
\r
920 res = MASK_OUT_ABOVE_16(res);
\r
923 m68ki_write_16(ea, res);
\r
927 void m68k_op_negx_16_pi(void)
\r
929 uint ea = EA_AY_PI_16();
\r
930 uint src = m68ki_read_16(ea);
\r
931 uint res = 0 - MASK_OUT_ABOVE_16(src) - XFLAG_AS_1();
\r
933 FLAG_N = NFLAG_16(res);
\r
934 FLAG_X = FLAG_C = CFLAG_16(res);
\r
935 FLAG_V = (src & res)>>8;
\r
937 res = MASK_OUT_ABOVE_16(res);
\r
940 m68ki_write_16(ea, res);
\r
944 void m68k_op_negx_16_pd(void)
\r
946 uint ea = EA_AY_PD_16();
\r
947 uint src = m68ki_read_16(ea);
\r
948 uint res = 0 - MASK_OUT_ABOVE_16(src) - XFLAG_AS_1();
\r
950 FLAG_N = NFLAG_16(res);
\r
951 FLAG_X = FLAG_C = CFLAG_16(res);
\r
952 FLAG_V = (src & res)>>8;
\r
954 res = MASK_OUT_ABOVE_16(res);
\r
957 m68ki_write_16(ea, res);
\r
961 void m68k_op_negx_16_di(void)
\r
963 uint ea = EA_AY_DI_16();
\r
964 uint src = m68ki_read_16(ea);
\r
965 uint res = 0 - MASK_OUT_ABOVE_16(src) - XFLAG_AS_1();
\r
967 FLAG_N = NFLAG_16(res);
\r
968 FLAG_X = FLAG_C = CFLAG_16(res);
\r
969 FLAG_V = (src & res)>>8;
\r
971 res = MASK_OUT_ABOVE_16(res);
\r
974 m68ki_write_16(ea, res);
\r
978 void m68k_op_negx_16_ix(void)
\r
980 uint ea = EA_AY_IX_16();
\r
981 uint src = m68ki_read_16(ea);
\r
982 uint res = 0 - MASK_OUT_ABOVE_16(src) - XFLAG_AS_1();
\r
984 FLAG_N = NFLAG_16(res);
\r
985 FLAG_X = FLAG_C = CFLAG_16(res);
\r
986 FLAG_V = (src & res)>>8;
\r
988 res = MASK_OUT_ABOVE_16(res);
\r
991 m68ki_write_16(ea, res);
\r
995 void m68k_op_negx_16_aw(void)
\r
997 uint ea = EA_AW_16();
\r
998 uint src = m68ki_read_16(ea);
\r
999 uint res = 0 - MASK_OUT_ABOVE_16(src) - XFLAG_AS_1();
\r
1001 FLAG_N = NFLAG_16(res);
\r
1002 FLAG_X = FLAG_C = CFLAG_16(res);
\r
1003 FLAG_V = (src & res)>>8;
\r
1005 res = MASK_OUT_ABOVE_16(res);
\r
1008 m68ki_write_16(ea, res);
\r
1012 void m68k_op_negx_16_al(void)
\r
1014 uint ea = EA_AL_16();
\r
1015 uint src = m68ki_read_16(ea);
\r
1016 uint res = 0 - MASK_OUT_ABOVE_16(src) - XFLAG_AS_1();
\r
1018 FLAG_N = NFLAG_16(res);
\r
1019 FLAG_X = FLAG_C = CFLAG_16(res);
\r
1020 FLAG_V = (src & res)>>8;
\r
1022 res = MASK_OUT_ABOVE_16(res);
\r
1025 m68ki_write_16(ea, res);
\r
1029 void m68k_op_negx_32_d(void)
\r
1031 uint* r_dst = &DY;
\r
1032 uint res = 0 - MASK_OUT_ABOVE_32(*r_dst) - XFLAG_AS_1();
\r
1034 FLAG_N = NFLAG_32(res);
\r
1035 FLAG_X = FLAG_C = CFLAG_SUB_32(*r_dst, 0, res);
\r
1036 FLAG_V = (*r_dst & res)>>24;
\r
1038 res = MASK_OUT_ABOVE_32(res);
\r
1045 void m68k_op_negx_32_ai(void)
\r
1047 uint ea = EA_AY_AI_32();
\r
1048 uint src = m68ki_read_32(ea);
\r
1049 uint res = 0 - MASK_OUT_ABOVE_32(src) - XFLAG_AS_1();
\r
1051 FLAG_N = NFLAG_32(res);
\r
1052 FLAG_X = FLAG_C = CFLAG_SUB_32(src, 0, res);
\r
1053 FLAG_V = (src & res)>>24;
\r
1055 res = MASK_OUT_ABOVE_32(res);
\r
1058 m68ki_write_32(ea, res);
\r
1062 void m68k_op_negx_32_pi(void)
\r
1064 uint ea = EA_AY_PI_32();
\r
1065 uint src = m68ki_read_32(ea);
\r
1066 uint res = 0 - MASK_OUT_ABOVE_32(src) - XFLAG_AS_1();
\r
1068 FLAG_N = NFLAG_32(res);
\r
1069 FLAG_X = FLAG_C = CFLAG_SUB_32(src, 0, res);
\r
1070 FLAG_V = (src & res)>>24;
\r
1072 res = MASK_OUT_ABOVE_32(res);
\r
1075 m68ki_write_32(ea, res);
\r
1079 void m68k_op_negx_32_pd(void)
\r
1081 uint ea = EA_AY_PD_32();
\r
1082 uint src = m68ki_read_32(ea);
\r
1083 uint res = 0 - MASK_OUT_ABOVE_32(src) - XFLAG_AS_1();
\r
1085 FLAG_N = NFLAG_32(res);
\r
1086 FLAG_X = FLAG_C = CFLAG_SUB_32(src, 0, res);
\r
1087 FLAG_V = (src & res)>>24;
\r
1089 res = MASK_OUT_ABOVE_32(res);
\r
1092 m68ki_write_32(ea, res);
\r
1096 void m68k_op_negx_32_di(void)
\r
1098 uint ea = EA_AY_DI_32();
\r
1099 uint src = m68ki_read_32(ea);
\r
1100 uint res = 0 - MASK_OUT_ABOVE_32(src) - XFLAG_AS_1();
\r
1102 FLAG_N = NFLAG_32(res);
\r
1103 FLAG_X = FLAG_C = CFLAG_SUB_32(src, 0, res);
\r
1104 FLAG_V = (src & res)>>24;
\r
1106 res = MASK_OUT_ABOVE_32(res);
\r
1109 m68ki_write_32(ea, res);
\r
1113 void m68k_op_negx_32_ix(void)
\r
1115 uint ea = EA_AY_IX_32();
\r
1116 uint src = m68ki_read_32(ea);
\r
1117 uint res = 0 - MASK_OUT_ABOVE_32(src) - XFLAG_AS_1();
\r
1119 FLAG_N = NFLAG_32(res);
\r
1120 FLAG_X = FLAG_C = CFLAG_SUB_32(src, 0, res);
\r
1121 FLAG_V = (src & res)>>24;
\r
1123 res = MASK_OUT_ABOVE_32(res);
\r
1126 m68ki_write_32(ea, res);
\r
1130 void m68k_op_negx_32_aw(void)
\r
1132 uint ea = EA_AW_32();
\r
1133 uint src = m68ki_read_32(ea);
\r
1134 uint res = 0 - MASK_OUT_ABOVE_32(src) - XFLAG_AS_1();
\r
1136 FLAG_N = NFLAG_32(res);
\r
1137 FLAG_X = FLAG_C = CFLAG_SUB_32(src, 0, res);
\r
1138 FLAG_V = (src & res)>>24;
\r
1140 res = MASK_OUT_ABOVE_32(res);
\r
1143 m68ki_write_32(ea, res);
\r
1147 void m68k_op_negx_32_al(void)
\r
1149 uint ea = EA_AL_32();
\r
1150 uint src = m68ki_read_32(ea);
\r
1151 uint res = 0 - MASK_OUT_ABOVE_32(src) - XFLAG_AS_1();
\r
1153 FLAG_N = NFLAG_32(res);
\r
1154 FLAG_X = FLAG_C = CFLAG_SUB_32(src, 0, res);
\r
1155 FLAG_V = (src & res)>>24;
\r
1157 res = MASK_OUT_ABOVE_32(res);
\r
1160 m68ki_write_32(ea, res);
\r
1164 void m68k_op_nop(void)
\r
1166 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
1170 void m68k_op_not_8_d(void)
\r
1172 uint* r_dst = &DY;
\r
1173 uint res = MASK_OUT_ABOVE_8(~*r_dst);
\r
1175 *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
\r
1177 FLAG_N = NFLAG_8(res);
\r
1179 FLAG_C = CFLAG_CLEAR;
\r
1180 FLAG_V = VFLAG_CLEAR;
\r
1184 void m68k_op_not_8_ai(void)
\r
1186 uint ea = EA_AY_AI_8();
\r
1187 uint res = MASK_OUT_ABOVE_8(~m68ki_read_8(ea));
\r
1189 m68ki_write_8(ea, res);
\r
1191 FLAG_N = NFLAG_8(res);
\r
1193 FLAG_C = CFLAG_CLEAR;
\r
1194 FLAG_V = VFLAG_CLEAR;
\r
1198 void m68k_op_not_8_pi(void)
\r
1200 uint ea = EA_AY_PI_8();
\r
1201 uint res = MASK_OUT_ABOVE_8(~m68ki_read_8(ea));
\r
1203 m68ki_write_8(ea, res);
\r
1205 FLAG_N = NFLAG_8(res);
\r
1207 FLAG_C = CFLAG_CLEAR;
\r
1208 FLAG_V = VFLAG_CLEAR;
\r
1212 void m68k_op_not_8_pi7(void)
\r
1214 uint ea = EA_A7_PI_8();
\r
1215 uint res = MASK_OUT_ABOVE_8(~m68ki_read_8(ea));
\r
1217 m68ki_write_8(ea, res);
\r
1219 FLAG_N = NFLAG_8(res);
\r
1221 FLAG_C = CFLAG_CLEAR;
\r
1222 FLAG_V = VFLAG_CLEAR;
\r
1226 void m68k_op_not_8_pd(void)
\r
1228 uint ea = EA_AY_PD_8();
\r
1229 uint res = MASK_OUT_ABOVE_8(~m68ki_read_8(ea));
\r
1231 m68ki_write_8(ea, res);
\r
1233 FLAG_N = NFLAG_8(res);
\r
1235 FLAG_C = CFLAG_CLEAR;
\r
1236 FLAG_V = VFLAG_CLEAR;
\r
1240 void m68k_op_not_8_pd7(void)
\r
1242 uint ea = EA_A7_PD_8();
\r
1243 uint res = MASK_OUT_ABOVE_8(~m68ki_read_8(ea));
\r
1245 m68ki_write_8(ea, res);
\r
1247 FLAG_N = NFLAG_8(res);
\r
1249 FLAG_C = CFLAG_CLEAR;
\r
1250 FLAG_V = VFLAG_CLEAR;
\r
1254 void m68k_op_not_8_di(void)
\r
1256 uint ea = EA_AY_DI_8();
\r
1257 uint res = MASK_OUT_ABOVE_8(~m68ki_read_8(ea));
\r
1259 m68ki_write_8(ea, res);
\r
1261 FLAG_N = NFLAG_8(res);
\r
1263 FLAG_C = CFLAG_CLEAR;
\r
1264 FLAG_V = VFLAG_CLEAR;
\r
1268 void m68k_op_not_8_ix(void)
\r
1270 uint ea = EA_AY_IX_8();
\r
1271 uint res = MASK_OUT_ABOVE_8(~m68ki_read_8(ea));
\r
1273 m68ki_write_8(ea, res);
\r
1275 FLAG_N = NFLAG_8(res);
\r
1277 FLAG_C = CFLAG_CLEAR;
\r
1278 FLAG_V = VFLAG_CLEAR;
\r
1282 void m68k_op_not_8_aw(void)
\r
1284 uint ea = EA_AW_8();
\r
1285 uint res = MASK_OUT_ABOVE_8(~m68ki_read_8(ea));
\r
1287 m68ki_write_8(ea, res);
\r
1289 FLAG_N = NFLAG_8(res);
\r
1291 FLAG_C = CFLAG_CLEAR;
\r
1292 FLAG_V = VFLAG_CLEAR;
\r
1296 void m68k_op_not_8_al(void)
\r
1298 uint ea = EA_AL_8();
\r
1299 uint res = MASK_OUT_ABOVE_8(~m68ki_read_8(ea));
\r
1301 m68ki_write_8(ea, res);
\r
1303 FLAG_N = NFLAG_8(res);
\r
1305 FLAG_C = CFLAG_CLEAR;
\r
1306 FLAG_V = VFLAG_CLEAR;
\r
1310 void m68k_op_not_16_d(void)
\r
1312 uint* r_dst = &DY;
\r
1313 uint res = MASK_OUT_ABOVE_16(~*r_dst);
\r
1315 *r_dst = MASK_OUT_BELOW_16(*r_dst) | res;
\r
1317 FLAG_N = NFLAG_16(res);
\r
1319 FLAG_C = CFLAG_CLEAR;
\r
1320 FLAG_V = VFLAG_CLEAR;
\r
1324 void m68k_op_not_16_ai(void)
\r
1326 uint ea = EA_AY_AI_16();
\r
1327 uint res = MASK_OUT_ABOVE_16(~m68ki_read_16(ea));
\r
1329 m68ki_write_16(ea, res);
\r
1331 FLAG_N = NFLAG_16(res);
\r
1333 FLAG_C = CFLAG_CLEAR;
\r
1334 FLAG_V = VFLAG_CLEAR;
\r
1338 void m68k_op_not_16_pi(void)
\r
1340 uint ea = EA_AY_PI_16();
\r
1341 uint res = MASK_OUT_ABOVE_16(~m68ki_read_16(ea));
\r
1343 m68ki_write_16(ea, res);
\r
1345 FLAG_N = NFLAG_16(res);
\r
1347 FLAG_C = CFLAG_CLEAR;
\r
1348 FLAG_V = VFLAG_CLEAR;
\r
1352 void m68k_op_not_16_pd(void)
\r
1354 uint ea = EA_AY_PD_16();
\r
1355 uint res = MASK_OUT_ABOVE_16(~m68ki_read_16(ea));
\r
1357 m68ki_write_16(ea, res);
\r
1359 FLAG_N = NFLAG_16(res);
\r
1361 FLAG_C = CFLAG_CLEAR;
\r
1362 FLAG_V = VFLAG_CLEAR;
\r
1366 void m68k_op_not_16_di(void)
\r
1368 uint ea = EA_AY_DI_16();
\r
1369 uint res = MASK_OUT_ABOVE_16(~m68ki_read_16(ea));
\r
1371 m68ki_write_16(ea, res);
\r
1373 FLAG_N = NFLAG_16(res);
\r
1375 FLAG_C = CFLAG_CLEAR;
\r
1376 FLAG_V = VFLAG_CLEAR;
\r
1380 void m68k_op_not_16_ix(void)
\r
1382 uint ea = EA_AY_IX_16();
\r
1383 uint res = MASK_OUT_ABOVE_16(~m68ki_read_16(ea));
\r
1385 m68ki_write_16(ea, res);
\r
1387 FLAG_N = NFLAG_16(res);
\r
1389 FLAG_C = CFLAG_CLEAR;
\r
1390 FLAG_V = VFLAG_CLEAR;
\r
1394 void m68k_op_not_16_aw(void)
\r
1396 uint ea = EA_AW_16();
\r
1397 uint res = MASK_OUT_ABOVE_16(~m68ki_read_16(ea));
\r
1399 m68ki_write_16(ea, res);
\r
1401 FLAG_N = NFLAG_16(res);
\r
1403 FLAG_C = CFLAG_CLEAR;
\r
1404 FLAG_V = VFLAG_CLEAR;
\r
1408 void m68k_op_not_16_al(void)
\r
1410 uint ea = EA_AL_16();
\r
1411 uint res = MASK_OUT_ABOVE_16(~m68ki_read_16(ea));
\r
1413 m68ki_write_16(ea, res);
\r
1415 FLAG_N = NFLAG_16(res);
\r
1417 FLAG_C = CFLAG_CLEAR;
\r
1418 FLAG_V = VFLAG_CLEAR;
\r
1422 void m68k_op_not_32_d(void)
\r
1424 uint* r_dst = &DY;
\r
1425 uint res = *r_dst = MASK_OUT_ABOVE_32(~*r_dst);
\r
1427 FLAG_N = NFLAG_32(res);
\r
1429 FLAG_C = CFLAG_CLEAR;
\r
1430 FLAG_V = VFLAG_CLEAR;
\r
1434 void m68k_op_not_32_ai(void)
\r
1436 uint ea = EA_AY_AI_32();
\r
1437 uint res = MASK_OUT_ABOVE_32(~m68ki_read_32(ea));
\r
1439 m68ki_write_32(ea, res);
\r
1441 FLAG_N = NFLAG_32(res);
\r
1443 FLAG_C = CFLAG_CLEAR;
\r
1444 FLAG_V = VFLAG_CLEAR;
\r
1448 void m68k_op_not_32_pi(void)
\r
1450 uint ea = EA_AY_PI_32();
\r
1451 uint res = MASK_OUT_ABOVE_32(~m68ki_read_32(ea));
\r
1453 m68ki_write_32(ea, res);
\r
1455 FLAG_N = NFLAG_32(res);
\r
1457 FLAG_C = CFLAG_CLEAR;
\r
1458 FLAG_V = VFLAG_CLEAR;
\r
1462 void m68k_op_not_32_pd(void)
\r
1464 uint ea = EA_AY_PD_32();
\r
1465 uint res = MASK_OUT_ABOVE_32(~m68ki_read_32(ea));
\r
1467 m68ki_write_32(ea, res);
\r
1469 FLAG_N = NFLAG_32(res);
\r
1471 FLAG_C = CFLAG_CLEAR;
\r
1472 FLAG_V = VFLAG_CLEAR;
\r
1476 void m68k_op_not_32_di(void)
\r
1478 uint ea = EA_AY_DI_32();
\r
1479 uint res = MASK_OUT_ABOVE_32(~m68ki_read_32(ea));
\r
1481 m68ki_write_32(ea, res);
\r
1483 FLAG_N = NFLAG_32(res);
\r
1485 FLAG_C = CFLAG_CLEAR;
\r
1486 FLAG_V = VFLAG_CLEAR;
\r
1490 void m68k_op_not_32_ix(void)
\r
1492 uint ea = EA_AY_IX_32();
\r
1493 uint res = MASK_OUT_ABOVE_32(~m68ki_read_32(ea));
\r
1495 m68ki_write_32(ea, res);
\r
1497 FLAG_N = NFLAG_32(res);
\r
1499 FLAG_C = CFLAG_CLEAR;
\r
1500 FLAG_V = VFLAG_CLEAR;
\r
1504 void m68k_op_not_32_aw(void)
\r
1506 uint ea = EA_AW_32();
\r
1507 uint res = MASK_OUT_ABOVE_32(~m68ki_read_32(ea));
\r
1509 m68ki_write_32(ea, res);
\r
1511 FLAG_N = NFLAG_32(res);
\r
1513 FLAG_C = CFLAG_CLEAR;
\r
1514 FLAG_V = VFLAG_CLEAR;
\r
1518 void m68k_op_not_32_al(void)
\r
1520 uint ea = EA_AL_32();
\r
1521 uint res = MASK_OUT_ABOVE_32(~m68ki_read_32(ea));
\r
1523 m68ki_write_32(ea, res);
\r
1525 FLAG_N = NFLAG_32(res);
\r
1527 FLAG_C = CFLAG_CLEAR;
\r
1528 FLAG_V = VFLAG_CLEAR;
\r
1532 void m68k_op_or_8_er_d(void)
\r
1534 uint res = MASK_OUT_ABOVE_8((DX |= MASK_OUT_ABOVE_8(DY)));
\r
1536 FLAG_N = NFLAG_8(res);
\r
1538 FLAG_C = CFLAG_CLEAR;
\r
1539 FLAG_V = VFLAG_CLEAR;
\r
1543 void m68k_op_or_8_er_ai(void)
\r
1545 uint res = MASK_OUT_ABOVE_8((DX |= OPER_AY_AI_8()));
\r
1547 FLAG_N = NFLAG_8(res);
\r
1549 FLAG_C = CFLAG_CLEAR;
\r
1550 FLAG_V = VFLAG_CLEAR;
\r
1554 void m68k_op_or_8_er_pi(void)
\r
1556 uint res = MASK_OUT_ABOVE_8((DX |= OPER_AY_PI_8()));
\r
1558 FLAG_N = NFLAG_8(res);
\r
1560 FLAG_C = CFLAG_CLEAR;
\r
1561 FLAG_V = VFLAG_CLEAR;
\r
1565 void m68k_op_or_8_er_pi7(void)
\r
1567 uint res = MASK_OUT_ABOVE_8((DX |= OPER_A7_PI_8()));
\r
1569 FLAG_N = NFLAG_8(res);
\r
1571 FLAG_C = CFLAG_CLEAR;
\r
1572 FLAG_V = VFLAG_CLEAR;
\r
1576 void m68k_op_or_8_er_pd(void)
\r
1578 uint res = MASK_OUT_ABOVE_8((DX |= OPER_AY_PD_8()));
\r
1580 FLAG_N = NFLAG_8(res);
\r
1582 FLAG_C = CFLAG_CLEAR;
\r
1583 FLAG_V = VFLAG_CLEAR;
\r
1587 void m68k_op_or_8_er_pd7(void)
\r
1589 uint res = MASK_OUT_ABOVE_8((DX |= OPER_A7_PD_8()));
\r
1591 FLAG_N = NFLAG_8(res);
\r
1593 FLAG_C = CFLAG_CLEAR;
\r
1594 FLAG_V = VFLAG_CLEAR;
\r
1598 void m68k_op_or_8_er_di(void)
\r
1600 uint res = MASK_OUT_ABOVE_8((DX |= OPER_AY_DI_8()));
\r
1602 FLAG_N = NFLAG_8(res);
\r
1604 FLAG_C = CFLAG_CLEAR;
\r
1605 FLAG_V = VFLAG_CLEAR;
\r
1609 void m68k_op_or_8_er_ix(void)
\r
1611 uint res = MASK_OUT_ABOVE_8((DX |= OPER_AY_IX_8()));
\r
1613 FLAG_N = NFLAG_8(res);
\r
1615 FLAG_C = CFLAG_CLEAR;
\r
1616 FLAG_V = VFLAG_CLEAR;
\r
1620 void m68k_op_or_8_er_aw(void)
\r
1622 uint res = MASK_OUT_ABOVE_8((DX |= OPER_AW_8()));
\r
1624 FLAG_N = NFLAG_8(res);
\r
1626 FLAG_C = CFLAG_CLEAR;
\r
1627 FLAG_V = VFLAG_CLEAR;
\r
1631 void m68k_op_or_8_er_al(void)
\r
1633 uint res = MASK_OUT_ABOVE_8((DX |= OPER_AL_8()));
\r
1635 FLAG_N = NFLAG_8(res);
\r
1637 FLAG_C = CFLAG_CLEAR;
\r
1638 FLAG_V = VFLAG_CLEAR;
\r
1642 void m68k_op_or_8_er_pcdi(void)
\r
1644 uint res = MASK_OUT_ABOVE_8((DX |= OPER_PCDI_8()));
\r
1646 FLAG_N = NFLAG_8(res);
\r
1648 FLAG_C = CFLAG_CLEAR;
\r
1649 FLAG_V = VFLAG_CLEAR;
\r
1653 void m68k_op_or_8_er_pcix(void)
\r
1655 uint res = MASK_OUT_ABOVE_8((DX |= OPER_PCIX_8()));
\r
1657 FLAG_N = NFLAG_8(res);
\r
1659 FLAG_C = CFLAG_CLEAR;
\r
1660 FLAG_V = VFLAG_CLEAR;
\r
1664 void m68k_op_or_8_er_i(void)
\r
1666 uint res = MASK_OUT_ABOVE_8((DX |= OPER_I_8()));
\r
1668 FLAG_N = NFLAG_8(res);
\r
1670 FLAG_C = CFLAG_CLEAR;
\r
1671 FLAG_V = VFLAG_CLEAR;
\r
1675 void m68k_op_or_16_er_d(void)
\r
1677 uint res = MASK_OUT_ABOVE_16((DX |= MASK_OUT_ABOVE_16(DY)));
\r
1679 FLAG_N = NFLAG_16(res);
\r
1681 FLAG_C = CFLAG_CLEAR;
\r
1682 FLAG_V = VFLAG_CLEAR;
\r
1686 void m68k_op_or_16_er_ai(void)
\r
1688 uint res = MASK_OUT_ABOVE_16((DX |= OPER_AY_AI_16()));
\r
1690 FLAG_N = NFLAG_16(res);
\r
1692 FLAG_C = CFLAG_CLEAR;
\r
1693 FLAG_V = VFLAG_CLEAR;
\r
1697 void m68k_op_or_16_er_pi(void)
\r
1699 uint res = MASK_OUT_ABOVE_16((DX |= OPER_AY_PI_16()));
\r
1701 FLAG_N = NFLAG_16(res);
\r
1703 FLAG_C = CFLAG_CLEAR;
\r
1704 FLAG_V = VFLAG_CLEAR;
\r
1708 void m68k_op_or_16_er_pd(void)
\r
1710 uint res = MASK_OUT_ABOVE_16((DX |= OPER_AY_PD_16()));
\r
1712 FLAG_N = NFLAG_16(res);
\r
1714 FLAG_C = CFLAG_CLEAR;
\r
1715 FLAG_V = VFLAG_CLEAR;
\r
1719 void m68k_op_or_16_er_di(void)
\r
1721 uint res = MASK_OUT_ABOVE_16((DX |= OPER_AY_DI_16()));
\r
1723 FLAG_N = NFLAG_16(res);
\r
1725 FLAG_C = CFLAG_CLEAR;
\r
1726 FLAG_V = VFLAG_CLEAR;
\r
1730 void m68k_op_or_16_er_ix(void)
\r
1732 uint res = MASK_OUT_ABOVE_16((DX |= OPER_AY_IX_16()));
\r
1734 FLAG_N = NFLAG_16(res);
\r
1736 FLAG_C = CFLAG_CLEAR;
\r
1737 FLAG_V = VFLAG_CLEAR;
\r
1741 void m68k_op_or_16_er_aw(void)
\r
1743 uint res = MASK_OUT_ABOVE_16((DX |= OPER_AW_16()));
\r
1745 FLAG_N = NFLAG_16(res);
\r
1747 FLAG_C = CFLAG_CLEAR;
\r
1748 FLAG_V = VFLAG_CLEAR;
\r
1752 void m68k_op_or_16_er_al(void)
\r
1754 uint res = MASK_OUT_ABOVE_16((DX |= OPER_AL_16()));
\r
1756 FLAG_N = NFLAG_16(res);
\r
1758 FLAG_C = CFLAG_CLEAR;
\r
1759 FLAG_V = VFLAG_CLEAR;
\r
1763 void m68k_op_or_16_er_pcdi(void)
\r
1765 uint res = MASK_OUT_ABOVE_16((DX |= OPER_PCDI_16()));
\r
1767 FLAG_N = NFLAG_16(res);
\r
1769 FLAG_C = CFLAG_CLEAR;
\r
1770 FLAG_V = VFLAG_CLEAR;
\r
1774 void m68k_op_or_16_er_pcix(void)
\r
1776 uint res = MASK_OUT_ABOVE_16((DX |= OPER_PCIX_16()));
\r
1778 FLAG_N = NFLAG_16(res);
\r
1780 FLAG_C = CFLAG_CLEAR;
\r
1781 FLAG_V = VFLAG_CLEAR;
\r
1785 void m68k_op_or_16_er_i(void)
\r
1787 uint res = MASK_OUT_ABOVE_16((DX |= OPER_I_16()));
\r
1789 FLAG_N = NFLAG_16(res);
\r
1791 FLAG_C = CFLAG_CLEAR;
\r
1792 FLAG_V = VFLAG_CLEAR;
\r
1796 void m68k_op_or_32_er_d(void)
\r
1798 uint res = DX |= DY;
\r
1800 FLAG_N = NFLAG_32(res);
\r
1802 FLAG_C = CFLAG_CLEAR;
\r
1803 FLAG_V = VFLAG_CLEAR;
\r
1807 void m68k_op_or_32_er_ai(void)
\r
1809 uint res = DX |= OPER_AY_AI_32();
\r
1811 FLAG_N = NFLAG_32(res);
\r
1813 FLAG_C = CFLAG_CLEAR;
\r
1814 FLAG_V = VFLAG_CLEAR;
\r
1818 void m68k_op_or_32_er_pi(void)
\r
1820 uint res = DX |= OPER_AY_PI_32();
\r
1822 FLAG_N = NFLAG_32(res);
\r
1824 FLAG_C = CFLAG_CLEAR;
\r
1825 FLAG_V = VFLAG_CLEAR;
\r
1829 void m68k_op_or_32_er_pd(void)
\r
1831 uint res = DX |= OPER_AY_PD_32();
\r
1833 FLAG_N = NFLAG_32(res);
\r
1835 FLAG_C = CFLAG_CLEAR;
\r
1836 FLAG_V = VFLAG_CLEAR;
\r
1840 void m68k_op_or_32_er_di(void)
\r
1842 uint res = DX |= OPER_AY_DI_32();
\r
1844 FLAG_N = NFLAG_32(res);
\r
1846 FLAG_C = CFLAG_CLEAR;
\r
1847 FLAG_V = VFLAG_CLEAR;
\r
1851 void m68k_op_or_32_er_ix(void)
\r
1853 uint res = DX |= OPER_AY_IX_32();
\r
1855 FLAG_N = NFLAG_32(res);
\r
1857 FLAG_C = CFLAG_CLEAR;
\r
1858 FLAG_V = VFLAG_CLEAR;
\r
1862 void m68k_op_or_32_er_aw(void)
\r
1864 uint res = DX |= OPER_AW_32();
\r
1866 FLAG_N = NFLAG_32(res);
\r
1868 FLAG_C = CFLAG_CLEAR;
\r
1869 FLAG_V = VFLAG_CLEAR;
\r
1873 void m68k_op_or_32_er_al(void)
\r
1875 uint res = DX |= OPER_AL_32();
\r
1877 FLAG_N = NFLAG_32(res);
\r
1879 FLAG_C = CFLAG_CLEAR;
\r
1880 FLAG_V = VFLAG_CLEAR;
\r
1884 void m68k_op_or_32_er_pcdi(void)
\r
1886 uint res = DX |= OPER_PCDI_32();
\r
1888 FLAG_N = NFLAG_32(res);
\r
1890 FLAG_C = CFLAG_CLEAR;
\r
1891 FLAG_V = VFLAG_CLEAR;
\r
1895 void m68k_op_or_32_er_pcix(void)
\r
1897 uint res = DX |= OPER_PCIX_32();
\r
1899 FLAG_N = NFLAG_32(res);
\r
1901 FLAG_C = CFLAG_CLEAR;
\r
1902 FLAG_V = VFLAG_CLEAR;
\r
1906 void m68k_op_or_32_er_i(void)
\r
1908 uint res = DX |= OPER_I_32();
\r
1910 FLAG_N = NFLAG_32(res);
\r
1912 FLAG_C = CFLAG_CLEAR;
\r
1913 FLAG_V = VFLAG_CLEAR;
\r
1917 void m68k_op_or_8_re_ai(void)
\r
1919 uint ea = EA_AY_AI_8();
\r
1920 uint res = MASK_OUT_ABOVE_8(DX | m68ki_read_8(ea));
\r
1922 m68ki_write_8(ea, res);
\r
1924 FLAG_N = NFLAG_8(res);
\r
1926 FLAG_C = CFLAG_CLEAR;
\r
1927 FLAG_V = VFLAG_CLEAR;
\r
1931 void m68k_op_or_8_re_pi(void)
\r
1933 uint ea = EA_AY_PI_8();
\r
1934 uint res = MASK_OUT_ABOVE_8(DX | m68ki_read_8(ea));
\r
1936 m68ki_write_8(ea, res);
\r
1938 FLAG_N = NFLAG_8(res);
\r
1940 FLAG_C = CFLAG_CLEAR;
\r
1941 FLAG_V = VFLAG_CLEAR;
\r
1945 void m68k_op_or_8_re_pi7(void)
\r
1947 uint ea = EA_A7_PI_8();
\r
1948 uint res = MASK_OUT_ABOVE_8(DX | m68ki_read_8(ea));
\r
1950 m68ki_write_8(ea, res);
\r
1952 FLAG_N = NFLAG_8(res);
\r
1954 FLAG_C = CFLAG_CLEAR;
\r
1955 FLAG_V = VFLAG_CLEAR;
\r
1959 void m68k_op_or_8_re_pd(void)
\r
1961 uint ea = EA_AY_PD_8();
\r
1962 uint res = MASK_OUT_ABOVE_8(DX | m68ki_read_8(ea));
\r
1964 m68ki_write_8(ea, res);
\r
1966 FLAG_N = NFLAG_8(res);
\r
1968 FLAG_C = CFLAG_CLEAR;
\r
1969 FLAG_V = VFLAG_CLEAR;
\r
1973 void m68k_op_or_8_re_pd7(void)
\r
1975 uint ea = EA_A7_PD_8();
\r
1976 uint res = MASK_OUT_ABOVE_8(DX | m68ki_read_8(ea));
\r
1978 m68ki_write_8(ea, res);
\r
1980 FLAG_N = NFLAG_8(res);
\r
1982 FLAG_C = CFLAG_CLEAR;
\r
1983 FLAG_V = VFLAG_CLEAR;
\r
1987 void m68k_op_or_8_re_di(void)
\r
1989 uint ea = EA_AY_DI_8();
\r
1990 uint res = MASK_OUT_ABOVE_8(DX | m68ki_read_8(ea));
\r
1992 m68ki_write_8(ea, res);
\r
1994 FLAG_N = NFLAG_8(res);
\r
1996 FLAG_C = CFLAG_CLEAR;
\r
1997 FLAG_V = VFLAG_CLEAR;
\r
2001 void m68k_op_or_8_re_ix(void)
\r
2003 uint ea = EA_AY_IX_8();
\r
2004 uint res = MASK_OUT_ABOVE_8(DX | m68ki_read_8(ea));
\r
2006 m68ki_write_8(ea, res);
\r
2008 FLAG_N = NFLAG_8(res);
\r
2010 FLAG_C = CFLAG_CLEAR;
\r
2011 FLAG_V = VFLAG_CLEAR;
\r
2015 void m68k_op_or_8_re_aw(void)
\r
2017 uint ea = EA_AW_8();
\r
2018 uint res = MASK_OUT_ABOVE_8(DX | m68ki_read_8(ea));
\r
2020 m68ki_write_8(ea, res);
\r
2022 FLAG_N = NFLAG_8(res);
\r
2024 FLAG_C = CFLAG_CLEAR;
\r
2025 FLAG_V = VFLAG_CLEAR;
\r
2029 void m68k_op_or_8_re_al(void)
\r
2031 uint ea = EA_AL_8();
\r
2032 uint res = MASK_OUT_ABOVE_8(DX | m68ki_read_8(ea));
\r
2034 m68ki_write_8(ea, res);
\r
2036 FLAG_N = NFLAG_8(res);
\r
2038 FLAG_C = CFLAG_CLEAR;
\r
2039 FLAG_V = VFLAG_CLEAR;
\r
2043 void m68k_op_or_16_re_ai(void)
\r
2045 uint ea = EA_AY_AI_16();
\r
2046 uint res = MASK_OUT_ABOVE_16(DX | m68ki_read_16(ea));
\r
2048 m68ki_write_16(ea, res);
\r
2050 FLAG_N = NFLAG_16(res);
\r
2052 FLAG_C = CFLAG_CLEAR;
\r
2053 FLAG_V = VFLAG_CLEAR;
\r
2057 void m68k_op_or_16_re_pi(void)
\r
2059 uint ea = EA_AY_PI_16();
\r
2060 uint res = MASK_OUT_ABOVE_16(DX | m68ki_read_16(ea));
\r
2062 m68ki_write_16(ea, res);
\r
2064 FLAG_N = NFLAG_16(res);
\r
2066 FLAG_C = CFLAG_CLEAR;
\r
2067 FLAG_V = VFLAG_CLEAR;
\r
2071 void m68k_op_or_16_re_pd(void)
\r
2073 uint ea = EA_AY_PD_16();
\r
2074 uint res = MASK_OUT_ABOVE_16(DX | m68ki_read_16(ea));
\r
2076 m68ki_write_16(ea, res);
\r
2078 FLAG_N = NFLAG_16(res);
\r
2080 FLAG_C = CFLAG_CLEAR;
\r
2081 FLAG_V = VFLAG_CLEAR;
\r
2085 void m68k_op_or_16_re_di(void)
\r
2087 uint ea = EA_AY_DI_16();
\r
2088 uint res = MASK_OUT_ABOVE_16(DX | m68ki_read_16(ea));
\r
2090 m68ki_write_16(ea, res);
\r
2092 FLAG_N = NFLAG_16(res);
\r
2094 FLAG_C = CFLAG_CLEAR;
\r
2095 FLAG_V = VFLAG_CLEAR;
\r
2099 void m68k_op_or_16_re_ix(void)
\r
2101 uint ea = EA_AY_IX_16();
\r
2102 uint res = MASK_OUT_ABOVE_16(DX | m68ki_read_16(ea));
\r
2104 m68ki_write_16(ea, res);
\r
2106 FLAG_N = NFLAG_16(res);
\r
2108 FLAG_C = CFLAG_CLEAR;
\r
2109 FLAG_V = VFLAG_CLEAR;
\r
2113 void m68k_op_or_16_re_aw(void)
\r
2115 uint ea = EA_AW_16();
\r
2116 uint res = MASK_OUT_ABOVE_16(DX | m68ki_read_16(ea));
\r
2118 m68ki_write_16(ea, res);
\r
2120 FLAG_N = NFLAG_16(res);
\r
2122 FLAG_C = CFLAG_CLEAR;
\r
2123 FLAG_V = VFLAG_CLEAR;
\r
2127 void m68k_op_or_16_re_al(void)
\r
2129 uint ea = EA_AL_16();
\r
2130 uint res = MASK_OUT_ABOVE_16(DX | m68ki_read_16(ea));
\r
2132 m68ki_write_16(ea, res);
\r
2134 FLAG_N = NFLAG_16(res);
\r
2136 FLAG_C = CFLAG_CLEAR;
\r
2137 FLAG_V = VFLAG_CLEAR;
\r
2141 void m68k_op_or_32_re_ai(void)
\r
2143 uint ea = EA_AY_AI_32();
\r
2144 uint res = DX | m68ki_read_32(ea);
\r
2146 m68ki_write_32(ea, res);
\r
2148 FLAG_N = NFLAG_32(res);
\r
2150 FLAG_C = CFLAG_CLEAR;
\r
2151 FLAG_V = VFLAG_CLEAR;
\r
2155 void m68k_op_or_32_re_pi(void)
\r
2157 uint ea = EA_AY_PI_32();
\r
2158 uint res = DX | m68ki_read_32(ea);
\r
2160 m68ki_write_32(ea, res);
\r
2162 FLAG_N = NFLAG_32(res);
\r
2164 FLAG_C = CFLAG_CLEAR;
\r
2165 FLAG_V = VFLAG_CLEAR;
\r
2169 void m68k_op_or_32_re_pd(void)
\r
2171 uint ea = EA_AY_PD_32();
\r
2172 uint res = DX | m68ki_read_32(ea);
\r
2174 m68ki_write_32(ea, res);
\r
2176 FLAG_N = NFLAG_32(res);
\r
2178 FLAG_C = CFLAG_CLEAR;
\r
2179 FLAG_V = VFLAG_CLEAR;
\r
2183 void m68k_op_or_32_re_di(void)
\r
2185 uint ea = EA_AY_DI_32();
\r
2186 uint res = DX | m68ki_read_32(ea);
\r
2188 m68ki_write_32(ea, res);
\r
2190 FLAG_N = NFLAG_32(res);
\r
2192 FLAG_C = CFLAG_CLEAR;
\r
2193 FLAG_V = VFLAG_CLEAR;
\r
2197 void m68k_op_or_32_re_ix(void)
\r
2199 uint ea = EA_AY_IX_32();
\r
2200 uint res = DX | m68ki_read_32(ea);
\r
2202 m68ki_write_32(ea, res);
\r
2204 FLAG_N = NFLAG_32(res);
\r
2206 FLAG_C = CFLAG_CLEAR;
\r
2207 FLAG_V = VFLAG_CLEAR;
\r
2211 void m68k_op_or_32_re_aw(void)
\r
2213 uint ea = EA_AW_32();
\r
2214 uint res = DX | m68ki_read_32(ea);
\r
2216 m68ki_write_32(ea, res);
\r
2218 FLAG_N = NFLAG_32(res);
\r
2220 FLAG_C = CFLAG_CLEAR;
\r
2221 FLAG_V = VFLAG_CLEAR;
\r
2225 void m68k_op_or_32_re_al(void)
\r
2227 uint ea = EA_AL_32();
\r
2228 uint res = DX | m68ki_read_32(ea);
\r
2230 m68ki_write_32(ea, res);
\r
2232 FLAG_N = NFLAG_32(res);
\r
2234 FLAG_C = CFLAG_CLEAR;
\r
2235 FLAG_V = VFLAG_CLEAR;
\r
2239 void m68k_op_ori_8_d(void)
\r
2241 uint res = MASK_OUT_ABOVE_8((DY |= OPER_I_8()));
\r
2243 FLAG_N = NFLAG_8(res);
\r
2245 FLAG_C = CFLAG_CLEAR;
\r
2246 FLAG_V = VFLAG_CLEAR;
\r
2250 void m68k_op_ori_8_ai(void)
\r
2252 uint src = OPER_I_8();
\r
2253 uint ea = EA_AY_AI_8();
\r
2254 uint res = MASK_OUT_ABOVE_8(src | m68ki_read_8(ea));
\r
2256 m68ki_write_8(ea, res);
\r
2258 FLAG_N = NFLAG_8(res);
\r
2260 FLAG_C = CFLAG_CLEAR;
\r
2261 FLAG_V = VFLAG_CLEAR;
\r
2265 void m68k_op_ori_8_pi(void)
\r
2267 uint src = OPER_I_8();
\r
2268 uint ea = EA_AY_PI_8();
\r
2269 uint res = MASK_OUT_ABOVE_8(src | m68ki_read_8(ea));
\r
2271 m68ki_write_8(ea, res);
\r
2273 FLAG_N = NFLAG_8(res);
\r
2275 FLAG_C = CFLAG_CLEAR;
\r
2276 FLAG_V = VFLAG_CLEAR;
\r
2280 void m68k_op_ori_8_pi7(void)
\r
2282 uint src = OPER_I_8();
\r
2283 uint ea = EA_A7_PI_8();
\r
2284 uint res = MASK_OUT_ABOVE_8(src | m68ki_read_8(ea));
\r
2286 m68ki_write_8(ea, res);
\r
2288 FLAG_N = NFLAG_8(res);
\r
2290 FLAG_C = CFLAG_CLEAR;
\r
2291 FLAG_V = VFLAG_CLEAR;
\r
2295 void m68k_op_ori_8_pd(void)
\r
2297 uint src = OPER_I_8();
\r
2298 uint ea = EA_AY_PD_8();
\r
2299 uint res = MASK_OUT_ABOVE_8(src | m68ki_read_8(ea));
\r
2301 m68ki_write_8(ea, res);
\r
2303 FLAG_N = NFLAG_8(res);
\r
2305 FLAG_C = CFLAG_CLEAR;
\r
2306 FLAG_V = VFLAG_CLEAR;
\r
2310 void m68k_op_ori_8_pd7(void)
\r
2312 uint src = OPER_I_8();
\r
2313 uint ea = EA_A7_PD_8();
\r
2314 uint res = MASK_OUT_ABOVE_8(src | m68ki_read_8(ea));
\r
2316 m68ki_write_8(ea, res);
\r
2318 FLAG_N = NFLAG_8(res);
\r
2320 FLAG_C = CFLAG_CLEAR;
\r
2321 FLAG_V = VFLAG_CLEAR;
\r
2325 void m68k_op_ori_8_di(void)
\r
2327 uint src = OPER_I_8();
\r
2328 uint ea = EA_AY_DI_8();
\r
2329 uint res = MASK_OUT_ABOVE_8(src | m68ki_read_8(ea));
\r
2331 m68ki_write_8(ea, res);
\r
2333 FLAG_N = NFLAG_8(res);
\r
2335 FLAG_C = CFLAG_CLEAR;
\r
2336 FLAG_V = VFLAG_CLEAR;
\r
2340 void m68k_op_ori_8_ix(void)
\r
2342 uint src = OPER_I_8();
\r
2343 uint ea = EA_AY_IX_8();
\r
2344 uint res = MASK_OUT_ABOVE_8(src | m68ki_read_8(ea));
\r
2346 m68ki_write_8(ea, res);
\r
2348 FLAG_N = NFLAG_8(res);
\r
2350 FLAG_C = CFLAG_CLEAR;
\r
2351 FLAG_V = VFLAG_CLEAR;
\r
2355 void m68k_op_ori_8_aw(void)
\r
2357 uint src = OPER_I_8();
\r
2358 uint ea = EA_AW_8();
\r
2359 uint res = MASK_OUT_ABOVE_8(src | m68ki_read_8(ea));
\r
2361 m68ki_write_8(ea, res);
\r
2363 FLAG_N = NFLAG_8(res);
\r
2365 FLAG_C = CFLAG_CLEAR;
\r
2366 FLAG_V = VFLAG_CLEAR;
\r
2370 void m68k_op_ori_8_al(void)
\r
2372 uint src = OPER_I_8();
\r
2373 uint ea = EA_AL_8();
\r
2374 uint res = MASK_OUT_ABOVE_8(src | m68ki_read_8(ea));
\r
2376 m68ki_write_8(ea, res);
\r
2378 FLAG_N = NFLAG_8(res);
\r
2380 FLAG_C = CFLAG_CLEAR;
\r
2381 FLAG_V = VFLAG_CLEAR;
\r
2385 void m68k_op_ori_16_d(void)
\r
2387 uint res = MASK_OUT_ABOVE_16(DY |= OPER_I_16());
\r
2389 FLAG_N = NFLAG_16(res);
\r
2391 FLAG_C = CFLAG_CLEAR;
\r
2392 FLAG_V = VFLAG_CLEAR;
\r
2396 void m68k_op_ori_16_ai(void)
\r
2398 uint src = OPER_I_16();
\r
2399 uint ea = EA_AY_AI_16();
\r
2400 uint res = MASK_OUT_ABOVE_16(src | m68ki_read_16(ea));
\r
2402 m68ki_write_16(ea, res);
\r
2404 FLAG_N = NFLAG_16(res);
\r
2406 FLAG_C = CFLAG_CLEAR;
\r
2407 FLAG_V = VFLAG_CLEAR;
\r
2411 void m68k_op_ori_16_pi(void)
\r
2413 uint src = OPER_I_16();
\r
2414 uint ea = EA_AY_PI_16();
\r
2415 uint res = MASK_OUT_ABOVE_16(src | m68ki_read_16(ea));
\r
2417 m68ki_write_16(ea, res);
\r
2419 FLAG_N = NFLAG_16(res);
\r
2421 FLAG_C = CFLAG_CLEAR;
\r
2422 FLAG_V = VFLAG_CLEAR;
\r
2426 void m68k_op_ori_16_pd(void)
\r
2428 uint src = OPER_I_16();
\r
2429 uint ea = EA_AY_PD_16();
\r
2430 uint res = MASK_OUT_ABOVE_16(src | m68ki_read_16(ea));
\r
2432 m68ki_write_16(ea, res);
\r
2434 FLAG_N = NFLAG_16(res);
\r
2436 FLAG_C = CFLAG_CLEAR;
\r
2437 FLAG_V = VFLAG_CLEAR;
\r
2441 void m68k_op_ori_16_di(void)
\r
2443 uint src = OPER_I_16();
\r
2444 uint ea = EA_AY_DI_16();
\r
2445 uint res = MASK_OUT_ABOVE_16(src | m68ki_read_16(ea));
\r
2447 m68ki_write_16(ea, res);
\r
2449 FLAG_N = NFLAG_16(res);
\r
2451 FLAG_C = CFLAG_CLEAR;
\r
2452 FLAG_V = VFLAG_CLEAR;
\r
2456 void m68k_op_ori_16_ix(void)
\r
2458 uint src = OPER_I_16();
\r
2459 uint ea = EA_AY_IX_16();
\r
2460 uint res = MASK_OUT_ABOVE_16(src | m68ki_read_16(ea));
\r
2462 m68ki_write_16(ea, res);
\r
2464 FLAG_N = NFLAG_16(res);
\r
2466 FLAG_C = CFLAG_CLEAR;
\r
2467 FLAG_V = VFLAG_CLEAR;
\r
2471 void m68k_op_ori_16_aw(void)
\r
2473 uint src = OPER_I_16();
\r
2474 uint ea = EA_AW_16();
\r
2475 uint res = MASK_OUT_ABOVE_16(src | m68ki_read_16(ea));
\r
2477 m68ki_write_16(ea, res);
\r
2479 FLAG_N = NFLAG_16(res);
\r
2481 FLAG_C = CFLAG_CLEAR;
\r
2482 FLAG_V = VFLAG_CLEAR;
\r
2486 void m68k_op_ori_16_al(void)
\r
2488 uint src = OPER_I_16();
\r
2489 uint ea = EA_AL_16();
\r
2490 uint res = MASK_OUT_ABOVE_16(src | m68ki_read_16(ea));
\r
2492 m68ki_write_16(ea, res);
\r
2494 FLAG_N = NFLAG_16(res);
\r
2496 FLAG_C = CFLAG_CLEAR;
\r
2497 FLAG_V = VFLAG_CLEAR;
\r
2501 void m68k_op_ori_32_d(void)
\r
2503 uint res = DY |= OPER_I_32();
\r
2505 FLAG_N = NFLAG_32(res);
\r
2507 FLAG_C = CFLAG_CLEAR;
\r
2508 FLAG_V = VFLAG_CLEAR;
\r
2512 void m68k_op_ori_32_ai(void)
\r
2514 uint src = OPER_I_32();
\r
2515 uint ea = EA_AY_AI_32();
\r
2516 uint res = src | m68ki_read_32(ea);
\r
2518 m68ki_write_32(ea, res);
\r
2520 FLAG_N = NFLAG_32(res);
\r
2522 FLAG_C = CFLAG_CLEAR;
\r
2523 FLAG_V = VFLAG_CLEAR;
\r
2527 void m68k_op_ori_32_pi(void)
\r
2529 uint src = OPER_I_32();
\r
2530 uint ea = EA_AY_PI_32();
\r
2531 uint res = src | m68ki_read_32(ea);
\r
2533 m68ki_write_32(ea, res);
\r
2535 FLAG_N = NFLAG_32(res);
\r
2537 FLAG_C = CFLAG_CLEAR;
\r
2538 FLAG_V = VFLAG_CLEAR;
\r
2542 void m68k_op_ori_32_pd(void)
\r
2544 uint src = OPER_I_32();
\r
2545 uint ea = EA_AY_PD_32();
\r
2546 uint res = src | m68ki_read_32(ea);
\r
2548 m68ki_write_32(ea, res);
\r
2550 FLAG_N = NFLAG_32(res);
\r
2552 FLAG_C = CFLAG_CLEAR;
\r
2553 FLAG_V = VFLAG_CLEAR;
\r
2557 void m68k_op_ori_32_di(void)
\r
2559 uint src = OPER_I_32();
\r
2560 uint ea = EA_AY_DI_32();
\r
2561 uint res = src | m68ki_read_32(ea);
\r
2563 m68ki_write_32(ea, res);
\r
2565 FLAG_N = NFLAG_32(res);
\r
2567 FLAG_C = CFLAG_CLEAR;
\r
2568 FLAG_V = VFLAG_CLEAR;
\r
2572 void m68k_op_ori_32_ix(void)
\r
2574 uint src = OPER_I_32();
\r
2575 uint ea = EA_AY_IX_32();
\r
2576 uint res = src | m68ki_read_32(ea);
\r
2578 m68ki_write_32(ea, res);
\r
2580 FLAG_N = NFLAG_32(res);
\r
2582 FLAG_C = CFLAG_CLEAR;
\r
2583 FLAG_V = VFLAG_CLEAR;
\r
2587 void m68k_op_ori_32_aw(void)
\r
2589 uint src = OPER_I_32();
\r
2590 uint ea = EA_AW_32();
\r
2591 uint res = src | m68ki_read_32(ea);
\r
2593 m68ki_write_32(ea, res);
\r
2595 FLAG_N = NFLAG_32(res);
\r
2597 FLAG_C = CFLAG_CLEAR;
\r
2598 FLAG_V = VFLAG_CLEAR;
\r
2602 void m68k_op_ori_32_al(void)
\r
2604 uint src = OPER_I_32();
\r
2605 uint ea = EA_AL_32();
\r
2606 uint res = src | m68ki_read_32(ea);
\r
2608 m68ki_write_32(ea, res);
\r
2610 FLAG_N = NFLAG_32(res);
\r
2612 FLAG_C = CFLAG_CLEAR;
\r
2613 FLAG_V = VFLAG_CLEAR;
\r
2617 void m68k_op_ori_16_toc(void)
\r
2619 m68ki_set_ccr(m68ki_get_ccr() | OPER_I_16());
\r
2623 void m68k_op_ori_16_tos(void)
\r
2627 uint src = OPER_I_16();
\r
2628 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
2629 m68ki_set_sr(m68ki_get_sr() | src);
\r
2632 m68ki_exception_privilege_violation();
\r
2636 void m68k_op_pack_16_rr(void)
\r
2638 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
2640 /* Note: DX and DY are reversed in Motorola's docs */
\r
2641 uint src = DY + OPER_I_16();
\r
2642 uint* r_dst = &DX;
\r
2644 *r_dst = MASK_OUT_BELOW_8(*r_dst) | ((src >> 4) & 0x00f0) | (src & 0x000f);
\r
2647 m68ki_exception_illegal();
\r
2651 void m68k_op_pack_16_mm_ax7(void)
\r
2653 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
2655 /* Note: AX and AY are reversed in Motorola's docs */
\r
2656 uint ea_src = EA_AY_PD_8();
\r
2657 uint src = m68ki_read_8(ea_src);
\r
2658 ea_src = EA_AY_PD_8();
\r
2659 src = ((src << 8) | m68ki_read_8(ea_src)) + OPER_I_16();
\r
2661 m68ki_write_8(EA_A7_PD_8(), ((src >> 4) & 0x00f0) | (src & 0x000f));
\r
2664 m68ki_exception_illegal();
\r
2668 void m68k_op_pack_16_mm_ay7(void)
\r
2670 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
2672 /* Note: AX and AY are reversed in Motorola's docs */
\r
2673 uint ea_src = EA_A7_PD_8();
\r
2674 uint src = m68ki_read_8(ea_src);
\r
2675 ea_src = EA_A7_PD_8();
\r
2676 src = ((src << 8) | m68ki_read_8(ea_src)) + OPER_I_16();
\r
2678 m68ki_write_8(EA_AX_PD_8(), ((src >> 4) & 0x00f0) | (src & 0x000f));
\r
2681 m68ki_exception_illegal();
\r
2685 void m68k_op_pack_16_mm_axy7(void)
\r
2687 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
2689 uint ea_src = EA_A7_PD_8();
\r
2690 uint src = m68ki_read_8(ea_src);
\r
2691 ea_src = EA_A7_PD_8();
\r
2692 src = ((src << 8) | m68ki_read_8(ea_src)) + OPER_I_16();
\r
2694 m68ki_write_8(EA_A7_PD_8(), ((src >> 4) & 0x00f0) | (src & 0x000f));
\r
2697 m68ki_exception_illegal();
\r
2701 void m68k_op_pack_16_mm(void)
\r
2703 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
2705 /* Note: AX and AY are reversed in Motorola's docs */
\r
2706 uint ea_src = EA_AY_PD_8();
\r
2707 uint src = m68ki_read_8(ea_src);
\r
2708 ea_src = EA_AY_PD_8();
\r
2709 src = ((src << 8) | m68ki_read_8(ea_src)) + OPER_I_16();
\r
2711 m68ki_write_8(EA_AX_PD_8(), ((src >> 4) & 0x00f0) | (src & 0x000f));
\r
2714 m68ki_exception_illegal();
\r
2718 void m68k_op_pea_32_ai(void)
\r
2720 uint ea = EA_AY_AI_32();
\r
2722 m68ki_push_32(ea);
\r
2726 void m68k_op_pea_32_di(void)
\r
2728 uint ea = EA_AY_DI_32();
\r
2730 m68ki_push_32(ea);
\r
2734 void m68k_op_pea_32_ix(void)
\r
2736 uint ea = EA_AY_IX_32();
\r
2738 m68ki_push_32(ea);
\r
2742 void m68k_op_pea_32_aw(void)
\r
2744 uint ea = EA_AW_32();
\r
2746 m68ki_push_32(ea);
\r
2750 void m68k_op_pea_32_al(void)
\r
2752 uint ea = EA_AL_32();
\r
2754 m68ki_push_32(ea);
\r
2758 void m68k_op_pea_32_pcdi(void)
\r
2760 uint ea = EA_PCDI_32();
\r
2762 m68ki_push_32(ea);
\r
2766 void m68k_op_pea_32_pcix(void)
\r
2768 uint ea = EA_PCIX_32();
\r
2770 m68ki_push_32(ea);
\r
2774 void m68k_op_pflush_32(void)
\r
2776 if(CPU_TYPE_IS_040_PLUS(CPU_TYPE))
\r
2778 // Nothing to do, unless address translation cache is emulated
\r
2781 m68ki_exception_illegal();
\r
2785 void m68k_op_reset(void)
\r
2789 m68ki_output_reset(); /* auto-disable (see m68kcpu.h) */
\r
2790 USE_CYCLES(CYC_RESET);
\r
2793 m68ki_exception_privilege_violation();
\r
2797 void m68k_op_ror_8_s(void)
\r
2799 uint* r_dst = &DY;
\r
2800 uint orig_shift = (((REG_IR >> 9) - 1) & 7) + 1;
\r
2801 uint shift = orig_shift & 7;
\r
2802 uint src = MASK_OUT_ABOVE_8(*r_dst);
\r
2803 uint res = ROR_8(src, shift);
\r
2805 if(orig_shift != 0)
\r
2806 USE_CYCLES(orig_shift<<CYC_SHIFT);
\r
2808 *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
\r
2810 FLAG_N = NFLAG_8(res);
\r
2812 FLAG_C = src << (9-orig_shift);
\r
2813 FLAG_V = VFLAG_CLEAR;
\r
2817 void m68k_op_ror_16_s(void)
\r
2819 uint* r_dst = &DY;
\r
2820 uint shift = (((REG_IR >> 9) - 1) & 7) + 1;
\r
2821 uint src = MASK_OUT_ABOVE_16(*r_dst);
\r
2822 uint res = ROR_16(src, shift);
\r
2825 USE_CYCLES(shift<<CYC_SHIFT);
\r
2827 *r_dst = MASK_OUT_BELOW_16(*r_dst) | res;
\r
2829 FLAG_N = NFLAG_16(res);
\r
2831 FLAG_C = src << (9-shift);
\r
2832 FLAG_V = VFLAG_CLEAR;
\r
2836 void m68k_op_ror_32_s(void)
\r
2838 uint* r_dst = &DY;
\r
2839 uint shift = (((REG_IR >> 9) - 1) & 7) + 1;
\r
2840 uint64 src = *r_dst;
\r
2841 uint res = ROR_32(src, shift);
\r
2844 USE_CYCLES(shift<<CYC_SHIFT);
\r
2848 FLAG_N = NFLAG_32(res);
\r
2850 FLAG_C = src << (9-shift);
\r
2851 FLAG_V = VFLAG_CLEAR;
\r
2855 void m68k_op_ror_8_r(void)
\r
2857 uint* r_dst = &DY;
\r
2858 uint orig_shift = DX & 0x3f;
\r
2859 uint shift = orig_shift & 7;
\r
2860 uint src = MASK_OUT_ABOVE_8(*r_dst);
\r
2861 uint res = ROR_8(src, shift);
\r
2863 if(orig_shift != 0)
\r
2865 USE_CYCLES(orig_shift<<CYC_SHIFT);
\r
2867 *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
\r
2868 FLAG_C = src << (8-((shift-1)&7));
\r
2869 FLAG_N = NFLAG_8(res);
\r
2871 FLAG_V = VFLAG_CLEAR;
\r
2875 FLAG_C = CFLAG_CLEAR;
\r
2876 FLAG_N = NFLAG_8(src);
\r
2878 FLAG_V = VFLAG_CLEAR;
\r
2882 void m68k_op_ror_16_r(void)
\r
2884 uint* r_dst = &DY;
\r
2885 uint orig_shift = DX & 0x3f;
\r
2886 uint shift = orig_shift & 15;
\r
2887 uint src = MASK_OUT_ABOVE_16(*r_dst);
\r
2888 uint res = ROR_16(src, shift);
\r
2890 if(orig_shift != 0)
\r
2892 USE_CYCLES(orig_shift<<CYC_SHIFT);
\r
2894 *r_dst = MASK_OUT_BELOW_16(*r_dst) | res;
\r
2895 FLAG_C = (src >> ((shift - 1) & 15)) << 8;
\r
2896 FLAG_N = NFLAG_16(res);
\r
2898 FLAG_V = VFLAG_CLEAR;
\r
2902 FLAG_C = CFLAG_CLEAR;
\r
2903 FLAG_N = NFLAG_16(src);
\r
2905 FLAG_V = VFLAG_CLEAR;
\r
2909 void m68k_op_ror_32_r(void)
\r
2911 uint* r_dst = &DY;
\r
2912 uint orig_shift = DX & 0x3f;
\r
2913 uint shift = orig_shift & 31;
\r
2914 uint64 src = *r_dst;
\r
2915 uint res = ROR_32(src, shift);
\r
2917 if(orig_shift != 0)
\r
2919 USE_CYCLES(orig_shift<<CYC_SHIFT);
\r
2922 FLAG_C = (src >> ((shift - 1) & 31)) << 8;
\r
2923 FLAG_N = NFLAG_32(res);
\r
2925 FLAG_V = VFLAG_CLEAR;
\r
2929 FLAG_C = CFLAG_CLEAR;
\r
2930 FLAG_N = NFLAG_32(src);
\r
2932 FLAG_V = VFLAG_CLEAR;
\r
2936 void m68k_op_ror_16_ai(void)
\r
2938 uint ea = EA_AY_AI_16();
\r
2939 uint src = m68ki_read_16(ea);
\r
2940 uint res = ROR_16(src, 1);
\r
2942 m68ki_write_16(ea, res);
\r
2944 FLAG_N = NFLAG_16(res);
\r
2946 FLAG_C = src << 8;
\r
2947 FLAG_V = VFLAG_CLEAR;
\r
2951 void m68k_op_ror_16_pi(void)
\r
2953 uint ea = EA_AY_PI_16();
\r
2954 uint src = m68ki_read_16(ea);
\r
2955 uint res = ROR_16(src, 1);
\r
2957 m68ki_write_16(ea, res);
\r
2959 FLAG_N = NFLAG_16(res);
\r
2961 FLAG_C = src << 8;
\r
2962 FLAG_V = VFLAG_CLEAR;
\r
2966 void m68k_op_ror_16_pd(void)
\r
2968 uint ea = EA_AY_PD_16();
\r
2969 uint src = m68ki_read_16(ea);
\r
2970 uint res = ROR_16(src, 1);
\r
2972 m68ki_write_16(ea, res);
\r
2974 FLAG_N = NFLAG_16(res);
\r
2976 FLAG_C = src << 8;
\r
2977 FLAG_V = VFLAG_CLEAR;
\r
2981 void m68k_op_ror_16_di(void)
\r
2983 uint ea = EA_AY_DI_16();
\r
2984 uint src = m68ki_read_16(ea);
\r
2985 uint res = ROR_16(src, 1);
\r
2987 m68ki_write_16(ea, res);
\r
2989 FLAG_N = NFLAG_16(res);
\r
2991 FLAG_C = src << 8;
\r
2992 FLAG_V = VFLAG_CLEAR;
\r
2996 void m68k_op_ror_16_ix(void)
\r
2998 uint ea = EA_AY_IX_16();
\r
2999 uint src = m68ki_read_16(ea);
\r
3000 uint res = ROR_16(src, 1);
\r
3002 m68ki_write_16(ea, res);
\r
3004 FLAG_N = NFLAG_16(res);
\r
3006 FLAG_C = src << 8;
\r
3007 FLAG_V = VFLAG_CLEAR;
\r
3011 void m68k_op_ror_16_aw(void)
\r
3013 uint ea = EA_AW_16();
\r
3014 uint src = m68ki_read_16(ea);
\r
3015 uint res = ROR_16(src, 1);
\r
3017 m68ki_write_16(ea, res);
\r
3019 FLAG_N = NFLAG_16(res);
\r
3021 FLAG_C = src << 8;
\r
3022 FLAG_V = VFLAG_CLEAR;
\r
3026 void m68k_op_ror_16_al(void)
\r
3028 uint ea = EA_AL_16();
\r
3029 uint src = m68ki_read_16(ea);
\r
3030 uint res = ROR_16(src, 1);
\r
3032 m68ki_write_16(ea, res);
\r
3034 FLAG_N = NFLAG_16(res);
\r
3036 FLAG_C = src << 8;
\r
3037 FLAG_V = VFLAG_CLEAR;
\r
3041 void m68k_op_rol_8_s(void)
\r
3043 uint* r_dst = &DY;
\r
3044 uint orig_shift = (((REG_IR >> 9) - 1) & 7) + 1;
\r
3045 uint shift = orig_shift & 7;
\r
3046 uint src = MASK_OUT_ABOVE_8(*r_dst);
\r
3047 uint res = ROL_8(src, shift);
\r
3049 if(orig_shift != 0)
\r
3050 USE_CYCLES(orig_shift<<CYC_SHIFT);
\r
3052 *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
\r
3054 FLAG_N = NFLAG_8(res);
\r
3056 FLAG_C = src << orig_shift;
\r
3057 FLAG_V = VFLAG_CLEAR;
\r
3061 void m68k_op_rol_16_s(void)
\r
3063 uint* r_dst = &DY;
\r
3064 uint shift = (((REG_IR >> 9) - 1) & 7) + 1;
\r
3065 uint src = MASK_OUT_ABOVE_16(*r_dst);
\r
3066 uint res = ROL_16(src, shift);
\r
3069 USE_CYCLES(shift<<CYC_SHIFT);
\r
3071 *r_dst = MASK_OUT_BELOW_16(*r_dst) | res;
\r
3073 FLAG_N = NFLAG_16(res);
\r
3075 FLAG_C = src >> (8-shift);
\r
3076 FLAG_V = VFLAG_CLEAR;
\r
3080 void m68k_op_rol_32_s(void)
\r
3082 uint* r_dst = &DY;
\r
3083 uint shift = (((REG_IR >> 9) - 1) & 7) + 1;
\r
3084 uint64 src = *r_dst;
\r
3085 uint res = ROL_32(src, shift);
\r
3088 USE_CYCLES(shift<<CYC_SHIFT);
\r
3092 FLAG_N = NFLAG_32(res);
\r
3094 FLAG_C = src >> (24-shift);
\r
3095 FLAG_V = VFLAG_CLEAR;
\r
3099 void m68k_op_rol_8_r(void)
\r
3101 uint* r_dst = &DY;
\r
3102 uint orig_shift = DX & 0x3f;
\r
3103 uint shift = orig_shift & 7;
\r
3104 uint src = MASK_OUT_ABOVE_8(*r_dst);
\r
3105 uint res = ROL_8(src, shift);
\r
3107 if(orig_shift != 0)
\r
3109 USE_CYCLES(orig_shift<<CYC_SHIFT);
\r
3113 *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
\r
3114 FLAG_C = src << shift;
\r
3115 FLAG_N = NFLAG_8(res);
\r
3117 FLAG_V = VFLAG_CLEAR;
\r
3120 FLAG_C = (src & 1)<<8;
\r
3121 FLAG_N = NFLAG_8(src);
\r
3123 FLAG_V = VFLAG_CLEAR;
\r
3127 FLAG_C = CFLAG_CLEAR;
\r
3128 FLAG_N = NFLAG_8(src);
\r
3130 FLAG_V = VFLAG_CLEAR;
\r
3134 void m68k_op_rol_16_r(void)
\r
3136 uint* r_dst = &DY;
\r
3137 uint orig_shift = DX & 0x3f;
\r
3138 uint shift = orig_shift & 15;
\r
3139 uint src = MASK_OUT_ABOVE_16(*r_dst);
\r
3140 uint res = MASK_OUT_ABOVE_16(ROL_16(src, shift));
\r
3142 if(orig_shift != 0)
\r
3144 USE_CYCLES(orig_shift<<CYC_SHIFT);
\r
3148 *r_dst = MASK_OUT_BELOW_16(*r_dst) | res;
\r
3149 FLAG_C = (src << shift) >> 8;
\r
3150 FLAG_N = NFLAG_16(res);
\r
3152 FLAG_V = VFLAG_CLEAR;
\r
3155 FLAG_C = (src & 1)<<8;
\r
3156 FLAG_N = NFLAG_16(src);
\r
3158 FLAG_V = VFLAG_CLEAR;
\r
3162 FLAG_C = CFLAG_CLEAR;
\r
3163 FLAG_N = NFLAG_16(src);
\r
3165 FLAG_V = VFLAG_CLEAR;
\r
3169 void m68k_op_rol_32_r(void)
\r
3171 uint* r_dst = &DY;
\r
3172 uint orig_shift = DX & 0x3f;
\r
3173 uint shift = orig_shift & 31;
\r
3174 uint64 src = *r_dst;
\r
3175 uint res = ROL_32(src, shift);
\r
3177 if(orig_shift != 0)
\r
3179 USE_CYCLES(orig_shift<<CYC_SHIFT);
\r
3183 FLAG_C = (src >> (32 - shift)) << 8;
\r
3184 FLAG_N = NFLAG_32(res);
\r
3186 FLAG_V = VFLAG_CLEAR;
\r
3190 FLAG_C = CFLAG_CLEAR;
\r
3191 FLAG_N = NFLAG_32(src);
\r
3193 FLAG_V = VFLAG_CLEAR;
\r
3197 void m68k_op_rol_16_ai(void)
\r
3199 uint ea = EA_AY_AI_16();
\r
3200 uint src = m68ki_read_16(ea);
\r
3201 uint res = MASK_OUT_ABOVE_16(ROL_16(src, 1));
\r
3203 m68ki_write_16(ea, res);
\r
3205 FLAG_N = NFLAG_16(res);
\r
3207 FLAG_C = src >> 7;
\r
3208 FLAG_V = VFLAG_CLEAR;
\r
3212 void m68k_op_rol_16_pi(void)
\r
3214 uint ea = EA_AY_PI_16();
\r
3215 uint src = m68ki_read_16(ea);
\r
3216 uint res = MASK_OUT_ABOVE_16(ROL_16(src, 1));
\r
3218 m68ki_write_16(ea, res);
\r
3220 FLAG_N = NFLAG_16(res);
\r
3222 FLAG_C = src >> 7;
\r
3223 FLAG_V = VFLAG_CLEAR;
\r
3227 void m68k_op_rol_16_pd(void)
\r
3229 uint ea = EA_AY_PD_16();
\r
3230 uint src = m68ki_read_16(ea);
\r
3231 uint res = MASK_OUT_ABOVE_16(ROL_16(src, 1));
\r
3233 m68ki_write_16(ea, res);
\r
3235 FLAG_N = NFLAG_16(res);
\r
3237 FLAG_C = src >> 7;
\r
3238 FLAG_V = VFLAG_CLEAR;
\r
3242 void m68k_op_rol_16_di(void)
\r
3244 uint ea = EA_AY_DI_16();
\r
3245 uint src = m68ki_read_16(ea);
\r
3246 uint res = MASK_OUT_ABOVE_16(ROL_16(src, 1));
\r
3248 m68ki_write_16(ea, res);
\r
3250 FLAG_N = NFLAG_16(res);
\r
3252 FLAG_C = src >> 7;
\r
3253 FLAG_V = VFLAG_CLEAR;
\r
3257 void m68k_op_rol_16_ix(void)
\r
3259 uint ea = EA_AY_IX_16();
\r
3260 uint src = m68ki_read_16(ea);
\r
3261 uint res = MASK_OUT_ABOVE_16(ROL_16(src, 1));
\r
3263 m68ki_write_16(ea, res);
\r
3265 FLAG_N = NFLAG_16(res);
\r
3267 FLAG_C = src >> 7;
\r
3268 FLAG_V = VFLAG_CLEAR;
\r
3272 void m68k_op_rol_16_aw(void)
\r
3274 uint ea = EA_AW_16();
\r
3275 uint src = m68ki_read_16(ea);
\r
3276 uint res = MASK_OUT_ABOVE_16(ROL_16(src, 1));
\r
3278 m68ki_write_16(ea, res);
\r
3280 FLAG_N = NFLAG_16(res);
\r
3282 FLAG_C = src >> 7;
\r
3283 FLAG_V = VFLAG_CLEAR;
\r
3287 void m68k_op_rol_16_al(void)
\r
3289 uint ea = EA_AL_16();
\r
3290 uint src = m68ki_read_16(ea);
\r
3291 uint res = MASK_OUT_ABOVE_16(ROL_16(src, 1));
\r
3293 m68ki_write_16(ea, res);
\r
3295 FLAG_N = NFLAG_16(res);
\r
3297 FLAG_C = src >> 7;
\r
3298 FLAG_V = VFLAG_CLEAR;
\r
3302 void m68k_op_roxr_8_s(void)
\r
3304 uint* r_dst = &DY;
\r
3305 uint shift = (((REG_IR >> 9) - 1) & 7) + 1;
\r
3306 uint src = MASK_OUT_ABOVE_8(*r_dst);
\r
3307 uint res = ROR_9(src | (XFLAG_AS_1() << 8), shift);
\r
3310 USE_CYCLES(shift<<CYC_SHIFT);
\r
3312 FLAG_C = FLAG_X = res;
\r
3313 res = MASK_OUT_ABOVE_8(res);
\r
3315 *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
\r
3317 FLAG_N = NFLAG_8(res);
\r
3319 FLAG_V = VFLAG_CLEAR;
\r
3323 void m68k_op_roxr_16_s(void)
\r
3325 uint* r_dst = &DY;
\r
3326 uint shift = (((REG_IR >> 9) - 1) & 7) + 1;
\r
3327 uint src = MASK_OUT_ABOVE_16(*r_dst);
\r
3328 uint res = ROR_17(src | (XFLAG_AS_1() << 16), shift);
\r
3331 USE_CYCLES(shift<<CYC_SHIFT);
\r
3333 FLAG_C = FLAG_X = res >> 8;
\r
3334 res = MASK_OUT_ABOVE_16(res);
\r
3336 *r_dst = MASK_OUT_BELOW_16(*r_dst) | res;
\r
3338 FLAG_N = NFLAG_16(res);
\r
3340 FLAG_V = VFLAG_CLEAR;
\r
3344 void m68k_op_roxr_32_s(void)
\r
3346 #if M68K_USE_64_BIT
\r
3348 uint* r_dst = &DY;
\r
3349 uint shift = (((REG_IR >> 9) - 1) & 7) + 1;
\r
3350 uint64 src = *r_dst;
\r
3351 uint64 res = src | (((uint64)XFLAG_AS_1()) << 32);
\r
3354 USE_CYCLES(shift<<CYC_SHIFT);
\r
3356 res = ROR_33_64(res, shift);
\r
3358 FLAG_C = FLAG_X = res >> 24;
\r
3359 res = MASK_OUT_ABOVE_32(res);
\r
3363 FLAG_N = NFLAG_32(res);
\r
3365 FLAG_V = VFLAG_CLEAR;
\r
3369 uint* r_dst = &DY;
\r
3370 uint shift = (((REG_IR >> 9) - 1) & 7) + 1;
\r
3371 uint src = *r_dst;
\r
3372 uint res = MASK_OUT_ABOVE_32((ROR_33(src, shift) & ~(1 << (32 - shift))) | (XFLAG_AS_1() << (32 - shift)));
\r
3373 uint new_x_flag = src & (1 << (shift - 1));
\r
3376 USE_CYCLES(shift<<CYC_SHIFT);
\r
3380 FLAG_C = FLAG_X = (new_x_flag != 0)<<8;
\r
3381 FLAG_N = NFLAG_32(res);
\r
3383 FLAG_V = VFLAG_CLEAR;
\r
3389 void m68k_op_roxr_8_r(void)
\r
3391 uint* r_dst = &DY;
\r
3392 uint orig_shift = DX & 0x3f;
\r
3394 if(orig_shift != 0)
\r
3396 uint shift = orig_shift % 9;
\r
3397 uint src = MASK_OUT_ABOVE_8(*r_dst);
\r
3398 uint res = ROR_9(src | (XFLAG_AS_1() << 8), shift);
\r
3400 USE_CYCLES(orig_shift<<CYC_SHIFT);
\r
3402 FLAG_C = FLAG_X = res;
\r
3403 res = MASK_OUT_ABOVE_8(res);
\r
3405 *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
\r
3406 FLAG_N = NFLAG_8(res);
\r
3408 FLAG_V = VFLAG_CLEAR;
\r
3413 FLAG_N = NFLAG_8(*r_dst);
\r
3414 FLAG_Z = MASK_OUT_ABOVE_8(*r_dst);
\r
3415 FLAG_V = VFLAG_CLEAR;
\r
3419 void m68k_op_roxr_16_r(void)
\r
3421 uint* r_dst = &DY;
\r
3422 uint orig_shift = DX & 0x3f;
\r
3424 if(orig_shift != 0)
\r
3426 uint shift = orig_shift % 17;
\r
3427 uint src = MASK_OUT_ABOVE_16(*r_dst);
\r
3428 uint res = ROR_17(src | (XFLAG_AS_1() << 16), shift);
\r
3430 USE_CYCLES(orig_shift<<CYC_SHIFT);
\r
3432 FLAG_C = FLAG_X = res >> 8;
\r
3433 res = MASK_OUT_ABOVE_16(res);
\r
3435 *r_dst = MASK_OUT_BELOW_16(*r_dst) | res;
\r
3436 FLAG_N = NFLAG_16(res);
\r
3438 FLAG_V = VFLAG_CLEAR;
\r
3443 FLAG_N = NFLAG_16(*r_dst);
\r
3444 FLAG_Z = MASK_OUT_ABOVE_16(*r_dst);
\r
3445 FLAG_V = VFLAG_CLEAR;
\r
3449 void m68k_op_roxr_32_r(void)
\r
3451 #if M68K_USE_64_BIT
\r
3453 uint* r_dst = &DY;
\r
3454 uint orig_shift = DX & 0x3f;
\r
3456 if(orig_shift != 0)
\r
3458 uint shift = orig_shift % 33;
\r
3459 uint64 src = *r_dst;
\r
3460 uint64 res = src | (((uint64)XFLAG_AS_1()) << 32);
\r
3462 res = ROR_33_64(res, shift);
\r
3464 USE_CYCLES(orig_shift<<CYC_SHIFT);
\r
3466 FLAG_C = FLAG_X = res >> 24;
\r
3467 res = MASK_OUT_ABOVE_32(res);
\r
3470 FLAG_N = NFLAG_32(res);
\r
3472 FLAG_V = VFLAG_CLEAR;
\r
3477 FLAG_N = NFLAG_32(*r_dst);
\r
3479 FLAG_V = VFLAG_CLEAR;
\r
3483 uint* r_dst = &DY;
\r
3484 uint orig_shift = DX & 0x3f;
\r
3485 uint shift = orig_shift % 33;
\r
3486 uint src = *r_dst;
\r
3487 uint res = MASK_OUT_ABOVE_32((ROR_33(src, shift) & ~(1 << (32 - shift))) | (XFLAG_AS_1() << (32 - shift)));
\r
3488 uint new_x_flag = src & (1 << (shift - 1));
\r
3490 if(orig_shift != 0)
\r
3491 USE_CYCLES(orig_shift<<CYC_SHIFT);
\r
3496 FLAG_X = (new_x_flag != 0)<<8;
\r
3501 FLAG_N = NFLAG_32(res);
\r
3503 FLAG_V = VFLAG_CLEAR;
\r
3509 void m68k_op_roxr_16_ai(void)
\r
3511 uint ea = EA_AY_AI_16();
\r
3512 uint src = m68ki_read_16(ea);
\r
3513 uint res = ROR_17(src | (XFLAG_AS_1() << 16), 1);
\r
3515 FLAG_C = FLAG_X = res >> 8;
\r
3516 res = MASK_OUT_ABOVE_16(res);
\r
3518 m68ki_write_16(ea, res);
\r
3520 FLAG_N = NFLAG_16(res);
\r
3522 FLAG_V = VFLAG_CLEAR;
\r
3526 void m68k_op_roxr_16_pi(void)
\r
3528 uint ea = EA_AY_PI_16();
\r
3529 uint src = m68ki_read_16(ea);
\r
3530 uint res = ROR_17(src | (XFLAG_AS_1() << 16), 1);
\r
3532 FLAG_C = FLAG_X = res >> 8;
\r
3533 res = MASK_OUT_ABOVE_16(res);
\r
3535 m68ki_write_16(ea, res);
\r
3537 FLAG_N = NFLAG_16(res);
\r
3539 FLAG_V = VFLAG_CLEAR;
\r
3543 void m68k_op_roxr_16_pd(void)
\r
3545 uint ea = EA_AY_PD_16();
\r
3546 uint src = m68ki_read_16(ea);
\r
3547 uint res = ROR_17(src | (XFLAG_AS_1() << 16), 1);
\r
3549 FLAG_C = FLAG_X = res >> 8;
\r
3550 res = MASK_OUT_ABOVE_16(res);
\r
3552 m68ki_write_16(ea, res);
\r
3554 FLAG_N = NFLAG_16(res);
\r
3556 FLAG_V = VFLAG_CLEAR;
\r
3560 void m68k_op_roxr_16_di(void)
\r
3562 uint ea = EA_AY_DI_16();
\r
3563 uint src = m68ki_read_16(ea);
\r
3564 uint res = ROR_17(src | (XFLAG_AS_1() << 16), 1);
\r
3566 FLAG_C = FLAG_X = res >> 8;
\r
3567 res = MASK_OUT_ABOVE_16(res);
\r
3569 m68ki_write_16(ea, res);
\r
3571 FLAG_N = NFLAG_16(res);
\r
3573 FLAG_V = VFLAG_CLEAR;
\r
3577 void m68k_op_roxr_16_ix(void)
\r
3579 uint ea = EA_AY_IX_16();
\r
3580 uint src = m68ki_read_16(ea);
\r
3581 uint res = ROR_17(src | (XFLAG_AS_1() << 16), 1);
\r
3583 FLAG_C = FLAG_X = res >> 8;
\r
3584 res = MASK_OUT_ABOVE_16(res);
\r
3586 m68ki_write_16(ea, res);
\r
3588 FLAG_N = NFLAG_16(res);
\r
3590 FLAG_V = VFLAG_CLEAR;
\r
3594 void m68k_op_roxr_16_aw(void)
\r
3596 uint ea = EA_AW_16();
\r
3597 uint src = m68ki_read_16(ea);
\r
3598 uint res = ROR_17(src | (XFLAG_AS_1() << 16), 1);
\r
3600 FLAG_C = FLAG_X = res >> 8;
\r
3601 res = MASK_OUT_ABOVE_16(res);
\r
3603 m68ki_write_16(ea, res);
\r
3605 FLAG_N = NFLAG_16(res);
\r
3607 FLAG_V = VFLAG_CLEAR;
\r
3611 void m68k_op_roxr_16_al(void)
\r
3613 uint ea = EA_AL_16();
\r
3614 uint src = m68ki_read_16(ea);
\r
3615 uint res = ROR_17(src | (XFLAG_AS_1() << 16), 1);
\r
3617 FLAG_C = FLAG_X = res >> 8;
\r
3618 res = MASK_OUT_ABOVE_16(res);
\r
3620 m68ki_write_16(ea, res);
\r
3622 FLAG_N = NFLAG_16(res);
\r
3624 FLAG_V = VFLAG_CLEAR;
\r
3628 void m68k_op_roxl_8_s(void)
\r
3630 uint* r_dst = &DY;
\r
3631 uint shift = (((REG_IR >> 9) - 1) & 7) + 1;
\r
3632 uint src = MASK_OUT_ABOVE_8(*r_dst);
\r
3633 uint res = ROL_9(src | (XFLAG_AS_1() << 8), shift);
\r
3636 USE_CYCLES(shift<<CYC_SHIFT);
\r
3638 FLAG_C = FLAG_X = res;
\r
3639 res = MASK_OUT_ABOVE_8(res);
\r
3641 *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
\r
3643 FLAG_N = NFLAG_8(res);
\r
3645 FLAG_V = VFLAG_CLEAR;
\r
3649 void m68k_op_roxl_16_s(void)
\r
3651 uint* r_dst = &DY;
\r
3652 uint shift = (((REG_IR >> 9) - 1) & 7) + 1;
\r
3653 uint src = MASK_OUT_ABOVE_16(*r_dst);
\r
3654 uint res = ROL_17(src | (XFLAG_AS_1() << 16), shift);
\r
3657 USE_CYCLES(shift<<CYC_SHIFT);
\r
3659 FLAG_C = FLAG_X = res >> 8;
\r
3660 res = MASK_OUT_ABOVE_16(res);
\r
3662 *r_dst = MASK_OUT_BELOW_16(*r_dst) | res;
\r
3664 FLAG_N = NFLAG_16(res);
\r
3666 FLAG_V = VFLAG_CLEAR;
\r
3670 void m68k_op_roxl_32_s(void)
\r
3672 #if M68K_USE_64_BIT
\r
3674 uint* r_dst = &DY;
\r
3675 uint shift = (((REG_IR >> 9) - 1) & 7) + 1;
\r
3676 uint64 src = *r_dst;
\r
3677 uint64 res = src | (((uint64)XFLAG_AS_1()) << 32);
\r
3680 USE_CYCLES(shift<<CYC_SHIFT);
\r
3682 res = ROL_33_64(res, shift);
\r
3684 FLAG_C = FLAG_X = res >> 24;
\r
3685 res = MASK_OUT_ABOVE_32(res);
\r
3689 FLAG_N = NFLAG_32(res);
\r
3691 FLAG_V = VFLAG_CLEAR;
\r
3695 uint* r_dst = &DY;
\r
3696 uint shift = (((REG_IR >> 9) - 1) & 7) + 1;
\r
3697 uint src = *r_dst;
\r
3698 uint res = MASK_OUT_ABOVE_32((ROL_33(src, shift) & ~(1 << (shift - 1))) | (XFLAG_AS_1() << (shift - 1)));
\r
3699 uint new_x_flag = src & (1 << (32 - shift));
\r
3702 USE_CYCLES(shift<<CYC_SHIFT);
\r
3706 FLAG_C = FLAG_X = (new_x_flag != 0)<<8;
\r
3707 FLAG_N = NFLAG_32(res);
\r
3709 FLAG_V = VFLAG_CLEAR;
\r
3715 void m68k_op_roxl_8_r(void)
\r
3717 uint* r_dst = &DY;
\r
3718 uint orig_shift = DX & 0x3f;
\r
3721 if(orig_shift != 0)
\r
3723 uint shift = orig_shift % 9;
\r
3724 uint src = MASK_OUT_ABOVE_8(*r_dst);
\r
3725 uint res = ROL_9(src | (XFLAG_AS_1() << 8), shift);
\r
3727 USE_CYCLES(orig_shift<<CYC_SHIFT);
\r
3729 FLAG_C = FLAG_X = res;
\r
3730 res = MASK_OUT_ABOVE_8(res);
\r
3732 *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
\r
3733 FLAG_N = NFLAG_8(res);
\r
3735 FLAG_V = VFLAG_CLEAR;
\r
3740 FLAG_N = NFLAG_8(*r_dst);
\r
3741 FLAG_Z = MASK_OUT_ABOVE_8(*r_dst);
\r
3742 FLAG_V = VFLAG_CLEAR;
\r
3746 void m68k_op_roxl_16_r(void)
\r
3748 uint* r_dst = &DY;
\r
3749 uint orig_shift = DX & 0x3f;
\r
3751 if(orig_shift != 0)
\r
3753 uint shift = orig_shift % 17;
\r
3754 uint src = MASK_OUT_ABOVE_16(*r_dst);
\r
3755 uint res = ROL_17(src | (XFLAG_AS_1() << 16), shift);
\r
3757 USE_CYCLES(orig_shift<<CYC_SHIFT);
\r
3759 FLAG_C = FLAG_X = res >> 8;
\r
3760 res = MASK_OUT_ABOVE_16(res);
\r
3762 *r_dst = MASK_OUT_BELOW_16(*r_dst) | res;
\r
3763 FLAG_N = NFLAG_16(res);
\r
3765 FLAG_V = VFLAG_CLEAR;
\r
3770 FLAG_N = NFLAG_16(*r_dst);
\r
3771 FLAG_Z = MASK_OUT_ABOVE_16(*r_dst);
\r
3772 FLAG_V = VFLAG_CLEAR;
\r
3776 void m68k_op_roxl_32_r(void)
\r
3778 #if M68K_USE_64_BIT
\r
3780 uint* r_dst = &DY;
\r
3781 uint orig_shift = DX & 0x3f;
\r
3783 if(orig_shift != 0)
\r
3785 uint shift = orig_shift % 33;
\r
3786 uint64 src = *r_dst;
\r
3787 uint64 res = src | (((uint64)XFLAG_AS_1()) << 32);
\r
3789 res = ROL_33_64(res, shift);
\r
3791 USE_CYCLES(orig_shift<<CYC_SHIFT);
\r
3793 FLAG_C = FLAG_X = res >> 24;
\r
3794 res = MASK_OUT_ABOVE_32(res);
\r
3797 FLAG_N = NFLAG_32(res);
\r
3799 FLAG_V = VFLAG_CLEAR;
\r
3804 FLAG_N = NFLAG_32(*r_dst);
\r
3806 FLAG_V = VFLAG_CLEAR;
\r
3810 uint* r_dst = &DY;
\r
3811 uint orig_shift = DX & 0x3f;
\r
3812 uint shift = orig_shift % 33;
\r
3813 uint src = *r_dst;
\r
3814 uint res = MASK_OUT_ABOVE_32((ROL_33(src, shift) & ~(1 << (shift - 1))) | (XFLAG_AS_1() << (shift - 1)));
\r
3815 uint new_x_flag = src & (1 << (32 - shift));
\r
3817 if(orig_shift != 0)
\r
3818 USE_CYCLES(orig_shift<<CYC_SHIFT);
\r
3823 FLAG_X = (new_x_flag != 0)<<8;
\r
3828 FLAG_N = NFLAG_32(res);
\r
3830 FLAG_V = VFLAG_CLEAR;
\r
3836 void m68k_op_roxl_16_ai(void)
\r
3838 uint ea = EA_AY_AI_16();
\r
3839 uint src = m68ki_read_16(ea);
\r
3840 uint res = ROL_17(src | (XFLAG_AS_1() << 16), 1);
\r
3842 FLAG_C = FLAG_X = res >> 8;
\r
3843 res = MASK_OUT_ABOVE_16(res);
\r
3845 m68ki_write_16(ea, res);
\r
3847 FLAG_N = NFLAG_16(res);
\r
3849 FLAG_V = VFLAG_CLEAR;
\r
3853 void m68k_op_roxl_16_pi(void)
\r
3855 uint ea = EA_AY_PI_16();
\r
3856 uint src = m68ki_read_16(ea);
\r
3857 uint res = ROL_17(src | (XFLAG_AS_1() << 16), 1);
\r
3859 FLAG_C = FLAG_X = res >> 8;
\r
3860 res = MASK_OUT_ABOVE_16(res);
\r
3862 m68ki_write_16(ea, res);
\r
3864 FLAG_N = NFLAG_16(res);
\r
3866 FLAG_V = VFLAG_CLEAR;
\r
3870 void m68k_op_roxl_16_pd(void)
\r
3872 uint ea = EA_AY_PD_16();
\r
3873 uint src = m68ki_read_16(ea);
\r
3874 uint res = ROL_17(src | (XFLAG_AS_1() << 16), 1);
\r
3876 FLAG_C = FLAG_X = res >> 8;
\r
3877 res = MASK_OUT_ABOVE_16(res);
\r
3879 m68ki_write_16(ea, res);
\r
3881 FLAG_N = NFLAG_16(res);
\r
3883 FLAG_V = VFLAG_CLEAR;
\r
3887 void m68k_op_roxl_16_di(void)
\r
3889 uint ea = EA_AY_DI_16();
\r
3890 uint src = m68ki_read_16(ea);
\r
3891 uint res = ROL_17(src | (XFLAG_AS_1() << 16), 1);
\r
3893 FLAG_C = FLAG_X = res >> 8;
\r
3894 res = MASK_OUT_ABOVE_16(res);
\r
3896 m68ki_write_16(ea, res);
\r
3898 FLAG_N = NFLAG_16(res);
\r
3900 FLAG_V = VFLAG_CLEAR;
\r
3904 void m68k_op_roxl_16_ix(void)
\r
3906 uint ea = EA_AY_IX_16();
\r
3907 uint src = m68ki_read_16(ea);
\r
3908 uint res = ROL_17(src | (XFLAG_AS_1() << 16), 1);
\r
3910 FLAG_C = FLAG_X = res >> 8;
\r
3911 res = MASK_OUT_ABOVE_16(res);
\r
3913 m68ki_write_16(ea, res);
\r
3915 FLAG_N = NFLAG_16(res);
\r
3917 FLAG_V = VFLAG_CLEAR;
\r
3921 void m68k_op_roxl_16_aw(void)
\r
3923 uint ea = EA_AW_16();
\r
3924 uint src = m68ki_read_16(ea);
\r
3925 uint res = ROL_17(src | (XFLAG_AS_1() << 16), 1);
\r
3927 FLAG_C = FLAG_X = res >> 8;
\r
3928 res = MASK_OUT_ABOVE_16(res);
\r
3930 m68ki_write_16(ea, res);
\r
3932 FLAG_N = NFLAG_16(res);
\r
3934 FLAG_V = VFLAG_CLEAR;
\r
3938 void m68k_op_roxl_16_al(void)
\r
3940 uint ea = EA_AL_16();
\r
3941 uint src = m68ki_read_16(ea);
\r
3942 uint res = ROL_17(src | (XFLAG_AS_1() << 16), 1);
\r
3944 FLAG_C = FLAG_X = res >> 8;
\r
3945 res = MASK_OUT_ABOVE_16(res);
\r
3947 m68ki_write_16(ea, res);
\r
3949 FLAG_N = NFLAG_16(res);
\r
3951 FLAG_V = VFLAG_CLEAR;
\r
3955 void m68k_op_rtd_32(void)
\r
3957 if(CPU_TYPE_IS_010_PLUS(CPU_TYPE))
\r
3959 uint new_pc = m68ki_pull_32();
\r
3961 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
3962 REG_A[7] = MASK_OUT_ABOVE_32(REG_A[7] + MAKE_INT_16(OPER_I_16()));
\r
3963 m68ki_jump(new_pc);
\r
3966 m68ki_exception_illegal();
\r
3970 void m68k_op_rte_32(void)
\r
3978 m68ki_rte_callback(); /* auto-disable (see m68kcpu.h) */
\r
3979 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
3981 if(CPU_TYPE_IS_000(CPU_TYPE))
\r
3983 new_sr = m68ki_pull_16();
\r
3984 new_pc = m68ki_pull_32();
\r
3985 m68ki_jump(new_pc);
\r
3986 m68ki_set_sr(new_sr);
\r
3988 CPU_INSTR_MODE = INSTRUCTION_YES;
\r
3989 CPU_RUN_MODE = RUN_MODE_NORMAL;
\r
3994 if(CPU_TYPE_IS_010(CPU_TYPE))
\r
3996 format_word = m68ki_read_16(REG_A[7]+6) >> 12;
\r
3997 if(format_word == 0)
\r
3999 new_sr = m68ki_pull_16();
\r
4000 new_pc = m68ki_pull_32();
\r
4001 m68ki_fake_pull_16(); /* format word */
\r
4002 m68ki_jump(new_pc);
\r
4003 m68ki_set_sr(new_sr);
\r
4004 CPU_INSTR_MODE = INSTRUCTION_YES;
\r
4005 CPU_RUN_MODE = RUN_MODE_NORMAL;
\r
4008 CPU_INSTR_MODE = INSTRUCTION_YES;
\r
4009 CPU_RUN_MODE = RUN_MODE_NORMAL;
\r
4010 /* Not handling bus fault (9) */
\r
4011 m68ki_exception_format_error();
\r
4015 /* Otherwise it's 020 */
\r
4017 format_word = m68ki_read_16(REG_A[7]+6) >> 12;
\r
4018 switch(format_word)
\r
4020 case 0: /* Normal */
\r
4021 new_sr = m68ki_pull_16();
\r
4022 new_pc = m68ki_pull_32();
\r
4023 m68ki_fake_pull_16(); /* format word */
\r
4024 m68ki_jump(new_pc);
\r
4025 m68ki_set_sr(new_sr);
\r
4026 CPU_INSTR_MODE = INSTRUCTION_YES;
\r
4027 CPU_RUN_MODE = RUN_MODE_NORMAL;
\r
4029 case 1: /* Throwaway */
\r
4030 new_sr = m68ki_pull_16();
\r
4031 m68ki_fake_pull_32(); /* program counter */
\r
4032 m68ki_fake_pull_16(); /* format word */
\r
4033 m68ki_set_sr_noint(new_sr);
\r
4035 case 2: /* Trap */
\r
4036 new_sr = m68ki_pull_16();
\r
4037 new_pc = m68ki_pull_32();
\r
4038 m68ki_fake_pull_16(); /* format word */
\r
4039 m68ki_fake_pull_32(); /* address */
\r
4040 m68ki_jump(new_pc);
\r
4041 m68ki_set_sr(new_sr);
\r
4042 CPU_INSTR_MODE = INSTRUCTION_YES;
\r
4043 CPU_RUN_MODE = RUN_MODE_NORMAL;
\r
4046 /* Not handling long or short bus fault */
\r
4047 CPU_INSTR_MODE = INSTRUCTION_YES;
\r
4048 CPU_RUN_MODE = RUN_MODE_NORMAL;
\r
4049 m68ki_exception_format_error();
\r
4052 m68ki_exception_privilege_violation();
\r
4056 void m68k_op_rtm_32(void)
\r
4058 if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE))
\r
4060 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4061 M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n",
\r
4062 m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR,
\r
4063 m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2))));
\r
4066 m68ki_exception_illegal();
\r
4070 void m68k_op_rtr_32(void)
\r
4072 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4073 m68ki_set_ccr(m68ki_pull_16());
\r
4074 m68ki_jump(m68ki_pull_32());
\r
4078 void m68k_op_rts_32(void)
\r
4080 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4081 m68ki_jump(m68ki_pull_32());
\r
4085 void m68k_op_sbcd_8_rr(void)
\r
4087 uint* r_dst = &DX;
\r
4089 uint dst = *r_dst;
\r
4090 uint res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1();
\r
4092 // FLAG_V = ~res; /* Undefined V behavior */
\r
4093 FLAG_V = VFLAG_CLEAR; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to assume cleared. */
\r
4097 res += HIGH_NIBBLE(dst) - HIGH_NIBBLE(src);
\r
4101 FLAG_X = FLAG_C = CFLAG_SET;
\r
4102 FLAG_N = NFLAG_SET; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to follow carry. */
\r
4105 FLAG_N = FLAG_X = FLAG_C = 0;
\r
4107 res = MASK_OUT_ABOVE_8(res);
\r
4109 // FLAG_V &= res; /* Undefined V behavior part II */
\r
4110 // FLAG_N = NFLAG_8(res); /* Undefined N behavior */
\r
4113 *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
\r
4117 void m68k_op_sbcd_8_mm_ax7(void)
\r
4119 uint src = OPER_AY_PD_8();
\r
4120 uint ea = EA_A7_PD_8();
\r
4121 uint dst = m68ki_read_8(ea);
\r
4122 uint res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1();
\r
4124 // FLAG_V = ~res; /* Undefined V behavior */
\r
4125 FLAG_V = VFLAG_CLEAR; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to return zero. */
\r
4129 res += HIGH_NIBBLE(dst) - HIGH_NIBBLE(src);
\r
4133 FLAG_X = FLAG_C = CFLAG_SET;
\r
4134 FLAG_N = NFLAG_SET; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to follow carry. */
\r
4137 FLAG_N = FLAG_X = FLAG_C = 0;
\r
4139 res = MASK_OUT_ABOVE_8(res);
\r
4141 // FLAG_V &= res; /* Undefined V behavior part II */
\r
4142 // FLAG_N = NFLAG_8(res); /* Undefined N behavior */
\r
4145 m68ki_write_8(ea, res);
\r
4149 void m68k_op_sbcd_8_mm_ay7(void)
\r
4151 uint src = OPER_A7_PD_8();
\r
4152 uint ea = EA_AX_PD_8();
\r
4153 uint dst = m68ki_read_8(ea);
\r
4154 uint res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1();
\r
4156 // FLAG_V = ~res; /* Undefined V behavior */
\r
4157 FLAG_V = VFLAG_CLEAR; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to return zero. */
\r
4161 res += HIGH_NIBBLE(dst) - HIGH_NIBBLE(src);
\r
4165 FLAG_X = FLAG_C = CFLAG_SET;
\r
4166 FLAG_N = NFLAG_SET; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to follow carry. */
\r
4169 FLAG_N = FLAG_X = FLAG_C = 0;
\r
4171 res = MASK_OUT_ABOVE_8(res);
\r
4173 // FLAG_V &= res; /* Undefined V behavior part II */
\r
4174 // FLAG_N = NFLAG_8(res); /* Undefined N behavior */
\r
4177 m68ki_write_8(ea, res);
\r
4181 void m68k_op_sbcd_8_mm_axy7(void)
\r
4183 uint src = OPER_A7_PD_8();
\r
4184 uint ea = EA_A7_PD_8();
\r
4185 uint dst = m68ki_read_8(ea);
\r
4186 uint res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1();
\r
4188 // FLAG_V = ~res; /* Undefined V behavior */
\r
4189 FLAG_V = VFLAG_CLEAR; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to return zero. */
\r
4193 res += HIGH_NIBBLE(dst) - HIGH_NIBBLE(src);
\r
4197 FLAG_X = FLAG_C = CFLAG_SET;
\r
4198 FLAG_N = NFLAG_SET; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to follow carry. */
\r
4201 FLAG_N = FLAG_X = FLAG_C = 0;
\r
4203 res = MASK_OUT_ABOVE_8(res);
\r
4205 // FLAG_V &= res; /* Undefined V behavior part II */
\r
4206 // FLAG_N = NFLAG_8(res); /* Undefined N behavior */
\r
4209 m68ki_write_8(ea, res);
\r
4213 void m68k_op_sbcd_8_mm(void)
\r
4215 uint src = OPER_AY_PD_8();
\r
4216 uint ea = EA_AX_PD_8();
\r
4217 uint dst = m68ki_read_8(ea);
\r
4218 uint res = LOW_NIBBLE(dst) - LOW_NIBBLE(src) - XFLAG_AS_1();
\r
4220 // FLAG_V = ~res; /* Undefined V behavior */
\r
4221 FLAG_V = VFLAG_CLEAR; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to return zero. */
\r
4225 res += HIGH_NIBBLE(dst) - HIGH_NIBBLE(src);
\r
4229 FLAG_X = FLAG_C = CFLAG_SET;
\r
4230 FLAG_N = NFLAG_SET; /* Undefined in Motorola's M68000PM/AD rev.1 and safer to follow carry. */
\r
4233 FLAG_N = FLAG_X = FLAG_C = 0;
\r
4235 res = MASK_OUT_ABOVE_8(res);
\r
4237 // FLAG_V &= res; /* Undefined V behavior part II */
\r
4238 // FLAG_N = NFLAG_8(res); /* Undefined N behavior */
\r
4241 m68ki_write_8(ea, res);
\r
4245 void m68k_op_st_8_d(void)
\r
4251 void m68k_op_st_8_ai(void)
\r
4253 m68ki_write_8(EA_AY_AI_8(), 0xff);
\r
4257 void m68k_op_st_8_pi(void)
\r
4259 m68ki_write_8(EA_AY_PI_8(), 0xff);
\r
4263 void m68k_op_st_8_pi7(void)
\r
4265 m68ki_write_8(EA_A7_PI_8(), 0xff);
\r
4269 void m68k_op_st_8_pd(void)
\r
4271 m68ki_write_8(EA_AY_PD_8(), 0xff);
\r
4275 void m68k_op_st_8_pd7(void)
\r
4277 m68ki_write_8(EA_A7_PD_8(), 0xff);
\r
4281 void m68k_op_st_8_di(void)
\r
4283 m68ki_write_8(EA_AY_DI_8(), 0xff);
\r
4287 void m68k_op_st_8_ix(void)
\r
4289 m68ki_write_8(EA_AY_IX_8(), 0xff);
\r
4293 void m68k_op_st_8_aw(void)
\r
4295 m68ki_write_8(EA_AW_8(), 0xff);
\r
4299 void m68k_op_st_8_al(void)
\r
4301 m68ki_write_8(EA_AL_8(), 0xff);
\r
4305 void m68k_op_sf_8_d(void)
\r
4311 void m68k_op_sf_8_ai(void)
\r
4313 m68ki_write_8(EA_AY_AI_8(), 0);
\r
4317 void m68k_op_sf_8_pi(void)
\r
4319 m68ki_write_8(EA_AY_PI_8(), 0);
\r
4323 void m68k_op_sf_8_pi7(void)
\r
4325 m68ki_write_8(EA_A7_PI_8(), 0);
\r
4329 void m68k_op_sf_8_pd(void)
\r
4331 m68ki_write_8(EA_AY_PD_8(), 0);
\r
4335 void m68k_op_sf_8_pd7(void)
\r
4337 m68ki_write_8(EA_A7_PD_8(), 0);
\r
4341 void m68k_op_sf_8_di(void)
\r
4343 m68ki_write_8(EA_AY_DI_8(), 0);
\r
4347 void m68k_op_sf_8_ix(void)
\r
4349 m68ki_write_8(EA_AY_IX_8(), 0);
\r
4353 void m68k_op_sf_8_aw(void)
\r
4355 m68ki_write_8(EA_AW_8(), 0);
\r
4359 void m68k_op_sf_8_al(void)
\r
4361 m68ki_write_8(EA_AL_8(), 0);
\r
4365 void m68k_op_shi_8_d(void)
\r
4370 USE_CYCLES(CYC_SCC_R_TRUE);
\r
4377 void m68k_op_sls_8_d(void)
\r
4382 USE_CYCLES(CYC_SCC_R_TRUE);
\r
4389 void m68k_op_scc_8_d(void)
\r
4394 USE_CYCLES(CYC_SCC_R_TRUE);
\r
4401 void m68k_op_scs_8_d(void)
\r
4406 USE_CYCLES(CYC_SCC_R_TRUE);
\r
4413 void m68k_op_sne_8_d(void)
\r
4418 USE_CYCLES(CYC_SCC_R_TRUE);
\r
4425 void m68k_op_seq_8_d(void)
\r
4430 USE_CYCLES(CYC_SCC_R_TRUE);
\r
4437 void m68k_op_svc_8_d(void)
\r
4442 USE_CYCLES(CYC_SCC_R_TRUE);
\r
4449 void m68k_op_svs_8_d(void)
\r
4454 USE_CYCLES(CYC_SCC_R_TRUE);
\r
4461 void m68k_op_spl_8_d(void)
\r
4466 USE_CYCLES(CYC_SCC_R_TRUE);
\r
4473 void m68k_op_smi_8_d(void)
\r
4478 USE_CYCLES(CYC_SCC_R_TRUE);
\r
4485 void m68k_op_sge_8_d(void)
\r
4490 USE_CYCLES(CYC_SCC_R_TRUE);
\r
4497 void m68k_op_slt_8_d(void)
\r
4502 USE_CYCLES(CYC_SCC_R_TRUE);
\r
4509 void m68k_op_sgt_8_d(void)
\r
4514 USE_CYCLES(CYC_SCC_R_TRUE);
\r
4521 void m68k_op_sle_8_d(void)
\r
4526 USE_CYCLES(CYC_SCC_R_TRUE);
\r
4533 void m68k_op_shi_8_ai(void)
\r
4535 m68ki_write_8(EA_AY_AI_8(), COND_HI() ? 0xff : 0);
\r
4539 void m68k_op_shi_8_pi(void)
\r
4541 m68ki_write_8(EA_AY_PI_8(), COND_HI() ? 0xff : 0);
\r
4545 void m68k_op_shi_8_pi7(void)
\r
4547 m68ki_write_8(EA_A7_PI_8(), COND_HI() ? 0xff : 0);
\r
4551 void m68k_op_shi_8_pd(void)
\r
4553 m68ki_write_8(EA_AY_PD_8(), COND_HI() ? 0xff : 0);
\r
4557 void m68k_op_shi_8_pd7(void)
\r
4559 m68ki_write_8(EA_A7_PD_8(), COND_HI() ? 0xff : 0);
\r
4563 void m68k_op_shi_8_di(void)
\r
4565 m68ki_write_8(EA_AY_DI_8(), COND_HI() ? 0xff : 0);
\r
4569 void m68k_op_shi_8_ix(void)
\r
4571 m68ki_write_8(EA_AY_IX_8(), COND_HI() ? 0xff : 0);
\r
4575 void m68k_op_shi_8_aw(void)
\r
4577 m68ki_write_8(EA_AW_8(), COND_HI() ? 0xff : 0);
\r
4581 void m68k_op_shi_8_al(void)
\r
4583 m68ki_write_8(EA_AL_8(), COND_HI() ? 0xff : 0);
\r
4587 void m68k_op_sls_8_ai(void)
\r
4589 m68ki_write_8(EA_AY_AI_8(), COND_LS() ? 0xff : 0);
\r
4593 void m68k_op_sls_8_pi(void)
\r
4595 m68ki_write_8(EA_AY_PI_8(), COND_LS() ? 0xff : 0);
\r
4599 void m68k_op_sls_8_pi7(void)
\r
4601 m68ki_write_8(EA_A7_PI_8(), COND_LS() ? 0xff : 0);
\r
4605 void m68k_op_sls_8_pd(void)
\r
4607 m68ki_write_8(EA_AY_PD_8(), COND_LS() ? 0xff : 0);
\r
4611 void m68k_op_sls_8_pd7(void)
\r
4613 m68ki_write_8(EA_A7_PD_8(), COND_LS() ? 0xff : 0);
\r
4617 void m68k_op_sls_8_di(void)
\r
4619 m68ki_write_8(EA_AY_DI_8(), COND_LS() ? 0xff : 0);
\r
4623 void m68k_op_sls_8_ix(void)
\r
4625 m68ki_write_8(EA_AY_IX_8(), COND_LS() ? 0xff : 0);
\r
4629 void m68k_op_sls_8_aw(void)
\r
4631 m68ki_write_8(EA_AW_8(), COND_LS() ? 0xff : 0);
\r
4635 void m68k_op_sls_8_al(void)
\r
4637 m68ki_write_8(EA_AL_8(), COND_LS() ? 0xff : 0);
\r
4641 void m68k_op_scc_8_ai(void)
\r
4643 m68ki_write_8(EA_AY_AI_8(), COND_CC() ? 0xff : 0);
\r
4647 void m68k_op_scc_8_pi(void)
\r
4649 m68ki_write_8(EA_AY_PI_8(), COND_CC() ? 0xff : 0);
\r
4653 void m68k_op_scc_8_pi7(void)
\r
4655 m68ki_write_8(EA_A7_PI_8(), COND_CC() ? 0xff : 0);
\r
4659 void m68k_op_scc_8_pd(void)
\r
4661 m68ki_write_8(EA_AY_PD_8(), COND_CC() ? 0xff : 0);
\r
4665 void m68k_op_scc_8_pd7(void)
\r
4667 m68ki_write_8(EA_A7_PD_8(), COND_CC() ? 0xff : 0);
\r
4671 void m68k_op_scc_8_di(void)
\r
4673 m68ki_write_8(EA_AY_DI_8(), COND_CC() ? 0xff : 0);
\r
4677 void m68k_op_scc_8_ix(void)
\r
4679 m68ki_write_8(EA_AY_IX_8(), COND_CC() ? 0xff : 0);
\r
4683 void m68k_op_scc_8_aw(void)
\r
4685 m68ki_write_8(EA_AW_8(), COND_CC() ? 0xff : 0);
\r
4689 void m68k_op_scc_8_al(void)
\r
4691 m68ki_write_8(EA_AL_8(), COND_CC() ? 0xff : 0);
\r
4695 void m68k_op_scs_8_ai(void)
\r
4697 m68ki_write_8(EA_AY_AI_8(), COND_CS() ? 0xff : 0);
\r
4701 void m68k_op_scs_8_pi(void)
\r
4703 m68ki_write_8(EA_AY_PI_8(), COND_CS() ? 0xff : 0);
\r
4707 void m68k_op_scs_8_pi7(void)
\r
4709 m68ki_write_8(EA_A7_PI_8(), COND_CS() ? 0xff : 0);
\r
4713 void m68k_op_scs_8_pd(void)
\r
4715 m68ki_write_8(EA_AY_PD_8(), COND_CS() ? 0xff : 0);
\r
4719 void m68k_op_scs_8_pd7(void)
\r
4721 m68ki_write_8(EA_A7_PD_8(), COND_CS() ? 0xff : 0);
\r
4725 void m68k_op_scs_8_di(void)
\r
4727 m68ki_write_8(EA_AY_DI_8(), COND_CS() ? 0xff : 0);
\r
4731 void m68k_op_scs_8_ix(void)
\r
4733 m68ki_write_8(EA_AY_IX_8(), COND_CS() ? 0xff : 0);
\r
4737 void m68k_op_scs_8_aw(void)
\r
4739 m68ki_write_8(EA_AW_8(), COND_CS() ? 0xff : 0);
\r
4743 void m68k_op_scs_8_al(void)
\r
4745 m68ki_write_8(EA_AL_8(), COND_CS() ? 0xff : 0);
\r
4749 void m68k_op_sne_8_ai(void)
\r
4751 m68ki_write_8(EA_AY_AI_8(), COND_NE() ? 0xff : 0);
\r
4755 void m68k_op_sne_8_pi(void)
\r
4757 m68ki_write_8(EA_AY_PI_8(), COND_NE() ? 0xff : 0);
\r
4761 void m68k_op_sne_8_pi7(void)
\r
4763 m68ki_write_8(EA_A7_PI_8(), COND_NE() ? 0xff : 0);
\r
4767 void m68k_op_sne_8_pd(void)
\r
4769 m68ki_write_8(EA_AY_PD_8(), COND_NE() ? 0xff : 0);
\r
4773 void m68k_op_sne_8_pd7(void)
\r
4775 m68ki_write_8(EA_A7_PD_8(), COND_NE() ? 0xff : 0);
\r
4779 void m68k_op_sne_8_di(void)
\r
4781 m68ki_write_8(EA_AY_DI_8(), COND_NE() ? 0xff : 0);
\r
4785 void m68k_op_sne_8_ix(void)
\r
4787 m68ki_write_8(EA_AY_IX_8(), COND_NE() ? 0xff : 0);
\r
4791 void m68k_op_sne_8_aw(void)
\r
4793 m68ki_write_8(EA_AW_8(), COND_NE() ? 0xff : 0);
\r
4797 void m68k_op_sne_8_al(void)
\r
4799 m68ki_write_8(EA_AL_8(), COND_NE() ? 0xff : 0);
\r
4803 void m68k_op_seq_8_ai(void)
\r
4805 m68ki_write_8(EA_AY_AI_8(), COND_EQ() ? 0xff : 0);
\r
4809 void m68k_op_seq_8_pi(void)
\r
4811 m68ki_write_8(EA_AY_PI_8(), COND_EQ() ? 0xff : 0);
\r
4815 void m68k_op_seq_8_pi7(void)
\r
4817 m68ki_write_8(EA_A7_PI_8(), COND_EQ() ? 0xff : 0);
\r
4821 void m68k_op_seq_8_pd(void)
\r
4823 m68ki_write_8(EA_AY_PD_8(), COND_EQ() ? 0xff : 0);
\r
4827 void m68k_op_seq_8_pd7(void)
\r
4829 m68ki_write_8(EA_A7_PD_8(), COND_EQ() ? 0xff : 0);
\r
4833 void m68k_op_seq_8_di(void)
\r
4835 m68ki_write_8(EA_AY_DI_8(), COND_EQ() ? 0xff : 0);
\r
4839 void m68k_op_seq_8_ix(void)
\r
4841 m68ki_write_8(EA_AY_IX_8(), COND_EQ() ? 0xff : 0);
\r
4845 void m68k_op_seq_8_aw(void)
\r
4847 m68ki_write_8(EA_AW_8(), COND_EQ() ? 0xff : 0);
\r
4851 void m68k_op_seq_8_al(void)
\r
4853 m68ki_write_8(EA_AL_8(), COND_EQ() ? 0xff : 0);
\r
4857 void m68k_op_svc_8_ai(void)
\r
4859 m68ki_write_8(EA_AY_AI_8(), COND_VC() ? 0xff : 0);
\r
4863 void m68k_op_svc_8_pi(void)
\r
4865 m68ki_write_8(EA_AY_PI_8(), COND_VC() ? 0xff : 0);
\r
4869 void m68k_op_svc_8_pi7(void)
\r
4871 m68ki_write_8(EA_A7_PI_8(), COND_VC() ? 0xff : 0);
\r
4875 void m68k_op_svc_8_pd(void)
\r
4877 m68ki_write_8(EA_AY_PD_8(), COND_VC() ? 0xff : 0);
\r
4881 void m68k_op_svc_8_pd7(void)
\r
4883 m68ki_write_8(EA_A7_PD_8(), COND_VC() ? 0xff : 0);
\r
4887 void m68k_op_svc_8_di(void)
\r
4889 m68ki_write_8(EA_AY_DI_8(), COND_VC() ? 0xff : 0);
\r
4893 void m68k_op_svc_8_ix(void)
\r
4895 m68ki_write_8(EA_AY_IX_8(), COND_VC() ? 0xff : 0);
\r
4899 void m68k_op_svc_8_aw(void)
\r
4901 m68ki_write_8(EA_AW_8(), COND_VC() ? 0xff : 0);
\r
4905 void m68k_op_svc_8_al(void)
\r
4907 m68ki_write_8(EA_AL_8(), COND_VC() ? 0xff : 0);
\r
4911 void m68k_op_svs_8_ai(void)
\r
4913 m68ki_write_8(EA_AY_AI_8(), COND_VS() ? 0xff : 0);
\r
4917 void m68k_op_svs_8_pi(void)
\r
4919 m68ki_write_8(EA_AY_PI_8(), COND_VS() ? 0xff : 0);
\r
4923 void m68k_op_svs_8_pi7(void)
\r
4925 m68ki_write_8(EA_A7_PI_8(), COND_VS() ? 0xff : 0);
\r
4929 void m68k_op_svs_8_pd(void)
\r
4931 m68ki_write_8(EA_AY_PD_8(), COND_VS() ? 0xff : 0);
\r
4935 void m68k_op_svs_8_pd7(void)
\r
4937 m68ki_write_8(EA_A7_PD_8(), COND_VS() ? 0xff : 0);
\r
4941 void m68k_op_svs_8_di(void)
\r
4943 m68ki_write_8(EA_AY_DI_8(), COND_VS() ? 0xff : 0);
\r
4947 void m68k_op_svs_8_ix(void)
\r
4949 m68ki_write_8(EA_AY_IX_8(), COND_VS() ? 0xff : 0);
\r
4953 void m68k_op_svs_8_aw(void)
\r
4955 m68ki_write_8(EA_AW_8(), COND_VS() ? 0xff : 0);
\r
4959 void m68k_op_svs_8_al(void)
\r
4961 m68ki_write_8(EA_AL_8(), COND_VS() ? 0xff : 0);
\r
4965 void m68k_op_spl_8_ai(void)
\r
4967 m68ki_write_8(EA_AY_AI_8(), COND_PL() ? 0xff : 0);
\r
4971 void m68k_op_spl_8_pi(void)
\r
4973 m68ki_write_8(EA_AY_PI_8(), COND_PL() ? 0xff : 0);
\r
4977 void m68k_op_spl_8_pi7(void)
\r
4979 m68ki_write_8(EA_A7_PI_8(), COND_PL() ? 0xff : 0);
\r
4983 void m68k_op_spl_8_pd(void)
\r
4985 m68ki_write_8(EA_AY_PD_8(), COND_PL() ? 0xff : 0);
\r
4989 void m68k_op_spl_8_pd7(void)
\r
4991 m68ki_write_8(EA_A7_PD_8(), COND_PL() ? 0xff : 0);
\r
4995 void m68k_op_spl_8_di(void)
\r
4997 m68ki_write_8(EA_AY_DI_8(), COND_PL() ? 0xff : 0);
\r
5001 void m68k_op_spl_8_ix(void)
\r
5003 m68ki_write_8(EA_AY_IX_8(), COND_PL() ? 0xff : 0);
\r
5007 void m68k_op_spl_8_aw(void)
\r
5009 m68ki_write_8(EA_AW_8(), COND_PL() ? 0xff : 0);
\r
5013 void m68k_op_spl_8_al(void)
\r
5015 m68ki_write_8(EA_AL_8(), COND_PL() ? 0xff : 0);
\r
5019 void m68k_op_smi_8_ai(void)
\r
5021 m68ki_write_8(EA_AY_AI_8(), COND_MI() ? 0xff : 0);
\r
5025 void m68k_op_smi_8_pi(void)
\r
5027 m68ki_write_8(EA_AY_PI_8(), COND_MI() ? 0xff : 0);
\r
5031 void m68k_op_smi_8_pi7(void)
\r
5033 m68ki_write_8(EA_A7_PI_8(), COND_MI() ? 0xff : 0);
\r
5037 void m68k_op_smi_8_pd(void)
\r
5039 m68ki_write_8(EA_AY_PD_8(), COND_MI() ? 0xff : 0);
\r
5043 void m68k_op_smi_8_pd7(void)
\r
5045 m68ki_write_8(EA_A7_PD_8(), COND_MI() ? 0xff : 0);
\r
5049 void m68k_op_smi_8_di(void)
\r
5051 m68ki_write_8(EA_AY_DI_8(), COND_MI() ? 0xff : 0);
\r
5055 void m68k_op_smi_8_ix(void)
\r
5057 m68ki_write_8(EA_AY_IX_8(), COND_MI() ? 0xff : 0);
\r
5061 void m68k_op_smi_8_aw(void)
\r
5063 m68ki_write_8(EA_AW_8(), COND_MI() ? 0xff : 0);
\r
5067 void m68k_op_smi_8_al(void)
\r
5069 m68ki_write_8(EA_AL_8(), COND_MI() ? 0xff : 0);
\r
5073 void m68k_op_sge_8_ai(void)
\r
5075 m68ki_write_8(EA_AY_AI_8(), COND_GE() ? 0xff : 0);
\r
5079 void m68k_op_sge_8_pi(void)
\r
5081 m68ki_write_8(EA_AY_PI_8(), COND_GE() ? 0xff : 0);
\r
5085 void m68k_op_sge_8_pi7(void)
\r
5087 m68ki_write_8(EA_A7_PI_8(), COND_GE() ? 0xff : 0);
\r
5091 void m68k_op_sge_8_pd(void)
\r
5093 m68ki_write_8(EA_AY_PD_8(), COND_GE() ? 0xff : 0);
\r
5097 void m68k_op_sge_8_pd7(void)
\r
5099 m68ki_write_8(EA_A7_PD_8(), COND_GE() ? 0xff : 0);
\r
5103 void m68k_op_sge_8_di(void)
\r
5105 m68ki_write_8(EA_AY_DI_8(), COND_GE() ? 0xff : 0);
\r
5109 void m68k_op_sge_8_ix(void)
\r
5111 m68ki_write_8(EA_AY_IX_8(), COND_GE() ? 0xff : 0);
\r
5115 void m68k_op_sge_8_aw(void)
\r
5117 m68ki_write_8(EA_AW_8(), COND_GE() ? 0xff : 0);
\r
5121 void m68k_op_sge_8_al(void)
\r
5123 m68ki_write_8(EA_AL_8(), COND_GE() ? 0xff : 0);
\r
5127 void m68k_op_slt_8_ai(void)
\r
5129 m68ki_write_8(EA_AY_AI_8(), COND_LT() ? 0xff : 0);
\r
5133 void m68k_op_slt_8_pi(void)
\r
5135 m68ki_write_8(EA_AY_PI_8(), COND_LT() ? 0xff : 0);
\r
5139 void m68k_op_slt_8_pi7(void)
\r
5141 m68ki_write_8(EA_A7_PI_8(), COND_LT() ? 0xff : 0);
\r
5145 void m68k_op_slt_8_pd(void)
\r
5147 m68ki_write_8(EA_AY_PD_8(), COND_LT() ? 0xff : 0);
\r
5151 void m68k_op_slt_8_pd7(void)
\r
5153 m68ki_write_8(EA_A7_PD_8(), COND_LT() ? 0xff : 0);
\r
5157 void m68k_op_slt_8_di(void)
\r
5159 m68ki_write_8(EA_AY_DI_8(), COND_LT() ? 0xff : 0);
\r
5163 void m68k_op_slt_8_ix(void)
\r
5165 m68ki_write_8(EA_AY_IX_8(), COND_LT() ? 0xff : 0);
\r
5169 void m68k_op_slt_8_aw(void)
\r
5171 m68ki_write_8(EA_AW_8(), COND_LT() ? 0xff : 0);
\r
5175 void m68k_op_slt_8_al(void)
\r
5177 m68ki_write_8(EA_AL_8(), COND_LT() ? 0xff : 0);
\r
5181 void m68k_op_sgt_8_ai(void)
\r
5183 m68ki_write_8(EA_AY_AI_8(), COND_GT() ? 0xff : 0);
\r
5187 void m68k_op_sgt_8_pi(void)
\r
5189 m68ki_write_8(EA_AY_PI_8(), COND_GT() ? 0xff : 0);
\r
5193 void m68k_op_sgt_8_pi7(void)
\r
5195 m68ki_write_8(EA_A7_PI_8(), COND_GT() ? 0xff : 0);
\r
5199 void m68k_op_sgt_8_pd(void)
\r
5201 m68ki_write_8(EA_AY_PD_8(), COND_GT() ? 0xff : 0);
\r
5205 void m68k_op_sgt_8_pd7(void)
\r
5207 m68ki_write_8(EA_A7_PD_8(), COND_GT() ? 0xff : 0);
\r
5211 void m68k_op_sgt_8_di(void)
\r
5213 m68ki_write_8(EA_AY_DI_8(), COND_GT() ? 0xff : 0);
\r
5217 void m68k_op_sgt_8_ix(void)
\r
5219 m68ki_write_8(EA_AY_IX_8(), COND_GT() ? 0xff : 0);
\r
5223 void m68k_op_sgt_8_aw(void)
\r
5225 m68ki_write_8(EA_AW_8(), COND_GT() ? 0xff : 0);
\r
5229 void m68k_op_sgt_8_al(void)
\r
5231 m68ki_write_8(EA_AL_8(), COND_GT() ? 0xff : 0);
\r
5235 void m68k_op_sle_8_ai(void)
\r
5237 m68ki_write_8(EA_AY_AI_8(), COND_LE() ? 0xff : 0);
\r
5241 void m68k_op_sle_8_pi(void)
\r
5243 m68ki_write_8(EA_AY_PI_8(), COND_LE() ? 0xff : 0);
\r
5247 void m68k_op_sle_8_pi7(void)
\r
5249 m68ki_write_8(EA_A7_PI_8(), COND_LE() ? 0xff : 0);
\r
5253 void m68k_op_sle_8_pd(void)
\r
5255 m68ki_write_8(EA_AY_PD_8(), COND_LE() ? 0xff : 0);
\r
5259 void m68k_op_sle_8_pd7(void)
\r
5261 m68ki_write_8(EA_A7_PD_8(), COND_LE() ? 0xff : 0);
\r
5265 void m68k_op_sle_8_di(void)
\r
5267 m68ki_write_8(EA_AY_DI_8(), COND_LE() ? 0xff : 0);
\r
5271 void m68k_op_sle_8_ix(void)
\r
5273 m68ki_write_8(EA_AY_IX_8(), COND_LE() ? 0xff : 0);
\r
5277 void m68k_op_sle_8_aw(void)
\r
5279 m68ki_write_8(EA_AW_8(), COND_LE() ? 0xff : 0);
\r
5283 void m68k_op_sle_8_al(void)
\r
5285 m68ki_write_8(EA_AL_8(), COND_LE() ? 0xff : 0);
\r
5289 void m68k_op_stop(void)
\r
5293 uint new_sr = OPER_I_16();
\r
5294 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
5295 CPU_STOPPED |= STOP_LEVEL_STOP;
\r
5296 m68ki_set_sr(new_sr);
\r
5297 m68ki_remaining_cycles = 0;
\r
5300 m68ki_exception_privilege_violation();
\r
5304 void m68k_op_sub_8_er_d(void)
\r
5306 uint* r_dst = &DX;
\r
5307 uint src = MASK_OUT_ABOVE_8(DY);
\r
5308 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
5309 uint res = dst - src;
\r
5311 FLAG_N = NFLAG_8(res);
\r
5312 FLAG_X = FLAG_C = CFLAG_8(res);
\r
5313 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
5314 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
5316 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
5320 void m68k_op_sub_8_er_ai(void)
\r
5322 uint* r_dst = &DX;
\r
5323 uint src = OPER_AY_AI_8();
\r
5324 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
5325 uint res = dst - src;
\r
5327 FLAG_N = NFLAG_8(res);
\r
5328 FLAG_X = FLAG_C = CFLAG_8(res);
\r
5329 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
5330 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
5332 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
5336 void m68k_op_sub_8_er_pi(void)
\r
5338 uint* r_dst = &DX;
\r
5339 uint src = OPER_AY_PI_8();
\r
5340 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
5341 uint res = dst - src;
\r
5343 FLAG_N = NFLAG_8(res);
\r
5344 FLAG_X = FLAG_C = CFLAG_8(res);
\r
5345 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
5346 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
5348 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
5352 void m68k_op_sub_8_er_pi7(void)
\r
5354 uint* r_dst = &DX;
\r
5355 uint src = OPER_A7_PI_8();
\r
5356 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
5357 uint res = dst - src;
\r
5359 FLAG_N = NFLAG_8(res);
\r
5360 FLAG_X = FLAG_C = CFLAG_8(res);
\r
5361 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
5362 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
5364 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
5368 void m68k_op_sub_8_er_pd(void)
\r
5370 uint* r_dst = &DX;
\r
5371 uint src = OPER_AY_PD_8();
\r
5372 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
5373 uint res = dst - src;
\r
5375 FLAG_N = NFLAG_8(res);
\r
5376 FLAG_X = FLAG_C = CFLAG_8(res);
\r
5377 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
5378 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
5380 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
5384 void m68k_op_sub_8_er_pd7(void)
\r
5386 uint* r_dst = &DX;
\r
5387 uint src = OPER_A7_PD_8();
\r
5388 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
5389 uint res = dst - src;
\r
5391 FLAG_N = NFLAG_8(res);
\r
5392 FLAG_X = FLAG_C = CFLAG_8(res);
\r
5393 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
5394 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
5396 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
5400 void m68k_op_sub_8_er_di(void)
\r
5402 uint* r_dst = &DX;
\r
5403 uint src = OPER_AY_DI_8();
\r
5404 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
5405 uint res = dst - src;
\r
5407 FLAG_N = NFLAG_8(res);
\r
5408 FLAG_X = FLAG_C = CFLAG_8(res);
\r
5409 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
5410 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
5412 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
5416 void m68k_op_sub_8_er_ix(void)
\r
5418 uint* r_dst = &DX;
\r
5419 uint src = OPER_AY_IX_8();
\r
5420 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
5421 uint res = dst - src;
\r
5423 FLAG_N = NFLAG_8(res);
\r
5424 FLAG_X = FLAG_C = CFLAG_8(res);
\r
5425 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
5426 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
5428 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
5432 void m68k_op_sub_8_er_aw(void)
\r
5434 uint* r_dst = &DX;
\r
5435 uint src = OPER_AW_8();
\r
5436 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
5437 uint res = dst - src;
\r
5439 FLAG_N = NFLAG_8(res);
\r
5440 FLAG_X = FLAG_C = CFLAG_8(res);
\r
5441 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
5442 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
5444 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
5448 void m68k_op_sub_8_er_al(void)
\r
5450 uint* r_dst = &DX;
\r
5451 uint src = OPER_AL_8();
\r
5452 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
5453 uint res = dst - src;
\r
5455 FLAG_N = NFLAG_8(res);
\r
5456 FLAG_X = FLAG_C = CFLAG_8(res);
\r
5457 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
5458 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
5460 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
5464 void m68k_op_sub_8_er_pcdi(void)
\r
5466 uint* r_dst = &DX;
\r
5467 uint src = OPER_PCDI_8();
\r
5468 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
5469 uint res = dst - src;
\r
5471 FLAG_N = NFLAG_8(res);
\r
5472 FLAG_X = FLAG_C = CFLAG_8(res);
\r
5473 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
5474 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
5476 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
5480 void m68k_op_sub_8_er_pcix(void)
\r
5482 uint* r_dst = &DX;
\r
5483 uint src = OPER_PCIX_8();
\r
5484 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
5485 uint res = dst - src;
\r
5487 FLAG_N = NFLAG_8(res);
\r
5488 FLAG_X = FLAG_C = CFLAG_8(res);
\r
5489 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
5490 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
5492 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
5496 void m68k_op_sub_8_er_i(void)
\r
5498 uint* r_dst = &DX;
\r
5499 uint src = OPER_I_8();
\r
5500 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
5501 uint res = dst - src;
\r
5503 FLAG_N = NFLAG_8(res);
\r
5504 FLAG_X = FLAG_C = CFLAG_8(res);
\r
5505 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
5506 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
5508 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
5512 void m68k_op_sub_16_er_d(void)
\r
5514 uint* r_dst = &DX;
\r
5515 uint src = MASK_OUT_ABOVE_16(DY);
\r
5516 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
5517 uint res = dst - src;
\r
5519 FLAG_N = NFLAG_16(res);
\r
5520 FLAG_X = FLAG_C = CFLAG_16(res);
\r
5521 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
5522 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
5524 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
5528 void m68k_op_sub_16_er_a(void)
\r
5530 uint* r_dst = &DX;
\r
5531 uint src = MASK_OUT_ABOVE_16(AY);
\r
5532 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
5533 uint res = dst - src;
\r
5535 FLAG_N = NFLAG_16(res);
\r
5536 FLAG_X = FLAG_C = CFLAG_16(res);
\r
5537 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
5538 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
5540 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
5544 void m68k_op_sub_16_er_ai(void)
\r
5546 uint* r_dst = &DX;
\r
5547 uint src = OPER_AY_AI_16();
\r
5548 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
5549 uint res = dst - src;
\r
5551 FLAG_N = NFLAG_16(res);
\r
5552 FLAG_X = FLAG_C = CFLAG_16(res);
\r
5553 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
5554 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
5556 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
5560 void m68k_op_sub_16_er_pi(void)
\r
5562 uint* r_dst = &DX;
\r
5563 uint src = OPER_AY_PI_16();
\r
5564 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
5565 uint res = dst - src;
\r
5567 FLAG_N = NFLAG_16(res);
\r
5568 FLAG_X = FLAG_C = CFLAG_16(res);
\r
5569 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
5570 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
5572 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
5576 void m68k_op_sub_16_er_pd(void)
\r
5578 uint* r_dst = &DX;
\r
5579 uint src = OPER_AY_PD_16();
\r
5580 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
5581 uint res = dst - src;
\r
5583 FLAG_N = NFLAG_16(res);
\r
5584 FLAG_X = FLAG_C = CFLAG_16(res);
\r
5585 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
5586 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
5588 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
5592 void m68k_op_sub_16_er_di(void)
\r
5594 uint* r_dst = &DX;
\r
5595 uint src = OPER_AY_DI_16();
\r
5596 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
5597 uint res = dst - src;
\r
5599 FLAG_N = NFLAG_16(res);
\r
5600 FLAG_X = FLAG_C = CFLAG_16(res);
\r
5601 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
5602 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
5604 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
5608 void m68k_op_sub_16_er_ix(void)
\r
5610 uint* r_dst = &DX;
\r
5611 uint src = OPER_AY_IX_16();
\r
5612 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
5613 uint res = dst - src;
\r
5615 FLAG_N = NFLAG_16(res);
\r
5616 FLAG_X = FLAG_C = CFLAG_16(res);
\r
5617 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
5618 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
5620 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
5624 void m68k_op_sub_16_er_aw(void)
\r
5626 uint* r_dst = &DX;
\r
5627 uint src = OPER_AW_16();
\r
5628 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
5629 uint res = dst - src;
\r
5631 FLAG_N = NFLAG_16(res);
\r
5632 FLAG_X = FLAG_C = CFLAG_16(res);
\r
5633 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
5634 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
5636 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
5640 void m68k_op_sub_16_er_al(void)
\r
5642 uint* r_dst = &DX;
\r
5643 uint src = OPER_AL_16();
\r
5644 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
5645 uint res = dst - src;
\r
5647 FLAG_N = NFLAG_16(res);
\r
5648 FLAG_X = FLAG_C = CFLAG_16(res);
\r
5649 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
5650 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
5652 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
5656 void m68k_op_sub_16_er_pcdi(void)
\r
5658 uint* r_dst = &DX;
\r
5659 uint src = OPER_PCDI_16();
\r
5660 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
5661 uint res = dst - src;
\r
5663 FLAG_N = NFLAG_16(res);
\r
5664 FLAG_X = FLAG_C = CFLAG_16(res);
\r
5665 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
5666 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
5668 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
5672 void m68k_op_sub_16_er_pcix(void)
\r
5674 uint* r_dst = &DX;
\r
5675 uint src = OPER_PCIX_16();
\r
5676 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
5677 uint res = dst - src;
\r
5679 FLAG_N = NFLAG_16(res);
\r
5680 FLAG_X = FLAG_C = CFLAG_16(res);
\r
5681 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
5682 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
5684 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
5688 void m68k_op_sub_16_er_i(void)
\r
5690 uint* r_dst = &DX;
\r
5691 uint src = OPER_I_16();
\r
5692 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
5693 uint res = dst - src;
\r
5695 FLAG_N = NFLAG_16(res);
\r
5696 FLAG_X = FLAG_C = CFLAG_16(res);
\r
5697 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
5698 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
5700 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
5704 void m68k_op_sub_32_er_d(void)
\r
5706 uint* r_dst = &DX;
\r
5708 uint dst = *r_dst;
\r
5709 uint res = dst - src;
\r
5711 FLAG_N = NFLAG_32(res);
\r
5712 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
5713 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
5714 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
5720 void m68k_op_sub_32_er_a(void)
\r
5722 uint* r_dst = &DX;
\r
5724 uint dst = *r_dst;
\r
5725 uint res = dst - src;
\r
5727 FLAG_N = NFLAG_32(res);
\r
5728 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
5729 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
5730 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
5736 void m68k_op_sub_32_er_ai(void)
\r
5738 uint* r_dst = &DX;
\r
5739 uint src = OPER_AY_AI_32();
\r
5740 uint dst = *r_dst;
\r
5741 uint res = dst - src;
\r
5743 FLAG_N = NFLAG_32(res);
\r
5744 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
5745 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
5746 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
5752 void m68k_op_sub_32_er_pi(void)
\r
5754 uint* r_dst = &DX;
\r
5755 uint src = OPER_AY_PI_32();
\r
5756 uint dst = *r_dst;
\r
5757 uint res = dst - src;
\r
5759 FLAG_N = NFLAG_32(res);
\r
5760 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
5761 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
5762 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
5768 void m68k_op_sub_32_er_pd(void)
\r
5770 uint* r_dst = &DX;
\r
5771 uint src = OPER_AY_PD_32();
\r
5772 uint dst = *r_dst;
\r
5773 uint res = dst - src;
\r
5775 FLAG_N = NFLAG_32(res);
\r
5776 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
5777 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
5778 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
5784 void m68k_op_sub_32_er_di(void)
\r
5786 uint* r_dst = &DX;
\r
5787 uint src = OPER_AY_DI_32();
\r
5788 uint dst = *r_dst;
\r
5789 uint res = dst - src;
\r
5791 FLAG_N = NFLAG_32(res);
\r
5792 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
5793 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
5794 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
5800 void m68k_op_sub_32_er_ix(void)
\r
5802 uint* r_dst = &DX;
\r
5803 uint src = OPER_AY_IX_32();
\r
5804 uint dst = *r_dst;
\r
5805 uint res = dst - src;
\r
5807 FLAG_N = NFLAG_32(res);
\r
5808 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
5809 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
5810 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
5816 void m68k_op_sub_32_er_aw(void)
\r
5818 uint* r_dst = &DX;
\r
5819 uint src = OPER_AW_32();
\r
5820 uint dst = *r_dst;
\r
5821 uint res = dst - src;
\r
5823 FLAG_N = NFLAG_32(res);
\r
5824 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
5825 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
5826 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
5832 void m68k_op_sub_32_er_al(void)
\r
5834 uint* r_dst = &DX;
\r
5835 uint src = OPER_AL_32();
\r
5836 uint dst = *r_dst;
\r
5837 uint res = dst - src;
\r
5839 FLAG_N = NFLAG_32(res);
\r
5840 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
5841 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
5842 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
5848 void m68k_op_sub_32_er_pcdi(void)
\r
5850 uint* r_dst = &DX;
\r
5851 uint src = OPER_PCDI_32();
\r
5852 uint dst = *r_dst;
\r
5853 uint res = dst - src;
\r
5855 FLAG_N = NFLAG_32(res);
\r
5856 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
5857 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
5858 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
5864 void m68k_op_sub_32_er_pcix(void)
\r
5866 uint* r_dst = &DX;
\r
5867 uint src = OPER_PCIX_32();
\r
5868 uint dst = *r_dst;
\r
5869 uint res = dst - src;
\r
5871 FLAG_N = NFLAG_32(res);
\r
5872 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
5873 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
5874 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
5880 void m68k_op_sub_32_er_i(void)
\r
5882 uint* r_dst = &DX;
\r
5883 uint src = OPER_I_32();
\r
5884 uint dst = *r_dst;
\r
5885 uint res = dst - src;
\r
5887 FLAG_N = NFLAG_32(res);
\r
5888 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
5889 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
5890 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
5896 void m68k_op_sub_8_re_ai(void)
\r
5898 uint ea = EA_AY_AI_8();
\r
5899 uint src = MASK_OUT_ABOVE_8(DX);
\r
5900 uint dst = m68ki_read_8(ea);
\r
5901 uint res = dst - src;
\r
5903 FLAG_N = NFLAG_8(res);
\r
5904 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
5905 FLAG_X = FLAG_C = CFLAG_8(res);
\r
5906 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
5908 m68ki_write_8(ea, FLAG_Z);
\r
5912 void m68k_op_sub_8_re_pi(void)
\r
5914 uint ea = EA_AY_PI_8();
\r
5915 uint src = MASK_OUT_ABOVE_8(DX);
\r
5916 uint dst = m68ki_read_8(ea);
\r
5917 uint res = dst - src;
\r
5919 FLAG_N = NFLAG_8(res);
\r
5920 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
5921 FLAG_X = FLAG_C = CFLAG_8(res);
\r
5922 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
5924 m68ki_write_8(ea, FLAG_Z);
\r
5928 void m68k_op_sub_8_re_pi7(void)
\r
5930 uint ea = EA_A7_PI_8();
\r
5931 uint src = MASK_OUT_ABOVE_8(DX);
\r
5932 uint dst = m68ki_read_8(ea);
\r
5933 uint res = dst - src;
\r
5935 FLAG_N = NFLAG_8(res);
\r
5936 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
5937 FLAG_X = FLAG_C = CFLAG_8(res);
\r
5938 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
5940 m68ki_write_8(ea, FLAG_Z);
\r
5944 void m68k_op_sub_8_re_pd(void)
\r
5946 uint ea = EA_AY_PD_8();
\r
5947 uint src = MASK_OUT_ABOVE_8(DX);
\r
5948 uint dst = m68ki_read_8(ea);
\r
5949 uint res = dst - src;
\r
5951 FLAG_N = NFLAG_8(res);
\r
5952 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
5953 FLAG_X = FLAG_C = CFLAG_8(res);
\r
5954 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
5956 m68ki_write_8(ea, FLAG_Z);
\r
5960 void m68k_op_sub_8_re_pd7(void)
\r
5962 uint ea = EA_A7_PD_8();
\r
5963 uint src = MASK_OUT_ABOVE_8(DX);
\r
5964 uint dst = m68ki_read_8(ea);
\r
5965 uint res = dst - src;
\r
5967 FLAG_N = NFLAG_8(res);
\r
5968 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
5969 FLAG_X = FLAG_C = CFLAG_8(res);
\r
5970 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
5972 m68ki_write_8(ea, FLAG_Z);
\r
5976 void m68k_op_sub_8_re_di(void)
\r
5978 uint ea = EA_AY_DI_8();
\r
5979 uint src = MASK_OUT_ABOVE_8(DX);
\r
5980 uint dst = m68ki_read_8(ea);
\r
5981 uint res = dst - src;
\r
5983 FLAG_N = NFLAG_8(res);
\r
5984 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
5985 FLAG_X = FLAG_C = CFLAG_8(res);
\r
5986 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
5988 m68ki_write_8(ea, FLAG_Z);
\r
5992 void m68k_op_sub_8_re_ix(void)
\r
5994 uint ea = EA_AY_IX_8();
\r
5995 uint src = MASK_OUT_ABOVE_8(DX);
\r
5996 uint dst = m68ki_read_8(ea);
\r
5997 uint res = dst - src;
\r
5999 FLAG_N = NFLAG_8(res);
\r
6000 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
6001 FLAG_X = FLAG_C = CFLAG_8(res);
\r
6002 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
6004 m68ki_write_8(ea, FLAG_Z);
\r
6008 void m68k_op_sub_8_re_aw(void)
\r
6010 uint ea = EA_AW_8();
\r
6011 uint src = MASK_OUT_ABOVE_8(DX);
\r
6012 uint dst = m68ki_read_8(ea);
\r
6013 uint res = dst - src;
\r
6015 FLAG_N = NFLAG_8(res);
\r
6016 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
6017 FLAG_X = FLAG_C = CFLAG_8(res);
\r
6018 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
6020 m68ki_write_8(ea, FLAG_Z);
\r
6024 void m68k_op_sub_8_re_al(void)
\r
6026 uint ea = EA_AL_8();
\r
6027 uint src = MASK_OUT_ABOVE_8(DX);
\r
6028 uint dst = m68ki_read_8(ea);
\r
6029 uint res = dst - src;
\r
6031 FLAG_N = NFLAG_8(res);
\r
6032 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
6033 FLAG_X = FLAG_C = CFLAG_8(res);
\r
6034 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
6036 m68ki_write_8(ea, FLAG_Z);
\r
6040 void m68k_op_sub_16_re_ai(void)
\r
6042 uint ea = EA_AY_AI_16();
\r
6043 uint src = MASK_OUT_ABOVE_16(DX);
\r
6044 uint dst = m68ki_read_16(ea);
\r
6045 uint res = dst - src;
\r
6047 FLAG_N = NFLAG_16(res);
\r
6048 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
6049 FLAG_X = FLAG_C = CFLAG_16(res);
\r
6050 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
6052 m68ki_write_16(ea, FLAG_Z);
\r
6056 void m68k_op_sub_16_re_pi(void)
\r
6058 uint ea = EA_AY_PI_16();
\r
6059 uint src = MASK_OUT_ABOVE_16(DX);
\r
6060 uint dst = m68ki_read_16(ea);
\r
6061 uint res = dst - src;
\r
6063 FLAG_N = NFLAG_16(res);
\r
6064 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
6065 FLAG_X = FLAG_C = CFLAG_16(res);
\r
6066 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
6068 m68ki_write_16(ea, FLAG_Z);
\r
6072 void m68k_op_sub_16_re_pd(void)
\r
6074 uint ea = EA_AY_PD_16();
\r
6075 uint src = MASK_OUT_ABOVE_16(DX);
\r
6076 uint dst = m68ki_read_16(ea);
\r
6077 uint res = dst - src;
\r
6079 FLAG_N = NFLAG_16(res);
\r
6080 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
6081 FLAG_X = FLAG_C = CFLAG_16(res);
\r
6082 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
6084 m68ki_write_16(ea, FLAG_Z);
\r
6088 void m68k_op_sub_16_re_di(void)
\r
6090 uint ea = EA_AY_DI_16();
\r
6091 uint src = MASK_OUT_ABOVE_16(DX);
\r
6092 uint dst = m68ki_read_16(ea);
\r
6093 uint res = dst - src;
\r
6095 FLAG_N = NFLAG_16(res);
\r
6096 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
6097 FLAG_X = FLAG_C = CFLAG_16(res);
\r
6098 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
6100 m68ki_write_16(ea, FLAG_Z);
\r
6104 void m68k_op_sub_16_re_ix(void)
\r
6106 uint ea = EA_AY_IX_16();
\r
6107 uint src = MASK_OUT_ABOVE_16(DX);
\r
6108 uint dst = m68ki_read_16(ea);
\r
6109 uint res = dst - src;
\r
6111 FLAG_N = NFLAG_16(res);
\r
6112 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
6113 FLAG_X = FLAG_C = CFLAG_16(res);
\r
6114 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
6116 m68ki_write_16(ea, FLAG_Z);
\r
6120 void m68k_op_sub_16_re_aw(void)
\r
6122 uint ea = EA_AW_16();
\r
6123 uint src = MASK_OUT_ABOVE_16(DX);
\r
6124 uint dst = m68ki_read_16(ea);
\r
6125 uint res = dst - src;
\r
6127 FLAG_N = NFLAG_16(res);
\r
6128 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
6129 FLAG_X = FLAG_C = CFLAG_16(res);
\r
6130 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
6132 m68ki_write_16(ea, FLAG_Z);
\r
6136 void m68k_op_sub_16_re_al(void)
\r
6138 uint ea = EA_AL_16();
\r
6139 uint src = MASK_OUT_ABOVE_16(DX);
\r
6140 uint dst = m68ki_read_16(ea);
\r
6141 uint res = dst - src;
\r
6143 FLAG_N = NFLAG_16(res);
\r
6144 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
6145 FLAG_X = FLAG_C = CFLAG_16(res);
\r
6146 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
6148 m68ki_write_16(ea, FLAG_Z);
\r
6152 void m68k_op_sub_32_re_ai(void)
\r
6154 uint ea = EA_AY_AI_32();
\r
6156 uint dst = m68ki_read_32(ea);
\r
6157 uint res = dst - src;
\r
6159 FLAG_N = NFLAG_32(res);
\r
6160 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
6161 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
6162 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
6164 m68ki_write_32(ea, FLAG_Z);
\r
6168 void m68k_op_sub_32_re_pi(void)
\r
6170 uint ea = EA_AY_PI_32();
\r
6172 uint dst = m68ki_read_32(ea);
\r
6173 uint res = dst - src;
\r
6175 FLAG_N = NFLAG_32(res);
\r
6176 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
6177 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
6178 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
6180 m68ki_write_32(ea, FLAG_Z);
\r
6184 void m68k_op_sub_32_re_pd(void)
\r
6186 uint ea = EA_AY_PD_32();
\r
6188 uint dst = m68ki_read_32(ea);
\r
6189 uint res = dst - src;
\r
6191 FLAG_N = NFLAG_32(res);
\r
6192 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
6193 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
6194 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
6196 m68ki_write_32(ea, FLAG_Z);
\r
6200 void m68k_op_sub_32_re_di(void)
\r
6202 uint ea = EA_AY_DI_32();
\r
6204 uint dst = m68ki_read_32(ea);
\r
6205 uint res = dst - src;
\r
6207 FLAG_N = NFLAG_32(res);
\r
6208 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
6209 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
6210 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
6212 m68ki_write_32(ea, FLAG_Z);
\r
6216 void m68k_op_sub_32_re_ix(void)
\r
6218 uint ea = EA_AY_IX_32();
\r
6220 uint dst = m68ki_read_32(ea);
\r
6221 uint res = dst - src;
\r
6223 FLAG_N = NFLAG_32(res);
\r
6224 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
6225 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
6226 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
6228 m68ki_write_32(ea, FLAG_Z);
\r
6232 void m68k_op_sub_32_re_aw(void)
\r
6234 uint ea = EA_AW_32();
\r
6236 uint dst = m68ki_read_32(ea);
\r
6237 uint res = dst - src;
\r
6239 FLAG_N = NFLAG_32(res);
\r
6240 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
6241 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
6242 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
6244 m68ki_write_32(ea, FLAG_Z);
\r
6248 void m68k_op_sub_32_re_al(void)
\r
6250 uint ea = EA_AL_32();
\r
6252 uint dst = m68ki_read_32(ea);
\r
6253 uint res = dst - src;
\r
6255 FLAG_N = NFLAG_32(res);
\r
6256 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
6257 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
6258 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
6260 m68ki_write_32(ea, FLAG_Z);
\r
6264 void m68k_op_suba_16_d(void)
\r
6266 uint* r_dst = &AX;
\r
6268 *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(DY));
\r
6272 void m68k_op_suba_16_a(void)
\r
6274 uint* r_dst = &AX;
\r
6276 *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(AY));
\r
6280 void m68k_op_suba_16_ai(void)
\r
6282 uint* r_dst = &AX;
\r
6284 *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(OPER_AY_AI_16()));
\r
6288 void m68k_op_suba_16_pi(void)
\r
6290 uint* r_dst = &AX;
\r
6292 *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(OPER_AY_PI_16()));
\r
6296 void m68k_op_suba_16_pd(void)
\r
6298 uint* r_dst = &AX;
\r
6300 *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(OPER_AY_PD_16()));
\r
6304 void m68k_op_suba_16_di(void)
\r
6306 uint* r_dst = &AX;
\r
6308 *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(OPER_AY_DI_16()));
\r
6312 void m68k_op_suba_16_ix(void)
\r
6314 uint* r_dst = &AX;
\r
6316 *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(OPER_AY_IX_16()));
\r
6320 void m68k_op_suba_16_aw(void)
\r
6322 uint* r_dst = &AX;
\r
6324 *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(OPER_AW_16()));
\r
6328 void m68k_op_suba_16_al(void)
\r
6330 uint* r_dst = &AX;
\r
6332 *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(OPER_AL_16()));
\r
6336 void m68k_op_suba_16_pcdi(void)
\r
6338 uint* r_dst = &AX;
\r
6340 *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(OPER_PCDI_16()));
\r
6344 void m68k_op_suba_16_pcix(void)
\r
6346 uint* r_dst = &AX;
\r
6348 *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(OPER_PCIX_16()));
\r
6352 void m68k_op_suba_16_i(void)
\r
6354 uint* r_dst = &AX;
\r
6356 *r_dst = MASK_OUT_ABOVE_32(*r_dst - MAKE_INT_16(OPER_I_16()));
\r
6360 void m68k_op_suba_32_d(void)
\r
6362 uint* r_dst = &AX;
\r
6364 *r_dst = MASK_OUT_ABOVE_32(*r_dst - DY);
\r
6368 void m68k_op_suba_32_a(void)
\r
6370 uint* r_dst = &AX;
\r
6372 *r_dst = MASK_OUT_ABOVE_32(*r_dst - AY);
\r
6376 void m68k_op_suba_32_ai(void)
\r
6378 uint* r_dst = &AX;
\r
6380 *r_dst = MASK_OUT_ABOVE_32(*r_dst - OPER_AY_AI_32());
\r
6384 void m68k_op_suba_32_pi(void)
\r
6386 uint* r_dst = &AX;
\r
6388 *r_dst = MASK_OUT_ABOVE_32(*r_dst - OPER_AY_PI_32());
\r
6392 void m68k_op_suba_32_pd(void)
\r
6394 uint* r_dst = &AX;
\r
6396 *r_dst = MASK_OUT_ABOVE_32(*r_dst - OPER_AY_PD_32());
\r
6400 void m68k_op_suba_32_di(void)
\r
6402 uint* r_dst = &AX;
\r
6404 *r_dst = MASK_OUT_ABOVE_32(*r_dst - OPER_AY_DI_32());
\r
6408 void m68k_op_suba_32_ix(void)
\r
6410 uint* r_dst = &AX;
\r
6412 *r_dst = MASK_OUT_ABOVE_32(*r_dst - OPER_AY_IX_32());
\r
6416 void m68k_op_suba_32_aw(void)
\r
6418 uint* r_dst = &AX;
\r
6420 *r_dst = MASK_OUT_ABOVE_32(*r_dst - OPER_AW_32());
\r
6424 void m68k_op_suba_32_al(void)
\r
6426 uint* r_dst = &AX;
\r
6428 *r_dst = MASK_OUT_ABOVE_32(*r_dst - OPER_AL_32());
\r
6432 void m68k_op_suba_32_pcdi(void)
\r
6434 uint* r_dst = &AX;
\r
6436 *r_dst = MASK_OUT_ABOVE_32(*r_dst - OPER_PCDI_32());
\r
6440 void m68k_op_suba_32_pcix(void)
\r
6442 uint* r_dst = &AX;
\r
6444 *r_dst = MASK_OUT_ABOVE_32(*r_dst - OPER_PCIX_32());
\r
6448 void m68k_op_suba_32_i(void)
\r
6450 uint* r_dst = &AX;
\r
6452 *r_dst = MASK_OUT_ABOVE_32(*r_dst - OPER_I_32());
\r
6456 void m68k_op_subi_8_d(void)
\r
6458 uint* r_dst = &DY;
\r
6459 uint src = OPER_I_8();
\r
6460 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
6461 uint res = dst - src;
\r
6463 FLAG_N = NFLAG_8(res);
\r
6464 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
6465 FLAG_X = FLAG_C = CFLAG_8(res);
\r
6466 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
6468 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
6472 void m68k_op_subi_8_ai(void)
\r
6474 uint src = OPER_I_8();
\r
6475 uint ea = EA_AY_AI_8();
\r
6476 uint dst = m68ki_read_8(ea);
\r
6477 uint res = dst - src;
\r
6479 FLAG_N = NFLAG_8(res);
\r
6480 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
6481 FLAG_X = FLAG_C = CFLAG_8(res);
\r
6482 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
6484 m68ki_write_8(ea, FLAG_Z);
\r
6488 void m68k_op_subi_8_pi(void)
\r
6490 uint src = OPER_I_8();
\r
6491 uint ea = EA_AY_PI_8();
\r
6492 uint dst = m68ki_read_8(ea);
\r
6493 uint res = dst - src;
\r
6495 FLAG_N = NFLAG_8(res);
\r
6496 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
6497 FLAG_X = FLAG_C = CFLAG_8(res);
\r
6498 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
6500 m68ki_write_8(ea, FLAG_Z);
\r
6504 void m68k_op_subi_8_pi7(void)
\r
6506 uint src = OPER_I_8();
\r
6507 uint ea = EA_A7_PI_8();
\r
6508 uint dst = m68ki_read_8(ea);
\r
6509 uint res = dst - src;
\r
6511 FLAG_N = NFLAG_8(res);
\r
6512 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
6513 FLAG_X = FLAG_C = CFLAG_8(res);
\r
6514 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
6516 m68ki_write_8(ea, FLAG_Z);
\r
6520 void m68k_op_subi_8_pd(void)
\r
6522 uint src = OPER_I_8();
\r
6523 uint ea = EA_AY_PD_8();
\r
6524 uint dst = m68ki_read_8(ea);
\r
6525 uint res = dst - src;
\r
6527 FLAG_N = NFLAG_8(res);
\r
6528 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
6529 FLAG_X = FLAG_C = CFLAG_8(res);
\r
6530 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
6532 m68ki_write_8(ea, FLAG_Z);
\r
6536 void m68k_op_subi_8_pd7(void)
\r
6538 uint src = OPER_I_8();
\r
6539 uint ea = EA_A7_PD_8();
\r
6540 uint dst = m68ki_read_8(ea);
\r
6541 uint res = dst - src;
\r
6543 FLAG_N = NFLAG_8(res);
\r
6544 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
6545 FLAG_X = FLAG_C = CFLAG_8(res);
\r
6546 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
6548 m68ki_write_8(ea, FLAG_Z);
\r
6552 void m68k_op_subi_8_di(void)
\r
6554 uint src = OPER_I_8();
\r
6555 uint ea = EA_AY_DI_8();
\r
6556 uint dst = m68ki_read_8(ea);
\r
6557 uint res = dst - src;
\r
6559 FLAG_N = NFLAG_8(res);
\r
6560 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
6561 FLAG_X = FLAG_C = CFLAG_8(res);
\r
6562 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
6564 m68ki_write_8(ea, FLAG_Z);
\r
6568 void m68k_op_subi_8_ix(void)
\r
6570 uint src = OPER_I_8();
\r
6571 uint ea = EA_AY_IX_8();
\r
6572 uint dst = m68ki_read_8(ea);
\r
6573 uint res = dst - src;
\r
6575 FLAG_N = NFLAG_8(res);
\r
6576 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
6577 FLAG_X = FLAG_C = CFLAG_8(res);
\r
6578 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
6580 m68ki_write_8(ea, FLAG_Z);
\r
6584 void m68k_op_subi_8_aw(void)
\r
6586 uint src = OPER_I_8();
\r
6587 uint ea = EA_AW_8();
\r
6588 uint dst = m68ki_read_8(ea);
\r
6589 uint res = dst - src;
\r
6591 FLAG_N = NFLAG_8(res);
\r
6592 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
6593 FLAG_X = FLAG_C = CFLAG_8(res);
\r
6594 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
6596 m68ki_write_8(ea, FLAG_Z);
\r
6600 void m68k_op_subi_8_al(void)
\r
6602 uint src = OPER_I_8();
\r
6603 uint ea = EA_AL_8();
\r
6604 uint dst = m68ki_read_8(ea);
\r
6605 uint res = dst - src;
\r
6607 FLAG_N = NFLAG_8(res);
\r
6608 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
6609 FLAG_X = FLAG_C = CFLAG_8(res);
\r
6610 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
6612 m68ki_write_8(ea, FLAG_Z);
\r
6616 void m68k_op_subi_16_d(void)
\r
6618 uint* r_dst = &DY;
\r
6619 uint src = OPER_I_16();
\r
6620 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
6621 uint res = dst - src;
\r
6623 FLAG_N = NFLAG_16(res);
\r
6624 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
6625 FLAG_X = FLAG_C = CFLAG_16(res);
\r
6626 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
6628 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
6632 void m68k_op_subi_16_ai(void)
\r
6634 uint src = OPER_I_16();
\r
6635 uint ea = EA_AY_AI_16();
\r
6636 uint dst = m68ki_read_16(ea);
\r
6637 uint res = dst - src;
\r
6639 FLAG_N = NFLAG_16(res);
\r
6640 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
6641 FLAG_X = FLAG_C = CFLAG_16(res);
\r
6642 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
6644 m68ki_write_16(ea, FLAG_Z);
\r
6648 void m68k_op_subi_16_pi(void)
\r
6650 uint src = OPER_I_16();
\r
6651 uint ea = EA_AY_PI_16();
\r
6652 uint dst = m68ki_read_16(ea);
\r
6653 uint res = dst - src;
\r
6655 FLAG_N = NFLAG_16(res);
\r
6656 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
6657 FLAG_X = FLAG_C = CFLAG_16(res);
\r
6658 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
6660 m68ki_write_16(ea, FLAG_Z);
\r
6664 void m68k_op_subi_16_pd(void)
\r
6666 uint src = OPER_I_16();
\r
6667 uint ea = EA_AY_PD_16();
\r
6668 uint dst = m68ki_read_16(ea);
\r
6669 uint res = dst - src;
\r
6671 FLAG_N = NFLAG_16(res);
\r
6672 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
6673 FLAG_X = FLAG_C = CFLAG_16(res);
\r
6674 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
6676 m68ki_write_16(ea, FLAG_Z);
\r
6680 void m68k_op_subi_16_di(void)
\r
6682 uint src = OPER_I_16();
\r
6683 uint ea = EA_AY_DI_16();
\r
6684 uint dst = m68ki_read_16(ea);
\r
6685 uint res = dst - src;
\r
6687 FLAG_N = NFLAG_16(res);
\r
6688 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
6689 FLAG_X = FLAG_C = CFLAG_16(res);
\r
6690 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
6692 m68ki_write_16(ea, FLAG_Z);
\r
6696 void m68k_op_subi_16_ix(void)
\r
6698 uint src = OPER_I_16();
\r
6699 uint ea = EA_AY_IX_16();
\r
6700 uint dst = m68ki_read_16(ea);
\r
6701 uint res = dst - src;
\r
6703 FLAG_N = NFLAG_16(res);
\r
6704 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
6705 FLAG_X = FLAG_C = CFLAG_16(res);
\r
6706 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
6708 m68ki_write_16(ea, FLAG_Z);
\r
6712 void m68k_op_subi_16_aw(void)
\r
6714 uint src = OPER_I_16();
\r
6715 uint ea = EA_AW_16();
\r
6716 uint dst = m68ki_read_16(ea);
\r
6717 uint res = dst - src;
\r
6719 FLAG_N = NFLAG_16(res);
\r
6720 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
6721 FLAG_X = FLAG_C = CFLAG_16(res);
\r
6722 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
6724 m68ki_write_16(ea, FLAG_Z);
\r
6728 void m68k_op_subi_16_al(void)
\r
6730 uint src = OPER_I_16();
\r
6731 uint ea = EA_AL_16();
\r
6732 uint dst = m68ki_read_16(ea);
\r
6733 uint res = dst - src;
\r
6735 FLAG_N = NFLAG_16(res);
\r
6736 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
6737 FLAG_X = FLAG_C = CFLAG_16(res);
\r
6738 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
6740 m68ki_write_16(ea, FLAG_Z);
\r
6744 void m68k_op_subi_32_d(void)
\r
6746 uint* r_dst = &DY;
\r
6747 uint src = OPER_I_32();
\r
6748 uint dst = *r_dst;
\r
6749 uint res = dst - src;
\r
6751 FLAG_N = NFLAG_32(res);
\r
6752 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
6753 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
6754 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
6760 void m68k_op_subi_32_ai(void)
\r
6762 uint src = OPER_I_32();
\r
6763 uint ea = EA_AY_AI_32();
\r
6764 uint dst = m68ki_read_32(ea);
\r
6765 uint res = dst - src;
\r
6767 FLAG_N = NFLAG_32(res);
\r
6768 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
6769 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
6770 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
6772 m68ki_write_32(ea, FLAG_Z);
\r
6776 void m68k_op_subi_32_pi(void)
\r
6778 uint src = OPER_I_32();
\r
6779 uint ea = EA_AY_PI_32();
\r
6780 uint dst = m68ki_read_32(ea);
\r
6781 uint res = dst - src;
\r
6783 FLAG_N = NFLAG_32(res);
\r
6784 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
6785 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
6786 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
6788 m68ki_write_32(ea, FLAG_Z);
\r
6792 void m68k_op_subi_32_pd(void)
\r
6794 uint src = OPER_I_32();
\r
6795 uint ea = EA_AY_PD_32();
\r
6796 uint dst = m68ki_read_32(ea);
\r
6797 uint res = dst - src;
\r
6799 FLAG_N = NFLAG_32(res);
\r
6800 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
6801 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
6802 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
6804 m68ki_write_32(ea, FLAG_Z);
\r
6808 void m68k_op_subi_32_di(void)
\r
6810 uint src = OPER_I_32();
\r
6811 uint ea = EA_AY_DI_32();
\r
6812 uint dst = m68ki_read_32(ea);
\r
6813 uint res = dst - src;
\r
6815 FLAG_N = NFLAG_32(res);
\r
6816 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
6817 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
6818 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
6820 m68ki_write_32(ea, FLAG_Z);
\r
6824 void m68k_op_subi_32_ix(void)
\r
6826 uint src = OPER_I_32();
\r
6827 uint ea = EA_AY_IX_32();
\r
6828 uint dst = m68ki_read_32(ea);
\r
6829 uint res = dst - src;
\r
6831 FLAG_N = NFLAG_32(res);
\r
6832 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
6833 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
6834 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
6836 m68ki_write_32(ea, FLAG_Z);
\r
6840 void m68k_op_subi_32_aw(void)
\r
6842 uint src = OPER_I_32();
\r
6843 uint ea = EA_AW_32();
\r
6844 uint dst = m68ki_read_32(ea);
\r
6845 uint res = dst - src;
\r
6847 FLAG_N = NFLAG_32(res);
\r
6848 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
6849 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
6850 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
6852 m68ki_write_32(ea, FLAG_Z);
\r
6856 void m68k_op_subi_32_al(void)
\r
6858 uint src = OPER_I_32();
\r
6859 uint ea = EA_AL_32();
\r
6860 uint dst = m68ki_read_32(ea);
\r
6861 uint res = dst - src;
\r
6863 FLAG_N = NFLAG_32(res);
\r
6864 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
6865 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
6866 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
6868 m68ki_write_32(ea, FLAG_Z);
\r
6872 void m68k_op_subq_8_d(void)
\r
6874 uint* r_dst = &DY;
\r
6875 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
6876 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
6877 uint res = dst - src;
\r
6879 FLAG_N = NFLAG_8(res);
\r
6880 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
6881 FLAG_X = FLAG_C = CFLAG_8(res);
\r
6882 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
6884 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
6888 void m68k_op_subq_8_ai(void)
\r
6890 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
6891 uint ea = EA_AY_AI_8();
\r
6892 uint dst = m68ki_read_8(ea);
\r
6893 uint res = dst - src;
\r
6895 FLAG_N = NFLAG_8(res);
\r
6896 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
6897 FLAG_X = FLAG_C = CFLAG_8(res);
\r
6898 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
6900 m68ki_write_8(ea, FLAG_Z);
\r
6904 void m68k_op_subq_8_pi(void)
\r
6906 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
6907 uint ea = EA_AY_PI_8();
\r
6908 uint dst = m68ki_read_8(ea);
\r
6909 uint res = dst - src;
\r
6911 FLAG_N = NFLAG_8(res);
\r
6912 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
6913 FLAG_X = FLAG_C = CFLAG_8(res);
\r
6914 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
6916 m68ki_write_8(ea, FLAG_Z);
\r
6920 void m68k_op_subq_8_pi7(void)
\r
6922 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
6923 uint ea = EA_A7_PI_8();
\r
6924 uint dst = m68ki_read_8(ea);
\r
6925 uint res = dst - src;
\r
6927 FLAG_N = NFLAG_8(res);
\r
6928 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
6929 FLAG_X = FLAG_C = CFLAG_8(res);
\r
6930 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
6932 m68ki_write_8(ea, FLAG_Z);
\r
6936 void m68k_op_subq_8_pd(void)
\r
6938 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
6939 uint ea = EA_AY_PD_8();
\r
6940 uint dst = m68ki_read_8(ea);
\r
6941 uint res = dst - src;
\r
6943 FLAG_N = NFLAG_8(res);
\r
6944 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
6945 FLAG_X = FLAG_C = CFLAG_8(res);
\r
6946 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
6948 m68ki_write_8(ea, FLAG_Z);
\r
6952 void m68k_op_subq_8_pd7(void)
\r
6954 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
6955 uint ea = EA_A7_PD_8();
\r
6956 uint dst = m68ki_read_8(ea);
\r
6957 uint res = dst - src;
\r
6959 FLAG_N = NFLAG_8(res);
\r
6960 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
6961 FLAG_X = FLAG_C = CFLAG_8(res);
\r
6962 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
6964 m68ki_write_8(ea, FLAG_Z);
\r
6968 void m68k_op_subq_8_di(void)
\r
6970 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
6971 uint ea = EA_AY_DI_8();
\r
6972 uint dst = m68ki_read_8(ea);
\r
6973 uint res = dst - src;
\r
6975 FLAG_N = NFLAG_8(res);
\r
6976 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
6977 FLAG_X = FLAG_C = CFLAG_8(res);
\r
6978 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
6980 m68ki_write_8(ea, FLAG_Z);
\r
6984 void m68k_op_subq_8_ix(void)
\r
6986 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
6987 uint ea = EA_AY_IX_8();
\r
6988 uint dst = m68ki_read_8(ea);
\r
6989 uint res = dst - src;
\r
6991 FLAG_N = NFLAG_8(res);
\r
6992 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
6993 FLAG_X = FLAG_C = CFLAG_8(res);
\r
6994 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
6996 m68ki_write_8(ea, FLAG_Z);
\r
7000 void m68k_op_subq_8_aw(void)
\r
7002 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
7003 uint ea = EA_AW_8();
\r
7004 uint dst = m68ki_read_8(ea);
\r
7005 uint res = dst - src;
\r
7007 FLAG_N = NFLAG_8(res);
\r
7008 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
7009 FLAG_X = FLAG_C = CFLAG_8(res);
\r
7010 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
7012 m68ki_write_8(ea, FLAG_Z);
\r
7016 void m68k_op_subq_8_al(void)
\r
7018 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
7019 uint ea = EA_AL_8();
\r
7020 uint dst = m68ki_read_8(ea);
\r
7021 uint res = dst - src;
\r
7023 FLAG_N = NFLAG_8(res);
\r
7024 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
7025 FLAG_X = FLAG_C = CFLAG_8(res);
\r
7026 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
7028 m68ki_write_8(ea, FLAG_Z);
\r
7032 void m68k_op_subq_16_d(void)
\r
7034 uint* r_dst = &DY;
\r
7035 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
7036 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
7037 uint res = dst - src;
\r
7039 FLAG_N = NFLAG_16(res);
\r
7040 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
7041 FLAG_X = FLAG_C = CFLAG_16(res);
\r
7042 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
7044 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
7048 void m68k_op_subq_16_a(void)
\r
7050 uint* r_dst = &AY;
\r
7052 *r_dst = MASK_OUT_ABOVE_32(*r_dst - ((((REG_IR >> 9) - 1) & 7) + 1));
\r
7056 void m68k_op_subq_16_ai(void)
\r
7058 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
7059 uint ea = EA_AY_AI_16();
\r
7060 uint dst = m68ki_read_16(ea);
\r
7061 uint res = dst - src;
\r
7063 FLAG_N = NFLAG_16(res);
\r
7064 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
7065 FLAG_X = FLAG_C = CFLAG_16(res);
\r
7066 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
7068 m68ki_write_16(ea, FLAG_Z);
\r
7072 void m68k_op_subq_16_pi(void)
\r
7074 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
7075 uint ea = EA_AY_PI_16();
\r
7076 uint dst = m68ki_read_16(ea);
\r
7077 uint res = dst - src;
\r
7079 FLAG_N = NFLAG_16(res);
\r
7080 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
7081 FLAG_X = FLAG_C = CFLAG_16(res);
\r
7082 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
7084 m68ki_write_16(ea, FLAG_Z);
\r
7088 void m68k_op_subq_16_pd(void)
\r
7090 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
7091 uint ea = EA_AY_PD_16();
\r
7092 uint dst = m68ki_read_16(ea);
\r
7093 uint res = dst - src;
\r
7095 FLAG_N = NFLAG_16(res);
\r
7096 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
7097 FLAG_X = FLAG_C = CFLAG_16(res);
\r
7098 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
7100 m68ki_write_16(ea, FLAG_Z);
\r
7104 void m68k_op_subq_16_di(void)
\r
7106 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
7107 uint ea = EA_AY_DI_16();
\r
7108 uint dst = m68ki_read_16(ea);
\r
7109 uint res = dst - src;
\r
7111 FLAG_N = NFLAG_16(res);
\r
7112 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
7113 FLAG_X = FLAG_C = CFLAG_16(res);
\r
7114 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
7116 m68ki_write_16(ea, FLAG_Z);
\r
7120 void m68k_op_subq_16_ix(void)
\r
7122 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
7123 uint ea = EA_AY_IX_16();
\r
7124 uint dst = m68ki_read_16(ea);
\r
7125 uint res = dst - src;
\r
7127 FLAG_N = NFLAG_16(res);
\r
7128 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
7129 FLAG_X = FLAG_C = CFLAG_16(res);
\r
7130 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
7132 m68ki_write_16(ea, FLAG_Z);
\r
7136 void m68k_op_subq_16_aw(void)
\r
7138 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
7139 uint ea = EA_AW_16();
\r
7140 uint dst = m68ki_read_16(ea);
\r
7141 uint res = dst - src;
\r
7143 FLAG_N = NFLAG_16(res);
\r
7144 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
7145 FLAG_X = FLAG_C = CFLAG_16(res);
\r
7146 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
7148 m68ki_write_16(ea, FLAG_Z);
\r
7152 void m68k_op_subq_16_al(void)
\r
7154 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
7155 uint ea = EA_AL_16();
\r
7156 uint dst = m68ki_read_16(ea);
\r
7157 uint res = dst - src;
\r
7159 FLAG_N = NFLAG_16(res);
\r
7160 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
7161 FLAG_X = FLAG_C = CFLAG_16(res);
\r
7162 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
7164 m68ki_write_16(ea, FLAG_Z);
\r
7168 void m68k_op_subq_32_d(void)
\r
7170 uint* r_dst = &DY;
\r
7171 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
7172 uint dst = *r_dst;
\r
7173 uint res = dst - src;
\r
7175 FLAG_N = NFLAG_32(res);
\r
7176 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
7177 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
7178 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
7184 void m68k_op_subq_32_a(void)
\r
7186 uint* r_dst = &AY;
\r
7188 *r_dst = MASK_OUT_ABOVE_32(*r_dst - ((((REG_IR >> 9) - 1) & 7) + 1));
\r
7192 void m68k_op_subq_32_ai(void)
\r
7194 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
7195 uint ea = EA_AY_AI_32();
\r
7196 uint dst = m68ki_read_32(ea);
\r
7197 uint res = dst - src;
\r
7199 FLAG_N = NFLAG_32(res);
\r
7200 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
7201 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
7202 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
7204 m68ki_write_32(ea, FLAG_Z);
\r
7208 void m68k_op_subq_32_pi(void)
\r
7210 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
7211 uint ea = EA_AY_PI_32();
\r
7212 uint dst = m68ki_read_32(ea);
\r
7213 uint res = dst - src;
\r
7215 FLAG_N = NFLAG_32(res);
\r
7216 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
7217 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
7218 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
7220 m68ki_write_32(ea, FLAG_Z);
\r
7224 void m68k_op_subq_32_pd(void)
\r
7226 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
7227 uint ea = EA_AY_PD_32();
\r
7228 uint dst = m68ki_read_32(ea);
\r
7229 uint res = dst - src;
\r
7231 FLAG_N = NFLAG_32(res);
\r
7232 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
7233 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
7234 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
7236 m68ki_write_32(ea, FLAG_Z);
\r
7240 void m68k_op_subq_32_di(void)
\r
7242 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
7243 uint ea = EA_AY_DI_32();
\r
7244 uint dst = m68ki_read_32(ea);
\r
7245 uint res = dst - src;
\r
7247 FLAG_N = NFLAG_32(res);
\r
7248 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
7249 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
7250 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
7252 m68ki_write_32(ea, FLAG_Z);
\r
7256 void m68k_op_subq_32_ix(void)
\r
7258 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
7259 uint ea = EA_AY_IX_32();
\r
7260 uint dst = m68ki_read_32(ea);
\r
7261 uint res = dst - src;
\r
7263 FLAG_N = NFLAG_32(res);
\r
7264 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
7265 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
7266 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
7268 m68ki_write_32(ea, FLAG_Z);
\r
7272 void m68k_op_subq_32_aw(void)
\r
7274 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
7275 uint ea = EA_AW_32();
\r
7276 uint dst = m68ki_read_32(ea);
\r
7277 uint res = dst - src;
\r
7279 FLAG_N = NFLAG_32(res);
\r
7280 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
7281 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
7282 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
7284 m68ki_write_32(ea, FLAG_Z);
\r
7288 void m68k_op_subq_32_al(void)
\r
7290 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
7291 uint ea = EA_AL_32();
\r
7292 uint dst = m68ki_read_32(ea);
\r
7293 uint res = dst - src;
\r
7295 FLAG_N = NFLAG_32(res);
\r
7296 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
7297 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
7298 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
7300 m68ki_write_32(ea, FLAG_Z);
\r
7304 void m68k_op_subx_8_rr(void)
\r
7306 uint* r_dst = &DX;
\r
7307 uint src = MASK_OUT_ABOVE_8(DY);
\r
7308 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
7309 uint res = dst - src - XFLAG_AS_1();
\r
7311 FLAG_N = NFLAG_8(res);
\r
7312 FLAG_X = FLAG_C = CFLAG_8(res);
\r
7313 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
7315 res = MASK_OUT_ABOVE_8(res);
\r
7318 *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
\r
7322 void m68k_op_subx_16_rr(void)
\r
7324 uint* r_dst = &DX;
\r
7325 uint src = MASK_OUT_ABOVE_16(DY);
\r
7326 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
7327 uint res = dst - src - XFLAG_AS_1();
\r
7329 FLAG_N = NFLAG_16(res);
\r
7330 FLAG_X = FLAG_C = CFLAG_16(res);
\r
7331 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
7333 res = MASK_OUT_ABOVE_16(res);
\r
7336 *r_dst = MASK_OUT_BELOW_16(*r_dst) | res;
\r
7340 void m68k_op_subx_32_rr(void)
\r
7342 uint* r_dst = &DX;
\r
7344 uint dst = *r_dst;
\r
7345 uint res = dst - src - XFLAG_AS_1();
\r
7347 FLAG_N = NFLAG_32(res);
\r
7348 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
7349 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
7351 res = MASK_OUT_ABOVE_32(res);
\r
7358 void m68k_op_subx_8_mm_ax7(void)
\r
7360 uint src = OPER_AY_PD_8();
\r
7361 uint ea = EA_A7_PD_8();
\r
7362 uint dst = m68ki_read_8(ea);
\r
7363 uint res = dst - src - XFLAG_AS_1();
\r
7365 FLAG_N = NFLAG_8(res);
\r
7366 FLAG_X = FLAG_C = CFLAG_8(res);
\r
7367 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
7369 res = MASK_OUT_ABOVE_8(res);
\r
7372 m68ki_write_8(ea, res);
\r
7376 void m68k_op_subx_8_mm_ay7(void)
\r
7378 uint src = OPER_A7_PD_8();
\r
7379 uint ea = EA_AX_PD_8();
\r
7380 uint dst = m68ki_read_8(ea);
\r
7381 uint res = dst - src - XFLAG_AS_1();
\r
7383 FLAG_N = NFLAG_8(res);
\r
7384 FLAG_X = FLAG_C = CFLAG_8(res);
\r
7385 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
7387 res = MASK_OUT_ABOVE_8(res);
\r
7390 m68ki_write_8(ea, res);
\r
7394 void m68k_op_subx_8_mm_axy7(void)
\r
7396 uint src = OPER_A7_PD_8();
\r
7397 uint ea = EA_A7_PD_8();
\r
7398 uint dst = m68ki_read_8(ea);
\r
7399 uint res = dst - src - XFLAG_AS_1();
\r
7401 FLAG_N = NFLAG_8(res);
\r
7402 FLAG_X = FLAG_C = CFLAG_8(res);
\r
7403 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
7405 res = MASK_OUT_ABOVE_8(res);
\r
7408 m68ki_write_8(ea, res);
\r
7412 void m68k_op_subx_8_mm(void)
\r
7414 uint src = OPER_AY_PD_8();
\r
7415 uint ea = EA_AX_PD_8();
\r
7416 uint dst = m68ki_read_8(ea);
\r
7417 uint res = dst - src - XFLAG_AS_1();
\r
7419 FLAG_N = NFLAG_8(res);
\r
7420 FLAG_X = FLAG_C = CFLAG_8(res);
\r
7421 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
7423 res = MASK_OUT_ABOVE_8(res);
\r
7426 m68ki_write_8(ea, res);
\r
7430 void m68k_op_subx_16_mm(void)
\r
7432 uint src = OPER_AY_PD_16();
\r
7433 uint ea = EA_AX_PD_16();
\r
7434 uint dst = m68ki_read_16(ea);
\r
7435 uint res = dst - src - XFLAG_AS_1();
\r
7437 FLAG_N = NFLAG_16(res);
\r
7438 FLAG_X = FLAG_C = CFLAG_16(res);
\r
7439 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
7441 res = MASK_OUT_ABOVE_16(res);
\r
7444 m68ki_write_16(ea, res);
\r
7448 void m68k_op_subx_32_mm(void)
\r
7450 uint src = OPER_AY_PD_32();
\r
7451 uint ea = EA_AX_PD_32();
\r
7452 uint dst = m68ki_read_32(ea);
\r
7453 uint res = dst - src - XFLAG_AS_1();
\r
7455 FLAG_N = NFLAG_32(res);
\r
7456 FLAG_X = FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
7457 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
7459 res = MASK_OUT_ABOVE_32(res);
\r
7462 m68ki_write_32(ea, res);
\r
7466 void m68k_op_swap_32(void)
\r
7468 uint* r_dst = &DY;
\r
7470 FLAG_Z = MASK_OUT_ABOVE_32(*r_dst<<16);
\r
7471 *r_dst = (*r_dst>>16) | FLAG_Z;
\r
7474 FLAG_N = NFLAG_32(*r_dst);
\r
7475 FLAG_C = CFLAG_CLEAR;
\r
7476 FLAG_V = VFLAG_CLEAR;
\r
7480 void m68k_op_tas_8_d(void)
\r
7482 uint* r_dst = &DY;
\r
7484 FLAG_Z = MASK_OUT_ABOVE_8(*r_dst);
\r
7485 FLAG_N = NFLAG_8(*r_dst);
\r
7486 FLAG_V = VFLAG_CLEAR;
\r
7487 FLAG_C = CFLAG_CLEAR;
\r
7492 void m68k_op_tas_8_ai(void)
\r
7494 uint ea = EA_AY_AI_8();
\r
7495 uint dst = m68ki_read_8(ea);
\r
7498 FLAG_N = NFLAG_8(dst);
\r
7499 FLAG_V = VFLAG_CLEAR;
\r
7500 FLAG_C = CFLAG_CLEAR;
\r
7501 // m68ki_write_8(ea, dst | 0x80); // notaz: genesis, but only to mem
\r
7505 void m68k_op_tas_8_pi(void)
\r
7507 uint ea = EA_AY_PI_8();
\r
7508 uint dst = m68ki_read_8(ea);
\r
7511 FLAG_N = NFLAG_8(dst);
\r
7512 FLAG_V = VFLAG_CLEAR;
\r
7513 FLAG_C = CFLAG_CLEAR;
\r
7514 // m68ki_write_8(ea, dst | 0x80); // notaz: genesis, but only to mem
\r
7518 void m68k_op_tas_8_pi7(void)
\r
7520 uint ea = EA_A7_PI_8();
\r
7521 uint dst = m68ki_read_8(ea);
\r
7524 FLAG_N = NFLAG_8(dst);
\r
7525 FLAG_V = VFLAG_CLEAR;
\r
7526 FLAG_C = CFLAG_CLEAR;
\r
7527 // m68ki_write_8(ea, dst | 0x80); // notaz: genesis, but only to mem
\r
7531 void m68k_op_tas_8_pd(void)
\r
7533 uint ea = EA_AY_PD_8();
\r
7534 uint dst = m68ki_read_8(ea);
\r
7537 FLAG_N = NFLAG_8(dst);
\r
7538 FLAG_V = VFLAG_CLEAR;
\r
7539 FLAG_C = CFLAG_CLEAR;
\r
7540 // m68ki_write_8(ea, dst | 0x80); // notaz: genesis, but only to mem
\r
7544 void m68k_op_tas_8_pd7(void)
\r
7546 uint ea = EA_A7_PD_8();
\r
7547 uint dst = m68ki_read_8(ea);
\r
7550 FLAG_N = NFLAG_8(dst);
\r
7551 FLAG_V = VFLAG_CLEAR;
\r
7552 FLAG_C = CFLAG_CLEAR;
\r
7553 // m68ki_write_8(ea, dst | 0x80); // notaz: genesis, but only to mem
\r
7557 void m68k_op_tas_8_di(void)
\r
7559 uint ea = EA_AY_DI_8();
\r
7560 uint dst = m68ki_read_8(ea);
\r
7563 FLAG_N = NFLAG_8(dst);
\r
7564 FLAG_V = VFLAG_CLEAR;
\r
7565 FLAG_C = CFLAG_CLEAR;
\r
7566 // m68ki_write_8(ea, dst | 0x80); // notaz: genesis, but only to mem
\r
7570 void m68k_op_tas_8_ix(void)
\r
7572 uint ea = EA_AY_IX_8();
\r
7573 uint dst = m68ki_read_8(ea);
\r
7576 FLAG_N = NFLAG_8(dst);
\r
7577 FLAG_V = VFLAG_CLEAR;
\r
7578 FLAG_C = CFLAG_CLEAR;
\r
7579 // m68ki_write_8(ea, dst | 0x80); // notaz: genesis, but only to mem
\r
7583 void m68k_op_tas_8_aw(void)
\r
7585 uint ea = EA_AW_8();
\r
7586 uint dst = m68ki_read_8(ea);
\r
7589 FLAG_N = NFLAG_8(dst);
\r
7590 FLAG_V = VFLAG_CLEAR;
\r
7591 FLAG_C = CFLAG_CLEAR;
\r
7592 // m68ki_write_8(ea, dst | 0x80); // notaz: genesis, but only to mem
\r
7596 void m68k_op_tas_8_al(void)
\r
7598 uint ea = EA_AL_8();
\r
7599 uint dst = m68ki_read_8(ea);
\r
7602 FLAG_N = NFLAG_8(dst);
\r
7603 FLAG_V = VFLAG_CLEAR;
\r
7604 FLAG_C = CFLAG_CLEAR;
\r
7605 // m68ki_write_8(ea, dst | 0x80); // notaz: genesis, but only to mem
\r
7609 void m68k_op_trap(void)
\r
7611 /* Trap#n stacks exception frame type 0 */
\r
7612 m68ki_exception_trapN(EXCEPTION_TRAP_BASE + (REG_IR & 0xf)); /* HJB 990403 */
\r
7616 void m68k_op_trapt(void)
\r
7618 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7620 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7623 m68ki_exception_illegal();
\r
7627 void m68k_op_trapt_16(void)
\r
7629 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7631 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7634 m68ki_exception_illegal();
\r
7638 void m68k_op_trapt_32(void)
\r
7640 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7642 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7645 m68ki_exception_illegal();
\r
7649 void m68k_op_trapf(void)
\r
7651 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7655 m68ki_exception_illegal();
\r
7659 void m68k_op_trapf_16(void)
\r
7661 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7666 m68ki_exception_illegal();
\r
7670 void m68k_op_trapf_32(void)
\r
7672 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7677 m68ki_exception_illegal();
\r
7681 void m68k_op_traphi(void)
\r
7683 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7686 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7689 m68ki_exception_illegal();
\r
7693 void m68k_op_trapls(void)
\r
7695 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7698 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7701 m68ki_exception_illegal();
\r
7705 void m68k_op_trapcc(void)
\r
7707 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7710 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7713 m68ki_exception_illegal();
\r
7717 void m68k_op_trapcs(void)
\r
7719 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7722 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7725 m68ki_exception_illegal();
\r
7729 void m68k_op_trapne(void)
\r
7731 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7734 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7737 m68ki_exception_illegal();
\r
7741 void m68k_op_trapeq(void)
\r
7743 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7746 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7749 m68ki_exception_illegal();
\r
7753 void m68k_op_trapvc(void)
\r
7755 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7758 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7761 m68ki_exception_illegal();
\r
7765 void m68k_op_trapvs(void)
\r
7767 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7770 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7773 m68ki_exception_illegal();
\r
7777 void m68k_op_trappl(void)
\r
7779 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7782 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7785 m68ki_exception_illegal();
\r
7789 void m68k_op_trapmi(void)
\r
7791 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7794 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7797 m68ki_exception_illegal();
\r
7801 void m68k_op_trapge(void)
\r
7803 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7806 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7809 m68ki_exception_illegal();
\r
7813 void m68k_op_traplt(void)
\r
7815 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7818 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7821 m68ki_exception_illegal();
\r
7825 void m68k_op_trapgt(void)
\r
7827 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7830 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7833 m68ki_exception_illegal();
\r
7837 void m68k_op_traple(void)
\r
7839 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7842 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7845 m68ki_exception_illegal();
\r
7849 void m68k_op_traphi_16(void)
\r
7851 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7855 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7861 m68ki_exception_illegal();
\r
7865 void m68k_op_trapls_16(void)
\r
7867 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7871 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7877 m68ki_exception_illegal();
\r
7881 void m68k_op_trapcc_16(void)
\r
7883 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7887 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7893 m68ki_exception_illegal();
\r
7897 void m68k_op_trapcs_16(void)
\r
7899 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7903 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7909 m68ki_exception_illegal();
\r
7913 void m68k_op_trapne_16(void)
\r
7915 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7919 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7925 m68ki_exception_illegal();
\r
7929 void m68k_op_trapeq_16(void)
\r
7931 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7935 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7941 m68ki_exception_illegal();
\r
7945 void m68k_op_trapvc_16(void)
\r
7947 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7951 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7957 m68ki_exception_illegal();
\r
7961 void m68k_op_trapvs_16(void)
\r
7963 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7967 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7973 m68ki_exception_illegal();
\r
7977 void m68k_op_trappl_16(void)
\r
7979 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7983 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
7989 m68ki_exception_illegal();
\r
7993 void m68k_op_trapmi_16(void)
\r
7995 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7999 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
8005 m68ki_exception_illegal();
\r
8009 void m68k_op_trapge_16(void)
\r
8011 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8015 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
8021 m68ki_exception_illegal();
\r
8025 void m68k_op_traplt_16(void)
\r
8027 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8031 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
8037 m68ki_exception_illegal();
\r
8041 void m68k_op_trapgt_16(void)
\r
8043 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8047 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
8053 m68ki_exception_illegal();
\r
8057 void m68k_op_traple_16(void)
\r
8059 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8063 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
8069 m68ki_exception_illegal();
\r
8073 void m68k_op_traphi_32(void)
\r
8075 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8079 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
8085 m68ki_exception_illegal();
\r
8089 void m68k_op_trapls_32(void)
\r
8091 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8095 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
8101 m68ki_exception_illegal();
\r
8105 void m68k_op_trapcc_32(void)
\r
8107 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8111 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
8117 m68ki_exception_illegal();
\r
8121 void m68k_op_trapcs_32(void)
\r
8123 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8127 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
8133 m68ki_exception_illegal();
\r
8137 void m68k_op_trapne_32(void)
\r
8139 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8143 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
8149 m68ki_exception_illegal();
\r
8153 void m68k_op_trapeq_32(void)
\r
8155 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8159 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
8165 m68ki_exception_illegal();
\r
8169 void m68k_op_trapvc_32(void)
\r
8171 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8175 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
8181 m68ki_exception_illegal();
\r
8185 void m68k_op_trapvs_32(void)
\r
8187 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8191 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
8197 m68ki_exception_illegal();
\r
8201 void m68k_op_trappl_32(void)
\r
8203 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8207 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
8213 m68ki_exception_illegal();
\r
8217 void m68k_op_trapmi_32(void)
\r
8219 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8223 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
8229 m68ki_exception_illegal();
\r
8233 void m68k_op_trapge_32(void)
\r
8235 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8239 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
8245 m68ki_exception_illegal();
\r
8249 void m68k_op_traplt_32(void)
\r
8251 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8255 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
8261 m68ki_exception_illegal();
\r
8265 void m68k_op_trapgt_32(void)
\r
8267 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8271 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
8277 m68ki_exception_illegal();
\r
8281 void m68k_op_traple_32(void)
\r
8283 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8287 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
8293 m68ki_exception_illegal();
\r
8297 void m68k_op_trapv(void)
\r
8303 m68ki_exception_trap(EXCEPTION_TRAPV); /* HJB 990403 */
\r
8307 void m68k_op_tst_8_d(void)
\r
8309 uint res = MASK_OUT_ABOVE_8(DY);
\r
8311 FLAG_N = NFLAG_8(res);
\r
8313 FLAG_V = VFLAG_CLEAR;
\r
8314 FLAG_C = CFLAG_CLEAR;
\r
8318 void m68k_op_tst_8_ai(void)
\r
8320 uint res = OPER_AY_AI_8();
\r
8322 FLAG_N = NFLAG_8(res);
\r
8324 FLAG_V = VFLAG_CLEAR;
\r
8325 FLAG_C = CFLAG_CLEAR;
\r
8329 void m68k_op_tst_8_pi(void)
\r
8331 uint res = OPER_AY_PI_8();
\r
8333 FLAG_N = NFLAG_8(res);
\r
8335 FLAG_V = VFLAG_CLEAR;
\r
8336 FLAG_C = CFLAG_CLEAR;
\r
8340 void m68k_op_tst_8_pi7(void)
\r
8342 uint res = OPER_A7_PI_8();
\r
8344 FLAG_N = NFLAG_8(res);
\r
8346 FLAG_V = VFLAG_CLEAR;
\r
8347 FLAG_C = CFLAG_CLEAR;
\r
8351 void m68k_op_tst_8_pd(void)
\r
8353 uint res = OPER_AY_PD_8();
\r
8355 FLAG_N = NFLAG_8(res);
\r
8357 FLAG_V = VFLAG_CLEAR;
\r
8358 FLAG_C = CFLAG_CLEAR;
\r
8362 void m68k_op_tst_8_pd7(void)
\r
8364 uint res = OPER_A7_PD_8();
\r
8366 FLAG_N = NFLAG_8(res);
\r
8368 FLAG_V = VFLAG_CLEAR;
\r
8369 FLAG_C = CFLAG_CLEAR;
\r
8373 void m68k_op_tst_8_di(void)
\r
8375 uint res = OPER_AY_DI_8();
\r
8377 FLAG_N = NFLAG_8(res);
\r
8379 FLAG_V = VFLAG_CLEAR;
\r
8380 FLAG_C = CFLAG_CLEAR;
\r
8384 void m68k_op_tst_8_ix(void)
\r
8386 uint res = OPER_AY_IX_8();
\r
8388 FLAG_N = NFLAG_8(res);
\r
8390 FLAG_V = VFLAG_CLEAR;
\r
8391 FLAG_C = CFLAG_CLEAR;
\r
8395 void m68k_op_tst_8_aw(void)
\r
8397 uint res = OPER_AW_8();
\r
8399 FLAG_N = NFLAG_8(res);
\r
8401 FLAG_V = VFLAG_CLEAR;
\r
8402 FLAG_C = CFLAG_CLEAR;
\r
8406 void m68k_op_tst_8_al(void)
\r
8408 uint res = OPER_AL_8();
\r
8410 FLAG_N = NFLAG_8(res);
\r
8412 FLAG_V = VFLAG_CLEAR;
\r
8413 FLAG_C = CFLAG_CLEAR;
\r
8417 void m68k_op_tst_8_pcdi(void)
\r
8419 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8421 uint res = OPER_PCDI_8();
\r
8423 FLAG_N = NFLAG_8(res);
\r
8425 FLAG_V = VFLAG_CLEAR;
\r
8426 FLAG_C = CFLAG_CLEAR;
\r
8429 m68ki_exception_illegal();
\r
8433 void m68k_op_tst_8_pcix(void)
\r
8435 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8437 uint res = OPER_PCIX_8();
\r
8439 FLAG_N = NFLAG_8(res);
\r
8441 FLAG_V = VFLAG_CLEAR;
\r
8442 FLAG_C = CFLAG_CLEAR;
\r
8445 m68ki_exception_illegal();
\r
8449 void m68k_op_tst_8_i(void)
\r
8451 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8453 uint res = OPER_I_8();
\r
8455 FLAG_N = NFLAG_8(res);
\r
8457 FLAG_V = VFLAG_CLEAR;
\r
8458 FLAG_C = CFLAG_CLEAR;
\r
8461 m68ki_exception_illegal();
\r
8465 void m68k_op_tst_16_d(void)
\r
8467 uint res = MASK_OUT_ABOVE_16(DY);
\r
8469 FLAG_N = NFLAG_16(res);
\r
8471 FLAG_V = VFLAG_CLEAR;
\r
8472 FLAG_C = CFLAG_CLEAR;
\r
8476 void m68k_op_tst_16_a(void)
\r
8478 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8480 uint res = MAKE_INT_16(AY);
\r
8482 FLAG_N = NFLAG_16(res);
\r
8484 FLAG_V = VFLAG_CLEAR;
\r
8485 FLAG_C = CFLAG_CLEAR;
\r
8488 m68ki_exception_illegal();
\r
8492 void m68k_op_tst_16_ai(void)
\r
8494 uint res = OPER_AY_AI_16();
\r
8496 FLAG_N = NFLAG_16(res);
\r
8498 FLAG_V = VFLAG_CLEAR;
\r
8499 FLAG_C = CFLAG_CLEAR;
\r
8503 void m68k_op_tst_16_pi(void)
\r
8505 uint res = OPER_AY_PI_16();
\r
8507 FLAG_N = NFLAG_16(res);
\r
8509 FLAG_V = VFLAG_CLEAR;
\r
8510 FLAG_C = CFLAG_CLEAR;
\r
8514 void m68k_op_tst_16_pd(void)
\r
8516 uint res = OPER_AY_PD_16();
\r
8518 FLAG_N = NFLAG_16(res);
\r
8520 FLAG_V = VFLAG_CLEAR;
\r
8521 FLAG_C = CFLAG_CLEAR;
\r
8525 void m68k_op_tst_16_di(void)
\r
8527 uint res = OPER_AY_DI_16();
\r
8529 FLAG_N = NFLAG_16(res);
\r
8531 FLAG_V = VFLAG_CLEAR;
\r
8532 FLAG_C = CFLAG_CLEAR;
\r
8536 void m68k_op_tst_16_ix(void)
\r
8538 uint res = OPER_AY_IX_16();
\r
8540 FLAG_N = NFLAG_16(res);
\r
8542 FLAG_V = VFLAG_CLEAR;
\r
8543 FLAG_C = CFLAG_CLEAR;
\r
8547 void m68k_op_tst_16_aw(void)
\r
8549 uint res = OPER_AW_16();
\r
8551 FLAG_N = NFLAG_16(res);
\r
8553 FLAG_V = VFLAG_CLEAR;
\r
8554 FLAG_C = CFLAG_CLEAR;
\r
8558 void m68k_op_tst_16_al(void)
\r
8560 uint res = OPER_AL_16();
\r
8562 FLAG_N = NFLAG_16(res);
\r
8564 FLAG_V = VFLAG_CLEAR;
\r
8565 FLAG_C = CFLAG_CLEAR;
\r
8569 void m68k_op_tst_16_pcdi(void)
\r
8571 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8573 uint res = OPER_PCDI_16();
\r
8575 FLAG_N = NFLAG_16(res);
\r
8577 FLAG_V = VFLAG_CLEAR;
\r
8578 FLAG_C = CFLAG_CLEAR;
\r
8581 m68ki_exception_illegal();
\r
8585 void m68k_op_tst_16_pcix(void)
\r
8587 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8589 uint res = OPER_PCIX_16();
\r
8591 FLAG_N = NFLAG_16(res);
\r
8593 FLAG_V = VFLAG_CLEAR;
\r
8594 FLAG_C = CFLAG_CLEAR;
\r
8597 m68ki_exception_illegal();
\r
8601 void m68k_op_tst_16_i(void)
\r
8603 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8605 uint res = OPER_I_16();
\r
8607 FLAG_N = NFLAG_16(res);
\r
8609 FLAG_V = VFLAG_CLEAR;
\r
8610 FLAG_C = CFLAG_CLEAR;
\r
8613 m68ki_exception_illegal();
\r
8617 void m68k_op_tst_32_d(void)
\r
8621 FLAG_N = NFLAG_32(res);
\r
8623 FLAG_V = VFLAG_CLEAR;
\r
8624 FLAG_C = CFLAG_CLEAR;
\r
8628 void m68k_op_tst_32_a(void)
\r
8630 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8634 FLAG_N = NFLAG_32(res);
\r
8636 FLAG_V = VFLAG_CLEAR;
\r
8637 FLAG_C = CFLAG_CLEAR;
\r
8640 m68ki_exception_illegal();
\r
8644 void m68k_op_tst_32_ai(void)
\r
8646 uint res = OPER_AY_AI_32();
\r
8648 FLAG_N = NFLAG_32(res);
\r
8650 FLAG_V = VFLAG_CLEAR;
\r
8651 FLAG_C = CFLAG_CLEAR;
\r
8655 void m68k_op_tst_32_pi(void)
\r
8657 uint res = OPER_AY_PI_32();
\r
8659 FLAG_N = NFLAG_32(res);
\r
8661 FLAG_V = VFLAG_CLEAR;
\r
8662 FLAG_C = CFLAG_CLEAR;
\r
8666 void m68k_op_tst_32_pd(void)
\r
8668 uint res = OPER_AY_PD_32();
\r
8670 FLAG_N = NFLAG_32(res);
\r
8672 FLAG_V = VFLAG_CLEAR;
\r
8673 FLAG_C = CFLAG_CLEAR;
\r
8677 void m68k_op_tst_32_di(void)
\r
8679 uint res = OPER_AY_DI_32();
\r
8681 FLAG_N = NFLAG_32(res);
\r
8683 FLAG_V = VFLAG_CLEAR;
\r
8684 FLAG_C = CFLAG_CLEAR;
\r
8688 void m68k_op_tst_32_ix(void)
\r
8690 uint res = OPER_AY_IX_32();
\r
8692 FLAG_N = NFLAG_32(res);
\r
8694 FLAG_V = VFLAG_CLEAR;
\r
8695 FLAG_C = CFLAG_CLEAR;
\r
8699 void m68k_op_tst_32_aw(void)
\r
8701 uint res = OPER_AW_32();
\r
8703 FLAG_N = NFLAG_32(res);
\r
8705 FLAG_V = VFLAG_CLEAR;
\r
8706 FLAG_C = CFLAG_CLEAR;
\r
8710 void m68k_op_tst_32_al(void)
\r
8712 uint res = OPER_AL_32();
\r
8714 FLAG_N = NFLAG_32(res);
\r
8716 FLAG_V = VFLAG_CLEAR;
\r
8717 FLAG_C = CFLAG_CLEAR;
\r
8721 void m68k_op_tst_32_pcdi(void)
\r
8723 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8725 uint res = OPER_PCDI_32();
\r
8727 FLAG_N = NFLAG_32(res);
\r
8729 FLAG_V = VFLAG_CLEAR;
\r
8730 FLAG_C = CFLAG_CLEAR;
\r
8733 m68ki_exception_illegal();
\r
8737 void m68k_op_tst_32_pcix(void)
\r
8739 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8741 uint res = OPER_PCIX_32();
\r
8743 FLAG_N = NFLAG_32(res);
\r
8745 FLAG_V = VFLAG_CLEAR;
\r
8746 FLAG_C = CFLAG_CLEAR;
\r
8749 m68ki_exception_illegal();
\r
8753 void m68k_op_tst_32_i(void)
\r
8755 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8757 uint res = OPER_I_32();
\r
8759 FLAG_N = NFLAG_32(res);
\r
8761 FLAG_V = VFLAG_CLEAR;
\r
8762 FLAG_C = CFLAG_CLEAR;
\r
8765 m68ki_exception_illegal();
\r
8769 void m68k_op_unlk_32_a7(void)
\r
8771 REG_A[7] = m68ki_read_32(REG_A[7]);
\r
8775 void m68k_op_unlk_32(void)
\r
8777 uint* r_dst = &AY;
\r
8779 REG_A[7] = *r_dst;
\r
8780 *r_dst = m68ki_pull_32();
\r
8784 void m68k_op_unpk_16_rr(void)
\r
8786 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8788 /* Note: DX and DY are reversed in Motorola's docs */
\r
8790 uint* r_dst = &DX;
\r
8792 *r_dst = MASK_OUT_BELOW_16(*r_dst) | (((((src << 4) & 0x0f00) | (src & 0x000f)) + OPER_I_16()) & 0xffff);
\r
8795 m68ki_exception_illegal();
\r
8799 void m68k_op_unpk_16_mm_ax7(void)
\r
8801 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8803 /* Note: AX and AY are reversed in Motorola's docs */
\r
8804 uint src = OPER_AY_PD_8();
\r
8807 src = (((src << 4) & 0x0f00) | (src & 0x000f)) + OPER_I_16();
\r
8808 ea_dst = EA_A7_PD_8();
\r
8809 m68ki_write_8(ea_dst, (src >> 8) & 0xff);
\r
8810 ea_dst = EA_A7_PD_8();
\r
8811 m68ki_write_8(ea_dst, src & 0xff);
\r
8814 m68ki_exception_illegal();
\r
8818 void m68k_op_unpk_16_mm_ay7(void)
\r
8820 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8822 /* Note: AX and AY are reversed in Motorola's docs */
\r
8823 uint src = OPER_A7_PD_8();
\r
8826 src = (((src << 4) & 0x0f00) | (src & 0x000f)) + OPER_I_16();
\r
8827 ea_dst = EA_AX_PD_8();
\r
8828 m68ki_write_8(ea_dst, (src >> 8) & 0xff);
\r
8829 ea_dst = EA_AX_PD_8();
\r
8830 m68ki_write_8(ea_dst, src & 0xff);
\r
8833 m68ki_exception_illegal();
\r
8837 void m68k_op_unpk_16_mm_axy7(void)
\r
8839 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8841 uint src = OPER_A7_PD_8();
\r
8844 src = (((src << 4) & 0x0f00) | (src & 0x000f)) + OPER_I_16();
\r
8845 ea_dst = EA_A7_PD_8();
\r
8846 m68ki_write_8(ea_dst, (src >> 8) & 0xff);
\r
8847 ea_dst = EA_A7_PD_8();
\r
8848 m68ki_write_8(ea_dst, src & 0xff);
\r
8851 m68ki_exception_illegal();
\r
8855 void m68k_op_unpk_16_mm(void)
\r
8857 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8859 /* Note: AX and AY are reversed in Motorola's docs */
\r
8860 uint src = OPER_AY_PD_8();
\r
8863 src = (((src << 4) & 0x0f00) | (src & 0x000f)) + OPER_I_16();
\r
8864 ea_dst = EA_AX_PD_8();
\r
8865 m68ki_write_8(ea_dst, (src >> 8) & 0xff);
\r
8866 ea_dst = EA_AX_PD_8();
\r
8867 m68ki_write_8(ea_dst, src & 0xff);
\r
8870 m68ki_exception_illegal();
\r
8874 /* ======================================================================== */
\r
8875 /* ============================== END OF FILE ============================= */
\r
8876 /* ======================================================================== */
\r