3 /* ======================================================================== */
\r
4 /* ========================= INSTRUCTION HANDLERS ========================= */
\r
5 /* ======================================================================== */
\r
8 void m68k_op_1010(void)
\r
10 m68ki_exception_1010();
\r
14 void m68k_op_1111(void)
\r
16 m68ki_exception_1111();
\r
20 void m68k_op_abcd_8_rr(void)
\r
25 uint res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1();
\r
27 FLAG_V = ~res; /* Undefined V behavior */
\r
31 res += HIGH_NIBBLE(src) + HIGH_NIBBLE(dst);
\r
32 FLAG_X = FLAG_C = (res > 0x99) << 8;
\r
36 FLAG_V &= res; /* Undefined V behavior part II */
\r
37 FLAG_N = NFLAG_8(res); /* Undefined N behavior */
\r
39 res = MASK_OUT_ABOVE_8(res);
\r
42 *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
\r
46 void m68k_op_abcd_8_mm_ax7(void)
\r
48 uint src = OPER_AY_PD_8();
\r
49 uint ea = EA_A7_PD_8();
\r
50 uint dst = m68ki_read_8(ea);
\r
51 uint res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1();
\r
53 FLAG_V = ~res; /* Undefined V behavior */
\r
57 res += HIGH_NIBBLE(src) + HIGH_NIBBLE(dst);
\r
58 FLAG_X = FLAG_C = (res > 0x99) << 8;
\r
62 FLAG_V &= res; /* Undefined V behavior part II */
\r
63 FLAG_N = NFLAG_8(res); /* Undefined N behavior */
\r
65 res = MASK_OUT_ABOVE_8(res);
\r
68 m68ki_write_8(ea, res);
\r
72 void m68k_op_abcd_8_mm_ay7(void)
\r
74 uint src = OPER_A7_PD_8();
\r
75 uint ea = EA_AX_PD_8();
\r
76 uint dst = m68ki_read_8(ea);
\r
77 uint res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1();
\r
79 FLAG_V = ~res; /* Undefined V behavior */
\r
83 res += HIGH_NIBBLE(src) + HIGH_NIBBLE(dst);
\r
84 FLAG_X = FLAG_C = (res > 0x99) << 8;
\r
88 FLAG_V &= res; /* Undefined V behavior part II */
\r
89 FLAG_N = NFLAG_8(res); /* Undefined N behavior */
\r
91 res = MASK_OUT_ABOVE_8(res);
\r
94 m68ki_write_8(ea, res);
\r
98 void m68k_op_abcd_8_mm_axy7(void)
\r
100 uint src = OPER_A7_PD_8();
\r
101 uint ea = EA_A7_PD_8();
\r
102 uint dst = m68ki_read_8(ea);
\r
103 uint res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1();
\r
105 FLAG_V = ~res; /* Undefined V behavior */
\r
109 res += HIGH_NIBBLE(src) + HIGH_NIBBLE(dst);
\r
110 FLAG_X = FLAG_C = (res > 0x99) << 8;
\r
114 FLAG_V &= res; /* Undefined V behavior part II */
\r
115 FLAG_N = NFLAG_8(res); /* Undefined N behavior */
\r
117 res = MASK_OUT_ABOVE_8(res);
\r
120 m68ki_write_8(ea, res);
\r
124 void m68k_op_abcd_8_mm(void)
\r
126 uint src = OPER_AY_PD_8();
\r
127 uint ea = EA_AX_PD_8();
\r
128 uint dst = m68ki_read_8(ea);
\r
129 uint res = LOW_NIBBLE(src) + LOW_NIBBLE(dst) + XFLAG_AS_1();
\r
131 FLAG_V = ~res; /* Undefined V behavior */
\r
135 res += HIGH_NIBBLE(src) + HIGH_NIBBLE(dst);
\r
136 FLAG_X = FLAG_C = (res > 0x99) << 8;
\r
140 FLAG_V &= res; /* Undefined V behavior part II */
\r
141 FLAG_N = NFLAG_8(res); /* Undefined N behavior */
\r
143 res = MASK_OUT_ABOVE_8(res);
\r
146 m68ki_write_8(ea, res);
\r
150 void m68k_op_add_8_er_d(void)
\r
153 uint src = MASK_OUT_ABOVE_8(DY);
\r
154 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
155 uint res = src + dst;
\r
157 FLAG_N = NFLAG_8(res);
\r
158 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
159 FLAG_X = FLAG_C = CFLAG_8(res);
\r
160 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
162 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
166 void m68k_op_add_8_er_ai(void)
\r
169 uint src = OPER_AY_AI_8();
\r
170 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
171 uint res = src + dst;
\r
173 FLAG_N = NFLAG_8(res);
\r
174 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
175 FLAG_X = FLAG_C = CFLAG_8(res);
\r
176 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
178 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
182 void m68k_op_add_8_er_pi(void)
\r
185 uint src = OPER_AY_PI_8();
\r
186 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
187 uint res = src + dst;
\r
189 FLAG_N = NFLAG_8(res);
\r
190 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
191 FLAG_X = FLAG_C = CFLAG_8(res);
\r
192 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
194 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
198 void m68k_op_add_8_er_pi7(void)
\r
201 uint src = OPER_A7_PI_8();
\r
202 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
203 uint res = src + dst;
\r
205 FLAG_N = NFLAG_8(res);
\r
206 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
207 FLAG_X = FLAG_C = CFLAG_8(res);
\r
208 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
210 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
214 void m68k_op_add_8_er_pd(void)
\r
217 uint src = OPER_AY_PD_8();
\r
218 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
219 uint res = src + dst;
\r
221 FLAG_N = NFLAG_8(res);
\r
222 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
223 FLAG_X = FLAG_C = CFLAG_8(res);
\r
224 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
226 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
230 void m68k_op_add_8_er_pd7(void)
\r
233 uint src = OPER_A7_PD_8();
\r
234 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
235 uint res = src + dst;
\r
237 FLAG_N = NFLAG_8(res);
\r
238 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
239 FLAG_X = FLAG_C = CFLAG_8(res);
\r
240 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
242 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
246 void m68k_op_add_8_er_di(void)
\r
249 uint src = OPER_AY_DI_8();
\r
250 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
251 uint res = src + dst;
\r
253 FLAG_N = NFLAG_8(res);
\r
254 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
255 FLAG_X = FLAG_C = CFLAG_8(res);
\r
256 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
258 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
262 void m68k_op_add_8_er_ix(void)
\r
265 uint src = OPER_AY_IX_8();
\r
266 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
267 uint res = src + dst;
\r
269 FLAG_N = NFLAG_8(res);
\r
270 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
271 FLAG_X = FLAG_C = CFLAG_8(res);
\r
272 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
274 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
278 void m68k_op_add_8_er_aw(void)
\r
281 uint src = OPER_AW_8();
\r
282 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
283 uint res = src + dst;
\r
285 FLAG_N = NFLAG_8(res);
\r
286 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
287 FLAG_X = FLAG_C = CFLAG_8(res);
\r
288 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
290 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
294 void m68k_op_add_8_er_al(void)
\r
297 uint src = OPER_AL_8();
\r
298 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
299 uint res = src + dst;
\r
301 FLAG_N = NFLAG_8(res);
\r
302 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
303 FLAG_X = FLAG_C = CFLAG_8(res);
\r
304 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
306 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
310 void m68k_op_add_8_er_pcdi(void)
\r
313 uint src = OPER_PCDI_8();
\r
314 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
315 uint res = src + dst;
\r
317 FLAG_N = NFLAG_8(res);
\r
318 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
319 FLAG_X = FLAG_C = CFLAG_8(res);
\r
320 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
322 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
326 void m68k_op_add_8_er_pcix(void)
\r
329 uint src = OPER_PCIX_8();
\r
330 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
331 uint res = src + dst;
\r
333 FLAG_N = NFLAG_8(res);
\r
334 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
335 FLAG_X = FLAG_C = CFLAG_8(res);
\r
336 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
338 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
342 void m68k_op_add_8_er_i(void)
\r
345 uint src = OPER_I_8();
\r
346 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
347 uint res = src + dst;
\r
349 FLAG_N = NFLAG_8(res);
\r
350 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
351 FLAG_X = FLAG_C = CFLAG_8(res);
\r
352 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
354 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
358 void m68k_op_add_16_er_d(void)
\r
361 uint src = MASK_OUT_ABOVE_16(DY);
\r
362 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
363 uint res = src + dst;
\r
365 FLAG_N = NFLAG_16(res);
\r
366 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
367 FLAG_X = FLAG_C = CFLAG_16(res);
\r
368 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
370 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
374 void m68k_op_add_16_er_a(void)
\r
377 uint src = MASK_OUT_ABOVE_16(AY);
\r
378 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
379 uint res = src + dst;
\r
381 FLAG_N = NFLAG_16(res);
\r
382 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
383 FLAG_X = FLAG_C = CFLAG_16(res);
\r
384 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
386 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
390 void m68k_op_add_16_er_ai(void)
\r
393 uint src = OPER_AY_AI_16();
\r
394 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
395 uint res = src + dst;
\r
397 FLAG_N = NFLAG_16(res);
\r
398 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
399 FLAG_X = FLAG_C = CFLAG_16(res);
\r
400 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
402 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
406 void m68k_op_add_16_er_pi(void)
\r
409 uint src = OPER_AY_PI_16();
\r
410 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
411 uint res = src + dst;
\r
413 FLAG_N = NFLAG_16(res);
\r
414 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
415 FLAG_X = FLAG_C = CFLAG_16(res);
\r
416 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
418 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
422 void m68k_op_add_16_er_pd(void)
\r
425 uint src = OPER_AY_PD_16();
\r
426 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
427 uint res = src + dst;
\r
429 FLAG_N = NFLAG_16(res);
\r
430 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
431 FLAG_X = FLAG_C = CFLAG_16(res);
\r
432 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
434 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
438 void m68k_op_add_16_er_di(void)
\r
441 uint src = OPER_AY_DI_16();
\r
442 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
443 uint res = src + dst;
\r
445 FLAG_N = NFLAG_16(res);
\r
446 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
447 FLAG_X = FLAG_C = CFLAG_16(res);
\r
448 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
450 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
454 void m68k_op_add_16_er_ix(void)
\r
457 uint src = OPER_AY_IX_16();
\r
458 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
459 uint res = src + dst;
\r
461 FLAG_N = NFLAG_16(res);
\r
462 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
463 FLAG_X = FLAG_C = CFLAG_16(res);
\r
464 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
466 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
470 void m68k_op_add_16_er_aw(void)
\r
473 uint src = OPER_AW_16();
\r
474 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
475 uint res = src + dst;
\r
477 FLAG_N = NFLAG_16(res);
\r
478 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
479 FLAG_X = FLAG_C = CFLAG_16(res);
\r
480 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
482 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
486 void m68k_op_add_16_er_al(void)
\r
489 uint src = OPER_AL_16();
\r
490 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
491 uint res = src + dst;
\r
493 FLAG_N = NFLAG_16(res);
\r
494 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
495 FLAG_X = FLAG_C = CFLAG_16(res);
\r
496 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
498 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
502 void m68k_op_add_16_er_pcdi(void)
\r
505 uint src = OPER_PCDI_16();
\r
506 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
507 uint res = src + dst;
\r
509 FLAG_N = NFLAG_16(res);
\r
510 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
511 FLAG_X = FLAG_C = CFLAG_16(res);
\r
512 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
514 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
518 void m68k_op_add_16_er_pcix(void)
\r
521 uint src = OPER_PCIX_16();
\r
522 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
523 uint res = src + dst;
\r
525 FLAG_N = NFLAG_16(res);
\r
526 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
527 FLAG_X = FLAG_C = CFLAG_16(res);
\r
528 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
530 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
534 void m68k_op_add_16_er_i(void)
\r
537 uint src = OPER_I_16();
\r
538 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
539 uint res = src + dst;
\r
541 FLAG_N = NFLAG_16(res);
\r
542 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
543 FLAG_X = FLAG_C = CFLAG_16(res);
\r
544 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
546 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
550 void m68k_op_add_32_er_d(void)
\r
555 uint res = src + dst;
\r
557 FLAG_N = NFLAG_32(res);
\r
558 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
559 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
560 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
566 void m68k_op_add_32_er_a(void)
\r
571 uint res = src + dst;
\r
573 FLAG_N = NFLAG_32(res);
\r
574 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
575 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
576 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
582 void m68k_op_add_32_er_ai(void)
\r
585 uint src = OPER_AY_AI_32();
\r
587 uint res = src + dst;
\r
589 FLAG_N = NFLAG_32(res);
\r
590 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
591 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
592 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
598 void m68k_op_add_32_er_pi(void)
\r
601 uint src = OPER_AY_PI_32();
\r
603 uint res = src + dst;
\r
605 FLAG_N = NFLAG_32(res);
\r
606 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
607 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
608 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
614 void m68k_op_add_32_er_pd(void)
\r
617 uint src = OPER_AY_PD_32();
\r
619 uint res = src + dst;
\r
621 FLAG_N = NFLAG_32(res);
\r
622 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
623 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
624 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
630 void m68k_op_add_32_er_di(void)
\r
633 uint src = OPER_AY_DI_32();
\r
635 uint res = src + dst;
\r
637 FLAG_N = NFLAG_32(res);
\r
638 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
639 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
640 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
646 void m68k_op_add_32_er_ix(void)
\r
649 uint src = OPER_AY_IX_32();
\r
651 uint res = src + dst;
\r
653 FLAG_N = NFLAG_32(res);
\r
654 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
655 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
656 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
662 void m68k_op_add_32_er_aw(void)
\r
665 uint src = OPER_AW_32();
\r
667 uint res = src + dst;
\r
669 FLAG_N = NFLAG_32(res);
\r
670 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
671 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
672 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
678 void m68k_op_add_32_er_al(void)
\r
681 uint src = OPER_AL_32();
\r
683 uint res = src + dst;
\r
685 FLAG_N = NFLAG_32(res);
\r
686 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
687 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
688 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
694 void m68k_op_add_32_er_pcdi(void)
\r
697 uint src = OPER_PCDI_32();
\r
699 uint res = src + dst;
\r
701 FLAG_N = NFLAG_32(res);
\r
702 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
703 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
704 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
710 void m68k_op_add_32_er_pcix(void)
\r
713 uint src = OPER_PCIX_32();
\r
715 uint res = src + dst;
\r
717 FLAG_N = NFLAG_32(res);
\r
718 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
719 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
720 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
726 void m68k_op_add_32_er_i(void)
\r
729 uint src = OPER_I_32();
\r
731 uint res = src + dst;
\r
733 FLAG_N = NFLAG_32(res);
\r
734 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
735 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
736 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
742 void m68k_op_add_8_re_ai(void)
\r
744 uint ea = EA_AY_AI_8();
\r
745 uint src = MASK_OUT_ABOVE_8(DX);
\r
746 uint dst = m68ki_read_8(ea);
\r
747 uint res = src + dst;
\r
749 FLAG_N = NFLAG_8(res);
\r
750 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
751 FLAG_X = FLAG_C = CFLAG_8(res);
\r
752 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
754 m68ki_write_8(ea, FLAG_Z);
\r
758 void m68k_op_add_8_re_pi(void)
\r
760 uint ea = EA_AY_PI_8();
\r
761 uint src = MASK_OUT_ABOVE_8(DX);
\r
762 uint dst = m68ki_read_8(ea);
\r
763 uint res = src + dst;
\r
765 FLAG_N = NFLAG_8(res);
\r
766 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
767 FLAG_X = FLAG_C = CFLAG_8(res);
\r
768 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
770 m68ki_write_8(ea, FLAG_Z);
\r
774 void m68k_op_add_8_re_pi7(void)
\r
776 uint ea = EA_A7_PI_8();
\r
777 uint src = MASK_OUT_ABOVE_8(DX);
\r
778 uint dst = m68ki_read_8(ea);
\r
779 uint res = src + dst;
\r
781 FLAG_N = NFLAG_8(res);
\r
782 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
783 FLAG_X = FLAG_C = CFLAG_8(res);
\r
784 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
786 m68ki_write_8(ea, FLAG_Z);
\r
790 void m68k_op_add_8_re_pd(void)
\r
792 uint ea = EA_AY_PD_8();
\r
793 uint src = MASK_OUT_ABOVE_8(DX);
\r
794 uint dst = m68ki_read_8(ea);
\r
795 uint res = src + dst;
\r
797 FLAG_N = NFLAG_8(res);
\r
798 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
799 FLAG_X = FLAG_C = CFLAG_8(res);
\r
800 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
802 m68ki_write_8(ea, FLAG_Z);
\r
806 void m68k_op_add_8_re_pd7(void)
\r
808 uint ea = EA_A7_PD_8();
\r
809 uint src = MASK_OUT_ABOVE_8(DX);
\r
810 uint dst = m68ki_read_8(ea);
\r
811 uint res = src + dst;
\r
813 FLAG_N = NFLAG_8(res);
\r
814 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
815 FLAG_X = FLAG_C = CFLAG_8(res);
\r
816 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
818 m68ki_write_8(ea, FLAG_Z);
\r
822 void m68k_op_add_8_re_di(void)
\r
824 uint ea = EA_AY_DI_8();
\r
825 uint src = MASK_OUT_ABOVE_8(DX);
\r
826 uint dst = m68ki_read_8(ea);
\r
827 uint res = src + dst;
\r
829 FLAG_N = NFLAG_8(res);
\r
830 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
831 FLAG_X = FLAG_C = CFLAG_8(res);
\r
832 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
834 m68ki_write_8(ea, FLAG_Z);
\r
838 void m68k_op_add_8_re_ix(void)
\r
840 uint ea = EA_AY_IX_8();
\r
841 uint src = MASK_OUT_ABOVE_8(DX);
\r
842 uint dst = m68ki_read_8(ea);
\r
843 uint res = src + dst;
\r
845 FLAG_N = NFLAG_8(res);
\r
846 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
847 FLAG_X = FLAG_C = CFLAG_8(res);
\r
848 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
850 m68ki_write_8(ea, FLAG_Z);
\r
854 void m68k_op_add_8_re_aw(void)
\r
856 uint ea = EA_AW_8();
\r
857 uint src = MASK_OUT_ABOVE_8(DX);
\r
858 uint dst = m68ki_read_8(ea);
\r
859 uint res = src + dst;
\r
861 FLAG_N = NFLAG_8(res);
\r
862 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
863 FLAG_X = FLAG_C = CFLAG_8(res);
\r
864 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
866 m68ki_write_8(ea, FLAG_Z);
\r
870 void m68k_op_add_8_re_al(void)
\r
872 uint ea = EA_AL_8();
\r
873 uint src = MASK_OUT_ABOVE_8(DX);
\r
874 uint dst = m68ki_read_8(ea);
\r
875 uint res = src + dst;
\r
877 FLAG_N = NFLAG_8(res);
\r
878 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
879 FLAG_X = FLAG_C = CFLAG_8(res);
\r
880 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
882 m68ki_write_8(ea, FLAG_Z);
\r
886 void m68k_op_add_16_re_ai(void)
\r
888 uint ea = EA_AY_AI_16();
\r
889 uint src = MASK_OUT_ABOVE_16(DX);
\r
890 uint dst = m68ki_read_16(ea);
\r
891 uint res = src + dst;
\r
893 FLAG_N = NFLAG_16(res);
\r
894 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
895 FLAG_X = FLAG_C = CFLAG_16(res);
\r
896 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
898 m68ki_write_16(ea, FLAG_Z);
\r
902 void m68k_op_add_16_re_pi(void)
\r
904 uint ea = EA_AY_PI_16();
\r
905 uint src = MASK_OUT_ABOVE_16(DX);
\r
906 uint dst = m68ki_read_16(ea);
\r
907 uint res = src + dst;
\r
909 FLAG_N = NFLAG_16(res);
\r
910 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
911 FLAG_X = FLAG_C = CFLAG_16(res);
\r
912 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
914 m68ki_write_16(ea, FLAG_Z);
\r
918 void m68k_op_add_16_re_pd(void)
\r
920 uint ea = EA_AY_PD_16();
\r
921 uint src = MASK_OUT_ABOVE_16(DX);
\r
922 uint dst = m68ki_read_16(ea);
\r
923 uint res = src + dst;
\r
925 FLAG_N = NFLAG_16(res);
\r
926 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
927 FLAG_X = FLAG_C = CFLAG_16(res);
\r
928 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
930 m68ki_write_16(ea, FLAG_Z);
\r
934 void m68k_op_add_16_re_di(void)
\r
936 uint ea = EA_AY_DI_16();
\r
937 uint src = MASK_OUT_ABOVE_16(DX);
\r
938 uint dst = m68ki_read_16(ea);
\r
939 uint res = src + dst;
\r
941 FLAG_N = NFLAG_16(res);
\r
942 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
943 FLAG_X = FLAG_C = CFLAG_16(res);
\r
944 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
946 m68ki_write_16(ea, FLAG_Z);
\r
950 void m68k_op_add_16_re_ix(void)
\r
952 uint ea = EA_AY_IX_16();
\r
953 uint src = MASK_OUT_ABOVE_16(DX);
\r
954 uint dst = m68ki_read_16(ea);
\r
955 uint res = src + dst;
\r
957 FLAG_N = NFLAG_16(res);
\r
958 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
959 FLAG_X = FLAG_C = CFLAG_16(res);
\r
960 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
962 m68ki_write_16(ea, FLAG_Z);
\r
966 void m68k_op_add_16_re_aw(void)
\r
968 uint ea = EA_AW_16();
\r
969 uint src = MASK_OUT_ABOVE_16(DX);
\r
970 uint dst = m68ki_read_16(ea);
\r
971 uint res = src + dst;
\r
973 FLAG_N = NFLAG_16(res);
\r
974 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
975 FLAG_X = FLAG_C = CFLAG_16(res);
\r
976 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
978 m68ki_write_16(ea, FLAG_Z);
\r
982 void m68k_op_add_16_re_al(void)
\r
984 uint ea = EA_AL_16();
\r
985 uint src = MASK_OUT_ABOVE_16(DX);
\r
986 uint dst = m68ki_read_16(ea);
\r
987 uint res = src + dst;
\r
989 FLAG_N = NFLAG_16(res);
\r
990 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
991 FLAG_X = FLAG_C = CFLAG_16(res);
\r
992 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
994 m68ki_write_16(ea, FLAG_Z);
\r
998 void m68k_op_add_32_re_ai(void)
\r
1000 uint ea = EA_AY_AI_32();
\r
1002 uint dst = m68ki_read_32(ea);
\r
1003 uint res = src + dst;
\r
1005 FLAG_N = NFLAG_32(res);
\r
1006 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
1007 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
1008 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
1010 m68ki_write_32(ea, FLAG_Z);
\r
1014 void m68k_op_add_32_re_pi(void)
\r
1016 uint ea = EA_AY_PI_32();
\r
1018 uint dst = m68ki_read_32(ea);
\r
1019 uint res = src + dst;
\r
1021 FLAG_N = NFLAG_32(res);
\r
1022 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
1023 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
1024 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
1026 m68ki_write_32(ea, FLAG_Z);
\r
1030 void m68k_op_add_32_re_pd(void)
\r
1032 uint ea = EA_AY_PD_32();
\r
1034 uint dst = m68ki_read_32(ea);
\r
1035 uint res = src + dst;
\r
1037 FLAG_N = NFLAG_32(res);
\r
1038 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
1039 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
1040 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
1042 m68ki_write_32(ea, FLAG_Z);
\r
1046 void m68k_op_add_32_re_di(void)
\r
1048 uint ea = EA_AY_DI_32();
\r
1050 uint dst = m68ki_read_32(ea);
\r
1051 uint res = src + dst;
\r
1053 FLAG_N = NFLAG_32(res);
\r
1054 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
1055 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
1056 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
1058 m68ki_write_32(ea, FLAG_Z);
\r
1062 void m68k_op_add_32_re_ix(void)
\r
1064 uint ea = EA_AY_IX_32();
\r
1066 uint dst = m68ki_read_32(ea);
\r
1067 uint res = src + dst;
\r
1069 FLAG_N = NFLAG_32(res);
\r
1070 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
1071 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
1072 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
1074 m68ki_write_32(ea, FLAG_Z);
\r
1078 void m68k_op_add_32_re_aw(void)
\r
1080 uint ea = EA_AW_32();
\r
1082 uint dst = m68ki_read_32(ea);
\r
1083 uint res = src + dst;
\r
1085 FLAG_N = NFLAG_32(res);
\r
1086 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
1087 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
1088 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
1090 m68ki_write_32(ea, FLAG_Z);
\r
1094 void m68k_op_add_32_re_al(void)
\r
1096 uint ea = EA_AL_32();
\r
1098 uint dst = m68ki_read_32(ea);
\r
1099 uint res = src + dst;
\r
1101 FLAG_N = NFLAG_32(res);
\r
1102 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
1103 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
1104 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
1106 m68ki_write_32(ea, FLAG_Z);
\r
1110 void m68k_op_adda_16_d(void)
\r
1112 uint* r_dst = &AX;
\r
1114 *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(DY));
\r
1118 void m68k_op_adda_16_a(void)
\r
1120 uint* r_dst = &AX;
\r
1122 *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(AY));
\r
1126 void m68k_op_adda_16_ai(void)
\r
1128 uint* r_dst = &AX;
\r
1130 *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(OPER_AY_AI_16()));
\r
1134 void m68k_op_adda_16_pi(void)
\r
1136 uint* r_dst = &AX;
\r
1138 *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(OPER_AY_PI_16()));
\r
1142 void m68k_op_adda_16_pd(void)
\r
1144 uint* r_dst = &AX;
\r
1146 *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(OPER_AY_PD_16()));
\r
1150 void m68k_op_adda_16_di(void)
\r
1152 uint* r_dst = &AX;
\r
1154 *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(OPER_AY_DI_16()));
\r
1158 void m68k_op_adda_16_ix(void)
\r
1160 uint* r_dst = &AX;
\r
1162 *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(OPER_AY_IX_16()));
\r
1166 void m68k_op_adda_16_aw(void)
\r
1168 uint* r_dst = &AX;
\r
1170 *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(OPER_AW_16()));
\r
1174 void m68k_op_adda_16_al(void)
\r
1176 uint* r_dst = &AX;
\r
1178 *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(OPER_AL_16()));
\r
1182 void m68k_op_adda_16_pcdi(void)
\r
1184 uint* r_dst = &AX;
\r
1186 *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(OPER_PCDI_16()));
\r
1190 void m68k_op_adda_16_pcix(void)
\r
1192 uint* r_dst = &AX;
\r
1194 *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(OPER_PCIX_16()));
\r
1198 void m68k_op_adda_16_i(void)
\r
1200 uint* r_dst = &AX;
\r
1202 *r_dst = MASK_OUT_ABOVE_32(*r_dst + MAKE_INT_16(OPER_I_16()));
\r
1206 void m68k_op_adda_32_d(void)
\r
1208 uint* r_dst = &AX;
\r
1210 *r_dst = MASK_OUT_ABOVE_32(*r_dst + DY);
\r
1214 void m68k_op_adda_32_a(void)
\r
1216 uint* r_dst = &AX;
\r
1218 *r_dst = MASK_OUT_ABOVE_32(*r_dst + AY);
\r
1222 void m68k_op_adda_32_ai(void)
\r
1224 uint* r_dst = &AX;
\r
1226 *r_dst = MASK_OUT_ABOVE_32(*r_dst + OPER_AY_AI_32());
\r
1230 void m68k_op_adda_32_pi(void)
\r
1232 uint* r_dst = &AX;
\r
1234 *r_dst = MASK_OUT_ABOVE_32(*r_dst + OPER_AY_PI_32());
\r
1238 void m68k_op_adda_32_pd(void)
\r
1240 uint* r_dst = &AX;
\r
1242 *r_dst = MASK_OUT_ABOVE_32(*r_dst + OPER_AY_PD_32());
\r
1246 void m68k_op_adda_32_di(void)
\r
1248 uint* r_dst = &AX;
\r
1250 *r_dst = MASK_OUT_ABOVE_32(*r_dst + OPER_AY_DI_32());
\r
1254 void m68k_op_adda_32_ix(void)
\r
1256 uint* r_dst = &AX;
\r
1258 *r_dst = MASK_OUT_ABOVE_32(*r_dst + OPER_AY_IX_32());
\r
1262 void m68k_op_adda_32_aw(void)
\r
1264 uint* r_dst = &AX;
\r
1266 *r_dst = MASK_OUT_ABOVE_32(*r_dst + OPER_AW_32());
\r
1270 void m68k_op_adda_32_al(void)
\r
1272 uint* r_dst = &AX;
\r
1274 *r_dst = MASK_OUT_ABOVE_32(*r_dst + OPER_AL_32());
\r
1278 void m68k_op_adda_32_pcdi(void)
\r
1280 uint* r_dst = &AX;
\r
1282 *r_dst = MASK_OUT_ABOVE_32(*r_dst + OPER_PCDI_32());
\r
1286 void m68k_op_adda_32_pcix(void)
\r
1288 uint* r_dst = &AX;
\r
1290 *r_dst = MASK_OUT_ABOVE_32(*r_dst + OPER_PCIX_32());
\r
1294 void m68k_op_adda_32_i(void)
\r
1296 uint* r_dst = &AX;
\r
1298 *r_dst = MASK_OUT_ABOVE_32(*r_dst + OPER_I_32());
\r
1302 void m68k_op_addi_8_d(void)
\r
1304 uint* r_dst = &DY;
\r
1305 uint src = OPER_I_8();
\r
1306 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
1307 uint res = src + dst;
\r
1309 FLAG_N = NFLAG_8(res);
\r
1310 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
1311 FLAG_X = FLAG_C = CFLAG_8(res);
\r
1312 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
1314 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
1318 void m68k_op_addi_8_ai(void)
\r
1320 uint src = OPER_I_8();
\r
1321 uint ea = EA_AY_AI_8();
\r
1322 uint dst = m68ki_read_8(ea);
\r
1323 uint res = src + dst;
\r
1325 FLAG_N = NFLAG_8(res);
\r
1326 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
1327 FLAG_X = FLAG_C = CFLAG_8(res);
\r
1328 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
1330 m68ki_write_8(ea, FLAG_Z);
\r
1334 void m68k_op_addi_8_pi(void)
\r
1336 uint src = OPER_I_8();
\r
1337 uint ea = EA_AY_PI_8();
\r
1338 uint dst = m68ki_read_8(ea);
\r
1339 uint res = src + dst;
\r
1341 FLAG_N = NFLAG_8(res);
\r
1342 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
1343 FLAG_X = FLAG_C = CFLAG_8(res);
\r
1344 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
1346 m68ki_write_8(ea, FLAG_Z);
\r
1350 void m68k_op_addi_8_pi7(void)
\r
1352 uint src = OPER_I_8();
\r
1353 uint ea = EA_A7_PI_8();
\r
1354 uint dst = m68ki_read_8(ea);
\r
1355 uint res = src + dst;
\r
1357 FLAG_N = NFLAG_8(res);
\r
1358 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
1359 FLAG_X = FLAG_C = CFLAG_8(res);
\r
1360 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
1362 m68ki_write_8(ea, FLAG_Z);
\r
1366 void m68k_op_addi_8_pd(void)
\r
1368 uint src = OPER_I_8();
\r
1369 uint ea = EA_AY_PD_8();
\r
1370 uint dst = m68ki_read_8(ea);
\r
1371 uint res = src + dst;
\r
1373 FLAG_N = NFLAG_8(res);
\r
1374 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
1375 FLAG_X = FLAG_C = CFLAG_8(res);
\r
1376 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
1378 m68ki_write_8(ea, FLAG_Z);
\r
1382 void m68k_op_addi_8_pd7(void)
\r
1384 uint src = OPER_I_8();
\r
1385 uint ea = EA_A7_PD_8();
\r
1386 uint dst = m68ki_read_8(ea);
\r
1387 uint res = src + dst;
\r
1389 FLAG_N = NFLAG_8(res);
\r
1390 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
1391 FLAG_X = FLAG_C = CFLAG_8(res);
\r
1392 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
1394 m68ki_write_8(ea, FLAG_Z);
\r
1398 void m68k_op_addi_8_di(void)
\r
1400 uint src = OPER_I_8();
\r
1401 uint ea = EA_AY_DI_8();
\r
1402 uint dst = m68ki_read_8(ea);
\r
1403 uint res = src + dst;
\r
1405 FLAG_N = NFLAG_8(res);
\r
1406 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
1407 FLAG_X = FLAG_C = CFLAG_8(res);
\r
1408 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
1410 m68ki_write_8(ea, FLAG_Z);
\r
1414 void m68k_op_addi_8_ix(void)
\r
1416 uint src = OPER_I_8();
\r
1417 uint ea = EA_AY_IX_8();
\r
1418 uint dst = m68ki_read_8(ea);
\r
1419 uint res = src + dst;
\r
1421 FLAG_N = NFLAG_8(res);
\r
1422 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
1423 FLAG_X = FLAG_C = CFLAG_8(res);
\r
1424 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
1426 m68ki_write_8(ea, FLAG_Z);
\r
1430 void m68k_op_addi_8_aw(void)
\r
1432 uint src = OPER_I_8();
\r
1433 uint ea = EA_AW_8();
\r
1434 uint dst = m68ki_read_8(ea);
\r
1435 uint res = src + dst;
\r
1437 FLAG_N = NFLAG_8(res);
\r
1438 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
1439 FLAG_X = FLAG_C = CFLAG_8(res);
\r
1440 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
1442 m68ki_write_8(ea, FLAG_Z);
\r
1446 void m68k_op_addi_8_al(void)
\r
1448 uint src = OPER_I_8();
\r
1449 uint ea = EA_AL_8();
\r
1450 uint dst = m68ki_read_8(ea);
\r
1451 uint res = src + dst;
\r
1453 FLAG_N = NFLAG_8(res);
\r
1454 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
1455 FLAG_X = FLAG_C = CFLAG_8(res);
\r
1456 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
1458 m68ki_write_8(ea, FLAG_Z);
\r
1462 void m68k_op_addi_16_d(void)
\r
1464 uint* r_dst = &DY;
\r
1465 uint src = OPER_I_16();
\r
1466 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
1467 uint res = src + dst;
\r
1469 FLAG_N = NFLAG_16(res);
\r
1470 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
1471 FLAG_X = FLAG_C = CFLAG_16(res);
\r
1472 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
1474 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
1478 void m68k_op_addi_16_ai(void)
\r
1480 uint src = OPER_I_16();
\r
1481 uint ea = EA_AY_AI_16();
\r
1482 uint dst = m68ki_read_16(ea);
\r
1483 uint res = src + dst;
\r
1485 FLAG_N = NFLAG_16(res);
\r
1486 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
1487 FLAG_X = FLAG_C = CFLAG_16(res);
\r
1488 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
1490 m68ki_write_16(ea, FLAG_Z);
\r
1494 void m68k_op_addi_16_pi(void)
\r
1496 uint src = OPER_I_16();
\r
1497 uint ea = EA_AY_PI_16();
\r
1498 uint dst = m68ki_read_16(ea);
\r
1499 uint res = src + dst;
\r
1501 FLAG_N = NFLAG_16(res);
\r
1502 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
1503 FLAG_X = FLAG_C = CFLAG_16(res);
\r
1504 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
1506 m68ki_write_16(ea, FLAG_Z);
\r
1510 void m68k_op_addi_16_pd(void)
\r
1512 uint src = OPER_I_16();
\r
1513 uint ea = EA_AY_PD_16();
\r
1514 uint dst = m68ki_read_16(ea);
\r
1515 uint res = src + dst;
\r
1517 FLAG_N = NFLAG_16(res);
\r
1518 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
1519 FLAG_X = FLAG_C = CFLAG_16(res);
\r
1520 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
1522 m68ki_write_16(ea, FLAG_Z);
\r
1526 void m68k_op_addi_16_di(void)
\r
1528 uint src = OPER_I_16();
\r
1529 uint ea = EA_AY_DI_16();
\r
1530 uint dst = m68ki_read_16(ea);
\r
1531 uint res = src + dst;
\r
1533 FLAG_N = NFLAG_16(res);
\r
1534 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
1535 FLAG_X = FLAG_C = CFLAG_16(res);
\r
1536 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
1538 m68ki_write_16(ea, FLAG_Z);
\r
1542 void m68k_op_addi_16_ix(void)
\r
1544 uint src = OPER_I_16();
\r
1545 uint ea = EA_AY_IX_16();
\r
1546 uint dst = m68ki_read_16(ea);
\r
1547 uint res = src + dst;
\r
1549 FLAG_N = NFLAG_16(res);
\r
1550 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
1551 FLAG_X = FLAG_C = CFLAG_16(res);
\r
1552 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
1554 m68ki_write_16(ea, FLAG_Z);
\r
1558 void m68k_op_addi_16_aw(void)
\r
1560 uint src = OPER_I_16();
\r
1561 uint ea = EA_AW_16();
\r
1562 uint dst = m68ki_read_16(ea);
\r
1563 uint res = src + dst;
\r
1565 FLAG_N = NFLAG_16(res);
\r
1566 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
1567 FLAG_X = FLAG_C = CFLAG_16(res);
\r
1568 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
1570 m68ki_write_16(ea, FLAG_Z);
\r
1574 void m68k_op_addi_16_al(void)
\r
1576 uint src = OPER_I_16();
\r
1577 uint ea = EA_AL_16();
\r
1578 uint dst = m68ki_read_16(ea);
\r
1579 uint res = src + dst;
\r
1581 FLAG_N = NFLAG_16(res);
\r
1582 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
1583 FLAG_X = FLAG_C = CFLAG_16(res);
\r
1584 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
1586 m68ki_write_16(ea, FLAG_Z);
\r
1590 void m68k_op_addi_32_d(void)
\r
1592 uint* r_dst = &DY;
\r
1593 uint src = OPER_I_32();
\r
1594 uint dst = *r_dst;
\r
1595 uint res = src + dst;
\r
1597 FLAG_N = NFLAG_32(res);
\r
1598 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
1599 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
1600 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
1606 void m68k_op_addi_32_ai(void)
\r
1608 uint src = OPER_I_32();
\r
1609 uint ea = EA_AY_AI_32();
\r
1610 uint dst = m68ki_read_32(ea);
\r
1611 uint res = src + dst;
\r
1613 FLAG_N = NFLAG_32(res);
\r
1614 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
1615 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
1616 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
1618 m68ki_write_32(ea, FLAG_Z);
\r
1622 void m68k_op_addi_32_pi(void)
\r
1624 uint src = OPER_I_32();
\r
1625 uint ea = EA_AY_PI_32();
\r
1626 uint dst = m68ki_read_32(ea);
\r
1627 uint res = src + dst;
\r
1629 FLAG_N = NFLAG_32(res);
\r
1630 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
1631 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
1632 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
1634 m68ki_write_32(ea, FLAG_Z);
\r
1638 void m68k_op_addi_32_pd(void)
\r
1640 uint src = OPER_I_32();
\r
1641 uint ea = EA_AY_PD_32();
\r
1642 uint dst = m68ki_read_32(ea);
\r
1643 uint res = src + dst;
\r
1645 FLAG_N = NFLAG_32(res);
\r
1646 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
1647 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
1648 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
1650 m68ki_write_32(ea, FLAG_Z);
\r
1654 void m68k_op_addi_32_di(void)
\r
1656 uint src = OPER_I_32();
\r
1657 uint ea = EA_AY_DI_32();
\r
1658 uint dst = m68ki_read_32(ea);
\r
1659 uint res = src + dst;
\r
1661 FLAG_N = NFLAG_32(res);
\r
1662 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
1663 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
1664 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
1666 m68ki_write_32(ea, FLAG_Z);
\r
1670 void m68k_op_addi_32_ix(void)
\r
1672 uint src = OPER_I_32();
\r
1673 uint ea = EA_AY_IX_32();
\r
1674 uint dst = m68ki_read_32(ea);
\r
1675 uint res = src + dst;
\r
1677 FLAG_N = NFLAG_32(res);
\r
1678 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
1679 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
1680 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
1682 m68ki_write_32(ea, FLAG_Z);
\r
1686 void m68k_op_addi_32_aw(void)
\r
1688 uint src = OPER_I_32();
\r
1689 uint ea = EA_AW_32();
\r
1690 uint dst = m68ki_read_32(ea);
\r
1691 uint res = src + dst;
\r
1693 FLAG_N = NFLAG_32(res);
\r
1694 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
1695 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
1696 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
1698 m68ki_write_32(ea, FLAG_Z);
\r
1702 void m68k_op_addi_32_al(void)
\r
1704 uint src = OPER_I_32();
\r
1705 uint ea = EA_AL_32();
\r
1706 uint dst = m68ki_read_32(ea);
\r
1707 uint res = src + dst;
\r
1709 FLAG_N = NFLAG_32(res);
\r
1710 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
1711 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
1712 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
1714 m68ki_write_32(ea, FLAG_Z);
\r
1718 void m68k_op_addq_8_d(void)
\r
1720 uint* r_dst = &DY;
\r
1721 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
1722 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
1723 uint res = src + dst;
\r
1725 FLAG_N = NFLAG_8(res);
\r
1726 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
1727 FLAG_X = FLAG_C = CFLAG_8(res);
\r
1728 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
1730 *r_dst = MASK_OUT_BELOW_8(*r_dst) | FLAG_Z;
\r
1734 void m68k_op_addq_8_ai(void)
\r
1736 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
1737 uint ea = EA_AY_AI_8();
\r
1738 uint dst = m68ki_read_8(ea);
\r
1739 uint res = src + dst;
\r
1741 FLAG_N = NFLAG_8(res);
\r
1742 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
1743 FLAG_X = FLAG_C = CFLAG_8(res);
\r
1744 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
1746 m68ki_write_8(ea, FLAG_Z);
\r
1750 void m68k_op_addq_8_pi(void)
\r
1752 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
1753 uint ea = EA_AY_PI_8();
\r
1754 uint dst = m68ki_read_8(ea);
\r
1755 uint res = src + dst;
\r
1757 FLAG_N = NFLAG_8(res);
\r
1758 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
1759 FLAG_X = FLAG_C = CFLAG_8(res);
\r
1760 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
1762 m68ki_write_8(ea, FLAG_Z);
\r
1766 void m68k_op_addq_8_pi7(void)
\r
1768 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
1769 uint ea = EA_A7_PI_8();
\r
1770 uint dst = m68ki_read_8(ea);
\r
1771 uint res = src + dst;
\r
1773 FLAG_N = NFLAG_8(res);
\r
1774 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
1775 FLAG_X = FLAG_C = CFLAG_8(res);
\r
1776 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
1778 m68ki_write_8(ea, FLAG_Z);
\r
1782 void m68k_op_addq_8_pd(void)
\r
1784 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
1785 uint ea = EA_AY_PD_8();
\r
1786 uint dst = m68ki_read_8(ea);
\r
1787 uint res = src + dst;
\r
1789 FLAG_N = NFLAG_8(res);
\r
1790 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
1791 FLAG_X = FLAG_C = CFLAG_8(res);
\r
1792 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
1794 m68ki_write_8(ea, FLAG_Z);
\r
1798 void m68k_op_addq_8_pd7(void)
\r
1800 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
1801 uint ea = EA_A7_PD_8();
\r
1802 uint dst = m68ki_read_8(ea);
\r
1803 uint res = src + dst;
\r
1805 FLAG_N = NFLAG_8(res);
\r
1806 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
1807 FLAG_X = FLAG_C = CFLAG_8(res);
\r
1808 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
1810 m68ki_write_8(ea, FLAG_Z);
\r
1814 void m68k_op_addq_8_di(void)
\r
1816 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
1817 uint ea = EA_AY_DI_8();
\r
1818 uint dst = m68ki_read_8(ea);
\r
1819 uint res = src + dst;
\r
1821 FLAG_N = NFLAG_8(res);
\r
1822 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
1823 FLAG_X = FLAG_C = CFLAG_8(res);
\r
1824 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
1826 m68ki_write_8(ea, FLAG_Z);
\r
1830 void m68k_op_addq_8_ix(void)
\r
1832 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
1833 uint ea = EA_AY_IX_8();
\r
1834 uint dst = m68ki_read_8(ea);
\r
1835 uint res = src + dst;
\r
1837 FLAG_N = NFLAG_8(res);
\r
1838 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
1839 FLAG_X = FLAG_C = CFLAG_8(res);
\r
1840 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
1842 m68ki_write_8(ea, FLAG_Z);
\r
1846 void m68k_op_addq_8_aw(void)
\r
1848 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
1849 uint ea = EA_AW_8();
\r
1850 uint dst = m68ki_read_8(ea);
\r
1851 uint res = src + dst;
\r
1853 FLAG_N = NFLAG_8(res);
\r
1854 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
1855 FLAG_X = FLAG_C = CFLAG_8(res);
\r
1856 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
1858 m68ki_write_8(ea, FLAG_Z);
\r
1862 void m68k_op_addq_8_al(void)
\r
1864 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
1865 uint ea = EA_AL_8();
\r
1866 uint dst = m68ki_read_8(ea);
\r
1867 uint res = src + dst;
\r
1869 FLAG_N = NFLAG_8(res);
\r
1870 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
1871 FLAG_X = FLAG_C = CFLAG_8(res);
\r
1872 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
1874 m68ki_write_8(ea, FLAG_Z);
\r
1878 void m68k_op_addq_16_d(void)
\r
1880 uint* r_dst = &DY;
\r
1881 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
1882 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
1883 uint res = src + dst;
\r
1885 FLAG_N = NFLAG_16(res);
\r
1886 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
1887 FLAG_X = FLAG_C = CFLAG_16(res);
\r
1888 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
1890 *r_dst = MASK_OUT_BELOW_16(*r_dst) | FLAG_Z;
\r
1894 void m68k_op_addq_16_a(void)
\r
1896 uint* r_dst = &AY;
\r
1898 *r_dst = MASK_OUT_ABOVE_32(*r_dst + (((REG_IR >> 9) - 1) & 7) + 1);
\r
1902 void m68k_op_addq_16_ai(void)
\r
1904 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
1905 uint ea = EA_AY_AI_16();
\r
1906 uint dst = m68ki_read_16(ea);
\r
1907 uint res = src + dst;
\r
1909 FLAG_N = NFLAG_16(res);
\r
1910 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
1911 FLAG_X = FLAG_C = CFLAG_16(res);
\r
1912 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
1914 m68ki_write_16(ea, FLAG_Z);
\r
1918 void m68k_op_addq_16_pi(void)
\r
1920 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
1921 uint ea = EA_AY_PI_16();
\r
1922 uint dst = m68ki_read_16(ea);
\r
1923 uint res = src + dst;
\r
1925 FLAG_N = NFLAG_16(res);
\r
1926 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
1927 FLAG_X = FLAG_C = CFLAG_16(res);
\r
1928 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
1930 m68ki_write_16(ea, FLAG_Z);
\r
1934 void m68k_op_addq_16_pd(void)
\r
1936 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
1937 uint ea = EA_AY_PD_16();
\r
1938 uint dst = m68ki_read_16(ea);
\r
1939 uint res = src + dst;
\r
1941 FLAG_N = NFLAG_16(res);
\r
1942 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
1943 FLAG_X = FLAG_C = CFLAG_16(res);
\r
1944 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
1946 m68ki_write_16(ea, FLAG_Z);
\r
1950 void m68k_op_addq_16_di(void)
\r
1952 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
1953 uint ea = EA_AY_DI_16();
\r
1954 uint dst = m68ki_read_16(ea);
\r
1955 uint res = src + dst;
\r
1957 FLAG_N = NFLAG_16(res);
\r
1958 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
1959 FLAG_X = FLAG_C = CFLAG_16(res);
\r
1960 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
1962 m68ki_write_16(ea, FLAG_Z);
\r
1966 void m68k_op_addq_16_ix(void)
\r
1968 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
1969 uint ea = EA_AY_IX_16();
\r
1970 uint dst = m68ki_read_16(ea);
\r
1971 uint res = src + dst;
\r
1973 FLAG_N = NFLAG_16(res);
\r
1974 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
1975 FLAG_X = FLAG_C = CFLAG_16(res);
\r
1976 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
1978 m68ki_write_16(ea, FLAG_Z);
\r
1982 void m68k_op_addq_16_aw(void)
\r
1984 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
1985 uint ea = EA_AW_16();
\r
1986 uint dst = m68ki_read_16(ea);
\r
1987 uint res = src + dst;
\r
1989 FLAG_N = NFLAG_16(res);
\r
1990 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
1991 FLAG_X = FLAG_C = CFLAG_16(res);
\r
1992 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
1994 m68ki_write_16(ea, FLAG_Z);
\r
1998 void m68k_op_addq_16_al(void)
\r
2000 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
2001 uint ea = EA_AL_16();
\r
2002 uint dst = m68ki_read_16(ea);
\r
2003 uint res = src + dst;
\r
2005 FLAG_N = NFLAG_16(res);
\r
2006 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
2007 FLAG_X = FLAG_C = CFLAG_16(res);
\r
2008 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
2010 m68ki_write_16(ea, FLAG_Z);
\r
2014 void m68k_op_addq_32_d(void)
\r
2016 uint* r_dst = &DY;
\r
2017 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
2018 uint dst = *r_dst;
\r
2019 uint res = src + dst;
\r
2021 FLAG_N = NFLAG_32(res);
\r
2022 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
2023 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
2024 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
2030 void m68k_op_addq_32_a(void)
\r
2032 uint* r_dst = &AY;
\r
2034 *r_dst = MASK_OUT_ABOVE_32(*r_dst + (((REG_IR >> 9) - 1) & 7) + 1);
\r
2038 void m68k_op_addq_32_ai(void)
\r
2040 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
2041 uint ea = EA_AY_AI_32();
\r
2042 uint dst = m68ki_read_32(ea);
\r
2043 uint res = src + dst;
\r
2046 FLAG_N = NFLAG_32(res);
\r
2047 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
2048 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
2049 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
2051 m68ki_write_32(ea, FLAG_Z);
\r
2055 void m68k_op_addq_32_pi(void)
\r
2057 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
2058 uint ea = EA_AY_PI_32();
\r
2059 uint dst = m68ki_read_32(ea);
\r
2060 uint res = src + dst;
\r
2063 FLAG_N = NFLAG_32(res);
\r
2064 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
2065 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
2066 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
2068 m68ki_write_32(ea, FLAG_Z);
\r
2072 void m68k_op_addq_32_pd(void)
\r
2074 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
2075 uint ea = EA_AY_PD_32();
\r
2076 uint dst = m68ki_read_32(ea);
\r
2077 uint res = src + dst;
\r
2080 FLAG_N = NFLAG_32(res);
\r
2081 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
2082 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
2083 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
2085 m68ki_write_32(ea, FLAG_Z);
\r
2089 void m68k_op_addq_32_di(void)
\r
2091 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
2092 uint ea = EA_AY_DI_32();
\r
2093 uint dst = m68ki_read_32(ea);
\r
2094 uint res = src + dst;
\r
2097 FLAG_N = NFLAG_32(res);
\r
2098 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
2099 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
2100 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
2102 m68ki_write_32(ea, FLAG_Z);
\r
2106 void m68k_op_addq_32_ix(void)
\r
2108 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
2109 uint ea = EA_AY_IX_32();
\r
2110 uint dst = m68ki_read_32(ea);
\r
2111 uint res = src + dst;
\r
2114 FLAG_N = NFLAG_32(res);
\r
2115 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
2116 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
2117 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
2119 m68ki_write_32(ea, FLAG_Z);
\r
2123 void m68k_op_addq_32_aw(void)
\r
2125 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
2126 uint ea = EA_AW_32();
\r
2127 uint dst = m68ki_read_32(ea);
\r
2128 uint res = src + dst;
\r
2131 FLAG_N = NFLAG_32(res);
\r
2132 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
2133 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
2134 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
2136 m68ki_write_32(ea, FLAG_Z);
\r
2140 void m68k_op_addq_32_al(void)
\r
2142 uint src = (((REG_IR >> 9) - 1) & 7) + 1;
\r
2143 uint ea = EA_AL_32();
\r
2144 uint dst = m68ki_read_32(ea);
\r
2145 uint res = src + dst;
\r
2148 FLAG_N = NFLAG_32(res);
\r
2149 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
2150 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
2151 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
2153 m68ki_write_32(ea, FLAG_Z);
\r
2157 void m68k_op_addx_8_rr(void)
\r
2159 uint* r_dst = &DX;
\r
2160 uint src = MASK_OUT_ABOVE_8(DY);
\r
2161 uint dst = MASK_OUT_ABOVE_8(*r_dst);
\r
2162 uint res = src + dst + XFLAG_AS_1();
\r
2164 FLAG_N = NFLAG_8(res);
\r
2165 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
2166 FLAG_X = FLAG_C = CFLAG_8(res);
\r
2168 res = MASK_OUT_ABOVE_8(res);
\r
2171 *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
\r
2175 void m68k_op_addx_16_rr(void)
\r
2177 uint* r_dst = &DX;
\r
2178 uint src = MASK_OUT_ABOVE_16(DY);
\r
2179 uint dst = MASK_OUT_ABOVE_16(*r_dst);
\r
2180 uint res = src + dst + XFLAG_AS_1();
\r
2182 FLAG_N = NFLAG_16(res);
\r
2183 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
2184 FLAG_X = FLAG_C = CFLAG_16(res);
\r
2186 res = MASK_OUT_ABOVE_16(res);
\r
2189 *r_dst = MASK_OUT_BELOW_16(*r_dst) | res;
\r
2193 void m68k_op_addx_32_rr(void)
\r
2195 uint* r_dst = &DX;
\r
2197 uint dst = *r_dst;
\r
2198 uint res = src + dst + XFLAG_AS_1();
\r
2200 FLAG_N = NFLAG_32(res);
\r
2201 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
2202 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
2204 res = MASK_OUT_ABOVE_32(res);
\r
2211 void m68k_op_addx_8_mm_ax7(void)
\r
2213 uint src = OPER_AY_PD_8();
\r
2214 uint ea = EA_A7_PD_8();
\r
2215 uint dst = m68ki_read_8(ea);
\r
2216 uint res = src + dst + XFLAG_AS_1();
\r
2218 FLAG_N = NFLAG_8(res);
\r
2219 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
2220 FLAG_X = FLAG_C = CFLAG_8(res);
\r
2222 res = MASK_OUT_ABOVE_8(res);
\r
2225 m68ki_write_8(ea, res);
\r
2229 void m68k_op_addx_8_mm_ay7(void)
\r
2231 uint src = OPER_A7_PD_8();
\r
2232 uint ea = EA_AX_PD_8();
\r
2233 uint dst = m68ki_read_8(ea);
\r
2234 uint res = src + dst + XFLAG_AS_1();
\r
2236 FLAG_N = NFLAG_8(res);
\r
2237 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
2238 FLAG_X = FLAG_C = CFLAG_8(res);
\r
2240 res = MASK_OUT_ABOVE_8(res);
\r
2243 m68ki_write_8(ea, res);
\r
2247 void m68k_op_addx_8_mm_axy7(void)
\r
2249 uint src = OPER_A7_PD_8();
\r
2250 uint ea = EA_A7_PD_8();
\r
2251 uint dst = m68ki_read_8(ea);
\r
2252 uint res = src + dst + XFLAG_AS_1();
\r
2254 FLAG_N = NFLAG_8(res);
\r
2255 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
2256 FLAG_X = FLAG_C = CFLAG_8(res);
\r
2258 res = MASK_OUT_ABOVE_8(res);
\r
2261 m68ki_write_8(ea, res);
\r
2265 void m68k_op_addx_8_mm(void)
\r
2267 uint src = OPER_AY_PD_8();
\r
2268 uint ea = EA_AX_PD_8();
\r
2269 uint dst = m68ki_read_8(ea);
\r
2270 uint res = src + dst + XFLAG_AS_1();
\r
2272 FLAG_N = NFLAG_8(res);
\r
2273 FLAG_V = VFLAG_ADD_8(src, dst, res);
\r
2274 FLAG_X = FLAG_C = CFLAG_8(res);
\r
2276 res = MASK_OUT_ABOVE_8(res);
\r
2279 m68ki_write_8(ea, res);
\r
2283 void m68k_op_addx_16_mm(void)
\r
2285 uint src = OPER_AY_PD_16();
\r
2286 uint ea = EA_AX_PD_16();
\r
2287 uint dst = m68ki_read_16(ea);
\r
2288 uint res = src + dst + XFLAG_AS_1();
\r
2290 FLAG_N = NFLAG_16(res);
\r
2291 FLAG_V = VFLAG_ADD_16(src, dst, res);
\r
2292 FLAG_X = FLAG_C = CFLAG_16(res);
\r
2294 res = MASK_OUT_ABOVE_16(res);
\r
2297 m68ki_write_16(ea, res);
\r
2301 void m68k_op_addx_32_mm(void)
\r
2303 uint src = OPER_AY_PD_32();
\r
2304 uint ea = EA_AX_PD_32();
\r
2305 uint dst = m68ki_read_32(ea);
\r
2306 uint res = src + dst + XFLAG_AS_1();
\r
2308 FLAG_N = NFLAG_32(res);
\r
2309 FLAG_V = VFLAG_ADD_32(src, dst, res);
\r
2310 FLAG_X = FLAG_C = CFLAG_ADD_32(src, dst, res);
\r
2312 res = MASK_OUT_ABOVE_32(res);
\r
2315 m68ki_write_32(ea, res);
\r
2319 void m68k_op_and_8_er_d(void)
\r
2321 FLAG_Z = MASK_OUT_ABOVE_8(DX &= (DY | 0xffffff00));
\r
2323 FLAG_N = NFLAG_8(FLAG_Z);
\r
2324 FLAG_C = CFLAG_CLEAR;
\r
2325 FLAG_V = VFLAG_CLEAR;
\r
2329 void m68k_op_and_8_er_ai(void)
\r
2331 FLAG_Z = MASK_OUT_ABOVE_8(DX &= (OPER_AY_AI_8() | 0xffffff00));
\r
2333 FLAG_N = NFLAG_8(FLAG_Z);
\r
2334 FLAG_C = CFLAG_CLEAR;
\r
2335 FLAG_V = VFLAG_CLEAR;
\r
2339 void m68k_op_and_8_er_pi(void)
\r
2341 FLAG_Z = MASK_OUT_ABOVE_8(DX &= (OPER_AY_PI_8() | 0xffffff00));
\r
2343 FLAG_N = NFLAG_8(FLAG_Z);
\r
2344 FLAG_C = CFLAG_CLEAR;
\r
2345 FLAG_V = VFLAG_CLEAR;
\r
2349 void m68k_op_and_8_er_pi7(void)
\r
2351 FLAG_Z = MASK_OUT_ABOVE_8(DX &= (OPER_A7_PI_8() | 0xffffff00));
\r
2353 FLAG_N = NFLAG_8(FLAG_Z);
\r
2354 FLAG_C = CFLAG_CLEAR;
\r
2355 FLAG_V = VFLAG_CLEAR;
\r
2359 void m68k_op_and_8_er_pd(void)
\r
2361 FLAG_Z = MASK_OUT_ABOVE_8(DX &= (OPER_AY_PD_8() | 0xffffff00));
\r
2363 FLAG_N = NFLAG_8(FLAG_Z);
\r
2364 FLAG_C = CFLAG_CLEAR;
\r
2365 FLAG_V = VFLAG_CLEAR;
\r
2369 void m68k_op_and_8_er_pd7(void)
\r
2371 FLAG_Z = MASK_OUT_ABOVE_8(DX &= (OPER_A7_PD_8() | 0xffffff00));
\r
2373 FLAG_N = NFLAG_8(FLAG_Z);
\r
2374 FLAG_C = CFLAG_CLEAR;
\r
2375 FLAG_V = VFLAG_CLEAR;
\r
2379 void m68k_op_and_8_er_di(void)
\r
2381 FLAG_Z = MASK_OUT_ABOVE_8(DX &= (OPER_AY_DI_8() | 0xffffff00));
\r
2383 FLAG_N = NFLAG_8(FLAG_Z);
\r
2384 FLAG_C = CFLAG_CLEAR;
\r
2385 FLAG_V = VFLAG_CLEAR;
\r
2389 void m68k_op_and_8_er_ix(void)
\r
2391 FLAG_Z = MASK_OUT_ABOVE_8(DX &= (OPER_AY_IX_8() | 0xffffff00));
\r
2393 FLAG_N = NFLAG_8(FLAG_Z);
\r
2394 FLAG_C = CFLAG_CLEAR;
\r
2395 FLAG_V = VFLAG_CLEAR;
\r
2399 void m68k_op_and_8_er_aw(void)
\r
2401 FLAG_Z = MASK_OUT_ABOVE_8(DX &= (OPER_AW_8() | 0xffffff00));
\r
2403 FLAG_N = NFLAG_8(FLAG_Z);
\r
2404 FLAG_C = CFLAG_CLEAR;
\r
2405 FLAG_V = VFLAG_CLEAR;
\r
2409 void m68k_op_and_8_er_al(void)
\r
2411 FLAG_Z = MASK_OUT_ABOVE_8(DX &= (OPER_AL_8() | 0xffffff00));
\r
2413 FLAG_N = NFLAG_8(FLAG_Z);
\r
2414 FLAG_C = CFLAG_CLEAR;
\r
2415 FLAG_V = VFLAG_CLEAR;
\r
2419 void m68k_op_and_8_er_pcdi(void)
\r
2421 FLAG_Z = MASK_OUT_ABOVE_8(DX &= (OPER_PCDI_8() | 0xffffff00));
\r
2423 FLAG_N = NFLAG_8(FLAG_Z);
\r
2424 FLAG_C = CFLAG_CLEAR;
\r
2425 FLAG_V = VFLAG_CLEAR;
\r
2429 void m68k_op_and_8_er_pcix(void)
\r
2431 FLAG_Z = MASK_OUT_ABOVE_8(DX &= (OPER_PCIX_8() | 0xffffff00));
\r
2433 FLAG_N = NFLAG_8(FLAG_Z);
\r
2434 FLAG_C = CFLAG_CLEAR;
\r
2435 FLAG_V = VFLAG_CLEAR;
\r
2439 void m68k_op_and_8_er_i(void)
\r
2441 FLAG_Z = MASK_OUT_ABOVE_8(DX &= (OPER_I_8() | 0xffffff00));
\r
2443 FLAG_N = NFLAG_8(FLAG_Z);
\r
2444 FLAG_C = CFLAG_CLEAR;
\r
2445 FLAG_V = VFLAG_CLEAR;
\r
2449 void m68k_op_and_16_er_d(void)
\r
2451 FLAG_Z = MASK_OUT_ABOVE_16(DX &= (DY | 0xffff0000));
\r
2453 FLAG_N = NFLAG_16(FLAG_Z);
\r
2454 FLAG_C = CFLAG_CLEAR;
\r
2455 FLAG_V = VFLAG_CLEAR;
\r
2459 void m68k_op_and_16_er_ai(void)
\r
2461 FLAG_Z = MASK_OUT_ABOVE_16(DX &= (OPER_AY_AI_16() | 0xffff0000));
\r
2463 FLAG_N = NFLAG_16(FLAG_Z);
\r
2464 FLAG_C = CFLAG_CLEAR;
\r
2465 FLAG_V = VFLAG_CLEAR;
\r
2469 void m68k_op_and_16_er_pi(void)
\r
2471 FLAG_Z = MASK_OUT_ABOVE_16(DX &= (OPER_AY_PI_16() | 0xffff0000));
\r
2473 FLAG_N = NFLAG_16(FLAG_Z);
\r
2474 FLAG_C = CFLAG_CLEAR;
\r
2475 FLAG_V = VFLAG_CLEAR;
\r
2479 void m68k_op_and_16_er_pd(void)
\r
2481 FLAG_Z = MASK_OUT_ABOVE_16(DX &= (OPER_AY_PD_16() | 0xffff0000));
\r
2483 FLAG_N = NFLAG_16(FLAG_Z);
\r
2484 FLAG_C = CFLAG_CLEAR;
\r
2485 FLAG_V = VFLAG_CLEAR;
\r
2489 void m68k_op_and_16_er_di(void)
\r
2491 FLAG_Z = MASK_OUT_ABOVE_16(DX &= (OPER_AY_DI_16() | 0xffff0000));
\r
2493 FLAG_N = NFLAG_16(FLAG_Z);
\r
2494 FLAG_C = CFLAG_CLEAR;
\r
2495 FLAG_V = VFLAG_CLEAR;
\r
2499 void m68k_op_and_16_er_ix(void)
\r
2501 FLAG_Z = MASK_OUT_ABOVE_16(DX &= (OPER_AY_IX_16() | 0xffff0000));
\r
2503 FLAG_N = NFLAG_16(FLAG_Z);
\r
2504 FLAG_C = CFLAG_CLEAR;
\r
2505 FLAG_V = VFLAG_CLEAR;
\r
2509 void m68k_op_and_16_er_aw(void)
\r
2511 FLAG_Z = MASK_OUT_ABOVE_16(DX &= (OPER_AW_16() | 0xffff0000));
\r
2513 FLAG_N = NFLAG_16(FLAG_Z);
\r
2514 FLAG_C = CFLAG_CLEAR;
\r
2515 FLAG_V = VFLAG_CLEAR;
\r
2519 void m68k_op_and_16_er_al(void)
\r
2521 FLAG_Z = MASK_OUT_ABOVE_16(DX &= (OPER_AL_16() | 0xffff0000));
\r
2523 FLAG_N = NFLAG_16(FLAG_Z);
\r
2524 FLAG_C = CFLAG_CLEAR;
\r
2525 FLAG_V = VFLAG_CLEAR;
\r
2529 void m68k_op_and_16_er_pcdi(void)
\r
2531 FLAG_Z = MASK_OUT_ABOVE_16(DX &= (OPER_PCDI_16() | 0xffff0000));
\r
2533 FLAG_N = NFLAG_16(FLAG_Z);
\r
2534 FLAG_C = CFLAG_CLEAR;
\r
2535 FLAG_V = VFLAG_CLEAR;
\r
2539 void m68k_op_and_16_er_pcix(void)
\r
2541 FLAG_Z = MASK_OUT_ABOVE_16(DX &= (OPER_PCIX_16() | 0xffff0000));
\r
2543 FLAG_N = NFLAG_16(FLAG_Z);
\r
2544 FLAG_C = CFLAG_CLEAR;
\r
2545 FLAG_V = VFLAG_CLEAR;
\r
2549 void m68k_op_and_16_er_i(void)
\r
2551 FLAG_Z = MASK_OUT_ABOVE_16(DX &= (OPER_I_16() | 0xffff0000));
\r
2553 FLAG_N = NFLAG_16(FLAG_Z);
\r
2554 FLAG_C = CFLAG_CLEAR;
\r
2555 FLAG_V = VFLAG_CLEAR;
\r
2559 void m68k_op_and_32_er_d(void)
\r
2561 FLAG_Z = DX &= DY;
\r
2563 FLAG_N = NFLAG_32(FLAG_Z);
\r
2564 FLAG_C = CFLAG_CLEAR;
\r
2565 FLAG_V = VFLAG_CLEAR;
\r
2569 void m68k_op_and_32_er_ai(void)
\r
2571 FLAG_Z = DX &= OPER_AY_AI_32();
\r
2573 FLAG_N = NFLAG_32(FLAG_Z);
\r
2574 FLAG_C = CFLAG_CLEAR;
\r
2575 FLAG_V = VFLAG_CLEAR;
\r
2579 void m68k_op_and_32_er_pi(void)
\r
2581 FLAG_Z = DX &= OPER_AY_PI_32();
\r
2583 FLAG_N = NFLAG_32(FLAG_Z);
\r
2584 FLAG_C = CFLAG_CLEAR;
\r
2585 FLAG_V = VFLAG_CLEAR;
\r
2589 void m68k_op_and_32_er_pd(void)
\r
2591 FLAG_Z = DX &= OPER_AY_PD_32();
\r
2593 FLAG_N = NFLAG_32(FLAG_Z);
\r
2594 FLAG_C = CFLAG_CLEAR;
\r
2595 FLAG_V = VFLAG_CLEAR;
\r
2599 void m68k_op_and_32_er_di(void)
\r
2601 FLAG_Z = DX &= OPER_AY_DI_32();
\r
2603 FLAG_N = NFLAG_32(FLAG_Z);
\r
2604 FLAG_C = CFLAG_CLEAR;
\r
2605 FLAG_V = VFLAG_CLEAR;
\r
2609 void m68k_op_and_32_er_ix(void)
\r
2611 FLAG_Z = DX &= OPER_AY_IX_32();
\r
2613 FLAG_N = NFLAG_32(FLAG_Z);
\r
2614 FLAG_C = CFLAG_CLEAR;
\r
2615 FLAG_V = VFLAG_CLEAR;
\r
2619 void m68k_op_and_32_er_aw(void)
\r
2621 FLAG_Z = DX &= OPER_AW_32();
\r
2623 FLAG_N = NFLAG_32(FLAG_Z);
\r
2624 FLAG_C = CFLAG_CLEAR;
\r
2625 FLAG_V = VFLAG_CLEAR;
\r
2629 void m68k_op_and_32_er_al(void)
\r
2631 FLAG_Z = DX &= OPER_AL_32();
\r
2633 FLAG_N = NFLAG_32(FLAG_Z);
\r
2634 FLAG_C = CFLAG_CLEAR;
\r
2635 FLAG_V = VFLAG_CLEAR;
\r
2639 void m68k_op_and_32_er_pcdi(void)
\r
2641 FLAG_Z = DX &= OPER_PCDI_32();
\r
2643 FLAG_N = NFLAG_32(FLAG_Z);
\r
2644 FLAG_C = CFLAG_CLEAR;
\r
2645 FLAG_V = VFLAG_CLEAR;
\r
2649 void m68k_op_and_32_er_pcix(void)
\r
2651 FLAG_Z = DX &= OPER_PCIX_32();
\r
2653 FLAG_N = NFLAG_32(FLAG_Z);
\r
2654 FLAG_C = CFLAG_CLEAR;
\r
2655 FLAG_V = VFLAG_CLEAR;
\r
2659 void m68k_op_and_32_er_i(void)
\r
2661 FLAG_Z = DX &= OPER_I_32();
\r
2663 FLAG_N = NFLAG_32(FLAG_Z);
\r
2664 FLAG_C = CFLAG_CLEAR;
\r
2665 FLAG_V = VFLAG_CLEAR;
\r
2669 void m68k_op_and_8_re_ai(void)
\r
2671 uint ea = EA_AY_AI_8();
\r
2672 uint res = DX & m68ki_read_8(ea);
\r
2674 FLAG_N = NFLAG_8(res);
\r
2675 FLAG_C = CFLAG_CLEAR;
\r
2676 FLAG_V = VFLAG_CLEAR;
\r
2677 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
2679 m68ki_write_8(ea, FLAG_Z);
\r
2683 void m68k_op_and_8_re_pi(void)
\r
2685 uint ea = EA_AY_PI_8();
\r
2686 uint res = DX & m68ki_read_8(ea);
\r
2688 FLAG_N = NFLAG_8(res);
\r
2689 FLAG_C = CFLAG_CLEAR;
\r
2690 FLAG_V = VFLAG_CLEAR;
\r
2691 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
2693 m68ki_write_8(ea, FLAG_Z);
\r
2697 void m68k_op_and_8_re_pi7(void)
\r
2699 uint ea = EA_A7_PI_8();
\r
2700 uint res = DX & m68ki_read_8(ea);
\r
2702 FLAG_N = NFLAG_8(res);
\r
2703 FLAG_C = CFLAG_CLEAR;
\r
2704 FLAG_V = VFLAG_CLEAR;
\r
2705 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
2707 m68ki_write_8(ea, FLAG_Z);
\r
2711 void m68k_op_and_8_re_pd(void)
\r
2713 uint ea = EA_AY_PD_8();
\r
2714 uint res = DX & m68ki_read_8(ea);
\r
2716 FLAG_N = NFLAG_8(res);
\r
2717 FLAG_C = CFLAG_CLEAR;
\r
2718 FLAG_V = VFLAG_CLEAR;
\r
2719 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
2721 m68ki_write_8(ea, FLAG_Z);
\r
2725 void m68k_op_and_8_re_pd7(void)
\r
2727 uint ea = EA_A7_PD_8();
\r
2728 uint res = DX & m68ki_read_8(ea);
\r
2730 FLAG_N = NFLAG_8(res);
\r
2731 FLAG_C = CFLAG_CLEAR;
\r
2732 FLAG_V = VFLAG_CLEAR;
\r
2733 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
2735 m68ki_write_8(ea, FLAG_Z);
\r
2739 void m68k_op_and_8_re_di(void)
\r
2741 uint ea = EA_AY_DI_8();
\r
2742 uint res = DX & m68ki_read_8(ea);
\r
2744 FLAG_N = NFLAG_8(res);
\r
2745 FLAG_C = CFLAG_CLEAR;
\r
2746 FLAG_V = VFLAG_CLEAR;
\r
2747 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
2749 m68ki_write_8(ea, FLAG_Z);
\r
2753 void m68k_op_and_8_re_ix(void)
\r
2755 uint ea = EA_AY_IX_8();
\r
2756 uint res = DX & m68ki_read_8(ea);
\r
2758 FLAG_N = NFLAG_8(res);
\r
2759 FLAG_C = CFLAG_CLEAR;
\r
2760 FLAG_V = VFLAG_CLEAR;
\r
2761 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
2763 m68ki_write_8(ea, FLAG_Z);
\r
2767 void m68k_op_and_8_re_aw(void)
\r
2769 uint ea = EA_AW_8();
\r
2770 uint res = DX & m68ki_read_8(ea);
\r
2772 FLAG_N = NFLAG_8(res);
\r
2773 FLAG_C = CFLAG_CLEAR;
\r
2774 FLAG_V = VFLAG_CLEAR;
\r
2775 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
2777 m68ki_write_8(ea, FLAG_Z);
\r
2781 void m68k_op_and_8_re_al(void)
\r
2783 uint ea = EA_AL_8();
\r
2784 uint res = DX & m68ki_read_8(ea);
\r
2786 FLAG_N = NFLAG_8(res);
\r
2787 FLAG_C = CFLAG_CLEAR;
\r
2788 FLAG_V = VFLAG_CLEAR;
\r
2789 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
2791 m68ki_write_8(ea, FLAG_Z);
\r
2795 void m68k_op_and_16_re_ai(void)
\r
2797 uint ea = EA_AY_AI_16();
\r
2798 uint res = DX & m68ki_read_16(ea);
\r
2800 FLAG_N = NFLAG_16(res);
\r
2801 FLAG_C = CFLAG_CLEAR;
\r
2802 FLAG_V = VFLAG_CLEAR;
\r
2803 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
2805 m68ki_write_16(ea, FLAG_Z);
\r
2809 void m68k_op_and_16_re_pi(void)
\r
2811 uint ea = EA_AY_PI_16();
\r
2812 uint res = DX & m68ki_read_16(ea);
\r
2814 FLAG_N = NFLAG_16(res);
\r
2815 FLAG_C = CFLAG_CLEAR;
\r
2816 FLAG_V = VFLAG_CLEAR;
\r
2817 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
2819 m68ki_write_16(ea, FLAG_Z);
\r
2823 void m68k_op_and_16_re_pd(void)
\r
2825 uint ea = EA_AY_PD_16();
\r
2826 uint res = DX & m68ki_read_16(ea);
\r
2828 FLAG_N = NFLAG_16(res);
\r
2829 FLAG_C = CFLAG_CLEAR;
\r
2830 FLAG_V = VFLAG_CLEAR;
\r
2831 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
2833 m68ki_write_16(ea, FLAG_Z);
\r
2837 void m68k_op_and_16_re_di(void)
\r
2839 uint ea = EA_AY_DI_16();
\r
2840 uint res = DX & m68ki_read_16(ea);
\r
2842 FLAG_N = NFLAG_16(res);
\r
2843 FLAG_C = CFLAG_CLEAR;
\r
2844 FLAG_V = VFLAG_CLEAR;
\r
2845 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
2847 m68ki_write_16(ea, FLAG_Z);
\r
2851 void m68k_op_and_16_re_ix(void)
\r
2853 uint ea = EA_AY_IX_16();
\r
2854 uint res = DX & m68ki_read_16(ea);
\r
2856 FLAG_N = NFLAG_16(res);
\r
2857 FLAG_C = CFLAG_CLEAR;
\r
2858 FLAG_V = VFLAG_CLEAR;
\r
2859 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
2861 m68ki_write_16(ea, FLAG_Z);
\r
2865 void m68k_op_and_16_re_aw(void)
\r
2867 uint ea = EA_AW_16();
\r
2868 uint res = DX & m68ki_read_16(ea);
\r
2870 FLAG_N = NFLAG_16(res);
\r
2871 FLAG_C = CFLAG_CLEAR;
\r
2872 FLAG_V = VFLAG_CLEAR;
\r
2873 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
2875 m68ki_write_16(ea, FLAG_Z);
\r
2879 void m68k_op_and_16_re_al(void)
\r
2881 uint ea = EA_AL_16();
\r
2882 uint res = DX & m68ki_read_16(ea);
\r
2884 FLAG_N = NFLAG_16(res);
\r
2885 FLAG_C = CFLAG_CLEAR;
\r
2886 FLAG_V = VFLAG_CLEAR;
\r
2887 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
2889 m68ki_write_16(ea, FLAG_Z);
\r
2893 void m68k_op_and_32_re_ai(void)
\r
2895 uint ea = EA_AY_AI_32();
\r
2896 uint res = DX & m68ki_read_32(ea);
\r
2898 FLAG_N = NFLAG_32(res);
\r
2900 FLAG_C = CFLAG_CLEAR;
\r
2901 FLAG_V = VFLAG_CLEAR;
\r
2903 m68ki_write_32(ea, res);
\r
2907 void m68k_op_and_32_re_pi(void)
\r
2909 uint ea = EA_AY_PI_32();
\r
2910 uint res = DX & m68ki_read_32(ea);
\r
2912 FLAG_N = NFLAG_32(res);
\r
2914 FLAG_C = CFLAG_CLEAR;
\r
2915 FLAG_V = VFLAG_CLEAR;
\r
2917 m68ki_write_32(ea, res);
\r
2921 void m68k_op_and_32_re_pd(void)
\r
2923 uint ea = EA_AY_PD_32();
\r
2924 uint res = DX & m68ki_read_32(ea);
\r
2926 FLAG_N = NFLAG_32(res);
\r
2928 FLAG_C = CFLAG_CLEAR;
\r
2929 FLAG_V = VFLAG_CLEAR;
\r
2931 m68ki_write_32(ea, res);
\r
2935 void m68k_op_and_32_re_di(void)
\r
2937 uint ea = EA_AY_DI_32();
\r
2938 uint res = DX & m68ki_read_32(ea);
\r
2940 FLAG_N = NFLAG_32(res);
\r
2942 FLAG_C = CFLAG_CLEAR;
\r
2943 FLAG_V = VFLAG_CLEAR;
\r
2945 m68ki_write_32(ea, res);
\r
2949 void m68k_op_and_32_re_ix(void)
\r
2951 uint ea = EA_AY_IX_32();
\r
2952 uint res = DX & m68ki_read_32(ea);
\r
2954 FLAG_N = NFLAG_32(res);
\r
2956 FLAG_C = CFLAG_CLEAR;
\r
2957 FLAG_V = VFLAG_CLEAR;
\r
2959 m68ki_write_32(ea, res);
\r
2963 void m68k_op_and_32_re_aw(void)
\r
2965 uint ea = EA_AW_32();
\r
2966 uint res = DX & m68ki_read_32(ea);
\r
2968 FLAG_N = NFLAG_32(res);
\r
2970 FLAG_C = CFLAG_CLEAR;
\r
2971 FLAG_V = VFLAG_CLEAR;
\r
2973 m68ki_write_32(ea, res);
\r
2977 void m68k_op_and_32_re_al(void)
\r
2979 uint ea = EA_AL_32();
\r
2980 uint res = DX & m68ki_read_32(ea);
\r
2982 FLAG_N = NFLAG_32(res);
\r
2984 FLAG_C = CFLAG_CLEAR;
\r
2985 FLAG_V = VFLAG_CLEAR;
\r
2987 m68ki_write_32(ea, res);
\r
2991 void m68k_op_andi_8_d(void)
\r
2993 FLAG_Z = MASK_OUT_ABOVE_8(DY &= (OPER_I_8() | 0xffffff00));
\r
2995 FLAG_N = NFLAG_8(FLAG_Z);
\r
2996 FLAG_C = CFLAG_CLEAR;
\r
2997 FLAG_V = VFLAG_CLEAR;
\r
3001 void m68k_op_andi_8_ai(void)
\r
3003 uint src = OPER_I_8();
\r
3004 uint ea = EA_AY_AI_8();
\r
3005 uint res = src & m68ki_read_8(ea);
\r
3007 FLAG_N = NFLAG_8(res);
\r
3009 FLAG_C = CFLAG_CLEAR;
\r
3010 FLAG_V = VFLAG_CLEAR;
\r
3012 m68ki_write_8(ea, res);
\r
3016 void m68k_op_andi_8_pi(void)
\r
3018 uint src = OPER_I_8();
\r
3019 uint ea = EA_AY_PI_8();
\r
3020 uint res = src & m68ki_read_8(ea);
\r
3022 FLAG_N = NFLAG_8(res);
\r
3024 FLAG_C = CFLAG_CLEAR;
\r
3025 FLAG_V = VFLAG_CLEAR;
\r
3027 m68ki_write_8(ea, res);
\r
3031 void m68k_op_andi_8_pi7(void)
\r
3033 uint src = OPER_I_8();
\r
3034 uint ea = EA_A7_PI_8();
\r
3035 uint res = src & m68ki_read_8(ea);
\r
3037 FLAG_N = NFLAG_8(res);
\r
3039 FLAG_C = CFLAG_CLEAR;
\r
3040 FLAG_V = VFLAG_CLEAR;
\r
3042 m68ki_write_8(ea, res);
\r
3046 void m68k_op_andi_8_pd(void)
\r
3048 uint src = OPER_I_8();
\r
3049 uint ea = EA_AY_PD_8();
\r
3050 uint res = src & m68ki_read_8(ea);
\r
3052 FLAG_N = NFLAG_8(res);
\r
3054 FLAG_C = CFLAG_CLEAR;
\r
3055 FLAG_V = VFLAG_CLEAR;
\r
3057 m68ki_write_8(ea, res);
\r
3061 void m68k_op_andi_8_pd7(void)
\r
3063 uint src = OPER_I_8();
\r
3064 uint ea = EA_A7_PD_8();
\r
3065 uint res = src & m68ki_read_8(ea);
\r
3067 FLAG_N = NFLAG_8(res);
\r
3069 FLAG_C = CFLAG_CLEAR;
\r
3070 FLAG_V = VFLAG_CLEAR;
\r
3072 m68ki_write_8(ea, res);
\r
3076 void m68k_op_andi_8_di(void)
\r
3078 uint src = OPER_I_8();
\r
3079 uint ea = EA_AY_DI_8();
\r
3080 uint res = src & m68ki_read_8(ea);
\r
3082 FLAG_N = NFLAG_8(res);
\r
3084 FLAG_C = CFLAG_CLEAR;
\r
3085 FLAG_V = VFLAG_CLEAR;
\r
3087 m68ki_write_8(ea, res);
\r
3091 void m68k_op_andi_8_ix(void)
\r
3093 uint src = OPER_I_8();
\r
3094 uint ea = EA_AY_IX_8();
\r
3095 uint res = src & m68ki_read_8(ea);
\r
3097 FLAG_N = NFLAG_8(res);
\r
3099 FLAG_C = CFLAG_CLEAR;
\r
3100 FLAG_V = VFLAG_CLEAR;
\r
3102 m68ki_write_8(ea, res);
\r
3106 void m68k_op_andi_8_aw(void)
\r
3108 uint src = OPER_I_8();
\r
3109 uint ea = EA_AW_8();
\r
3110 uint res = src & m68ki_read_8(ea);
\r
3112 FLAG_N = NFLAG_8(res);
\r
3114 FLAG_C = CFLAG_CLEAR;
\r
3115 FLAG_V = VFLAG_CLEAR;
\r
3117 m68ki_write_8(ea, res);
\r
3121 void m68k_op_andi_8_al(void)
\r
3123 uint src = OPER_I_8();
\r
3124 uint ea = EA_AL_8();
\r
3125 uint res = src & m68ki_read_8(ea);
\r
3127 FLAG_N = NFLAG_8(res);
\r
3129 FLAG_C = CFLAG_CLEAR;
\r
3130 FLAG_V = VFLAG_CLEAR;
\r
3132 m68ki_write_8(ea, res);
\r
3136 void m68k_op_andi_16_d(void)
\r
3138 FLAG_Z = MASK_OUT_ABOVE_16(DY &= (OPER_I_16() | 0xffff0000));
\r
3140 FLAG_N = NFLAG_16(FLAG_Z);
\r
3141 FLAG_C = CFLAG_CLEAR;
\r
3142 FLAG_V = VFLAG_CLEAR;
\r
3146 void m68k_op_andi_16_ai(void)
\r
3148 uint src = OPER_I_16();
\r
3149 uint ea = EA_AY_AI_16();
\r
3150 uint res = src & m68ki_read_16(ea);
\r
3152 FLAG_N = NFLAG_16(res);
\r
3154 FLAG_C = CFLAG_CLEAR;
\r
3155 FLAG_V = VFLAG_CLEAR;
\r
3157 m68ki_write_16(ea, res);
\r
3161 void m68k_op_andi_16_pi(void)
\r
3163 uint src = OPER_I_16();
\r
3164 uint ea = EA_AY_PI_16();
\r
3165 uint res = src & m68ki_read_16(ea);
\r
3167 FLAG_N = NFLAG_16(res);
\r
3169 FLAG_C = CFLAG_CLEAR;
\r
3170 FLAG_V = VFLAG_CLEAR;
\r
3172 m68ki_write_16(ea, res);
\r
3176 void m68k_op_andi_16_pd(void)
\r
3178 uint src = OPER_I_16();
\r
3179 uint ea = EA_AY_PD_16();
\r
3180 uint res = src & m68ki_read_16(ea);
\r
3182 FLAG_N = NFLAG_16(res);
\r
3184 FLAG_C = CFLAG_CLEAR;
\r
3185 FLAG_V = VFLAG_CLEAR;
\r
3187 m68ki_write_16(ea, res);
\r
3191 void m68k_op_andi_16_di(void)
\r
3193 uint src = OPER_I_16();
\r
3194 uint ea = EA_AY_DI_16();
\r
3195 uint res = src & m68ki_read_16(ea);
\r
3197 FLAG_N = NFLAG_16(res);
\r
3199 FLAG_C = CFLAG_CLEAR;
\r
3200 FLAG_V = VFLAG_CLEAR;
\r
3202 m68ki_write_16(ea, res);
\r
3206 void m68k_op_andi_16_ix(void)
\r
3208 uint src = OPER_I_16();
\r
3209 uint ea = EA_AY_IX_16();
\r
3210 uint res = src & m68ki_read_16(ea);
\r
3212 FLAG_N = NFLAG_16(res);
\r
3214 FLAG_C = CFLAG_CLEAR;
\r
3215 FLAG_V = VFLAG_CLEAR;
\r
3217 m68ki_write_16(ea, res);
\r
3221 void m68k_op_andi_16_aw(void)
\r
3223 uint src = OPER_I_16();
\r
3224 uint ea = EA_AW_16();
\r
3225 uint res = src & m68ki_read_16(ea);
\r
3227 FLAG_N = NFLAG_16(res);
\r
3229 FLAG_C = CFLAG_CLEAR;
\r
3230 FLAG_V = VFLAG_CLEAR;
\r
3232 m68ki_write_16(ea, res);
\r
3236 void m68k_op_andi_16_al(void)
\r
3238 uint src = OPER_I_16();
\r
3239 uint ea = EA_AL_16();
\r
3240 uint res = src & m68ki_read_16(ea);
\r
3242 FLAG_N = NFLAG_16(res);
\r
3244 FLAG_C = CFLAG_CLEAR;
\r
3245 FLAG_V = VFLAG_CLEAR;
\r
3247 m68ki_write_16(ea, res);
\r
3251 void m68k_op_andi_32_d(void)
\r
3253 FLAG_Z = DY &= (OPER_I_32());
\r
3255 FLAG_N = NFLAG_32(FLAG_Z);
\r
3256 FLAG_C = CFLAG_CLEAR;
\r
3257 FLAG_V = VFLAG_CLEAR;
\r
3261 void m68k_op_andi_32_ai(void)
\r
3263 uint src = OPER_I_32();
\r
3264 uint ea = EA_AY_AI_32();
\r
3265 uint res = src & m68ki_read_32(ea);
\r
3267 FLAG_N = NFLAG_32(res);
\r
3269 FLAG_C = CFLAG_CLEAR;
\r
3270 FLAG_V = VFLAG_CLEAR;
\r
3272 m68ki_write_32(ea, res);
\r
3276 void m68k_op_andi_32_pi(void)
\r
3278 uint src = OPER_I_32();
\r
3279 uint ea = EA_AY_PI_32();
\r
3280 uint res = src & m68ki_read_32(ea);
\r
3282 FLAG_N = NFLAG_32(res);
\r
3284 FLAG_C = CFLAG_CLEAR;
\r
3285 FLAG_V = VFLAG_CLEAR;
\r
3287 m68ki_write_32(ea, res);
\r
3291 void m68k_op_andi_32_pd(void)
\r
3293 uint src = OPER_I_32();
\r
3294 uint ea = EA_AY_PD_32();
\r
3295 uint res = src & m68ki_read_32(ea);
\r
3297 FLAG_N = NFLAG_32(res);
\r
3299 FLAG_C = CFLAG_CLEAR;
\r
3300 FLAG_V = VFLAG_CLEAR;
\r
3302 m68ki_write_32(ea, res);
\r
3306 void m68k_op_andi_32_di(void)
\r
3308 uint src = OPER_I_32();
\r
3309 uint ea = EA_AY_DI_32();
\r
3310 uint res = src & m68ki_read_32(ea);
\r
3312 FLAG_N = NFLAG_32(res);
\r
3314 FLAG_C = CFLAG_CLEAR;
\r
3315 FLAG_V = VFLAG_CLEAR;
\r
3317 m68ki_write_32(ea, res);
\r
3321 void m68k_op_andi_32_ix(void)
\r
3323 uint src = OPER_I_32();
\r
3324 uint ea = EA_AY_IX_32();
\r
3325 uint res = src & m68ki_read_32(ea);
\r
3327 FLAG_N = NFLAG_32(res);
\r
3329 FLAG_C = CFLAG_CLEAR;
\r
3330 FLAG_V = VFLAG_CLEAR;
\r
3332 m68ki_write_32(ea, res);
\r
3336 void m68k_op_andi_32_aw(void)
\r
3338 uint src = OPER_I_32();
\r
3339 uint ea = EA_AW_32();
\r
3340 uint res = src & m68ki_read_32(ea);
\r
3342 FLAG_N = NFLAG_32(res);
\r
3344 FLAG_C = CFLAG_CLEAR;
\r
3345 FLAG_V = VFLAG_CLEAR;
\r
3347 m68ki_write_32(ea, res);
\r
3351 void m68k_op_andi_32_al(void)
\r
3353 uint src = OPER_I_32();
\r
3354 uint ea = EA_AL_32();
\r
3355 uint res = src & m68ki_read_32(ea);
\r
3357 FLAG_N = NFLAG_32(res);
\r
3359 FLAG_C = CFLAG_CLEAR;
\r
3360 FLAG_V = VFLAG_CLEAR;
\r
3362 m68ki_write_32(ea, res);
\r
3366 void m68k_op_andi_16_toc(void)
\r
3368 m68ki_set_ccr(m68ki_get_ccr() & OPER_I_16());
\r
3372 void m68k_op_andi_16_tos(void)
\r
3376 uint src = OPER_I_16();
\r
3377 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
3378 m68ki_set_sr(m68ki_get_sr() & src);
\r
3381 m68ki_exception_privilege_violation();
\r
3385 void m68k_op_asr_8_s(void)
\r
3387 uint* r_dst = &DY;
\r
3388 uint shift = (((REG_IR >> 9) - 1) & 7) + 1;
\r
3389 uint src = MASK_OUT_ABOVE_8(*r_dst);
\r
3390 uint res = src >> shift;
\r
3393 USE_CYCLES(shift<<CYC_SHIFT);
\r
3395 if(GET_MSB_8(src))
\r
3396 res |= m68ki_shift_8_table[shift];
\r
3398 *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
\r
3400 FLAG_N = NFLAG_8(res);
\r
3402 FLAG_V = VFLAG_CLEAR;
\r
3403 FLAG_X = FLAG_C = src << (9-shift);
\r
3407 void m68k_op_asr_16_s(void)
\r
3409 uint* r_dst = &DY;
\r
3410 uint shift = (((REG_IR >> 9) - 1) & 7) + 1;
\r
3411 uint src = MASK_OUT_ABOVE_16(*r_dst);
\r
3412 uint res = src >> shift;
\r
3415 USE_CYCLES(shift<<CYC_SHIFT);
\r
3417 if(GET_MSB_16(src))
\r
3418 res |= m68ki_shift_16_table[shift];
\r
3420 *r_dst = MASK_OUT_BELOW_16(*r_dst) | res;
\r
3422 FLAG_N = NFLAG_16(res);
\r
3424 FLAG_V = VFLAG_CLEAR;
\r
3425 FLAG_X = FLAG_C = src << (9-shift);
\r
3429 void m68k_op_asr_32_s(void)
\r
3431 uint* r_dst = &DY;
\r
3432 uint shift = (((REG_IR >> 9) - 1) & 7) + 1;
\r
3433 uint src = *r_dst;
\r
3434 uint res = src >> shift;
\r
3437 USE_CYCLES(shift<<CYC_SHIFT);
\r
3439 if(GET_MSB_32(src))
\r
3440 res |= m68ki_shift_32_table[shift];
\r
3444 FLAG_N = NFLAG_32(res);
\r
3446 FLAG_V = VFLAG_CLEAR;
\r
3447 FLAG_X = FLAG_C = src << (9-shift);
\r
3451 void m68k_op_asr_8_r(void)
\r
3453 uint* r_dst = &DY;
\r
3454 uint shift = DX & 0x3f;
\r
3455 uint src = MASK_OUT_ABOVE_8(*r_dst);
\r
3456 uint res = src >> shift;
\r
3460 USE_CYCLES(shift<<CYC_SHIFT);
\r
3464 if(GET_MSB_8(src))
\r
3465 res |= m68ki_shift_8_table[shift];
\r
3467 *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
\r
3469 FLAG_X = FLAG_C = src << (9-shift);
\r
3470 FLAG_N = NFLAG_8(res);
\r
3472 FLAG_V = VFLAG_CLEAR;
\r
3476 if(GET_MSB_8(src))
\r
3479 FLAG_C = CFLAG_SET;
\r
3480 FLAG_X = XFLAG_SET;
\r
3481 FLAG_N = NFLAG_SET;
\r
3482 FLAG_Z = ZFLAG_CLEAR;
\r
3483 FLAG_V = VFLAG_CLEAR;
\r
3487 *r_dst &= 0xffffff00;
\r
3488 FLAG_C = CFLAG_CLEAR;
\r
3489 FLAG_X = XFLAG_CLEAR;
\r
3490 FLAG_N = NFLAG_CLEAR;
\r
3491 FLAG_Z = ZFLAG_SET;
\r
3492 FLAG_V = VFLAG_CLEAR;
\r
3496 FLAG_C = CFLAG_CLEAR;
\r
3497 FLAG_N = NFLAG_8(src);
\r
3499 FLAG_V = VFLAG_CLEAR;
\r
3503 void m68k_op_asr_16_r(void)
\r
3505 uint* r_dst = &DY;
\r
3506 uint shift = DX & 0x3f;
\r
3507 uint src = MASK_OUT_ABOVE_16(*r_dst);
\r
3508 uint res = src >> shift;
\r
3512 USE_CYCLES(shift<<CYC_SHIFT);
\r
3516 if(GET_MSB_16(src))
\r
3517 res |= m68ki_shift_16_table[shift];
\r
3519 *r_dst = MASK_OUT_BELOW_16(*r_dst) | res;
\r
3521 FLAG_C = FLAG_X = (src >> (shift - 1))<<8;
\r
3522 FLAG_N = NFLAG_16(res);
\r
3524 FLAG_V = VFLAG_CLEAR;
\r
3528 if(GET_MSB_16(src))
\r
3531 FLAG_C = CFLAG_SET;
\r
3532 FLAG_X = XFLAG_SET;
\r
3533 FLAG_N = NFLAG_SET;
\r
3534 FLAG_Z = ZFLAG_CLEAR;
\r
3535 FLAG_V = VFLAG_CLEAR;
\r
3539 *r_dst &= 0xffff0000;
\r
3540 FLAG_C = CFLAG_CLEAR;
\r
3541 FLAG_X = XFLAG_CLEAR;
\r
3542 FLAG_N = NFLAG_CLEAR;
\r
3543 FLAG_Z = ZFLAG_SET;
\r
3544 FLAG_V = VFLAG_CLEAR;
\r
3548 FLAG_C = CFLAG_CLEAR;
\r
3549 FLAG_N = NFLAG_16(src);
\r
3551 FLAG_V = VFLAG_CLEAR;
\r
3555 void m68k_op_asr_32_r(void)
\r
3557 uint* r_dst = &DY;
\r
3558 uint shift = DX & 0x3f;
\r
3559 uint src = *r_dst;
\r
3560 uint res = src >> shift;
\r
3564 USE_CYCLES(shift<<CYC_SHIFT);
\r
3568 if(GET_MSB_32(src))
\r
3569 res |= m68ki_shift_32_table[shift];
\r
3573 FLAG_C = FLAG_X = (src >> (shift - 1))<<8;
\r
3574 FLAG_N = NFLAG_32(res);
\r
3576 FLAG_V = VFLAG_CLEAR;
\r
3580 if(GET_MSB_32(src))
\r
3582 *r_dst = 0xffffffff;
\r
3583 FLAG_C = CFLAG_SET;
\r
3584 FLAG_X = XFLAG_SET;
\r
3585 FLAG_N = NFLAG_SET;
\r
3586 FLAG_Z = ZFLAG_CLEAR;
\r
3587 FLAG_V = VFLAG_CLEAR;
\r
3592 FLAG_C = CFLAG_CLEAR;
\r
3593 FLAG_X = XFLAG_CLEAR;
\r
3594 FLAG_N = NFLAG_CLEAR;
\r
3595 FLAG_Z = ZFLAG_SET;
\r
3596 FLAG_V = VFLAG_CLEAR;
\r
3600 FLAG_C = CFLAG_CLEAR;
\r
3601 FLAG_N = NFLAG_32(src);
\r
3603 FLAG_V = VFLAG_CLEAR;
\r
3607 void m68k_op_asr_16_ai(void)
\r
3609 uint ea = EA_AY_AI_16();
\r
3610 uint src = m68ki_read_16(ea);
\r
3611 uint res = src >> 1;
\r
3613 if(GET_MSB_16(src))
\r
3616 m68ki_write_16(ea, res);
\r
3618 FLAG_N = NFLAG_16(res);
\r
3620 FLAG_V = VFLAG_CLEAR;
\r
3621 FLAG_C = FLAG_X = src << 8;
\r
3625 void m68k_op_asr_16_pi(void)
\r
3627 uint ea = EA_AY_PI_16();
\r
3628 uint src = m68ki_read_16(ea);
\r
3629 uint res = src >> 1;
\r
3631 if(GET_MSB_16(src))
\r
3634 m68ki_write_16(ea, res);
\r
3636 FLAG_N = NFLAG_16(res);
\r
3638 FLAG_V = VFLAG_CLEAR;
\r
3639 FLAG_C = FLAG_X = src << 8;
\r
3643 void m68k_op_asr_16_pd(void)
\r
3645 uint ea = EA_AY_PD_16();
\r
3646 uint src = m68ki_read_16(ea);
\r
3647 uint res = src >> 1;
\r
3649 if(GET_MSB_16(src))
\r
3652 m68ki_write_16(ea, res);
\r
3654 FLAG_N = NFLAG_16(res);
\r
3656 FLAG_V = VFLAG_CLEAR;
\r
3657 FLAG_C = FLAG_X = src << 8;
\r
3661 void m68k_op_asr_16_di(void)
\r
3663 uint ea = EA_AY_DI_16();
\r
3664 uint src = m68ki_read_16(ea);
\r
3665 uint res = src >> 1;
\r
3667 if(GET_MSB_16(src))
\r
3670 m68ki_write_16(ea, res);
\r
3672 FLAG_N = NFLAG_16(res);
\r
3674 FLAG_V = VFLAG_CLEAR;
\r
3675 FLAG_C = FLAG_X = src << 8;
\r
3679 void m68k_op_asr_16_ix(void)
\r
3681 uint ea = EA_AY_IX_16();
\r
3682 uint src = m68ki_read_16(ea);
\r
3683 uint res = src >> 1;
\r
3685 if(GET_MSB_16(src))
\r
3688 m68ki_write_16(ea, res);
\r
3690 FLAG_N = NFLAG_16(res);
\r
3692 FLAG_V = VFLAG_CLEAR;
\r
3693 FLAG_C = FLAG_X = src << 8;
\r
3697 void m68k_op_asr_16_aw(void)
\r
3699 uint ea = EA_AW_16();
\r
3700 uint src = m68ki_read_16(ea);
\r
3701 uint res = src >> 1;
\r
3703 if(GET_MSB_16(src))
\r
3706 m68ki_write_16(ea, res);
\r
3708 FLAG_N = NFLAG_16(res);
\r
3710 FLAG_V = VFLAG_CLEAR;
\r
3711 FLAG_C = FLAG_X = src << 8;
\r
3715 void m68k_op_asr_16_al(void)
\r
3717 uint ea = EA_AL_16();
\r
3718 uint src = m68ki_read_16(ea);
\r
3719 uint res = src >> 1;
\r
3721 if(GET_MSB_16(src))
\r
3724 m68ki_write_16(ea, res);
\r
3726 FLAG_N = NFLAG_16(res);
\r
3728 FLAG_V = VFLAG_CLEAR;
\r
3729 FLAG_C = FLAG_X = src << 8;
\r
3733 void m68k_op_asl_8_s(void)
\r
3735 uint* r_dst = &DY;
\r
3736 uint shift = (((REG_IR >> 9) - 1) & 7) + 1;
\r
3737 uint src = MASK_OUT_ABOVE_8(*r_dst);
\r
3738 uint res = MASK_OUT_ABOVE_8(src << shift);
\r
3741 USE_CYCLES(shift<<CYC_SHIFT);
\r
3743 *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
\r
3745 FLAG_X = FLAG_C = src << shift;
\r
3746 FLAG_N = NFLAG_8(res);
\r
3748 src &= m68ki_shift_8_table[shift + 1];
\r
3749 FLAG_V = (!(src == 0 || (src == m68ki_shift_8_table[shift + 1] && shift < 8)))<<7;
\r
3753 void m68k_op_asl_16_s(void)
\r
3755 uint* r_dst = &DY;
\r
3756 uint shift = (((REG_IR >> 9) - 1) & 7) + 1;
\r
3757 uint src = MASK_OUT_ABOVE_16(*r_dst);
\r
3758 uint res = MASK_OUT_ABOVE_16(src << shift);
\r
3761 USE_CYCLES(shift<<CYC_SHIFT);
\r
3763 *r_dst = MASK_OUT_BELOW_16(*r_dst) | res;
\r
3765 FLAG_N = NFLAG_16(res);
\r
3767 FLAG_X = FLAG_C = src >> (8-shift);
\r
3768 src &= m68ki_shift_16_table[shift + 1];
\r
3769 FLAG_V = (!(src == 0 || src == m68ki_shift_16_table[shift + 1]))<<7;
\r
3773 void m68k_op_asl_32_s(void)
\r
3775 uint* r_dst = &DY;
\r
3776 uint shift = (((REG_IR >> 9) - 1) & 7) + 1;
\r
3777 uint src = *r_dst;
\r
3778 uint res = MASK_OUT_ABOVE_32(src << shift);
\r
3781 USE_CYCLES(shift<<CYC_SHIFT);
\r
3785 FLAG_N = NFLAG_32(res);
\r
3787 FLAG_X = FLAG_C = src >> (24-shift);
\r
3788 src &= m68ki_shift_32_table[shift + 1];
\r
3789 FLAG_V = (!(src == 0 || src == m68ki_shift_32_table[shift + 1]))<<7;
\r
3793 void m68k_op_asl_8_r(void)
\r
3795 uint* r_dst = &DY;
\r
3796 uint shift = DX & 0x3f;
\r
3797 uint src = MASK_OUT_ABOVE_8(*r_dst);
\r
3798 uint res = MASK_OUT_ABOVE_8(src << shift);
\r
3802 USE_CYCLES(shift<<CYC_SHIFT);
\r
3806 *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
\r
3807 FLAG_X = FLAG_C = src << shift;
\r
3808 FLAG_N = NFLAG_8(res);
\r
3810 src &= m68ki_shift_8_table[shift + 1];
\r
3811 FLAG_V = (!(src == 0 || src == m68ki_shift_8_table[shift + 1]))<<7;
\r
3815 *r_dst &= 0xffffff00;
\r
3816 FLAG_X = FLAG_C = ((shift == 8 ? src & 1 : 0))<<8;
\r
3817 FLAG_N = NFLAG_CLEAR;
\r
3818 FLAG_Z = ZFLAG_SET;
\r
3819 FLAG_V = (!(src == 0))<<7;
\r
3823 FLAG_C = CFLAG_CLEAR;
\r
3824 FLAG_N = NFLAG_8(src);
\r
3826 FLAG_V = VFLAG_CLEAR;
\r
3830 void m68k_op_asl_16_r(void)
\r
3832 uint* r_dst = &DY;
\r
3833 uint shift = DX & 0x3f;
\r
3834 uint src = MASK_OUT_ABOVE_16(*r_dst);
\r
3835 uint res = MASK_OUT_ABOVE_16(src << shift);
\r
3839 USE_CYCLES(shift<<CYC_SHIFT);
\r
3843 *r_dst = MASK_OUT_BELOW_16(*r_dst) | res;
\r
3844 FLAG_X = FLAG_C = (src << shift) >> 8;
\r
3845 FLAG_N = NFLAG_16(res);
\r
3847 src &= m68ki_shift_16_table[shift + 1];
\r
3848 FLAG_V = (!(src == 0 || src == m68ki_shift_16_table[shift + 1]))<<7;
\r
3852 *r_dst &= 0xffff0000;
\r
3853 FLAG_X = FLAG_C = ((shift == 16 ? src & 1 : 0))<<8;
\r
3854 FLAG_N = NFLAG_CLEAR;
\r
3855 FLAG_Z = ZFLAG_SET;
\r
3856 FLAG_V = (!(src == 0))<<7;
\r
3860 FLAG_C = CFLAG_CLEAR;
\r
3861 FLAG_N = NFLAG_16(src);
\r
3863 FLAG_V = VFLAG_CLEAR;
\r
3867 void m68k_op_asl_32_r(void)
\r
3869 uint* r_dst = &DY;
\r
3870 uint shift = DX & 0x3f;
\r
3871 uint src = *r_dst;
\r
3872 uint res = MASK_OUT_ABOVE_32(src << shift);
\r
3876 USE_CYCLES(shift<<CYC_SHIFT);
\r
3881 FLAG_X = FLAG_C = (src >> (32 - shift)) << 8;
\r
3882 FLAG_N = NFLAG_32(res);
\r
3884 src &= m68ki_shift_32_table[shift + 1];
\r
3885 FLAG_V = (!(src == 0 || src == m68ki_shift_32_table[shift + 1]))<<7;
\r
3890 FLAG_X = FLAG_C = ((shift == 32 ? src & 1 : 0))<<8;
\r
3891 FLAG_N = NFLAG_CLEAR;
\r
3892 FLAG_Z = ZFLAG_SET;
\r
3893 FLAG_V = (!(src == 0))<<7;
\r
3897 FLAG_C = CFLAG_CLEAR;
\r
3898 FLAG_N = NFLAG_32(src);
\r
3900 FLAG_V = VFLAG_CLEAR;
\r
3904 void m68k_op_asl_16_ai(void)
\r
3906 uint ea = EA_AY_AI_16();
\r
3907 uint src = m68ki_read_16(ea);
\r
3908 uint res = MASK_OUT_ABOVE_16(src << 1);
\r
3910 m68ki_write_16(ea, res);
\r
3912 FLAG_N = NFLAG_16(res);
\r
3914 FLAG_X = FLAG_C = src >> 7;
\r
3916 FLAG_V = (!(src == 0 || src == 0xc000))<<7;
\r
3920 void m68k_op_asl_16_pi(void)
\r
3922 uint ea = EA_AY_PI_16();
\r
3923 uint src = m68ki_read_16(ea);
\r
3924 uint res = MASK_OUT_ABOVE_16(src << 1);
\r
3926 m68ki_write_16(ea, res);
\r
3928 FLAG_N = NFLAG_16(res);
\r
3930 FLAG_X = FLAG_C = src >> 7;
\r
3932 FLAG_V = (!(src == 0 || src == 0xc000))<<7;
\r
3936 void m68k_op_asl_16_pd(void)
\r
3938 uint ea = EA_AY_PD_16();
\r
3939 uint src = m68ki_read_16(ea);
\r
3940 uint res = MASK_OUT_ABOVE_16(src << 1);
\r
3942 m68ki_write_16(ea, res);
\r
3944 FLAG_N = NFLAG_16(res);
\r
3946 FLAG_X = FLAG_C = src >> 7;
\r
3948 FLAG_V = (!(src == 0 || src == 0xc000))<<7;
\r
3952 void m68k_op_asl_16_di(void)
\r
3954 uint ea = EA_AY_DI_16();
\r
3955 uint src = m68ki_read_16(ea);
\r
3956 uint res = MASK_OUT_ABOVE_16(src << 1);
\r
3958 m68ki_write_16(ea, res);
\r
3960 FLAG_N = NFLAG_16(res);
\r
3962 FLAG_X = FLAG_C = src >> 7;
\r
3964 FLAG_V = (!(src == 0 || src == 0xc000))<<7;
\r
3968 void m68k_op_asl_16_ix(void)
\r
3970 uint ea = EA_AY_IX_16();
\r
3971 uint src = m68ki_read_16(ea);
\r
3972 uint res = MASK_OUT_ABOVE_16(src << 1);
\r
3974 m68ki_write_16(ea, res);
\r
3976 FLAG_N = NFLAG_16(res);
\r
3978 FLAG_X = FLAG_C = src >> 7;
\r
3980 FLAG_V = (!(src == 0 || src == 0xc000))<<7;
\r
3984 void m68k_op_asl_16_aw(void)
\r
3986 uint ea = EA_AW_16();
\r
3987 uint src = m68ki_read_16(ea);
\r
3988 uint res = MASK_OUT_ABOVE_16(src << 1);
\r
3990 m68ki_write_16(ea, res);
\r
3992 FLAG_N = NFLAG_16(res);
\r
3994 FLAG_X = FLAG_C = src >> 7;
\r
3996 FLAG_V = (!(src == 0 || src == 0xc000))<<7;
\r
4000 void m68k_op_asl_16_al(void)
\r
4002 uint ea = EA_AL_16();
\r
4003 uint src = m68ki_read_16(ea);
\r
4004 uint res = MASK_OUT_ABOVE_16(src << 1);
\r
4006 m68ki_write_16(ea, res);
\r
4008 FLAG_N = NFLAG_16(res);
\r
4010 FLAG_X = FLAG_C = src >> 7;
\r
4012 FLAG_V = (!(src == 0 || src == 0xc000))<<7;
\r
4016 void m68k_op_bhi_8(void)
\r
4020 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4021 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4024 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4028 void m68k_op_bls_8(void)
\r
4032 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4033 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4036 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4040 void m68k_op_bcc_8(void)
\r
4044 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4045 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4048 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4052 void m68k_op_bcs_8(void)
\r
4056 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4057 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4060 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4064 void m68k_op_bne_8(void)
\r
4068 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4069 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4072 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4076 void m68k_op_beq_8(void)
\r
4080 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4081 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4084 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4088 void m68k_op_bvc_8(void)
\r
4092 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4093 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4096 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4100 void m68k_op_bvs_8(void)
\r
4104 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4105 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4108 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4112 void m68k_op_bpl_8(void)
\r
4116 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4117 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4120 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4124 void m68k_op_bmi_8(void)
\r
4128 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4129 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4132 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4136 void m68k_op_bge_8(void)
\r
4140 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4141 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4144 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4148 void m68k_op_blt_8(void)
\r
4152 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4153 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4156 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4160 void m68k_op_bgt_8(void)
\r
4164 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4165 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4168 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4172 void m68k_op_ble_8(void)
\r
4176 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4177 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4180 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4184 void m68k_op_bhi_16(void)
\r
4188 uint offset = OPER_I_16();
\r
4190 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4191 m68ki_branch_16(offset);
\r
4195 USE_CYCLES(CYC_BCC_NOTAKE_W);
\r
4199 void m68k_op_bls_16(void)
\r
4203 uint offset = OPER_I_16();
\r
4205 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4206 m68ki_branch_16(offset);
\r
4210 USE_CYCLES(CYC_BCC_NOTAKE_W);
\r
4214 void m68k_op_bcc_16(void)
\r
4218 uint offset = OPER_I_16();
\r
4220 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4221 m68ki_branch_16(offset);
\r
4225 USE_CYCLES(CYC_BCC_NOTAKE_W);
\r
4229 void m68k_op_bcs_16(void)
\r
4233 uint offset = OPER_I_16();
\r
4235 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4236 m68ki_branch_16(offset);
\r
4240 USE_CYCLES(CYC_BCC_NOTAKE_W);
\r
4244 void m68k_op_bne_16(void)
\r
4248 uint offset = OPER_I_16();
\r
4250 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4251 m68ki_branch_16(offset);
\r
4255 USE_CYCLES(CYC_BCC_NOTAKE_W);
\r
4259 void m68k_op_beq_16(void)
\r
4263 uint offset = OPER_I_16();
\r
4265 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4266 m68ki_branch_16(offset);
\r
4270 USE_CYCLES(CYC_BCC_NOTAKE_W);
\r
4274 void m68k_op_bvc_16(void)
\r
4278 uint offset = OPER_I_16();
\r
4280 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4281 m68ki_branch_16(offset);
\r
4285 USE_CYCLES(CYC_BCC_NOTAKE_W);
\r
4289 void m68k_op_bvs_16(void)
\r
4293 uint offset = OPER_I_16();
\r
4295 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4296 m68ki_branch_16(offset);
\r
4300 USE_CYCLES(CYC_BCC_NOTAKE_W);
\r
4304 void m68k_op_bpl_16(void)
\r
4308 uint offset = OPER_I_16();
\r
4310 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4311 m68ki_branch_16(offset);
\r
4315 USE_CYCLES(CYC_BCC_NOTAKE_W);
\r
4319 void m68k_op_bmi_16(void)
\r
4323 uint offset = OPER_I_16();
\r
4325 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4326 m68ki_branch_16(offset);
\r
4330 USE_CYCLES(CYC_BCC_NOTAKE_W);
\r
4334 void m68k_op_bge_16(void)
\r
4338 uint offset = OPER_I_16();
\r
4340 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4341 m68ki_branch_16(offset);
\r
4345 USE_CYCLES(CYC_BCC_NOTAKE_W);
\r
4349 void m68k_op_blt_16(void)
\r
4353 uint offset = OPER_I_16();
\r
4355 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4356 m68ki_branch_16(offset);
\r
4360 USE_CYCLES(CYC_BCC_NOTAKE_W);
\r
4364 void m68k_op_bgt_16(void)
\r
4368 uint offset = OPER_I_16();
\r
4370 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4371 m68ki_branch_16(offset);
\r
4375 USE_CYCLES(CYC_BCC_NOTAKE_W);
\r
4379 void m68k_op_ble_16(void)
\r
4383 uint offset = OPER_I_16();
\r
4385 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4386 m68ki_branch_16(offset);
\r
4390 USE_CYCLES(CYC_BCC_NOTAKE_W);
\r
4394 void m68k_op_bhi_32(void)
\r
4396 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
4400 uint offset = OPER_I_32();
\r
4402 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4403 m68ki_branch_32(offset);
\r
4413 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4414 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4417 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4422 void m68k_op_bls_32(void)
\r
4424 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
4428 uint offset = OPER_I_32();
\r
4430 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4431 m68ki_branch_32(offset);
\r
4441 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4442 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4445 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4450 void m68k_op_bcc_32(void)
\r
4452 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
4456 uint offset = OPER_I_32();
\r
4458 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4459 m68ki_branch_32(offset);
\r
4469 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4470 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4473 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4478 void m68k_op_bcs_32(void)
\r
4480 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
4484 uint offset = OPER_I_32();
\r
4486 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4487 m68ki_branch_32(offset);
\r
4497 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4498 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4501 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4506 void m68k_op_bne_32(void)
\r
4508 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
4512 uint offset = OPER_I_32();
\r
4514 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4515 m68ki_branch_32(offset);
\r
4525 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4526 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4529 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4534 void m68k_op_beq_32(void)
\r
4536 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
4540 uint offset = OPER_I_32();
\r
4542 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4543 m68ki_branch_32(offset);
\r
4553 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4554 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4557 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4562 void m68k_op_bvc_32(void)
\r
4564 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
4568 uint offset = OPER_I_32();
\r
4570 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4571 m68ki_branch_32(offset);
\r
4581 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4582 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4585 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4590 void m68k_op_bvs_32(void)
\r
4592 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
4596 uint offset = OPER_I_32();
\r
4598 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4599 m68ki_branch_32(offset);
\r
4609 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4610 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4613 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4618 void m68k_op_bpl_32(void)
\r
4620 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
4624 uint offset = OPER_I_32();
\r
4626 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4627 m68ki_branch_32(offset);
\r
4637 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4638 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4641 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4646 void m68k_op_bmi_32(void)
\r
4648 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
4652 uint offset = OPER_I_32();
\r
4654 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4655 m68ki_branch_32(offset);
\r
4665 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4666 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4669 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4674 void m68k_op_bge_32(void)
\r
4676 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
4680 uint offset = OPER_I_32();
\r
4682 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4683 m68ki_branch_32(offset);
\r
4693 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4694 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4697 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4702 void m68k_op_blt_32(void)
\r
4704 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
4708 uint offset = OPER_I_32();
\r
4710 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4711 m68ki_branch_32(offset);
\r
4721 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4722 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4725 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4730 void m68k_op_bgt_32(void)
\r
4732 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
4736 uint offset = OPER_I_32();
\r
4738 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4739 m68ki_branch_32(offset);
\r
4749 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4750 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4753 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4758 void m68k_op_ble_32(void)
\r
4760 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
4764 uint offset = OPER_I_32();
\r
4766 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4767 m68ki_branch_32(offset);
\r
4777 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
4778 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
4781 USE_CYCLES(CYC_BCC_NOTAKE_B);
\r
4786 void m68k_op_bchg_32_r_d(void)
\r
4788 uint* r_dst = &DY;
\r
4789 uint mask = 1 << (DX & 0x1f);
\r
4791 FLAG_Z = *r_dst & mask;
\r
4796 void m68k_op_bchg_8_r_ai(void)
\r
4798 uint ea = EA_AY_AI_8();
\r
4799 uint src = m68ki_read_8(ea);
\r
4800 uint mask = 1 << (DX & 7);
\r
4802 FLAG_Z = src & mask;
\r
4803 m68ki_write_8(ea, src ^ mask);
\r
4807 void m68k_op_bchg_8_r_pi(void)
\r
4809 uint ea = EA_AY_PI_8();
\r
4810 uint src = m68ki_read_8(ea);
\r
4811 uint mask = 1 << (DX & 7);
\r
4813 FLAG_Z = src & mask;
\r
4814 m68ki_write_8(ea, src ^ mask);
\r
4818 void m68k_op_bchg_8_r_pi7(void)
\r
4820 uint ea = EA_A7_PI_8();
\r
4821 uint src = m68ki_read_8(ea);
\r
4822 uint mask = 1 << (DX & 7);
\r
4824 FLAG_Z = src & mask;
\r
4825 m68ki_write_8(ea, src ^ mask);
\r
4829 void m68k_op_bchg_8_r_pd(void)
\r
4831 uint ea = EA_AY_PD_8();
\r
4832 uint src = m68ki_read_8(ea);
\r
4833 uint mask = 1 << (DX & 7);
\r
4835 FLAG_Z = src & mask;
\r
4836 m68ki_write_8(ea, src ^ mask);
\r
4840 void m68k_op_bchg_8_r_pd7(void)
\r
4842 uint ea = EA_A7_PD_8();
\r
4843 uint src = m68ki_read_8(ea);
\r
4844 uint mask = 1 << (DX & 7);
\r
4846 FLAG_Z = src & mask;
\r
4847 m68ki_write_8(ea, src ^ mask);
\r
4851 void m68k_op_bchg_8_r_di(void)
\r
4853 uint ea = EA_AY_DI_8();
\r
4854 uint src = m68ki_read_8(ea);
\r
4855 uint mask = 1 << (DX & 7);
\r
4857 FLAG_Z = src & mask;
\r
4858 m68ki_write_8(ea, src ^ mask);
\r
4862 void m68k_op_bchg_8_r_ix(void)
\r
4864 uint ea = EA_AY_IX_8();
\r
4865 uint src = m68ki_read_8(ea);
\r
4866 uint mask = 1 << (DX & 7);
\r
4868 FLAG_Z = src & mask;
\r
4869 m68ki_write_8(ea, src ^ mask);
\r
4873 void m68k_op_bchg_8_r_aw(void)
\r
4875 uint ea = EA_AW_8();
\r
4876 uint src = m68ki_read_8(ea);
\r
4877 uint mask = 1 << (DX & 7);
\r
4879 FLAG_Z = src & mask;
\r
4880 m68ki_write_8(ea, src ^ mask);
\r
4884 void m68k_op_bchg_8_r_al(void)
\r
4886 uint ea = EA_AL_8();
\r
4887 uint src = m68ki_read_8(ea);
\r
4888 uint mask = 1 << (DX & 7);
\r
4890 FLAG_Z = src & mask;
\r
4891 m68ki_write_8(ea, src ^ mask);
\r
4895 void m68k_op_bchg_32_s_d(void)
\r
4897 uint* r_dst = &DY;
\r
4898 uint mask = 1 << (OPER_I_8() & 0x1f);
\r
4900 FLAG_Z = *r_dst & mask;
\r
4905 void m68k_op_bchg_8_s_ai(void)
\r
4907 uint mask = 1 << (OPER_I_8() & 7);
\r
4908 uint ea = EA_AY_AI_8();
\r
4909 uint src = m68ki_read_8(ea);
\r
4911 FLAG_Z = src & mask;
\r
4912 m68ki_write_8(ea, src ^ mask);
\r
4916 void m68k_op_bchg_8_s_pi(void)
\r
4918 uint mask = 1 << (OPER_I_8() & 7);
\r
4919 uint ea = EA_AY_PI_8();
\r
4920 uint src = m68ki_read_8(ea);
\r
4922 FLAG_Z = src & mask;
\r
4923 m68ki_write_8(ea, src ^ mask);
\r
4927 void m68k_op_bchg_8_s_pi7(void)
\r
4929 uint mask = 1 << (OPER_I_8() & 7);
\r
4930 uint ea = EA_A7_PI_8();
\r
4931 uint src = m68ki_read_8(ea);
\r
4933 FLAG_Z = src & mask;
\r
4934 m68ki_write_8(ea, src ^ mask);
\r
4938 void m68k_op_bchg_8_s_pd(void)
\r
4940 uint mask = 1 << (OPER_I_8() & 7);
\r
4941 uint ea = EA_AY_PD_8();
\r
4942 uint src = m68ki_read_8(ea);
\r
4944 FLAG_Z = src & mask;
\r
4945 m68ki_write_8(ea, src ^ mask);
\r
4949 void m68k_op_bchg_8_s_pd7(void)
\r
4951 uint mask = 1 << (OPER_I_8() & 7);
\r
4952 uint ea = EA_A7_PD_8();
\r
4953 uint src = m68ki_read_8(ea);
\r
4955 FLAG_Z = src & mask;
\r
4956 m68ki_write_8(ea, src ^ mask);
\r
4960 void m68k_op_bchg_8_s_di(void)
\r
4962 uint mask = 1 << (OPER_I_8() & 7);
\r
4963 uint ea = EA_AY_DI_8();
\r
4964 uint src = m68ki_read_8(ea);
\r
4966 FLAG_Z = src & mask;
\r
4967 m68ki_write_8(ea, src ^ mask);
\r
4971 void m68k_op_bchg_8_s_ix(void)
\r
4973 uint mask = 1 << (OPER_I_8() & 7);
\r
4974 uint ea = EA_AY_IX_8();
\r
4975 uint src = m68ki_read_8(ea);
\r
4977 FLAG_Z = src & mask;
\r
4978 m68ki_write_8(ea, src ^ mask);
\r
4982 void m68k_op_bchg_8_s_aw(void)
\r
4984 uint mask = 1 << (OPER_I_8() & 7);
\r
4985 uint ea = EA_AW_8();
\r
4986 uint src = m68ki_read_8(ea);
\r
4988 FLAG_Z = src & mask;
\r
4989 m68ki_write_8(ea, src ^ mask);
\r
4993 void m68k_op_bchg_8_s_al(void)
\r
4995 uint mask = 1 << (OPER_I_8() & 7);
\r
4996 uint ea = EA_AL_8();
\r
4997 uint src = m68ki_read_8(ea);
\r
4999 FLAG_Z = src & mask;
\r
5000 m68ki_write_8(ea, src ^ mask);
\r
5004 void m68k_op_bclr_32_r_d(void)
\r
5006 uint* r_dst = &DY;
\r
5007 uint mask = 1 << (DX & 0x1f);
\r
5009 FLAG_Z = *r_dst & mask;
\r
5014 void m68k_op_bclr_8_r_ai(void)
\r
5016 uint ea = EA_AY_AI_8();
\r
5017 uint src = m68ki_read_8(ea);
\r
5018 uint mask = 1 << (DX & 7);
\r
5020 FLAG_Z = src & mask;
\r
5021 m68ki_write_8(ea, src & ~mask);
\r
5025 void m68k_op_bclr_8_r_pi(void)
\r
5027 uint ea = EA_AY_PI_8();
\r
5028 uint src = m68ki_read_8(ea);
\r
5029 uint mask = 1 << (DX & 7);
\r
5031 FLAG_Z = src & mask;
\r
5032 m68ki_write_8(ea, src & ~mask);
\r
5036 void m68k_op_bclr_8_r_pi7(void)
\r
5038 uint ea = EA_A7_PI_8();
\r
5039 uint src = m68ki_read_8(ea);
\r
5040 uint mask = 1 << (DX & 7);
\r
5042 FLAG_Z = src & mask;
\r
5043 m68ki_write_8(ea, src & ~mask);
\r
5047 void m68k_op_bclr_8_r_pd(void)
\r
5049 uint ea = EA_AY_PD_8();
\r
5050 uint src = m68ki_read_8(ea);
\r
5051 uint mask = 1 << (DX & 7);
\r
5053 FLAG_Z = src & mask;
\r
5054 m68ki_write_8(ea, src & ~mask);
\r
5058 void m68k_op_bclr_8_r_pd7(void)
\r
5060 uint ea = EA_A7_PD_8();
\r
5061 uint src = m68ki_read_8(ea);
\r
5062 uint mask = 1 << (DX & 7);
\r
5064 FLAG_Z = src & mask;
\r
5065 m68ki_write_8(ea, src & ~mask);
\r
5069 void m68k_op_bclr_8_r_di(void)
\r
5071 uint ea = EA_AY_DI_8();
\r
5072 uint src = m68ki_read_8(ea);
\r
5073 uint mask = 1 << (DX & 7);
\r
5075 FLAG_Z = src & mask;
\r
5076 m68ki_write_8(ea, src & ~mask);
\r
5080 void m68k_op_bclr_8_r_ix(void)
\r
5082 uint ea = EA_AY_IX_8();
\r
5083 uint src = m68ki_read_8(ea);
\r
5084 uint mask = 1 << (DX & 7);
\r
5086 FLAG_Z = src & mask;
\r
5087 m68ki_write_8(ea, src & ~mask);
\r
5091 void m68k_op_bclr_8_r_aw(void)
\r
5093 uint ea = EA_AW_8();
\r
5094 uint src = m68ki_read_8(ea);
\r
5095 uint mask = 1 << (DX & 7);
\r
5097 FLAG_Z = src & mask;
\r
5098 m68ki_write_8(ea, src & ~mask);
\r
5102 void m68k_op_bclr_8_r_al(void)
\r
5104 uint ea = EA_AL_8();
\r
5105 uint src = m68ki_read_8(ea);
\r
5106 uint mask = 1 << (DX & 7);
\r
5108 FLAG_Z = src & mask;
\r
5109 m68ki_write_8(ea, src & ~mask);
\r
5113 void m68k_op_bclr_32_s_d(void)
\r
5115 uint* r_dst = &DY;
\r
5116 uint mask = 1 << (OPER_I_8() & 0x1f);
\r
5118 FLAG_Z = *r_dst & mask;
\r
5123 void m68k_op_bclr_8_s_ai(void)
\r
5125 uint mask = 1 << (OPER_I_8() & 7);
\r
5126 uint ea = EA_AY_AI_8();
\r
5127 uint src = m68ki_read_8(ea);
\r
5129 FLAG_Z = src & mask;
\r
5130 m68ki_write_8(ea, src & ~mask);
\r
5134 void m68k_op_bclr_8_s_pi(void)
\r
5136 uint mask = 1 << (OPER_I_8() & 7);
\r
5137 uint ea = EA_AY_PI_8();
\r
5138 uint src = m68ki_read_8(ea);
\r
5140 FLAG_Z = src & mask;
\r
5141 m68ki_write_8(ea, src & ~mask);
\r
5145 void m68k_op_bclr_8_s_pi7(void)
\r
5147 uint mask = 1 << (OPER_I_8() & 7);
\r
5148 uint ea = EA_A7_PI_8();
\r
5149 uint src = m68ki_read_8(ea);
\r
5151 FLAG_Z = src & mask;
\r
5152 m68ki_write_8(ea, src & ~mask);
\r
5156 void m68k_op_bclr_8_s_pd(void)
\r
5158 uint mask = 1 << (OPER_I_8() & 7);
\r
5159 uint ea = EA_AY_PD_8();
\r
5160 uint src = m68ki_read_8(ea);
\r
5162 FLAG_Z = src & mask;
\r
5163 m68ki_write_8(ea, src & ~mask);
\r
5167 void m68k_op_bclr_8_s_pd7(void)
\r
5169 uint mask = 1 << (OPER_I_8() & 7);
\r
5170 uint ea = EA_A7_PD_8();
\r
5171 uint src = m68ki_read_8(ea);
\r
5173 FLAG_Z = src & mask;
\r
5174 m68ki_write_8(ea, src & ~mask);
\r
5178 void m68k_op_bclr_8_s_di(void)
\r
5180 uint mask = 1 << (OPER_I_8() & 7);
\r
5181 uint ea = EA_AY_DI_8();
\r
5182 uint src = m68ki_read_8(ea);
\r
5184 FLAG_Z = src & mask;
\r
5185 m68ki_write_8(ea, src & ~mask);
\r
5189 void m68k_op_bclr_8_s_ix(void)
\r
5191 uint mask = 1 << (OPER_I_8() & 7);
\r
5192 uint ea = EA_AY_IX_8();
\r
5193 uint src = m68ki_read_8(ea);
\r
5195 FLAG_Z = src & mask;
\r
5196 m68ki_write_8(ea, src & ~mask);
\r
5200 void m68k_op_bclr_8_s_aw(void)
\r
5202 uint mask = 1 << (OPER_I_8() & 7);
\r
5203 uint ea = EA_AW_8();
\r
5204 uint src = m68ki_read_8(ea);
\r
5206 FLAG_Z = src & mask;
\r
5207 m68ki_write_8(ea, src & ~mask);
\r
5211 void m68k_op_bclr_8_s_al(void)
\r
5213 uint mask = 1 << (OPER_I_8() & 7);
\r
5214 uint ea = EA_AL_8();
\r
5215 uint src = m68ki_read_8(ea);
\r
5217 FLAG_Z = src & mask;
\r
5218 m68ki_write_8(ea, src & ~mask);
\r
5222 void m68k_op_bfchg_32_d(void)
\r
5224 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
5226 uint word2 = OPER_I_16();
\r
5227 uint offset = (word2>>6)&31;
\r
5228 uint width = word2;
\r
5234 offset = REG_D[offset&7];
\r
5236 width = REG_D[width&7];
\r
5239 width = ((width-1) & 31) + 1;
\r
5241 mask = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
5242 mask = ROR_32(mask, offset);
\r
5244 FLAG_N = NFLAG_32(*data<<offset);
\r
5245 FLAG_Z = *data & mask;
\r
5246 FLAG_V = VFLAG_CLEAR;
\r
5247 FLAG_C = CFLAG_CLEAR;
\r
5253 m68ki_exception_illegal();
\r
5257 void m68k_op_bfchg_32_ai(void)
\r
5259 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
5261 uint word2 = OPER_I_16();
\r
5262 sint offset = (word2>>6)&31;
\r
5263 uint width = word2;
\r
5267 uint data_byte = 0;
\r
5268 uint mask_byte = 0;
\r
5269 uint ea = EA_AY_AI_8();
\r
5273 offset = MAKE_INT_32(REG_D[offset&7]);
\r
5275 width = REG_D[width&7];
\r
5277 /* Offset is signed so we have to use ugly math =( */
\r
5285 width = ((width-1) & 31) + 1;
\r
5287 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
5288 mask_long = mask_base >> offset;
\r
5290 data_long = m68ki_read_32(ea);
\r
5291 FLAG_N = NFLAG_32(data_long << offset);
\r
5292 FLAG_Z = data_long & mask_long;
\r
5293 FLAG_V = VFLAG_CLEAR;
\r
5294 FLAG_C = CFLAG_CLEAR;
\r
5296 m68ki_write_32(ea, data_long ^ mask_long);
\r
5298 if((width + offset) > 32)
\r
5300 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
5301 data_byte = m68ki_read_8(ea+4);
\r
5302 FLAG_Z |= (data_byte & mask_byte);
\r
5303 m68ki_write_8(ea+4, data_byte ^ mask_byte);
\r
5307 m68ki_exception_illegal();
\r
5311 void m68k_op_bfchg_32_di(void)
\r
5313 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
5315 uint word2 = OPER_I_16();
\r
5316 sint offset = (word2>>6)&31;
\r
5317 uint width = word2;
\r
5321 uint data_byte = 0;
\r
5322 uint mask_byte = 0;
\r
5323 uint ea = EA_AY_DI_8();
\r
5327 offset = MAKE_INT_32(REG_D[offset&7]);
\r
5329 width = REG_D[width&7];
\r
5331 /* Offset is signed so we have to use ugly math =( */
\r
5339 width = ((width-1) & 31) + 1;
\r
5341 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
5342 mask_long = mask_base >> offset;
\r
5344 data_long = m68ki_read_32(ea);
\r
5345 FLAG_N = NFLAG_32(data_long << offset);
\r
5346 FLAG_Z = data_long & mask_long;
\r
5347 FLAG_V = VFLAG_CLEAR;
\r
5348 FLAG_C = CFLAG_CLEAR;
\r
5350 m68ki_write_32(ea, data_long ^ mask_long);
\r
5352 if((width + offset) > 32)
\r
5354 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
5355 data_byte = m68ki_read_8(ea+4);
\r
5356 FLAG_Z |= (data_byte & mask_byte);
\r
5357 m68ki_write_8(ea+4, data_byte ^ mask_byte);
\r
5361 m68ki_exception_illegal();
\r
5365 void m68k_op_bfchg_32_ix(void)
\r
5367 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
5369 uint word2 = OPER_I_16();
\r
5370 sint offset = (word2>>6)&31;
\r
5371 uint width = word2;
\r
5375 uint data_byte = 0;
\r
5376 uint mask_byte = 0;
\r
5377 uint ea = EA_AY_IX_8();
\r
5381 offset = MAKE_INT_32(REG_D[offset&7]);
\r
5383 width = REG_D[width&7];
\r
5385 /* Offset is signed so we have to use ugly math =( */
\r
5393 width = ((width-1) & 31) + 1;
\r
5395 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
5396 mask_long = mask_base >> offset;
\r
5398 data_long = m68ki_read_32(ea);
\r
5399 FLAG_N = NFLAG_32(data_long << offset);
\r
5400 FLAG_Z = data_long & mask_long;
\r
5401 FLAG_V = VFLAG_CLEAR;
\r
5402 FLAG_C = CFLAG_CLEAR;
\r
5404 m68ki_write_32(ea, data_long ^ mask_long);
\r
5406 if((width + offset) > 32)
\r
5408 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
5409 data_byte = m68ki_read_8(ea+4);
\r
5410 FLAG_Z |= (data_byte & mask_byte);
\r
5411 m68ki_write_8(ea+4, data_byte ^ mask_byte);
\r
5415 m68ki_exception_illegal();
\r
5419 void m68k_op_bfchg_32_aw(void)
\r
5421 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
5423 uint word2 = OPER_I_16();
\r
5424 sint offset = (word2>>6)&31;
\r
5425 uint width = word2;
\r
5429 uint data_byte = 0;
\r
5430 uint mask_byte = 0;
\r
5431 uint ea = EA_AW_8();
\r
5435 offset = MAKE_INT_32(REG_D[offset&7]);
\r
5437 width = REG_D[width&7];
\r
5439 /* Offset is signed so we have to use ugly math =( */
\r
5447 width = ((width-1) & 31) + 1;
\r
5449 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
5450 mask_long = mask_base >> offset;
\r
5452 data_long = m68ki_read_32(ea);
\r
5453 FLAG_N = NFLAG_32(data_long << offset);
\r
5454 FLAG_Z = data_long & mask_long;
\r
5455 FLAG_V = VFLAG_CLEAR;
\r
5456 FLAG_C = CFLAG_CLEAR;
\r
5458 m68ki_write_32(ea, data_long ^ mask_long);
\r
5460 if((width + offset) > 32)
\r
5462 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
5463 data_byte = m68ki_read_8(ea+4);
\r
5464 FLAG_Z |= (data_byte & mask_byte);
\r
5465 m68ki_write_8(ea+4, data_byte ^ mask_byte);
\r
5469 m68ki_exception_illegal();
\r
5473 void m68k_op_bfchg_32_al(void)
\r
5475 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
5477 uint word2 = OPER_I_16();
\r
5478 sint offset = (word2>>6)&31;
\r
5479 uint width = word2;
\r
5483 uint data_byte = 0;
\r
5484 uint mask_byte = 0;
\r
5485 uint ea = EA_AL_8();
\r
5489 offset = MAKE_INT_32(REG_D[offset&7]);
\r
5491 width = REG_D[width&7];
\r
5493 /* Offset is signed so we have to use ugly math =( */
\r
5501 width = ((width-1) & 31) + 1;
\r
5503 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
5504 mask_long = mask_base >> offset;
\r
5506 data_long = m68ki_read_32(ea);
\r
5507 FLAG_N = NFLAG_32(data_long << offset);
\r
5508 FLAG_Z = data_long & mask_long;
\r
5509 FLAG_V = VFLAG_CLEAR;
\r
5510 FLAG_C = CFLAG_CLEAR;
\r
5512 m68ki_write_32(ea, data_long ^ mask_long);
\r
5514 if((width + offset) > 32)
\r
5516 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
5517 data_byte = m68ki_read_8(ea+4);
\r
5518 FLAG_Z |= (data_byte & mask_byte);
\r
5519 m68ki_write_8(ea+4, data_byte ^ mask_byte);
\r
5523 m68ki_exception_illegal();
\r
5527 void m68k_op_bfclr_32_d(void)
\r
5529 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
5531 uint word2 = OPER_I_16();
\r
5532 uint offset = (word2>>6)&31;
\r
5533 uint width = word2;
\r
5539 offset = REG_D[offset&7];
\r
5541 width = REG_D[width&7];
\r
5545 width = ((width-1) & 31) + 1;
\r
5548 mask = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
5549 mask = ROR_32(mask, offset);
\r
5551 FLAG_N = NFLAG_32(*data<<offset);
\r
5552 FLAG_Z = *data & mask;
\r
5553 FLAG_V = VFLAG_CLEAR;
\r
5554 FLAG_C = CFLAG_CLEAR;
\r
5560 m68ki_exception_illegal();
\r
5564 void m68k_op_bfclr_32_ai(void)
\r
5566 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
5568 uint word2 = OPER_I_16();
\r
5569 sint offset = (word2>>6)&31;
\r
5570 uint width = word2;
\r
5574 uint data_byte = 0;
\r
5575 uint mask_byte = 0;
\r
5576 uint ea = EA_AY_AI_8();
\r
5580 offset = MAKE_INT_32(REG_D[offset&7]);
\r
5582 width = REG_D[width&7];
\r
5584 /* Offset is signed so we have to use ugly math =( */
\r
5592 width = ((width-1) & 31) + 1;
\r
5594 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
5595 mask_long = mask_base >> offset;
\r
5597 data_long = m68ki_read_32(ea);
\r
5598 FLAG_N = NFLAG_32(data_long << offset);
\r
5599 FLAG_Z = data_long & mask_long;
\r
5600 FLAG_V = VFLAG_CLEAR;
\r
5601 FLAG_C = CFLAG_CLEAR;
\r
5603 m68ki_write_32(ea, data_long & ~mask_long);
\r
5605 if((width + offset) > 32)
\r
5607 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
5608 data_byte = m68ki_read_8(ea+4);
\r
5609 FLAG_Z |= (data_byte & mask_byte);
\r
5610 m68ki_write_8(ea+4, data_byte & ~mask_byte);
\r
5614 m68ki_exception_illegal();
\r
5618 void m68k_op_bfclr_32_di(void)
\r
5620 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
5622 uint word2 = OPER_I_16();
\r
5623 sint offset = (word2>>6)&31;
\r
5624 uint width = word2;
\r
5628 uint data_byte = 0;
\r
5629 uint mask_byte = 0;
\r
5630 uint ea = EA_AY_DI_8();
\r
5634 offset = MAKE_INT_32(REG_D[offset&7]);
\r
5636 width = REG_D[width&7];
\r
5638 /* Offset is signed so we have to use ugly math =( */
\r
5646 width = ((width-1) & 31) + 1;
\r
5648 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
5649 mask_long = mask_base >> offset;
\r
5651 data_long = m68ki_read_32(ea);
\r
5652 FLAG_N = NFLAG_32(data_long << offset);
\r
5653 FLAG_Z = data_long & mask_long;
\r
5654 FLAG_V = VFLAG_CLEAR;
\r
5655 FLAG_C = CFLAG_CLEAR;
\r
5657 m68ki_write_32(ea, data_long & ~mask_long);
\r
5659 if((width + offset) > 32)
\r
5661 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
5662 data_byte = m68ki_read_8(ea+4);
\r
5663 FLAG_Z |= (data_byte & mask_byte);
\r
5664 m68ki_write_8(ea+4, data_byte & ~mask_byte);
\r
5668 m68ki_exception_illegal();
\r
5672 void m68k_op_bfclr_32_ix(void)
\r
5674 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
5676 uint word2 = OPER_I_16();
\r
5677 sint offset = (word2>>6)&31;
\r
5678 uint width = word2;
\r
5682 uint data_byte = 0;
\r
5683 uint mask_byte = 0;
\r
5684 uint ea = EA_AY_IX_8();
\r
5688 offset = MAKE_INT_32(REG_D[offset&7]);
\r
5690 width = REG_D[width&7];
\r
5692 /* Offset is signed so we have to use ugly math =( */
\r
5700 width = ((width-1) & 31) + 1;
\r
5702 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
5703 mask_long = mask_base >> offset;
\r
5705 data_long = m68ki_read_32(ea);
\r
5706 FLAG_N = NFLAG_32(data_long << offset);
\r
5707 FLAG_Z = data_long & mask_long;
\r
5708 FLAG_V = VFLAG_CLEAR;
\r
5709 FLAG_C = CFLAG_CLEAR;
\r
5711 m68ki_write_32(ea, data_long & ~mask_long);
\r
5713 if((width + offset) > 32)
\r
5715 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
5716 data_byte = m68ki_read_8(ea+4);
\r
5717 FLAG_Z |= (data_byte & mask_byte);
\r
5718 m68ki_write_8(ea+4, data_byte & ~mask_byte);
\r
5722 m68ki_exception_illegal();
\r
5726 void m68k_op_bfclr_32_aw(void)
\r
5728 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
5730 uint word2 = OPER_I_16();
\r
5731 sint offset = (word2>>6)&31;
\r
5732 uint width = word2;
\r
5736 uint data_byte = 0;
\r
5737 uint mask_byte = 0;
\r
5738 uint ea = EA_AW_8();
\r
5742 offset = MAKE_INT_32(REG_D[offset&7]);
\r
5744 width = REG_D[width&7];
\r
5746 /* Offset is signed so we have to use ugly math =( */
\r
5754 width = ((width-1) & 31) + 1;
\r
5756 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
5757 mask_long = mask_base >> offset;
\r
5759 data_long = m68ki_read_32(ea);
\r
5760 FLAG_N = NFLAG_32(data_long << offset);
\r
5761 FLAG_Z = data_long & mask_long;
\r
5762 FLAG_V = VFLAG_CLEAR;
\r
5763 FLAG_C = CFLAG_CLEAR;
\r
5765 m68ki_write_32(ea, data_long & ~mask_long);
\r
5767 if((width + offset) > 32)
\r
5769 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
5770 data_byte = m68ki_read_8(ea+4);
\r
5771 FLAG_Z |= (data_byte & mask_byte);
\r
5772 m68ki_write_8(ea+4, data_byte & ~mask_byte);
\r
5776 m68ki_exception_illegal();
\r
5780 void m68k_op_bfclr_32_al(void)
\r
5782 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
5784 uint word2 = OPER_I_16();
\r
5785 sint offset = (word2>>6)&31;
\r
5786 uint width = word2;
\r
5790 uint data_byte = 0;
\r
5791 uint mask_byte = 0;
\r
5792 uint ea = EA_AL_8();
\r
5796 offset = MAKE_INT_32(REG_D[offset&7]);
\r
5798 width = REG_D[width&7];
\r
5800 /* Offset is signed so we have to use ugly math =( */
\r
5808 width = ((width-1) & 31) + 1;
\r
5810 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
5811 mask_long = mask_base >> offset;
\r
5813 data_long = m68ki_read_32(ea);
\r
5814 FLAG_N = NFLAG_32(data_long << offset);
\r
5815 FLAG_Z = data_long & mask_long;
\r
5816 FLAG_V = VFLAG_CLEAR;
\r
5817 FLAG_C = CFLAG_CLEAR;
\r
5819 m68ki_write_32(ea, data_long & ~mask_long);
\r
5821 if((width + offset) > 32)
\r
5823 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
5824 data_byte = m68ki_read_8(ea+4);
\r
5825 FLAG_Z |= (data_byte & mask_byte);
\r
5826 m68ki_write_8(ea+4, data_byte & ~mask_byte);
\r
5830 m68ki_exception_illegal();
\r
5834 void m68k_op_bfexts_32_d(void)
\r
5836 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
5838 uint word2 = OPER_I_16();
\r
5839 uint offset = (word2>>6)&31;
\r
5840 uint width = word2;
\r
5845 offset = REG_D[offset&7];
\r
5847 width = REG_D[width&7];
\r
5850 width = ((width-1) & 31) + 1;
\r
5852 data = ROL_32(data, offset);
\r
5853 FLAG_N = NFLAG_32(data);
\r
5854 data = MAKE_INT_32(data) >> (32 - width);
\r
5857 FLAG_V = VFLAG_CLEAR;
\r
5858 FLAG_C = CFLAG_CLEAR;
\r
5860 REG_D[(word2>>12)&7] = data;
\r
5864 m68ki_exception_illegal();
\r
5868 void m68k_op_bfexts_32_ai(void)
\r
5870 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
5872 uint word2 = OPER_I_16();
\r
5873 sint offset = (word2>>6)&31;
\r
5874 uint width = word2;
\r
5876 uint ea = EA_AY_AI_8();
\r
5880 offset = MAKE_INT_32(REG_D[offset&7]);
\r
5882 width = REG_D[width&7];
\r
5884 /* Offset is signed so we have to use ugly math =( */
\r
5892 width = ((width-1) & 31) + 1;
\r
5894 data = m68ki_read_32(ea);
\r
5896 data = MASK_OUT_ABOVE_32(data<<offset);
\r
5898 if((offset+width) > 32)
\r
5899 data |= (m68ki_read_8(ea+4) << offset) >> 8;
\r
5901 FLAG_N = NFLAG_32(data);
\r
5902 data = MAKE_INT_32(data) >> (32 - width);
\r
5905 FLAG_V = VFLAG_CLEAR;
\r
5906 FLAG_C = CFLAG_CLEAR;
\r
5908 REG_D[(word2 >> 12) & 7] = data;
\r
5912 m68ki_exception_illegal();
\r
5916 void m68k_op_bfexts_32_di(void)
\r
5918 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
5920 uint word2 = OPER_I_16();
\r
5921 sint offset = (word2>>6)&31;
\r
5922 uint width = word2;
\r
5924 uint ea = EA_AY_DI_8();
\r
5928 offset = MAKE_INT_32(REG_D[offset&7]);
\r
5930 width = REG_D[width&7];
\r
5932 /* Offset is signed so we have to use ugly math =( */
\r
5940 width = ((width-1) & 31) + 1;
\r
5942 data = m68ki_read_32(ea);
\r
5944 data = MASK_OUT_ABOVE_32(data<<offset);
\r
5946 if((offset+width) > 32)
\r
5947 data |= (m68ki_read_8(ea+4) << offset) >> 8;
\r
5949 FLAG_N = NFLAG_32(data);
\r
5950 data = MAKE_INT_32(data) >> (32 - width);
\r
5953 FLAG_V = VFLAG_CLEAR;
\r
5954 FLAG_C = CFLAG_CLEAR;
\r
5956 REG_D[(word2 >> 12) & 7] = data;
\r
5960 m68ki_exception_illegal();
\r
5964 void m68k_op_bfexts_32_ix(void)
\r
5966 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
5968 uint word2 = OPER_I_16();
\r
5969 sint offset = (word2>>6)&31;
\r
5970 uint width = word2;
\r
5972 uint ea = EA_AY_IX_8();
\r
5976 offset = MAKE_INT_32(REG_D[offset&7]);
\r
5978 width = REG_D[width&7];
\r
5980 /* Offset is signed so we have to use ugly math =( */
\r
5988 width = ((width-1) & 31) + 1;
\r
5990 data = m68ki_read_32(ea);
\r
5992 data = MASK_OUT_ABOVE_32(data<<offset);
\r
5994 if((offset+width) > 32)
\r
5995 data |= (m68ki_read_8(ea+4) << offset) >> 8;
\r
5997 FLAG_N = NFLAG_32(data);
\r
5998 data = MAKE_INT_32(data) >> (32 - width);
\r
6001 FLAG_V = VFLAG_CLEAR;
\r
6002 FLAG_C = CFLAG_CLEAR;
\r
6004 REG_D[(word2 >> 12) & 7] = data;
\r
6008 m68ki_exception_illegal();
\r
6012 void m68k_op_bfexts_32_aw(void)
\r
6014 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
6016 uint word2 = OPER_I_16();
\r
6017 sint offset = (word2>>6)&31;
\r
6018 uint width = word2;
\r
6020 uint ea = EA_AW_8();
\r
6024 offset = MAKE_INT_32(REG_D[offset&7]);
\r
6026 width = REG_D[width&7];
\r
6028 /* Offset is signed so we have to use ugly math =( */
\r
6036 width = ((width-1) & 31) + 1;
\r
6038 data = m68ki_read_32(ea);
\r
6040 data = MASK_OUT_ABOVE_32(data<<offset);
\r
6042 if((offset+width) > 32)
\r
6043 data |= (m68ki_read_8(ea+4) << offset) >> 8;
\r
6045 FLAG_N = NFLAG_32(data);
\r
6046 data = MAKE_INT_32(data) >> (32 - width);
\r
6049 FLAG_V = VFLAG_CLEAR;
\r
6050 FLAG_C = CFLAG_CLEAR;
\r
6052 REG_D[(word2 >> 12) & 7] = data;
\r
6056 m68ki_exception_illegal();
\r
6060 void m68k_op_bfexts_32_al(void)
\r
6062 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
6064 uint word2 = OPER_I_16();
\r
6065 sint offset = (word2>>6)&31;
\r
6066 uint width = word2;
\r
6068 uint ea = EA_AL_8();
\r
6072 offset = MAKE_INT_32(REG_D[offset&7]);
\r
6074 width = REG_D[width&7];
\r
6076 /* Offset is signed so we have to use ugly math =( */
\r
6084 width = ((width-1) & 31) + 1;
\r
6086 data = m68ki_read_32(ea);
\r
6088 data = MASK_OUT_ABOVE_32(data<<offset);
\r
6090 if((offset+width) > 32)
\r
6091 data |= (m68ki_read_8(ea+4) << offset) >> 8;
\r
6093 FLAG_N = NFLAG_32(data);
\r
6094 data = MAKE_INT_32(data) >> (32 - width);
\r
6097 FLAG_V = VFLAG_CLEAR;
\r
6098 FLAG_C = CFLAG_CLEAR;
\r
6100 REG_D[(word2 >> 12) & 7] = data;
\r
6104 m68ki_exception_illegal();
\r
6108 void m68k_op_bfexts_32_pcdi(void)
\r
6110 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
6112 uint word2 = OPER_I_16();
\r
6113 sint offset = (word2>>6)&31;
\r
6114 uint width = word2;
\r
6116 uint ea = EA_PCDI_8();
\r
6120 offset = MAKE_INT_32(REG_D[offset&7]);
\r
6122 width = REG_D[width&7];
\r
6124 /* Offset is signed so we have to use ugly math =( */
\r
6132 width = ((width-1) & 31) + 1;
\r
6134 data = m68ki_read_32(ea);
\r
6136 data = MASK_OUT_ABOVE_32(data<<offset);
\r
6138 if((offset+width) > 32)
\r
6139 data |= (m68ki_read_8(ea+4) << offset) >> 8;
\r
6141 FLAG_N = NFLAG_32(data);
\r
6142 data = MAKE_INT_32(data) >> (32 - width);
\r
6145 FLAG_V = VFLAG_CLEAR;
\r
6146 FLAG_C = CFLAG_CLEAR;
\r
6148 REG_D[(word2 >> 12) & 7] = data;
\r
6152 m68ki_exception_illegal();
\r
6156 void m68k_op_bfexts_32_pcix(void)
\r
6158 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
6160 uint word2 = OPER_I_16();
\r
6161 sint offset = (word2>>6)&31;
\r
6162 uint width = word2;
\r
6164 uint ea = EA_PCIX_8();
\r
6168 offset = MAKE_INT_32(REG_D[offset&7]);
\r
6170 width = REG_D[width&7];
\r
6172 /* Offset is signed so we have to use ugly math =( */
\r
6180 width = ((width-1) & 31) + 1;
\r
6182 data = m68ki_read_32(ea);
\r
6184 data = MASK_OUT_ABOVE_32(data<<offset);
\r
6186 if((offset+width) > 32)
\r
6187 data |= (m68ki_read_8(ea+4) << offset) >> 8;
\r
6189 FLAG_N = NFLAG_32(data);
\r
6190 data = MAKE_INT_32(data) >> (32 - width);
\r
6193 FLAG_V = VFLAG_CLEAR;
\r
6194 FLAG_C = CFLAG_CLEAR;
\r
6196 REG_D[(word2 >> 12) & 7] = data;
\r
6200 m68ki_exception_illegal();
\r
6204 void m68k_op_bfextu_32_d(void)
\r
6206 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
6208 uint word2 = OPER_I_16();
\r
6209 uint offset = (word2>>6)&31;
\r
6210 uint width = word2;
\r
6215 offset = REG_D[offset&7];
\r
6217 width = REG_D[width&7];
\r
6220 width = ((width-1) & 31) + 1;
\r
6222 data = ROL_32(data, offset);
\r
6223 FLAG_N = NFLAG_32(data);
\r
6224 data >>= 32 - width;
\r
6227 FLAG_V = VFLAG_CLEAR;
\r
6228 FLAG_C = CFLAG_CLEAR;
\r
6230 REG_D[(word2>>12)&7] = data;
\r
6234 m68ki_exception_illegal();
\r
6238 void m68k_op_bfextu_32_ai(void)
\r
6240 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
6242 uint word2 = OPER_I_16();
\r
6243 sint offset = (word2>>6)&31;
\r
6244 uint width = word2;
\r
6246 uint ea = EA_AY_AI_8();
\r
6250 offset = MAKE_INT_32(REG_D[offset&7]);
\r
6252 width = REG_D[width&7];
\r
6254 /* Offset is signed so we have to use ugly math =( */
\r
6262 width = ((width-1) & 31) + 1;
\r
6264 data = m68ki_read_32(ea);
\r
6265 data = MASK_OUT_ABOVE_32(data<<offset);
\r
6267 if((offset+width) > 32)
\r
6268 data |= (m68ki_read_8(ea+4) << offset) >> 8;
\r
6270 FLAG_N = NFLAG_32(data);
\r
6271 data >>= (32 - width);
\r
6274 FLAG_V = VFLAG_CLEAR;
\r
6275 FLAG_C = CFLAG_CLEAR;
\r
6277 REG_D[(word2 >> 12) & 7] = data;
\r
6281 m68ki_exception_illegal();
\r
6285 void m68k_op_bfextu_32_di(void)
\r
6287 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
6289 uint word2 = OPER_I_16();
\r
6290 sint offset = (word2>>6)&31;
\r
6291 uint width = word2;
\r
6293 uint ea = EA_AY_DI_8();
\r
6297 offset = MAKE_INT_32(REG_D[offset&7]);
\r
6299 width = REG_D[width&7];
\r
6301 /* Offset is signed so we have to use ugly math =( */
\r
6309 width = ((width-1) & 31) + 1;
\r
6311 data = m68ki_read_32(ea);
\r
6312 data = MASK_OUT_ABOVE_32(data<<offset);
\r
6314 if((offset+width) > 32)
\r
6315 data |= (m68ki_read_8(ea+4) << offset) >> 8;
\r
6317 FLAG_N = NFLAG_32(data);
\r
6318 data >>= (32 - width);
\r
6321 FLAG_V = VFLAG_CLEAR;
\r
6322 FLAG_C = CFLAG_CLEAR;
\r
6324 REG_D[(word2 >> 12) & 7] = data;
\r
6328 m68ki_exception_illegal();
\r
6332 void m68k_op_bfextu_32_ix(void)
\r
6334 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
6336 uint word2 = OPER_I_16();
\r
6337 sint offset = (word2>>6)&31;
\r
6338 uint width = word2;
\r
6340 uint ea = EA_AY_IX_8();
\r
6344 offset = MAKE_INT_32(REG_D[offset&7]);
\r
6346 width = REG_D[width&7];
\r
6348 /* Offset is signed so we have to use ugly math =( */
\r
6356 width = ((width-1) & 31) + 1;
\r
6358 data = m68ki_read_32(ea);
\r
6359 data = MASK_OUT_ABOVE_32(data<<offset);
\r
6361 if((offset+width) > 32)
\r
6362 data |= (m68ki_read_8(ea+4) << offset) >> 8;
\r
6364 FLAG_N = NFLAG_32(data);
\r
6365 data >>= (32 - width);
\r
6368 FLAG_V = VFLAG_CLEAR;
\r
6369 FLAG_C = CFLAG_CLEAR;
\r
6371 REG_D[(word2 >> 12) & 7] = data;
\r
6375 m68ki_exception_illegal();
\r
6379 void m68k_op_bfextu_32_aw(void)
\r
6381 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
6383 uint word2 = OPER_I_16();
\r
6384 sint offset = (word2>>6)&31;
\r
6385 uint width = word2;
\r
6387 uint ea = EA_AW_8();
\r
6391 offset = MAKE_INT_32(REG_D[offset&7]);
\r
6393 width = REG_D[width&7];
\r
6395 /* Offset is signed so we have to use ugly math =( */
\r
6403 width = ((width-1) & 31) + 1;
\r
6405 data = m68ki_read_32(ea);
\r
6406 data = MASK_OUT_ABOVE_32(data<<offset);
\r
6408 if((offset+width) > 32)
\r
6409 data |= (m68ki_read_8(ea+4) << offset) >> 8;
\r
6411 FLAG_N = NFLAG_32(data);
\r
6412 data >>= (32 - width);
\r
6415 FLAG_V = VFLAG_CLEAR;
\r
6416 FLAG_C = CFLAG_CLEAR;
\r
6418 REG_D[(word2 >> 12) & 7] = data;
\r
6422 m68ki_exception_illegal();
\r
6426 void m68k_op_bfextu_32_al(void)
\r
6428 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
6430 uint word2 = OPER_I_16();
\r
6431 sint offset = (word2>>6)&31;
\r
6432 uint width = word2;
\r
6434 uint ea = EA_AL_8();
\r
6438 offset = MAKE_INT_32(REG_D[offset&7]);
\r
6440 width = REG_D[width&7];
\r
6442 /* Offset is signed so we have to use ugly math =( */
\r
6450 width = ((width-1) & 31) + 1;
\r
6452 data = m68ki_read_32(ea);
\r
6453 data = MASK_OUT_ABOVE_32(data<<offset);
\r
6455 if((offset+width) > 32)
\r
6456 data |= (m68ki_read_8(ea+4) << offset) >> 8;
\r
6458 FLAG_N = NFLAG_32(data);
\r
6459 data >>= (32 - width);
\r
6462 FLAG_V = VFLAG_CLEAR;
\r
6463 FLAG_C = CFLAG_CLEAR;
\r
6465 REG_D[(word2 >> 12) & 7] = data;
\r
6469 m68ki_exception_illegal();
\r
6473 void m68k_op_bfextu_32_pcdi(void)
\r
6475 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
6477 uint word2 = OPER_I_16();
\r
6478 sint offset = (word2>>6)&31;
\r
6479 uint width = word2;
\r
6481 uint ea = EA_PCDI_8();
\r
6485 offset = MAKE_INT_32(REG_D[offset&7]);
\r
6487 width = REG_D[width&7];
\r
6489 /* Offset is signed so we have to use ugly math =( */
\r
6497 width = ((width-1) & 31) + 1;
\r
6499 data = m68ki_read_32(ea);
\r
6500 data = MASK_OUT_ABOVE_32(data<<offset);
\r
6502 if((offset+width) > 32)
\r
6503 data |= (m68ki_read_8(ea+4) << offset) >> 8;
\r
6505 FLAG_N = NFLAG_32(data);
\r
6506 data >>= (32 - width);
\r
6509 FLAG_V = VFLAG_CLEAR;
\r
6510 FLAG_C = CFLAG_CLEAR;
\r
6512 REG_D[(word2 >> 12) & 7] = data;
\r
6516 m68ki_exception_illegal();
\r
6520 void m68k_op_bfextu_32_pcix(void)
\r
6522 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
6524 uint word2 = OPER_I_16();
\r
6525 sint offset = (word2>>6)&31;
\r
6526 uint width = word2;
\r
6528 uint ea = EA_PCIX_8();
\r
6532 offset = MAKE_INT_32(REG_D[offset&7]);
\r
6534 width = REG_D[width&7];
\r
6536 /* Offset is signed so we have to use ugly math =( */
\r
6544 width = ((width-1) & 31) + 1;
\r
6546 data = m68ki_read_32(ea);
\r
6547 data = MASK_OUT_ABOVE_32(data<<offset);
\r
6549 if((offset+width) > 32)
\r
6550 data |= (m68ki_read_8(ea+4) << offset) >> 8;
\r
6552 FLAG_N = NFLAG_32(data);
\r
6553 data >>= (32 - width);
\r
6556 FLAG_V = VFLAG_CLEAR;
\r
6557 FLAG_C = CFLAG_CLEAR;
\r
6559 REG_D[(word2 >> 12) & 7] = data;
\r
6563 m68ki_exception_illegal();
\r
6567 void m68k_op_bfffo_32_d(void)
\r
6569 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
6571 uint word2 = OPER_I_16();
\r
6572 uint offset = (word2>>6)&31;
\r
6573 uint width = word2;
\r
6579 offset = REG_D[offset&7];
\r
6581 width = REG_D[width&7];
\r
6584 width = ((width-1) & 31) + 1;
\r
6586 data = ROL_32(data, offset);
\r
6587 FLAG_N = NFLAG_32(data);
\r
6588 data >>= 32 - width;
\r
6591 FLAG_V = VFLAG_CLEAR;
\r
6592 FLAG_C = CFLAG_CLEAR;
\r
6594 for(bit = 1<<(width-1);bit && !(data & bit);bit>>= 1)
\r
6597 REG_D[(word2>>12)&7] = offset;
\r
6601 m68ki_exception_illegal();
\r
6605 void m68k_op_bfffo_32_ai(void)
\r
6607 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
6609 uint word2 = OPER_I_16();
\r
6610 sint offset = (word2>>6)&31;
\r
6611 sint local_offset;
\r
6612 uint width = word2;
\r
6615 uint ea = EA_AY_AI_8();
\r
6619 offset = MAKE_INT_32(REG_D[offset&7]);
\r
6621 width = REG_D[width&7];
\r
6623 /* Offset is signed so we have to use ugly math =( */
\r
6625 local_offset = offset % 8;
\r
6626 if(local_offset < 0)
\r
6628 local_offset += 8;
\r
6631 width = ((width-1) & 31) + 1;
\r
6633 data = m68ki_read_32(ea);
\r
6634 data = MASK_OUT_ABOVE_32(data<<local_offset);
\r
6636 if((local_offset+width) > 32)
\r
6637 data |= (m68ki_read_8(ea+4) << local_offset) >> 8;
\r
6639 FLAG_N = NFLAG_32(data);
\r
6640 data >>= (32 - width);
\r
6643 FLAG_V = VFLAG_CLEAR;
\r
6644 FLAG_C = CFLAG_CLEAR;
\r
6646 for(bit = 1<<(width-1);bit && !(data & bit);bit>>= 1)
\r
6649 REG_D[(word2>>12)&7] = offset;
\r
6653 m68ki_exception_illegal();
\r
6657 void m68k_op_bfffo_32_di(void)
\r
6659 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
6661 uint word2 = OPER_I_16();
\r
6662 sint offset = (word2>>6)&31;
\r
6663 sint local_offset;
\r
6664 uint width = word2;
\r
6667 uint ea = EA_AY_DI_8();
\r
6671 offset = MAKE_INT_32(REG_D[offset&7]);
\r
6673 width = REG_D[width&7];
\r
6675 /* Offset is signed so we have to use ugly math =( */
\r
6677 local_offset = offset % 8;
\r
6678 if(local_offset < 0)
\r
6680 local_offset += 8;
\r
6683 width = ((width-1) & 31) + 1;
\r
6685 data = m68ki_read_32(ea);
\r
6686 data = MASK_OUT_ABOVE_32(data<<local_offset);
\r
6688 if((local_offset+width) > 32)
\r
6689 data |= (m68ki_read_8(ea+4) << local_offset) >> 8;
\r
6691 FLAG_N = NFLAG_32(data);
\r
6692 data >>= (32 - width);
\r
6695 FLAG_V = VFLAG_CLEAR;
\r
6696 FLAG_C = CFLAG_CLEAR;
\r
6698 for(bit = 1<<(width-1);bit && !(data & bit);bit>>= 1)
\r
6701 REG_D[(word2>>12)&7] = offset;
\r
6705 m68ki_exception_illegal();
\r
6709 void m68k_op_bfffo_32_ix(void)
\r
6711 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
6713 uint word2 = OPER_I_16();
\r
6714 sint offset = (word2>>6)&31;
\r
6715 sint local_offset;
\r
6716 uint width = word2;
\r
6719 uint ea = EA_AY_IX_8();
\r
6723 offset = MAKE_INT_32(REG_D[offset&7]);
\r
6725 width = REG_D[width&7];
\r
6727 /* Offset is signed so we have to use ugly math =( */
\r
6729 local_offset = offset % 8;
\r
6730 if(local_offset < 0)
\r
6732 local_offset += 8;
\r
6735 width = ((width-1) & 31) + 1;
\r
6737 data = m68ki_read_32(ea);
\r
6738 data = MASK_OUT_ABOVE_32(data<<local_offset);
\r
6740 if((local_offset+width) > 32)
\r
6741 data |= (m68ki_read_8(ea+4) << local_offset) >> 8;
\r
6743 FLAG_N = NFLAG_32(data);
\r
6744 data >>= (32 - width);
\r
6747 FLAG_V = VFLAG_CLEAR;
\r
6748 FLAG_C = CFLAG_CLEAR;
\r
6750 for(bit = 1<<(width-1);bit && !(data & bit);bit>>= 1)
\r
6753 REG_D[(word2>>12)&7] = offset;
\r
6757 m68ki_exception_illegal();
\r
6761 void m68k_op_bfffo_32_aw(void)
\r
6763 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
6765 uint word2 = OPER_I_16();
\r
6766 sint offset = (word2>>6)&31;
\r
6767 sint local_offset;
\r
6768 uint width = word2;
\r
6771 uint ea = EA_AW_8();
\r
6775 offset = MAKE_INT_32(REG_D[offset&7]);
\r
6777 width = REG_D[width&7];
\r
6779 /* Offset is signed so we have to use ugly math =( */
\r
6781 local_offset = offset % 8;
\r
6782 if(local_offset < 0)
\r
6784 local_offset += 8;
\r
6787 width = ((width-1) & 31) + 1;
\r
6789 data = m68ki_read_32(ea);
\r
6790 data = MASK_OUT_ABOVE_32(data<<local_offset);
\r
6792 if((local_offset+width) > 32)
\r
6793 data |= (m68ki_read_8(ea+4) << local_offset) >> 8;
\r
6795 FLAG_N = NFLAG_32(data);
\r
6796 data >>= (32 - width);
\r
6799 FLAG_V = VFLAG_CLEAR;
\r
6800 FLAG_C = CFLAG_CLEAR;
\r
6802 for(bit = 1<<(width-1);bit && !(data & bit);bit>>= 1)
\r
6805 REG_D[(word2>>12)&7] = offset;
\r
6809 m68ki_exception_illegal();
\r
6813 void m68k_op_bfffo_32_al(void)
\r
6815 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
6817 uint word2 = OPER_I_16();
\r
6818 sint offset = (word2>>6)&31;
\r
6819 sint local_offset;
\r
6820 uint width = word2;
\r
6823 uint ea = EA_AL_8();
\r
6827 offset = MAKE_INT_32(REG_D[offset&7]);
\r
6829 width = REG_D[width&7];
\r
6831 /* Offset is signed so we have to use ugly math =( */
\r
6833 local_offset = offset % 8;
\r
6834 if(local_offset < 0)
\r
6836 local_offset += 8;
\r
6839 width = ((width-1) & 31) + 1;
\r
6841 data = m68ki_read_32(ea);
\r
6842 data = MASK_OUT_ABOVE_32(data<<local_offset);
\r
6844 if((local_offset+width) > 32)
\r
6845 data |= (m68ki_read_8(ea+4) << local_offset) >> 8;
\r
6847 FLAG_N = NFLAG_32(data);
\r
6848 data >>= (32 - width);
\r
6851 FLAG_V = VFLAG_CLEAR;
\r
6852 FLAG_C = CFLAG_CLEAR;
\r
6854 for(bit = 1<<(width-1);bit && !(data & bit);bit>>= 1)
\r
6857 REG_D[(word2>>12)&7] = offset;
\r
6861 m68ki_exception_illegal();
\r
6865 void m68k_op_bfffo_32_pcdi(void)
\r
6867 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
6869 uint word2 = OPER_I_16();
\r
6870 sint offset = (word2>>6)&31;
\r
6871 sint local_offset;
\r
6872 uint width = word2;
\r
6875 uint ea = EA_PCDI_8();
\r
6879 offset = MAKE_INT_32(REG_D[offset&7]);
\r
6881 width = REG_D[width&7];
\r
6883 /* Offset is signed so we have to use ugly math =( */
\r
6885 local_offset = offset % 8;
\r
6886 if(local_offset < 0)
\r
6888 local_offset += 8;
\r
6891 width = ((width-1) & 31) + 1;
\r
6893 data = m68ki_read_32(ea);
\r
6894 data = MASK_OUT_ABOVE_32(data<<local_offset);
\r
6896 if((local_offset+width) > 32)
\r
6897 data |= (m68ki_read_8(ea+4) << local_offset) >> 8;
\r
6899 FLAG_N = NFLAG_32(data);
\r
6900 data >>= (32 - width);
\r
6903 FLAG_V = VFLAG_CLEAR;
\r
6904 FLAG_C = CFLAG_CLEAR;
\r
6906 for(bit = 1<<(width-1);bit && !(data & bit);bit>>= 1)
\r
6909 REG_D[(word2>>12)&7] = offset;
\r
6913 m68ki_exception_illegal();
\r
6917 void m68k_op_bfffo_32_pcix(void)
\r
6919 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
6921 uint word2 = OPER_I_16();
\r
6922 sint offset = (word2>>6)&31;
\r
6923 sint local_offset;
\r
6924 uint width = word2;
\r
6927 uint ea = EA_PCIX_8();
\r
6931 offset = MAKE_INT_32(REG_D[offset&7]);
\r
6933 width = REG_D[width&7];
\r
6935 /* Offset is signed so we have to use ugly math =( */
\r
6937 local_offset = offset % 8;
\r
6938 if(local_offset < 0)
\r
6940 local_offset += 8;
\r
6943 width = ((width-1) & 31) + 1;
\r
6945 data = m68ki_read_32(ea);
\r
6946 data = MASK_OUT_ABOVE_32(data<<local_offset);
\r
6948 if((local_offset+width) > 32)
\r
6949 data |= (m68ki_read_8(ea+4) << local_offset) >> 8;
\r
6951 FLAG_N = NFLAG_32(data);
\r
6952 data >>= (32 - width);
\r
6955 FLAG_V = VFLAG_CLEAR;
\r
6956 FLAG_C = CFLAG_CLEAR;
\r
6958 for(bit = 1<<(width-1);bit && !(data & bit);bit>>= 1)
\r
6961 REG_D[(word2>>12)&7] = offset;
\r
6965 m68ki_exception_illegal();
\r
6969 void m68k_op_bfins_32_d(void)
\r
6971 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
6973 uint word2 = OPER_I_16();
\r
6974 uint offset = (word2>>6)&31;
\r
6975 uint width = word2;
\r
6978 uint64 insert = REG_D[(word2>>12)&7];
\r
6982 offset = REG_D[offset&7];
\r
6984 width = REG_D[width&7];
\r
6988 width = ((width-1) & 31) + 1;
\r
6991 mask = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
6992 mask = ROR_32(mask, offset);
\r
6994 insert = MASK_OUT_ABOVE_32(insert << (32 - width));
\r
6995 FLAG_N = NFLAG_32(insert);
\r
6997 insert = ROR_32(insert, offset);
\r
6999 FLAG_V = VFLAG_CLEAR;
\r
7000 FLAG_C = CFLAG_CLEAR;
\r
7007 m68ki_exception_illegal();
\r
7011 void m68k_op_bfins_32_ai(void)
\r
7013 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7015 uint word2 = OPER_I_16();
\r
7016 sint offset = (word2>>6)&31;
\r
7017 uint width = word2;
\r
7018 uint insert_base = REG_D[(word2>>12)&7];
\r
7024 uint data_byte = 0;
\r
7025 uint mask_byte = 0;
\r
7026 uint ea = EA_AY_AI_8();
\r
7030 offset = MAKE_INT_32(REG_D[offset&7]);
\r
7032 width = REG_D[width&7];
\r
7034 /* Offset is signed so we have to use ugly math =( */
\r
7042 width = ((width-1) & 31) + 1;
\r
7044 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
7045 mask_long = mask_base >> offset;
\r
7047 insert_base = MASK_OUT_ABOVE_32(insert_base << (32 - width));
\r
7048 FLAG_N = NFLAG_32(insert_base);
\r
7049 FLAG_Z = insert_base;
\r
7050 insert_long = insert_base >> offset;
\r
7052 data_long = m68ki_read_32(ea);
\r
7053 FLAG_V = VFLAG_CLEAR;
\r
7054 FLAG_C = CFLAG_CLEAR;
\r
7056 m68ki_write_32(ea, (data_long & ~mask_long) | insert_long);
\r
7058 if((width + offset) > 32)
\r
7060 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
7061 insert_byte = MASK_OUT_ABOVE_8(insert_base);
\r
7062 data_byte = m68ki_read_8(ea+4);
\r
7063 FLAG_Z |= (data_byte & mask_byte);
\r
7064 m68ki_write_8(ea+4, (data_byte & ~mask_byte) | insert_byte);
\r
7068 m68ki_exception_illegal();
\r
7072 void m68k_op_bfins_32_di(void)
\r
7074 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7076 uint word2 = OPER_I_16();
\r
7077 sint offset = (word2>>6)&31;
\r
7078 uint width = word2;
\r
7079 uint insert_base = REG_D[(word2>>12)&7];
\r
7085 uint data_byte = 0;
\r
7086 uint mask_byte = 0;
\r
7087 uint ea = EA_AY_DI_8();
\r
7091 offset = MAKE_INT_32(REG_D[offset&7]);
\r
7093 width = REG_D[width&7];
\r
7095 /* Offset is signed so we have to use ugly math =( */
\r
7103 width = ((width-1) & 31) + 1;
\r
7105 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
7106 mask_long = mask_base >> offset;
\r
7108 insert_base = MASK_OUT_ABOVE_32(insert_base << (32 - width));
\r
7109 FLAG_N = NFLAG_32(insert_base);
\r
7110 FLAG_Z = insert_base;
\r
7111 insert_long = insert_base >> offset;
\r
7113 data_long = m68ki_read_32(ea);
\r
7114 FLAG_V = VFLAG_CLEAR;
\r
7115 FLAG_C = CFLAG_CLEAR;
\r
7117 m68ki_write_32(ea, (data_long & ~mask_long) | insert_long);
\r
7119 if((width + offset) > 32)
\r
7121 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
7122 insert_byte = MASK_OUT_ABOVE_8(insert_base);
\r
7123 data_byte = m68ki_read_8(ea+4);
\r
7124 FLAG_Z |= (data_byte & mask_byte);
\r
7125 m68ki_write_8(ea+4, (data_byte & ~mask_byte) | insert_byte);
\r
7129 m68ki_exception_illegal();
\r
7133 void m68k_op_bfins_32_ix(void)
\r
7135 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7137 uint word2 = OPER_I_16();
\r
7138 sint offset = (word2>>6)&31;
\r
7139 uint width = word2;
\r
7140 uint insert_base = REG_D[(word2>>12)&7];
\r
7146 uint data_byte = 0;
\r
7147 uint mask_byte = 0;
\r
7148 uint ea = EA_AY_IX_8();
\r
7152 offset = MAKE_INT_32(REG_D[offset&7]);
\r
7154 width = REG_D[width&7];
\r
7156 /* Offset is signed so we have to use ugly math =( */
\r
7164 width = ((width-1) & 31) + 1;
\r
7166 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
7167 mask_long = mask_base >> offset;
\r
7169 insert_base = MASK_OUT_ABOVE_32(insert_base << (32 - width));
\r
7170 FLAG_N = NFLAG_32(insert_base);
\r
7171 FLAG_Z = insert_base;
\r
7172 insert_long = insert_base >> offset;
\r
7174 data_long = m68ki_read_32(ea);
\r
7175 FLAG_V = VFLAG_CLEAR;
\r
7176 FLAG_C = CFLAG_CLEAR;
\r
7178 m68ki_write_32(ea, (data_long & ~mask_long) | insert_long);
\r
7180 if((width + offset) > 32)
\r
7182 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
7183 insert_byte = MASK_OUT_ABOVE_8(insert_base);
\r
7184 data_byte = m68ki_read_8(ea+4);
\r
7185 FLAG_Z |= (data_byte & mask_byte);
\r
7186 m68ki_write_8(ea+4, (data_byte & ~mask_byte) | insert_byte);
\r
7190 m68ki_exception_illegal();
\r
7194 void m68k_op_bfins_32_aw(void)
\r
7196 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7198 uint word2 = OPER_I_16();
\r
7199 sint offset = (word2>>6)&31;
\r
7200 uint width = word2;
\r
7201 uint insert_base = REG_D[(word2>>12)&7];
\r
7207 uint data_byte = 0;
\r
7208 uint mask_byte = 0;
\r
7209 uint ea = EA_AW_8();
\r
7213 offset = MAKE_INT_32(REG_D[offset&7]);
\r
7215 width = REG_D[width&7];
\r
7217 /* Offset is signed so we have to use ugly math =( */
\r
7225 width = ((width-1) & 31) + 1;
\r
7227 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
7228 mask_long = mask_base >> offset;
\r
7230 insert_base = MASK_OUT_ABOVE_32(insert_base << (32 - width));
\r
7231 FLAG_N = NFLAG_32(insert_base);
\r
7232 FLAG_Z = insert_base;
\r
7233 insert_long = insert_base >> offset;
\r
7235 data_long = m68ki_read_32(ea);
\r
7236 FLAG_V = VFLAG_CLEAR;
\r
7237 FLAG_C = CFLAG_CLEAR;
\r
7239 m68ki_write_32(ea, (data_long & ~mask_long) | insert_long);
\r
7241 if((width + offset) > 32)
\r
7243 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
7244 insert_byte = MASK_OUT_ABOVE_8(insert_base);
\r
7245 data_byte = m68ki_read_8(ea+4);
\r
7246 FLAG_Z |= (data_byte & mask_byte);
\r
7247 m68ki_write_8(ea+4, (data_byte & ~mask_byte) | insert_byte);
\r
7251 m68ki_exception_illegal();
\r
7255 void m68k_op_bfins_32_al(void)
\r
7257 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7259 uint word2 = OPER_I_16();
\r
7260 sint offset = (word2>>6)&31;
\r
7261 uint width = word2;
\r
7262 uint insert_base = REG_D[(word2>>12)&7];
\r
7268 uint data_byte = 0;
\r
7269 uint mask_byte = 0;
\r
7270 uint ea = EA_AL_8();
\r
7274 offset = MAKE_INT_32(REG_D[offset&7]);
\r
7276 width = REG_D[width&7];
\r
7278 /* Offset is signed so we have to use ugly math =( */
\r
7286 width = ((width-1) & 31) + 1;
\r
7288 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
7289 mask_long = mask_base >> offset;
\r
7291 insert_base = MASK_OUT_ABOVE_32(insert_base << (32 - width));
\r
7292 FLAG_N = NFLAG_32(insert_base);
\r
7293 FLAG_Z = insert_base;
\r
7294 insert_long = insert_base >> offset;
\r
7296 data_long = m68ki_read_32(ea);
\r
7297 FLAG_V = VFLAG_CLEAR;
\r
7298 FLAG_C = CFLAG_CLEAR;
\r
7300 m68ki_write_32(ea, (data_long & ~mask_long) | insert_long);
\r
7302 if((width + offset) > 32)
\r
7304 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
7305 insert_byte = MASK_OUT_ABOVE_8(insert_base);
\r
7306 data_byte = m68ki_read_8(ea+4);
\r
7307 FLAG_Z |= (data_byte & mask_byte);
\r
7308 m68ki_write_8(ea+4, (data_byte & ~mask_byte) | insert_byte);
\r
7312 m68ki_exception_illegal();
\r
7316 void m68k_op_bfset_32_d(void)
\r
7318 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7320 uint word2 = OPER_I_16();
\r
7321 uint offset = (word2>>6)&31;
\r
7322 uint width = word2;
\r
7328 offset = REG_D[offset&7];
\r
7330 width = REG_D[width&7];
\r
7334 width = ((width-1) & 31) + 1;
\r
7337 mask = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
7338 mask = ROR_32(mask, offset);
\r
7340 FLAG_N = NFLAG_32(*data<<offset);
\r
7341 FLAG_Z = *data & mask;
\r
7342 FLAG_V = VFLAG_CLEAR;
\r
7343 FLAG_C = CFLAG_CLEAR;
\r
7349 m68ki_exception_illegal();
\r
7353 void m68k_op_bfset_32_ai(void)
\r
7355 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7357 uint word2 = OPER_I_16();
\r
7358 sint offset = (word2>>6)&31;
\r
7359 uint width = word2;
\r
7363 uint data_byte = 0;
\r
7364 uint mask_byte = 0;
\r
7365 uint ea = EA_AY_AI_8();
\r
7369 offset = MAKE_INT_32(REG_D[offset&7]);
\r
7371 width = REG_D[width&7];
\r
7373 /* Offset is signed so we have to use ugly math =( */
\r
7381 width = ((width-1) & 31) + 1;
\r
7384 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
7385 mask_long = mask_base >> offset;
\r
7387 data_long = m68ki_read_32(ea);
\r
7388 FLAG_N = NFLAG_32(data_long << offset);
\r
7389 FLAG_Z = data_long & mask_long;
\r
7390 FLAG_V = VFLAG_CLEAR;
\r
7391 FLAG_C = CFLAG_CLEAR;
\r
7393 m68ki_write_32(ea, data_long | mask_long);
\r
7395 if((width + offset) > 32)
\r
7397 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
7398 data_byte = m68ki_read_8(ea+4);
\r
7399 FLAG_Z |= (data_byte & mask_byte);
\r
7400 m68ki_write_8(ea+4, data_byte | mask_byte);
\r
7404 m68ki_exception_illegal();
\r
7408 void m68k_op_bfset_32_di(void)
\r
7410 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7412 uint word2 = OPER_I_16();
\r
7413 sint offset = (word2>>6)&31;
\r
7414 uint width = word2;
\r
7418 uint data_byte = 0;
\r
7419 uint mask_byte = 0;
\r
7420 uint ea = EA_AY_DI_8();
\r
7424 offset = MAKE_INT_32(REG_D[offset&7]);
\r
7426 width = REG_D[width&7];
\r
7428 /* Offset is signed so we have to use ugly math =( */
\r
7436 width = ((width-1) & 31) + 1;
\r
7439 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
7440 mask_long = mask_base >> offset;
\r
7442 data_long = m68ki_read_32(ea);
\r
7443 FLAG_N = NFLAG_32(data_long << offset);
\r
7444 FLAG_Z = data_long & mask_long;
\r
7445 FLAG_V = VFLAG_CLEAR;
\r
7446 FLAG_C = CFLAG_CLEAR;
\r
7448 m68ki_write_32(ea, data_long | mask_long);
\r
7450 if((width + offset) > 32)
\r
7452 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
7453 data_byte = m68ki_read_8(ea+4);
\r
7454 FLAG_Z |= (data_byte & mask_byte);
\r
7455 m68ki_write_8(ea+4, data_byte | mask_byte);
\r
7459 m68ki_exception_illegal();
\r
7463 void m68k_op_bfset_32_ix(void)
\r
7465 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7467 uint word2 = OPER_I_16();
\r
7468 sint offset = (word2>>6)&31;
\r
7469 uint width = word2;
\r
7473 uint data_byte = 0;
\r
7474 uint mask_byte = 0;
\r
7475 uint ea = EA_AY_IX_8();
\r
7479 offset = MAKE_INT_32(REG_D[offset&7]);
\r
7481 width = REG_D[width&7];
\r
7483 /* Offset is signed so we have to use ugly math =( */
\r
7491 width = ((width-1) & 31) + 1;
\r
7494 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
7495 mask_long = mask_base >> offset;
\r
7497 data_long = m68ki_read_32(ea);
\r
7498 FLAG_N = NFLAG_32(data_long << offset);
\r
7499 FLAG_Z = data_long & mask_long;
\r
7500 FLAG_V = VFLAG_CLEAR;
\r
7501 FLAG_C = CFLAG_CLEAR;
\r
7503 m68ki_write_32(ea, data_long | mask_long);
\r
7505 if((width + offset) > 32)
\r
7507 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
7508 data_byte = m68ki_read_8(ea+4);
\r
7509 FLAG_Z |= (data_byte & mask_byte);
\r
7510 m68ki_write_8(ea+4, data_byte | mask_byte);
\r
7514 m68ki_exception_illegal();
\r
7518 void m68k_op_bfset_32_aw(void)
\r
7520 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7522 uint word2 = OPER_I_16();
\r
7523 sint offset = (word2>>6)&31;
\r
7524 uint width = word2;
\r
7528 uint data_byte = 0;
\r
7529 uint mask_byte = 0;
\r
7530 uint ea = EA_AW_8();
\r
7534 offset = MAKE_INT_32(REG_D[offset&7]);
\r
7536 width = REG_D[width&7];
\r
7538 /* Offset is signed so we have to use ugly math =( */
\r
7546 width = ((width-1) & 31) + 1;
\r
7549 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
7550 mask_long = mask_base >> offset;
\r
7552 data_long = m68ki_read_32(ea);
\r
7553 FLAG_N = NFLAG_32(data_long << offset);
\r
7554 FLAG_Z = data_long & mask_long;
\r
7555 FLAG_V = VFLAG_CLEAR;
\r
7556 FLAG_C = CFLAG_CLEAR;
\r
7558 m68ki_write_32(ea, data_long | mask_long);
\r
7560 if((width + offset) > 32)
\r
7562 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
7563 data_byte = m68ki_read_8(ea+4);
\r
7564 FLAG_Z |= (data_byte & mask_byte);
\r
7565 m68ki_write_8(ea+4, data_byte | mask_byte);
\r
7569 m68ki_exception_illegal();
\r
7573 void m68k_op_bfset_32_al(void)
\r
7575 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7577 uint word2 = OPER_I_16();
\r
7578 sint offset = (word2>>6)&31;
\r
7579 uint width = word2;
\r
7583 uint data_byte = 0;
\r
7584 uint mask_byte = 0;
\r
7585 uint ea = EA_AL_8();
\r
7589 offset = MAKE_INT_32(REG_D[offset&7]);
\r
7591 width = REG_D[width&7];
\r
7593 /* Offset is signed so we have to use ugly math =( */
\r
7601 width = ((width-1) & 31) + 1;
\r
7604 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
7605 mask_long = mask_base >> offset;
\r
7607 data_long = m68ki_read_32(ea);
\r
7608 FLAG_N = NFLAG_32(data_long << offset);
\r
7609 FLAG_Z = data_long & mask_long;
\r
7610 FLAG_V = VFLAG_CLEAR;
\r
7611 FLAG_C = CFLAG_CLEAR;
\r
7613 m68ki_write_32(ea, data_long | mask_long);
\r
7615 if((width + offset) > 32)
\r
7617 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
7618 data_byte = m68ki_read_8(ea+4);
\r
7619 FLAG_Z |= (data_byte & mask_byte);
\r
7620 m68ki_write_8(ea+4, data_byte | mask_byte);
\r
7624 m68ki_exception_illegal();
\r
7628 void m68k_op_bftst_32_d(void)
\r
7630 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7632 uint word2 = OPER_I_16();
\r
7633 uint offset = (word2>>6)&31;
\r
7634 uint width = word2;
\r
7640 offset = REG_D[offset&7];
\r
7642 width = REG_D[width&7];
\r
7646 width = ((width-1) & 31) + 1;
\r
7649 mask = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
7650 mask = ROR_32(mask, offset);
\r
7652 FLAG_N = NFLAG_32(*data<<offset);
\r
7653 FLAG_Z = *data & mask;
\r
7654 FLAG_V = VFLAG_CLEAR;
\r
7655 FLAG_C = CFLAG_CLEAR;
\r
7659 m68ki_exception_illegal();
\r
7663 void m68k_op_bftst_32_ai(void)
\r
7665 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7667 uint word2 = OPER_I_16();
\r
7668 sint offset = (word2>>6)&31;
\r
7669 uint width = word2;
\r
7673 uint data_byte = 0;
\r
7674 uint mask_byte = 0;
\r
7675 uint ea = EA_AY_AI_8();
\r
7678 offset = MAKE_INT_32(REG_D[offset&7]);
\r
7680 width = REG_D[width&7];
\r
7682 /* Offset is signed so we have to use ugly math =( */
\r
7690 width = ((width-1) & 31) + 1;
\r
7693 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
7694 mask_long = mask_base >> offset;
\r
7696 data_long = m68ki_read_32(ea);
\r
7697 FLAG_N = ((data_long & (0x80000000 >> offset))<<offset)>>24;
\r
7698 FLAG_Z = data_long & mask_long;
\r
7699 FLAG_V = VFLAG_CLEAR;
\r
7700 FLAG_C = CFLAG_CLEAR;
\r
7702 if((width + offset) > 32)
\r
7704 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
7705 data_byte = m68ki_read_8(ea+4);
\r
7706 FLAG_Z |= (data_byte & mask_byte);
\r
7710 m68ki_exception_illegal();
\r
7714 void m68k_op_bftst_32_di(void)
\r
7716 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7718 uint word2 = OPER_I_16();
\r
7719 sint offset = (word2>>6)&31;
\r
7720 uint width = word2;
\r
7724 uint data_byte = 0;
\r
7725 uint mask_byte = 0;
\r
7726 uint ea = EA_AY_DI_8();
\r
7729 offset = MAKE_INT_32(REG_D[offset&7]);
\r
7731 width = REG_D[width&7];
\r
7733 /* Offset is signed so we have to use ugly math =( */
\r
7741 width = ((width-1) & 31) + 1;
\r
7744 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
7745 mask_long = mask_base >> offset;
\r
7747 data_long = m68ki_read_32(ea);
\r
7748 FLAG_N = ((data_long & (0x80000000 >> offset))<<offset)>>24;
\r
7749 FLAG_Z = data_long & mask_long;
\r
7750 FLAG_V = VFLAG_CLEAR;
\r
7751 FLAG_C = CFLAG_CLEAR;
\r
7753 if((width + offset) > 32)
\r
7755 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
7756 data_byte = m68ki_read_8(ea+4);
\r
7757 FLAG_Z |= (data_byte & mask_byte);
\r
7761 m68ki_exception_illegal();
\r
7765 void m68k_op_bftst_32_ix(void)
\r
7767 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7769 uint word2 = OPER_I_16();
\r
7770 sint offset = (word2>>6)&31;
\r
7771 uint width = word2;
\r
7775 uint data_byte = 0;
\r
7776 uint mask_byte = 0;
\r
7777 uint ea = EA_AY_IX_8();
\r
7780 offset = MAKE_INT_32(REG_D[offset&7]);
\r
7782 width = REG_D[width&7];
\r
7784 /* Offset is signed so we have to use ugly math =( */
\r
7792 width = ((width-1) & 31) + 1;
\r
7795 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
7796 mask_long = mask_base >> offset;
\r
7798 data_long = m68ki_read_32(ea);
\r
7799 FLAG_N = ((data_long & (0x80000000 >> offset))<<offset)>>24;
\r
7800 FLAG_Z = data_long & mask_long;
\r
7801 FLAG_V = VFLAG_CLEAR;
\r
7802 FLAG_C = CFLAG_CLEAR;
\r
7804 if((width + offset) > 32)
\r
7806 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
7807 data_byte = m68ki_read_8(ea+4);
\r
7808 FLAG_Z |= (data_byte & mask_byte);
\r
7812 m68ki_exception_illegal();
\r
7816 void m68k_op_bftst_32_aw(void)
\r
7818 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7820 uint word2 = OPER_I_16();
\r
7821 sint offset = (word2>>6)&31;
\r
7822 uint width = word2;
\r
7826 uint data_byte = 0;
\r
7827 uint mask_byte = 0;
\r
7828 uint ea = EA_AW_8();
\r
7831 offset = MAKE_INT_32(REG_D[offset&7]);
\r
7833 width = REG_D[width&7];
\r
7835 /* Offset is signed so we have to use ugly math =( */
\r
7843 width = ((width-1) & 31) + 1;
\r
7846 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
7847 mask_long = mask_base >> offset;
\r
7849 data_long = m68ki_read_32(ea);
\r
7850 FLAG_N = ((data_long & (0x80000000 >> offset))<<offset)>>24;
\r
7851 FLAG_Z = data_long & mask_long;
\r
7852 FLAG_V = VFLAG_CLEAR;
\r
7853 FLAG_C = CFLAG_CLEAR;
\r
7855 if((width + offset) > 32)
\r
7857 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
7858 data_byte = m68ki_read_8(ea+4);
\r
7859 FLAG_Z |= (data_byte & mask_byte);
\r
7863 m68ki_exception_illegal();
\r
7867 void m68k_op_bftst_32_al(void)
\r
7869 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7871 uint word2 = OPER_I_16();
\r
7872 sint offset = (word2>>6)&31;
\r
7873 uint width = word2;
\r
7877 uint data_byte = 0;
\r
7878 uint mask_byte = 0;
\r
7879 uint ea = EA_AL_8();
\r
7882 offset = MAKE_INT_32(REG_D[offset&7]);
\r
7884 width = REG_D[width&7];
\r
7886 /* Offset is signed so we have to use ugly math =( */
\r
7894 width = ((width-1) & 31) + 1;
\r
7897 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
7898 mask_long = mask_base >> offset;
\r
7900 data_long = m68ki_read_32(ea);
\r
7901 FLAG_N = ((data_long & (0x80000000 >> offset))<<offset)>>24;
\r
7902 FLAG_Z = data_long & mask_long;
\r
7903 FLAG_V = VFLAG_CLEAR;
\r
7904 FLAG_C = CFLAG_CLEAR;
\r
7906 if((width + offset) > 32)
\r
7908 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
7909 data_byte = m68ki_read_8(ea+4);
\r
7910 FLAG_Z |= (data_byte & mask_byte);
\r
7914 m68ki_exception_illegal();
\r
7918 void m68k_op_bftst_32_pcdi(void)
\r
7920 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7922 uint word2 = OPER_I_16();
\r
7923 sint offset = (word2>>6)&31;
\r
7924 uint width = word2;
\r
7928 uint data_byte = 0;
\r
7929 uint mask_byte = 0;
\r
7930 uint ea = EA_PCDI_8();
\r
7933 offset = MAKE_INT_32(REG_D[offset&7]);
\r
7935 width = REG_D[width&7];
\r
7937 /* Offset is signed so we have to use ugly math =( */
\r
7945 width = ((width-1) & 31) + 1;
\r
7948 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
7949 mask_long = mask_base >> offset;
\r
7951 data_long = m68ki_read_32(ea);
\r
7952 FLAG_N = ((data_long & (0x80000000 >> offset))<<offset)>>24;
\r
7953 FLAG_Z = data_long & mask_long;
\r
7954 FLAG_V = VFLAG_CLEAR;
\r
7955 FLAG_C = CFLAG_CLEAR;
\r
7957 if((width + offset) > 32)
\r
7959 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
7960 data_byte = m68ki_read_8(ea+4);
\r
7961 FLAG_Z |= (data_byte & mask_byte);
\r
7965 m68ki_exception_illegal();
\r
7969 void m68k_op_bftst_32_pcix(void)
\r
7971 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
7973 uint word2 = OPER_I_16();
\r
7974 sint offset = (word2>>6)&31;
\r
7975 uint width = word2;
\r
7979 uint data_byte = 0;
\r
7980 uint mask_byte = 0;
\r
7981 uint ea = EA_PCIX_8();
\r
7984 offset = MAKE_INT_32(REG_D[offset&7]);
\r
7986 width = REG_D[width&7];
\r
7988 /* Offset is signed so we have to use ugly math =( */
\r
7996 width = ((width-1) & 31) + 1;
\r
7999 mask_base = MASK_OUT_ABOVE_32(0xffffffff << (32 - width));
\r
8000 mask_long = mask_base >> offset;
\r
8002 data_long = m68ki_read_32(ea);
\r
8003 FLAG_N = ((data_long & (0x80000000 >> offset))<<offset)>>24;
\r
8004 FLAG_Z = data_long & mask_long;
\r
8005 FLAG_V = VFLAG_CLEAR;
\r
8006 FLAG_C = CFLAG_CLEAR;
\r
8008 if((width + offset) > 32)
\r
8010 mask_byte = MASK_OUT_ABOVE_8(mask_base);
\r
8011 data_byte = m68ki_read_8(ea+4);
\r
8012 FLAG_Z |= (data_byte & mask_byte);
\r
8016 m68ki_exception_illegal();
\r
8020 void m68k_op_bkpt(void)
\r
8022 if(CPU_TYPE_IS_010_PLUS(CPU_TYPE))
\r
8024 m68ki_bkpt_ack(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE) ? REG_IR & 7 : 0); /* auto-disable (see m68kcpu.h) */
\r
8026 m68ki_exception_illegal();
\r
8030 void m68k_op_bra_8(void)
\r
8032 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8033 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
8034 // if(REG_PC == REG_PPC)
\r
8035 // USE_ALL_CYCLES();
\r
8039 void m68k_op_bra_16(void)
\r
8041 uint offset = OPER_I_16();
\r
8043 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8044 m68ki_branch_16(offset);
\r
8045 // if(REG_PC == REG_PPC)
\r
8046 // USE_ALL_CYCLES();
\r
8050 void m68k_op_bra_32(void)
\r
8052 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8054 uint offset = OPER_I_32();
\r
8056 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8057 m68ki_branch_32(offset);
\r
8058 if(REG_PC == REG_PPC)
\r
8064 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8065 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
8066 // if(REG_PC == REG_PPC)
\r
8067 // USE_ALL_CYCLES();
\r
8072 void m68k_op_bset_32_r_d(void)
\r
8074 uint* r_dst = &DY;
\r
8075 uint mask = 1 << (DX & 0x1f);
\r
8077 FLAG_Z = *r_dst & mask;
\r
8082 void m68k_op_bset_8_r_ai(void)
\r
8084 uint ea = EA_AY_AI_8();
\r
8085 uint src = m68ki_read_8(ea);
\r
8086 uint mask = 1 << (DX & 7);
\r
8088 FLAG_Z = src & mask;
\r
8089 m68ki_write_8(ea, src | mask);
\r
8093 void m68k_op_bset_8_r_pi(void)
\r
8095 uint ea = EA_AY_PI_8();
\r
8096 uint src = m68ki_read_8(ea);
\r
8097 uint mask = 1 << (DX & 7);
\r
8099 FLAG_Z = src & mask;
\r
8100 m68ki_write_8(ea, src | mask);
\r
8104 void m68k_op_bset_8_r_pi7(void)
\r
8106 uint ea = EA_A7_PI_8();
\r
8107 uint src = m68ki_read_8(ea);
\r
8108 uint mask = 1 << (DX & 7);
\r
8110 FLAG_Z = src & mask;
\r
8111 m68ki_write_8(ea, src | mask);
\r
8115 void m68k_op_bset_8_r_pd(void)
\r
8117 uint ea = EA_AY_PD_8();
\r
8118 uint src = m68ki_read_8(ea);
\r
8119 uint mask = 1 << (DX & 7);
\r
8121 FLAG_Z = src & mask;
\r
8122 m68ki_write_8(ea, src | mask);
\r
8126 void m68k_op_bset_8_r_pd7(void)
\r
8128 uint ea = EA_A7_PD_8();
\r
8129 uint src = m68ki_read_8(ea);
\r
8130 uint mask = 1 << (DX & 7);
\r
8132 FLAG_Z = src & mask;
\r
8133 m68ki_write_8(ea, src | mask);
\r
8137 void m68k_op_bset_8_r_di(void)
\r
8139 uint ea = EA_AY_DI_8();
\r
8140 uint src = m68ki_read_8(ea);
\r
8141 uint mask = 1 << (DX & 7);
\r
8143 FLAG_Z = src & mask;
\r
8144 m68ki_write_8(ea, src | mask);
\r
8148 void m68k_op_bset_8_r_ix(void)
\r
8150 uint ea = EA_AY_IX_8();
\r
8151 uint src = m68ki_read_8(ea);
\r
8152 uint mask = 1 << (DX & 7);
\r
8154 FLAG_Z = src & mask;
\r
8155 m68ki_write_8(ea, src | mask);
\r
8159 void m68k_op_bset_8_r_aw(void)
\r
8161 uint ea = EA_AW_8();
\r
8162 uint src = m68ki_read_8(ea);
\r
8163 uint mask = 1 << (DX & 7);
\r
8165 FLAG_Z = src & mask;
\r
8166 m68ki_write_8(ea, src | mask);
\r
8170 void m68k_op_bset_8_r_al(void)
\r
8172 uint ea = EA_AL_8();
\r
8173 uint src = m68ki_read_8(ea);
\r
8174 uint mask = 1 << (DX & 7);
\r
8176 FLAG_Z = src & mask;
\r
8177 m68ki_write_8(ea, src | mask);
\r
8181 void m68k_op_bset_32_s_d(void)
\r
8183 uint* r_dst = &DY;
\r
8184 uint mask = 1 << (OPER_I_8() & 0x1f);
\r
8186 FLAG_Z = *r_dst & mask;
\r
8191 void m68k_op_bset_8_s_ai(void)
\r
8193 uint mask = 1 << (OPER_I_8() & 7);
\r
8194 uint ea = EA_AY_AI_8();
\r
8195 uint src = m68ki_read_8(ea);
\r
8197 FLAG_Z = src & mask;
\r
8198 m68ki_write_8(ea, src | mask);
\r
8202 void m68k_op_bset_8_s_pi(void)
\r
8204 uint mask = 1 << (OPER_I_8() & 7);
\r
8205 uint ea = EA_AY_PI_8();
\r
8206 uint src = m68ki_read_8(ea);
\r
8208 FLAG_Z = src & mask;
\r
8209 m68ki_write_8(ea, src | mask);
\r
8213 void m68k_op_bset_8_s_pi7(void)
\r
8215 uint mask = 1 << (OPER_I_8() & 7);
\r
8216 uint ea = EA_A7_PI_8();
\r
8217 uint src = m68ki_read_8(ea);
\r
8219 FLAG_Z = src & mask;
\r
8220 m68ki_write_8(ea, src | mask);
\r
8224 void m68k_op_bset_8_s_pd(void)
\r
8226 uint mask = 1 << (OPER_I_8() & 7);
\r
8227 uint ea = EA_AY_PD_8();
\r
8228 uint src = m68ki_read_8(ea);
\r
8230 FLAG_Z = src & mask;
\r
8231 m68ki_write_8(ea, src | mask);
\r
8235 void m68k_op_bset_8_s_pd7(void)
\r
8237 uint mask = 1 << (OPER_I_8() & 7);
\r
8238 uint ea = EA_A7_PD_8();
\r
8239 uint src = m68ki_read_8(ea);
\r
8241 FLAG_Z = src & mask;
\r
8242 m68ki_write_8(ea, src | mask);
\r
8246 void m68k_op_bset_8_s_di(void)
\r
8248 uint mask = 1 << (OPER_I_8() & 7);
\r
8249 uint ea = EA_AY_DI_8();
\r
8250 uint src = m68ki_read_8(ea);
\r
8252 FLAG_Z = src & mask;
\r
8253 m68ki_write_8(ea, src | mask);
\r
8257 void m68k_op_bset_8_s_ix(void)
\r
8259 uint mask = 1 << (OPER_I_8() & 7);
\r
8260 uint ea = EA_AY_IX_8();
\r
8261 uint src = m68ki_read_8(ea);
\r
8263 FLAG_Z = src & mask;
\r
8264 m68ki_write_8(ea, src | mask);
\r
8268 void m68k_op_bset_8_s_aw(void)
\r
8270 uint mask = 1 << (OPER_I_8() & 7);
\r
8271 uint ea = EA_AW_8();
\r
8272 uint src = m68ki_read_8(ea);
\r
8274 FLAG_Z = src & mask;
\r
8275 m68ki_write_8(ea, src | mask);
\r
8279 void m68k_op_bset_8_s_al(void)
\r
8281 uint mask = 1 << (OPER_I_8() & 7);
\r
8282 uint ea = EA_AL_8();
\r
8283 uint src = m68ki_read_8(ea);
\r
8285 FLAG_Z = src & mask;
\r
8286 m68ki_write_8(ea, src | mask);
\r
8290 void m68k_op_bsr_8(void)
\r
8292 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8293 m68ki_push_32(REG_PC);
\r
8294 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
8298 void m68k_op_bsr_16(void)
\r
8300 uint offset = OPER_I_16();
\r
8301 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8302 m68ki_push_32(REG_PC);
\r
8304 m68ki_branch_16(offset);
\r
8308 void m68k_op_bsr_32(void)
\r
8310 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8312 uint offset = OPER_I_32();
\r
8313 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8314 m68ki_push_32(REG_PC);
\r
8316 m68ki_branch_32(offset);
\r
8321 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8322 m68ki_push_32(REG_PC);
\r
8323 m68ki_branch_8(MASK_OUT_ABOVE_8(REG_IR));
\r
8328 void m68k_op_btst_32_r_d(void)
\r
8330 FLAG_Z = DY & (1 << (DX & 0x1f));
\r
8334 void m68k_op_btst_8_r_ai(void)
\r
8336 FLAG_Z = OPER_AY_AI_8() & (1 << (DX & 7));
\r
8340 void m68k_op_btst_8_r_pi(void)
\r
8342 FLAG_Z = OPER_AY_PI_8() & (1 << (DX & 7));
\r
8346 void m68k_op_btst_8_r_pi7(void)
\r
8348 FLAG_Z = OPER_A7_PI_8() & (1 << (DX & 7));
\r
8352 void m68k_op_btst_8_r_pd(void)
\r
8354 FLAG_Z = OPER_AY_PD_8() & (1 << (DX & 7));
\r
8358 void m68k_op_btst_8_r_pd7(void)
\r
8360 FLAG_Z = OPER_A7_PD_8() & (1 << (DX & 7));
\r
8364 void m68k_op_btst_8_r_di(void)
\r
8366 FLAG_Z = OPER_AY_DI_8() & (1 << (DX & 7));
\r
8370 void m68k_op_btst_8_r_ix(void)
\r
8372 FLAG_Z = OPER_AY_IX_8() & (1 << (DX & 7));
\r
8376 void m68k_op_btst_8_r_aw(void)
\r
8378 FLAG_Z = OPER_AW_8() & (1 << (DX & 7));
\r
8382 void m68k_op_btst_8_r_al(void)
\r
8384 FLAG_Z = OPER_AL_8() & (1 << (DX & 7));
\r
8388 void m68k_op_btst_8_r_pcdi(void)
\r
8390 FLAG_Z = OPER_PCDI_8() & (1 << (DX & 7));
\r
8394 void m68k_op_btst_8_r_pcix(void)
\r
8396 FLAG_Z = OPER_PCIX_8() & (1 << (DX & 7));
\r
8400 void m68k_op_btst_8_r_i(void)
\r
8402 FLAG_Z = OPER_I_8() & (1 << (DX & 7));
\r
8406 void m68k_op_btst_32_s_d(void)
\r
8408 FLAG_Z = DY & (1 << (OPER_I_8() & 0x1f));
\r
8412 void m68k_op_btst_8_s_ai(void)
\r
8414 uint bit = OPER_I_8() & 7;
\r
8416 FLAG_Z = OPER_AY_AI_8() & (1 << bit);
\r
8420 void m68k_op_btst_8_s_pi(void)
\r
8422 uint bit = OPER_I_8() & 7;
\r
8424 FLAG_Z = OPER_AY_PI_8() & (1 << bit);
\r
8428 void m68k_op_btst_8_s_pi7(void)
\r
8430 uint bit = OPER_I_8() & 7;
\r
8432 FLAG_Z = OPER_A7_PI_8() & (1 << bit);
\r
8436 void m68k_op_btst_8_s_pd(void)
\r
8438 uint bit = OPER_I_8() & 7;
\r
8440 FLAG_Z = OPER_AY_PD_8() & (1 << bit);
\r
8444 void m68k_op_btst_8_s_pd7(void)
\r
8446 uint bit = OPER_I_8() & 7;
\r
8448 FLAG_Z = OPER_A7_PD_8() & (1 << bit);
\r
8452 void m68k_op_btst_8_s_di(void)
\r
8454 uint bit = OPER_I_8() & 7;
\r
8456 FLAG_Z = OPER_AY_DI_8() & (1 << bit);
\r
8460 void m68k_op_btst_8_s_ix(void)
\r
8462 uint bit = OPER_I_8() & 7;
\r
8464 FLAG_Z = OPER_AY_IX_8() & (1 << bit);
\r
8468 void m68k_op_btst_8_s_aw(void)
\r
8470 uint bit = OPER_I_8() & 7;
\r
8472 FLAG_Z = OPER_AW_8() & (1 << bit);
\r
8476 void m68k_op_btst_8_s_al(void)
\r
8478 uint bit = OPER_I_8() & 7;
\r
8480 FLAG_Z = OPER_AL_8() & (1 << bit);
\r
8484 void m68k_op_btst_8_s_pcdi(void)
\r
8486 uint bit = OPER_I_8() & 7;
\r
8488 FLAG_Z = OPER_PCDI_8() & (1 << bit);
\r
8492 void m68k_op_btst_8_s_pcix(void)
\r
8494 uint bit = OPER_I_8() & 7;
\r
8496 FLAG_Z = OPER_PCIX_8() & (1 << bit);
\r
8500 void m68k_op_callm_32_ai(void)
\r
8502 /* note: watch out for pcrelative modes */
\r
8503 if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE))
\r
8505 uint ea = EA_AY_AI_32();
\r
8507 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8509 (void)ea; /* just to avoid an 'unused variable' warning */
\r
8510 M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n",
\r
8511 m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR,
\r
8512 m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2))));
\r
8515 m68ki_exception_illegal();
\r
8519 void m68k_op_callm_32_di(void)
\r
8521 /* note: watch out for pcrelative modes */
\r
8522 if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE))
\r
8524 uint ea = EA_AY_DI_32();
\r
8526 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8528 (void)ea; /* just to avoid an 'unused variable' warning */
\r
8529 M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n",
\r
8530 m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR,
\r
8531 m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2))));
\r
8534 m68ki_exception_illegal();
\r
8538 void m68k_op_callm_32_ix(void)
\r
8540 /* note: watch out for pcrelative modes */
\r
8541 if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE))
\r
8543 uint ea = EA_AY_IX_32();
\r
8545 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8547 (void)ea; /* just to avoid an 'unused variable' warning */
\r
8548 M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n",
\r
8549 m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR,
\r
8550 m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2))));
\r
8553 m68ki_exception_illegal();
\r
8557 void m68k_op_callm_32_aw(void)
\r
8559 /* note: watch out for pcrelative modes */
\r
8560 if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE))
\r
8562 uint ea = EA_AW_32();
\r
8564 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8566 (void)ea; /* just to avoid an 'unused variable' warning */
\r
8567 M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n",
\r
8568 m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR,
\r
8569 m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2))));
\r
8572 m68ki_exception_illegal();
\r
8576 void m68k_op_callm_32_al(void)
\r
8578 /* note: watch out for pcrelative modes */
\r
8579 if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE))
\r
8581 uint ea = EA_AL_32();
\r
8583 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8585 (void)ea; /* just to avoid an 'unused variable' warning */
\r
8586 M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n",
\r
8587 m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR,
\r
8588 m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2))));
\r
8591 m68ki_exception_illegal();
\r
8595 void m68k_op_callm_32_pcdi(void)
\r
8597 /* note: watch out for pcrelative modes */
\r
8598 if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE))
\r
8600 uint ea = EA_PCDI_32();
\r
8602 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8604 (void)ea; /* just to avoid an 'unused variable' warning */
\r
8605 M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n",
\r
8606 m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR,
\r
8607 m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2))));
\r
8610 m68ki_exception_illegal();
\r
8614 void m68k_op_callm_32_pcix(void)
\r
8616 /* note: watch out for pcrelative modes */
\r
8617 if(CPU_TYPE_IS_020_VARIANT(CPU_TYPE))
\r
8619 uint ea = EA_PCIX_32();
\r
8621 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8623 (void)ea; /* just to avoid an 'unused variable' warning */
\r
8624 M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n",
\r
8625 m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR,
\r
8626 m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2))));
\r
8629 m68ki_exception_illegal();
\r
8633 void m68k_op_cas_8_ai(void)
\r
8635 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8637 uint word2 = OPER_I_16();
\r
8638 uint ea = EA_AY_AI_8();
\r
8639 uint dest = m68ki_read_8(ea);
\r
8640 uint* compare = ®_D[word2 & 7];
\r
8641 uint res = dest - MASK_OUT_ABOVE_8(*compare);
\r
8643 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8644 FLAG_N = NFLAG_8(res);
\r
8645 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
8646 FLAG_V = VFLAG_SUB_8(*compare, dest, res);
\r
8647 FLAG_C = CFLAG_8(res);
\r
8650 *compare = MASK_OUT_BELOW_8(*compare) | dest;
\r
8654 m68ki_write_8(ea, MASK_OUT_ABOVE_8(REG_D[(word2 >> 6) & 7]));
\r
8658 m68ki_exception_illegal();
\r
8662 void m68k_op_cas_8_pi(void)
\r
8664 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8666 uint word2 = OPER_I_16();
\r
8667 uint ea = EA_AY_PI_8();
\r
8668 uint dest = m68ki_read_8(ea);
\r
8669 uint* compare = ®_D[word2 & 7];
\r
8670 uint res = dest - MASK_OUT_ABOVE_8(*compare);
\r
8672 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8673 FLAG_N = NFLAG_8(res);
\r
8674 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
8675 FLAG_V = VFLAG_SUB_8(*compare, dest, res);
\r
8676 FLAG_C = CFLAG_8(res);
\r
8679 *compare = MASK_OUT_BELOW_8(*compare) | dest;
\r
8683 m68ki_write_8(ea, MASK_OUT_ABOVE_8(REG_D[(word2 >> 6) & 7]));
\r
8687 m68ki_exception_illegal();
\r
8691 void m68k_op_cas_8_pi7(void)
\r
8693 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8695 uint word2 = OPER_I_16();
\r
8696 uint ea = EA_A7_PI_8();
\r
8697 uint dest = m68ki_read_8(ea);
\r
8698 uint* compare = ®_D[word2 & 7];
\r
8699 uint res = dest - MASK_OUT_ABOVE_8(*compare);
\r
8701 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8702 FLAG_N = NFLAG_8(res);
\r
8703 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
8704 FLAG_V = VFLAG_SUB_8(*compare, dest, res);
\r
8705 FLAG_C = CFLAG_8(res);
\r
8708 *compare = MASK_OUT_BELOW_8(*compare) | dest;
\r
8712 m68ki_write_8(ea, MASK_OUT_ABOVE_8(REG_D[(word2 >> 6) & 7]));
\r
8716 m68ki_exception_illegal();
\r
8720 void m68k_op_cas_8_pd(void)
\r
8722 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8724 uint word2 = OPER_I_16();
\r
8725 uint ea = EA_AY_PD_8();
\r
8726 uint dest = m68ki_read_8(ea);
\r
8727 uint* compare = ®_D[word2 & 7];
\r
8728 uint res = dest - MASK_OUT_ABOVE_8(*compare);
\r
8730 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8731 FLAG_N = NFLAG_8(res);
\r
8732 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
8733 FLAG_V = VFLAG_SUB_8(*compare, dest, res);
\r
8734 FLAG_C = CFLAG_8(res);
\r
8737 *compare = MASK_OUT_BELOW_8(*compare) | dest;
\r
8741 m68ki_write_8(ea, MASK_OUT_ABOVE_8(REG_D[(word2 >> 6) & 7]));
\r
8745 m68ki_exception_illegal();
\r
8749 void m68k_op_cas_8_pd7(void)
\r
8751 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8753 uint word2 = OPER_I_16();
\r
8754 uint ea = EA_A7_PD_8();
\r
8755 uint dest = m68ki_read_8(ea);
\r
8756 uint* compare = ®_D[word2 & 7];
\r
8757 uint res = dest - MASK_OUT_ABOVE_8(*compare);
\r
8759 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8760 FLAG_N = NFLAG_8(res);
\r
8761 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
8762 FLAG_V = VFLAG_SUB_8(*compare, dest, res);
\r
8763 FLAG_C = CFLAG_8(res);
\r
8766 *compare = MASK_OUT_BELOW_8(*compare) | dest;
\r
8770 m68ki_write_8(ea, MASK_OUT_ABOVE_8(REG_D[(word2 >> 6) & 7]));
\r
8774 m68ki_exception_illegal();
\r
8778 void m68k_op_cas_8_di(void)
\r
8780 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8782 uint word2 = OPER_I_16();
\r
8783 uint ea = EA_AY_DI_8();
\r
8784 uint dest = m68ki_read_8(ea);
\r
8785 uint* compare = ®_D[word2 & 7];
\r
8786 uint res = dest - MASK_OUT_ABOVE_8(*compare);
\r
8788 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8789 FLAG_N = NFLAG_8(res);
\r
8790 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
8791 FLAG_V = VFLAG_SUB_8(*compare, dest, res);
\r
8792 FLAG_C = CFLAG_8(res);
\r
8795 *compare = MASK_OUT_BELOW_8(*compare) | dest;
\r
8799 m68ki_write_8(ea, MASK_OUT_ABOVE_8(REG_D[(word2 >> 6) & 7]));
\r
8803 m68ki_exception_illegal();
\r
8807 void m68k_op_cas_8_ix(void)
\r
8809 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8811 uint word2 = OPER_I_16();
\r
8812 uint ea = EA_AY_IX_8();
\r
8813 uint dest = m68ki_read_8(ea);
\r
8814 uint* compare = ®_D[word2 & 7];
\r
8815 uint res = dest - MASK_OUT_ABOVE_8(*compare);
\r
8817 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8818 FLAG_N = NFLAG_8(res);
\r
8819 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
8820 FLAG_V = VFLAG_SUB_8(*compare, dest, res);
\r
8821 FLAG_C = CFLAG_8(res);
\r
8824 *compare = MASK_OUT_BELOW_8(*compare) | dest;
\r
8828 m68ki_write_8(ea, MASK_OUT_ABOVE_8(REG_D[(word2 >> 6) & 7]));
\r
8832 m68ki_exception_illegal();
\r
8836 void m68k_op_cas_8_aw(void)
\r
8838 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8840 uint word2 = OPER_I_16();
\r
8841 uint ea = EA_AW_8();
\r
8842 uint dest = m68ki_read_8(ea);
\r
8843 uint* compare = ®_D[word2 & 7];
\r
8844 uint res = dest - MASK_OUT_ABOVE_8(*compare);
\r
8846 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8847 FLAG_N = NFLAG_8(res);
\r
8848 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
8849 FLAG_V = VFLAG_SUB_8(*compare, dest, res);
\r
8850 FLAG_C = CFLAG_8(res);
\r
8853 *compare = MASK_OUT_BELOW_8(*compare) | dest;
\r
8857 m68ki_write_8(ea, MASK_OUT_ABOVE_8(REG_D[(word2 >> 6) & 7]));
\r
8861 m68ki_exception_illegal();
\r
8865 void m68k_op_cas_8_al(void)
\r
8867 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8869 uint word2 = OPER_I_16();
\r
8870 uint ea = EA_AL_8();
\r
8871 uint dest = m68ki_read_8(ea);
\r
8872 uint* compare = ®_D[word2 & 7];
\r
8873 uint res = dest - MASK_OUT_ABOVE_8(*compare);
\r
8875 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8876 FLAG_N = NFLAG_8(res);
\r
8877 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
8878 FLAG_V = VFLAG_SUB_8(*compare, dest, res);
\r
8879 FLAG_C = CFLAG_8(res);
\r
8882 *compare = MASK_OUT_BELOW_8(*compare) | dest;
\r
8886 m68ki_write_8(ea, MASK_OUT_ABOVE_8(REG_D[(word2 >> 6) & 7]));
\r
8890 m68ki_exception_illegal();
\r
8894 void m68k_op_cas_16_ai(void)
\r
8896 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8898 uint word2 = OPER_I_16();
\r
8899 uint ea = EA_AY_AI_16();
\r
8900 uint dest = m68ki_read_16(ea);
\r
8901 uint* compare = ®_D[word2 & 7];
\r
8902 uint res = dest - MASK_OUT_ABOVE_16(*compare);
\r
8904 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8905 FLAG_N = NFLAG_16(res);
\r
8906 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
8907 FLAG_V = VFLAG_SUB_16(*compare, dest, res);
\r
8908 FLAG_C = CFLAG_16(res);
\r
8911 *compare = MASK_OUT_BELOW_16(*compare) | dest;
\r
8915 m68ki_write_16(ea, MASK_OUT_ABOVE_16(REG_D[(word2 >> 6) & 7]));
\r
8919 m68ki_exception_illegal();
\r
8923 void m68k_op_cas_16_pi(void)
\r
8925 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8927 uint word2 = OPER_I_16();
\r
8928 uint ea = EA_AY_PI_16();
\r
8929 uint dest = m68ki_read_16(ea);
\r
8930 uint* compare = ®_D[word2 & 7];
\r
8931 uint res = dest - MASK_OUT_ABOVE_16(*compare);
\r
8933 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8934 FLAG_N = NFLAG_16(res);
\r
8935 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
8936 FLAG_V = VFLAG_SUB_16(*compare, dest, res);
\r
8937 FLAG_C = CFLAG_16(res);
\r
8940 *compare = MASK_OUT_BELOW_16(*compare) | dest;
\r
8944 m68ki_write_16(ea, MASK_OUT_ABOVE_16(REG_D[(word2 >> 6) & 7]));
\r
8948 m68ki_exception_illegal();
\r
8952 void m68k_op_cas_16_pd(void)
\r
8954 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8956 uint word2 = OPER_I_16();
\r
8957 uint ea = EA_AY_PD_16();
\r
8958 uint dest = m68ki_read_16(ea);
\r
8959 uint* compare = ®_D[word2 & 7];
\r
8960 uint res = dest - MASK_OUT_ABOVE_16(*compare);
\r
8962 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8963 FLAG_N = NFLAG_16(res);
\r
8964 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
8965 FLAG_V = VFLAG_SUB_16(*compare, dest, res);
\r
8966 FLAG_C = CFLAG_16(res);
\r
8969 *compare = MASK_OUT_BELOW_16(*compare) | dest;
\r
8973 m68ki_write_16(ea, MASK_OUT_ABOVE_16(REG_D[(word2 >> 6) & 7]));
\r
8977 m68ki_exception_illegal();
\r
8981 void m68k_op_cas_16_di(void)
\r
8983 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
8985 uint word2 = OPER_I_16();
\r
8986 uint ea = EA_AY_DI_16();
\r
8987 uint dest = m68ki_read_16(ea);
\r
8988 uint* compare = ®_D[word2 & 7];
\r
8989 uint res = dest - MASK_OUT_ABOVE_16(*compare);
\r
8991 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
8992 FLAG_N = NFLAG_16(res);
\r
8993 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
8994 FLAG_V = VFLAG_SUB_16(*compare, dest, res);
\r
8995 FLAG_C = CFLAG_16(res);
\r
8998 *compare = MASK_OUT_BELOW_16(*compare) | dest;
\r
9002 m68ki_write_16(ea, MASK_OUT_ABOVE_16(REG_D[(word2 >> 6) & 7]));
\r
9006 m68ki_exception_illegal();
\r
9010 void m68k_op_cas_16_ix(void)
\r
9012 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9014 uint word2 = OPER_I_16();
\r
9015 uint ea = EA_AY_IX_16();
\r
9016 uint dest = m68ki_read_16(ea);
\r
9017 uint* compare = ®_D[word2 & 7];
\r
9018 uint res = dest - MASK_OUT_ABOVE_16(*compare);
\r
9020 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
9021 FLAG_N = NFLAG_16(res);
\r
9022 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
9023 FLAG_V = VFLAG_SUB_16(*compare, dest, res);
\r
9024 FLAG_C = CFLAG_16(res);
\r
9027 *compare = MASK_OUT_BELOW_16(*compare) | dest;
\r
9031 m68ki_write_16(ea, MASK_OUT_ABOVE_16(REG_D[(word2 >> 6) & 7]));
\r
9035 m68ki_exception_illegal();
\r
9039 void m68k_op_cas_16_aw(void)
\r
9041 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9043 uint word2 = OPER_I_16();
\r
9044 uint ea = EA_AW_16();
\r
9045 uint dest = m68ki_read_16(ea);
\r
9046 uint* compare = ®_D[word2 & 7];
\r
9047 uint res = dest - MASK_OUT_ABOVE_16(*compare);
\r
9049 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
9050 FLAG_N = NFLAG_16(res);
\r
9051 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
9052 FLAG_V = VFLAG_SUB_16(*compare, dest, res);
\r
9053 FLAG_C = CFLAG_16(res);
\r
9056 *compare = MASK_OUT_BELOW_16(*compare) | dest;
\r
9060 m68ki_write_16(ea, MASK_OUT_ABOVE_16(REG_D[(word2 >> 6) & 7]));
\r
9064 m68ki_exception_illegal();
\r
9068 void m68k_op_cas_16_al(void)
\r
9070 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9072 uint word2 = OPER_I_16();
\r
9073 uint ea = EA_AL_16();
\r
9074 uint dest = m68ki_read_16(ea);
\r
9075 uint* compare = ®_D[word2 & 7];
\r
9076 uint res = dest - MASK_OUT_ABOVE_16(*compare);
\r
9078 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
9079 FLAG_N = NFLAG_16(res);
\r
9080 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
9081 FLAG_V = VFLAG_SUB_16(*compare, dest, res);
\r
9082 FLAG_C = CFLAG_16(res);
\r
9085 *compare = MASK_OUT_BELOW_16(*compare) | dest;
\r
9089 m68ki_write_16(ea, MASK_OUT_ABOVE_16(REG_D[(word2 >> 6) & 7]));
\r
9093 m68ki_exception_illegal();
\r
9097 void m68k_op_cas_32_ai(void)
\r
9099 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9101 uint word2 = OPER_I_16();
\r
9102 uint ea = EA_AY_AI_32();
\r
9103 uint dest = m68ki_read_32(ea);
\r
9104 uint* compare = ®_D[word2 & 7];
\r
9105 uint res = dest - *compare;
\r
9107 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
9108 FLAG_N = NFLAG_32(res);
\r
9109 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
9110 FLAG_V = VFLAG_SUB_32(*compare, dest, res);
\r
9111 FLAG_C = CFLAG_SUB_32(*compare, dest, res);
\r
9118 m68ki_write_32(ea, REG_D[(word2 >> 6) & 7]);
\r
9122 m68ki_exception_illegal();
\r
9126 void m68k_op_cas_32_pi(void)
\r
9128 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9130 uint word2 = OPER_I_16();
\r
9131 uint ea = EA_AY_PI_32();
\r
9132 uint dest = m68ki_read_32(ea);
\r
9133 uint* compare = ®_D[word2 & 7];
\r
9134 uint res = dest - *compare;
\r
9136 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
9137 FLAG_N = NFLAG_32(res);
\r
9138 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
9139 FLAG_V = VFLAG_SUB_32(*compare, dest, res);
\r
9140 FLAG_C = CFLAG_SUB_32(*compare, dest, res);
\r
9147 m68ki_write_32(ea, REG_D[(word2 >> 6) & 7]);
\r
9151 m68ki_exception_illegal();
\r
9155 void m68k_op_cas_32_pd(void)
\r
9157 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9159 uint word2 = OPER_I_16();
\r
9160 uint ea = EA_AY_PD_32();
\r
9161 uint dest = m68ki_read_32(ea);
\r
9162 uint* compare = ®_D[word2 & 7];
\r
9163 uint res = dest - *compare;
\r
9165 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
9166 FLAG_N = NFLAG_32(res);
\r
9167 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
9168 FLAG_V = VFLAG_SUB_32(*compare, dest, res);
\r
9169 FLAG_C = CFLAG_SUB_32(*compare, dest, res);
\r
9176 m68ki_write_32(ea, REG_D[(word2 >> 6) & 7]);
\r
9180 m68ki_exception_illegal();
\r
9184 void m68k_op_cas_32_di(void)
\r
9186 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9188 uint word2 = OPER_I_16();
\r
9189 uint ea = EA_AY_DI_32();
\r
9190 uint dest = m68ki_read_32(ea);
\r
9191 uint* compare = ®_D[word2 & 7];
\r
9192 uint res = dest - *compare;
\r
9194 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
9195 FLAG_N = NFLAG_32(res);
\r
9196 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
9197 FLAG_V = VFLAG_SUB_32(*compare, dest, res);
\r
9198 FLAG_C = CFLAG_SUB_32(*compare, dest, res);
\r
9205 m68ki_write_32(ea, REG_D[(word2 >> 6) & 7]);
\r
9209 m68ki_exception_illegal();
\r
9213 void m68k_op_cas_32_ix(void)
\r
9215 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9217 uint word2 = OPER_I_16();
\r
9218 uint ea = EA_AY_IX_32();
\r
9219 uint dest = m68ki_read_32(ea);
\r
9220 uint* compare = ®_D[word2 & 7];
\r
9221 uint res = dest - *compare;
\r
9223 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
9224 FLAG_N = NFLAG_32(res);
\r
9225 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
9226 FLAG_V = VFLAG_SUB_32(*compare, dest, res);
\r
9227 FLAG_C = CFLAG_SUB_32(*compare, dest, res);
\r
9234 m68ki_write_32(ea, REG_D[(word2 >> 6) & 7]);
\r
9238 m68ki_exception_illegal();
\r
9242 void m68k_op_cas_32_aw(void)
\r
9244 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9246 uint word2 = OPER_I_16();
\r
9247 uint ea = EA_AW_32();
\r
9248 uint dest = m68ki_read_32(ea);
\r
9249 uint* compare = ®_D[word2 & 7];
\r
9250 uint res = dest - *compare;
\r
9252 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
9253 FLAG_N = NFLAG_32(res);
\r
9254 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
9255 FLAG_V = VFLAG_SUB_32(*compare, dest, res);
\r
9256 FLAG_C = CFLAG_SUB_32(*compare, dest, res);
\r
9263 m68ki_write_32(ea, REG_D[(word2 >> 6) & 7]);
\r
9267 m68ki_exception_illegal();
\r
9271 void m68k_op_cas_32_al(void)
\r
9273 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9275 uint word2 = OPER_I_16();
\r
9276 uint ea = EA_AL_32();
\r
9277 uint dest = m68ki_read_32(ea);
\r
9278 uint* compare = ®_D[word2 & 7];
\r
9279 uint res = dest - *compare;
\r
9281 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
9282 FLAG_N = NFLAG_32(res);
\r
9283 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
9284 FLAG_V = VFLAG_SUB_32(*compare, dest, res);
\r
9285 FLAG_C = CFLAG_SUB_32(*compare, dest, res);
\r
9292 m68ki_write_32(ea, REG_D[(word2 >> 6) & 7]);
\r
9296 m68ki_exception_illegal();
\r
9300 void m68k_op_cas2_16(void)
\r
9302 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9304 uint word2 = OPER_I_32();
\r
9305 uint* compare1 = ®_D[(word2 >> 16) & 7];
\r
9306 uint ea1 = REG_DA[(word2 >> 28) & 15];
\r
9307 uint dest1 = m68ki_read_16(ea1);
\r
9308 uint res1 = dest1 - MASK_OUT_ABOVE_16(*compare1);
\r
9309 uint* compare2 = ®_D[word2 & 7];
\r
9310 uint ea2 = REG_DA[(word2 >> 12) & 15];
\r
9311 uint dest2 = m68ki_read_16(ea2);
\r
9314 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
9315 FLAG_N = NFLAG_16(res1);
\r
9316 FLAG_Z = MASK_OUT_ABOVE_16(res1);
\r
9317 FLAG_V = VFLAG_SUB_16(*compare1, dest1, res1);
\r
9318 FLAG_C = CFLAG_16(res1);
\r
9322 res2 = dest2 - MASK_OUT_ABOVE_16(*compare2);
\r
9324 FLAG_N = NFLAG_16(res2);
\r
9325 FLAG_Z = MASK_OUT_ABOVE_16(res2);
\r
9326 FLAG_V = VFLAG_SUB_16(*compare2, dest2, res2);
\r
9327 FLAG_C = CFLAG_16(res2);
\r
9332 m68ki_write_16(ea1, REG_D[(word2 >> 22) & 7]);
\r
9333 m68ki_write_16(ea2, REG_D[(word2 >> 6) & 7]);
\r
9337 *compare1 = BIT_1F(word2) ? MAKE_INT_16(dest1) : MASK_OUT_BELOW_16(*compare1) | dest1;
\r
9338 *compare2 = BIT_F(word2) ? MAKE_INT_16(dest2) : MASK_OUT_BELOW_16(*compare2) | dest2;
\r
9341 m68ki_exception_illegal();
\r
9345 void m68k_op_cas2_32(void)
\r
9347 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9349 uint word2 = OPER_I_32();
\r
9350 uint* compare1 = ®_D[(word2 >> 16) & 7];
\r
9351 uint ea1 = REG_DA[(word2 >> 28) & 15];
\r
9352 uint dest1 = m68ki_read_32(ea1);
\r
9353 uint res1 = dest1 - *compare1;
\r
9354 uint* compare2 = ®_D[word2 & 7];
\r
9355 uint ea2 = REG_DA[(word2 >> 12) & 15];
\r
9356 uint dest2 = m68ki_read_32(ea2);
\r
9359 m68ki_trace_t0(); /* auto-disable (see m68kcpu.h) */
\r
9360 FLAG_N = NFLAG_32(res1);
\r
9361 FLAG_Z = MASK_OUT_ABOVE_32(res1);
\r
9362 FLAG_V = VFLAG_SUB_32(*compare1, dest1, res1);
\r
9363 FLAG_C = CFLAG_SUB_32(*compare1, dest1, res1);
\r
9367 res2 = dest2 - *compare2;
\r
9369 FLAG_N = NFLAG_32(res2);
\r
9370 FLAG_Z = MASK_OUT_ABOVE_32(res2);
\r
9371 FLAG_V = VFLAG_SUB_32(*compare2, dest2, res2);
\r
9372 FLAG_C = CFLAG_SUB_32(*compare2, dest2, res2);
\r
9377 m68ki_write_32(ea1, REG_D[(word2 >> 22) & 7]);
\r
9378 m68ki_write_32(ea2, REG_D[(word2 >> 6) & 7]);
\r
9382 *compare1 = dest1;
\r
9383 *compare2 = dest2;
\r
9386 m68ki_exception_illegal();
\r
9390 void m68k_op_chk_16_d(void)
\r
9392 sint src = MAKE_INT_16(DX);
\r
9393 sint bound = MAKE_INT_16(DY);
\r
9395 FLAG_Z = ZFLAG_16(src); /* Undocumented */
\r
9396 FLAG_V = VFLAG_CLEAR; /* Undocumented */
\r
9397 FLAG_C = CFLAG_CLEAR; /* Undocumented */
\r
9399 if(src >= 0 && src <= bound)
\r
9403 FLAG_N = (src < 0)<<7;
\r
9404 m68ki_exception_trap(EXCEPTION_CHK);
\r
9408 void m68k_op_chk_16_ai(void)
\r
9410 sint src = MAKE_INT_16(DX);
\r
9411 sint bound = MAKE_INT_16(OPER_AY_AI_16());
\r
9413 FLAG_Z = ZFLAG_16(src); /* Undocumented */
\r
9414 FLAG_V = VFLAG_CLEAR; /* Undocumented */
\r
9415 FLAG_C = CFLAG_CLEAR; /* Undocumented */
\r
9417 if(src >= 0 && src <= bound)
\r
9421 FLAG_N = (src < 0)<<7;
\r
9422 m68ki_exception_trap(EXCEPTION_CHK);
\r
9426 void m68k_op_chk_16_pi(void)
\r
9428 sint src = MAKE_INT_16(DX);
\r
9429 sint bound = MAKE_INT_16(OPER_AY_PI_16());
\r
9431 FLAG_Z = ZFLAG_16(src); /* Undocumented */
\r
9432 FLAG_V = VFLAG_CLEAR; /* Undocumented */
\r
9433 FLAG_C = CFLAG_CLEAR; /* Undocumented */
\r
9435 if(src >= 0 && src <= bound)
\r
9439 FLAG_N = (src < 0)<<7;
\r
9440 m68ki_exception_trap(EXCEPTION_CHK);
\r
9444 void m68k_op_chk_16_pd(void)
\r
9446 sint src = MAKE_INT_16(DX);
\r
9447 sint bound = MAKE_INT_16(OPER_AY_PD_16());
\r
9449 FLAG_Z = ZFLAG_16(src); /* Undocumented */
\r
9450 FLAG_V = VFLAG_CLEAR; /* Undocumented */
\r
9451 FLAG_C = CFLAG_CLEAR; /* Undocumented */
\r
9453 if(src >= 0 && src <= bound)
\r
9457 FLAG_N = (src < 0)<<7;
\r
9458 m68ki_exception_trap(EXCEPTION_CHK);
\r
9462 void m68k_op_chk_16_di(void)
\r
9464 sint src = MAKE_INT_16(DX);
\r
9465 sint bound = MAKE_INT_16(OPER_AY_DI_16());
\r
9467 FLAG_Z = ZFLAG_16(src); /* Undocumented */
\r
9468 FLAG_V = VFLAG_CLEAR; /* Undocumented */
\r
9469 FLAG_C = CFLAG_CLEAR; /* Undocumented */
\r
9471 if(src >= 0 && src <= bound)
\r
9475 FLAG_N = (src < 0)<<7;
\r
9476 m68ki_exception_trap(EXCEPTION_CHK);
\r
9480 void m68k_op_chk_16_ix(void)
\r
9482 sint src = MAKE_INT_16(DX);
\r
9483 sint bound = MAKE_INT_16(OPER_AY_IX_16());
\r
9485 FLAG_Z = ZFLAG_16(src); /* Undocumented */
\r
9486 FLAG_V = VFLAG_CLEAR; /* Undocumented */
\r
9487 FLAG_C = CFLAG_CLEAR; /* Undocumented */
\r
9489 if(src >= 0 && src <= bound)
\r
9493 FLAG_N = (src < 0)<<7;
\r
9494 m68ki_exception_trap(EXCEPTION_CHK);
\r
9498 void m68k_op_chk_16_aw(void)
\r
9500 sint src = MAKE_INT_16(DX);
\r
9501 sint bound = MAKE_INT_16(OPER_AW_16());
\r
9503 FLAG_Z = ZFLAG_16(src); /* Undocumented */
\r
9504 FLAG_V = VFLAG_CLEAR; /* Undocumented */
\r
9505 FLAG_C = CFLAG_CLEAR; /* Undocumented */
\r
9507 if(src >= 0 && src <= bound)
\r
9511 FLAG_N = (src < 0)<<7;
\r
9512 m68ki_exception_trap(EXCEPTION_CHK);
\r
9516 void m68k_op_chk_16_al(void)
\r
9518 sint src = MAKE_INT_16(DX);
\r
9519 sint bound = MAKE_INT_16(OPER_AL_16());
\r
9521 FLAG_Z = ZFLAG_16(src); /* Undocumented */
\r
9522 FLAG_V = VFLAG_CLEAR; /* Undocumented */
\r
9523 FLAG_C = CFLAG_CLEAR; /* Undocumented */
\r
9525 if(src >= 0 && src <= bound)
\r
9529 FLAG_N = (src < 0)<<7;
\r
9530 m68ki_exception_trap(EXCEPTION_CHK);
\r
9534 void m68k_op_chk_16_pcdi(void)
\r
9536 sint src = MAKE_INT_16(DX);
\r
9537 sint bound = MAKE_INT_16(OPER_PCDI_16());
\r
9539 FLAG_Z = ZFLAG_16(src); /* Undocumented */
\r
9540 FLAG_V = VFLAG_CLEAR; /* Undocumented */
\r
9541 FLAG_C = CFLAG_CLEAR; /* Undocumented */
\r
9543 if(src >= 0 && src <= bound)
\r
9547 FLAG_N = (src < 0)<<7;
\r
9548 m68ki_exception_trap(EXCEPTION_CHK);
\r
9552 void m68k_op_chk_16_pcix(void)
\r
9554 sint src = MAKE_INT_16(DX);
\r
9555 sint bound = MAKE_INT_16(OPER_PCIX_16());
\r
9557 FLAG_Z = ZFLAG_16(src); /* Undocumented */
\r
9558 FLAG_V = VFLAG_CLEAR; /* Undocumented */
\r
9559 FLAG_C = CFLAG_CLEAR; /* Undocumented */
\r
9561 if(src >= 0 && src <= bound)
\r
9565 FLAG_N = (src < 0)<<7;
\r
9566 m68ki_exception_trap(EXCEPTION_CHK);
\r
9570 void m68k_op_chk_16_i(void)
\r
9572 sint src = MAKE_INT_16(DX);
\r
9573 sint bound = MAKE_INT_16(OPER_I_16());
\r
9575 FLAG_Z = ZFLAG_16(src); /* Undocumented */
\r
9576 FLAG_V = VFLAG_CLEAR; /* Undocumented */
\r
9577 FLAG_C = CFLAG_CLEAR; /* Undocumented */
\r
9579 if(src >= 0 && src <= bound)
\r
9583 FLAG_N = (src < 0)<<7;
\r
9584 m68ki_exception_trap(EXCEPTION_CHK);
\r
9588 void m68k_op_chk_32_d(void)
\r
9590 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9592 sint src = MAKE_INT_32(DX);
\r
9593 sint bound = MAKE_INT_32(DY);
\r
9595 FLAG_Z = ZFLAG_32(src); /* Undocumented */
\r
9596 FLAG_V = VFLAG_CLEAR; /* Undocumented */
\r
9597 FLAG_C = CFLAG_CLEAR; /* Undocumented */
\r
9599 if(src >= 0 && src <= bound)
\r
9603 FLAG_N = (src < 0)<<7;
\r
9604 m68ki_exception_trap(EXCEPTION_CHK);
\r
9607 m68ki_exception_illegal();
\r
9611 void m68k_op_chk_32_ai(void)
\r
9613 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9615 sint src = MAKE_INT_32(DX);
\r
9616 sint bound = MAKE_INT_32(OPER_AY_AI_32());
\r
9618 FLAG_Z = ZFLAG_32(src); /* Undocumented */
\r
9619 FLAG_V = VFLAG_CLEAR; /* Undocumented */
\r
9620 FLAG_C = CFLAG_CLEAR; /* Undocumented */
\r
9622 if(src >= 0 && src <= bound)
\r
9626 FLAG_N = (src < 0)<<7;
\r
9627 m68ki_exception_trap(EXCEPTION_CHK);
\r
9630 m68ki_exception_illegal();
\r
9634 void m68k_op_chk_32_pi(void)
\r
9636 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9638 sint src = MAKE_INT_32(DX);
\r
9639 sint bound = MAKE_INT_32(OPER_AY_PI_32());
\r
9641 FLAG_Z = ZFLAG_32(src); /* Undocumented */
\r
9642 FLAG_V = VFLAG_CLEAR; /* Undocumented */
\r
9643 FLAG_C = CFLAG_CLEAR; /* Undocumented */
\r
9645 if(src >= 0 && src <= bound)
\r
9649 FLAG_N = (src < 0)<<7;
\r
9650 m68ki_exception_trap(EXCEPTION_CHK);
\r
9653 m68ki_exception_illegal();
\r
9657 void m68k_op_chk_32_pd(void)
\r
9659 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9661 sint src = MAKE_INT_32(DX);
\r
9662 sint bound = MAKE_INT_32(OPER_AY_PD_32());
\r
9664 FLAG_Z = ZFLAG_32(src); /* Undocumented */
\r
9665 FLAG_V = VFLAG_CLEAR; /* Undocumented */
\r
9666 FLAG_C = CFLAG_CLEAR; /* Undocumented */
\r
9668 if(src >= 0 && src <= bound)
\r
9672 FLAG_N = (src < 0)<<7;
\r
9673 m68ki_exception_trap(EXCEPTION_CHK);
\r
9676 m68ki_exception_illegal();
\r
9680 void m68k_op_chk_32_di(void)
\r
9682 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9684 sint src = MAKE_INT_32(DX);
\r
9685 sint bound = MAKE_INT_32(OPER_AY_DI_32());
\r
9687 FLAG_Z = ZFLAG_32(src); /* Undocumented */
\r
9688 FLAG_V = VFLAG_CLEAR; /* Undocumented */
\r
9689 FLAG_C = CFLAG_CLEAR; /* Undocumented */
\r
9691 if(src >= 0 && src <= bound)
\r
9695 FLAG_N = (src < 0)<<7;
\r
9696 m68ki_exception_trap(EXCEPTION_CHK);
\r
9699 m68ki_exception_illegal();
\r
9703 void m68k_op_chk_32_ix(void)
\r
9705 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9707 sint src = MAKE_INT_32(DX);
\r
9708 sint bound = MAKE_INT_32(OPER_AY_IX_32());
\r
9710 FLAG_Z = ZFLAG_32(src); /* Undocumented */
\r
9711 FLAG_V = VFLAG_CLEAR; /* Undocumented */
\r
9712 FLAG_C = CFLAG_CLEAR; /* Undocumented */
\r
9714 if(src >= 0 && src <= bound)
\r
9718 FLAG_N = (src < 0)<<7;
\r
9719 m68ki_exception_trap(EXCEPTION_CHK);
\r
9722 m68ki_exception_illegal();
\r
9726 void m68k_op_chk_32_aw(void)
\r
9728 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9730 sint src = MAKE_INT_32(DX);
\r
9731 sint bound = MAKE_INT_32(OPER_AW_32());
\r
9733 FLAG_Z = ZFLAG_32(src); /* Undocumented */
\r
9734 FLAG_V = VFLAG_CLEAR; /* Undocumented */
\r
9735 FLAG_C = CFLAG_CLEAR; /* Undocumented */
\r
9737 if(src >= 0 && src <= bound)
\r
9741 FLAG_N = (src < 0)<<7;
\r
9742 m68ki_exception_trap(EXCEPTION_CHK);
\r
9745 m68ki_exception_illegal();
\r
9749 void m68k_op_chk_32_al(void)
\r
9751 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9753 sint src = MAKE_INT_32(DX);
\r
9754 sint bound = MAKE_INT_32(OPER_AL_32());
\r
9756 FLAG_Z = ZFLAG_32(src); /* Undocumented */
\r
9757 FLAG_V = VFLAG_CLEAR; /* Undocumented */
\r
9758 FLAG_C = CFLAG_CLEAR; /* Undocumented */
\r
9760 if(src >= 0 && src <= bound)
\r
9764 FLAG_N = (src < 0)<<7;
\r
9765 m68ki_exception_trap(EXCEPTION_CHK);
\r
9768 m68ki_exception_illegal();
\r
9772 void m68k_op_chk_32_pcdi(void)
\r
9774 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9776 sint src = MAKE_INT_32(DX);
\r
9777 sint bound = MAKE_INT_32(OPER_PCDI_32());
\r
9779 FLAG_Z = ZFLAG_32(src); /* Undocumented */
\r
9780 FLAG_V = VFLAG_CLEAR; /* Undocumented */
\r
9781 FLAG_C = CFLAG_CLEAR; /* Undocumented */
\r
9783 if(src >= 0 && src <= bound)
\r
9787 FLAG_N = (src < 0)<<7;
\r
9788 m68ki_exception_trap(EXCEPTION_CHK);
\r
9791 m68ki_exception_illegal();
\r
9795 void m68k_op_chk_32_pcix(void)
\r
9797 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9799 sint src = MAKE_INT_32(DX);
\r
9800 sint bound = MAKE_INT_32(OPER_PCIX_32());
\r
9802 FLAG_Z = ZFLAG_32(src); /* Undocumented */
\r
9803 FLAG_V = VFLAG_CLEAR; /* Undocumented */
\r
9804 FLAG_C = CFLAG_CLEAR; /* Undocumented */
\r
9806 if(src >= 0 && src <= bound)
\r
9810 FLAG_N = (src < 0)<<7;
\r
9811 m68ki_exception_trap(EXCEPTION_CHK);
\r
9814 m68ki_exception_illegal();
\r
9818 void m68k_op_chk_32_i(void)
\r
9820 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9822 sint src = MAKE_INT_32(DX);
\r
9823 sint bound = MAKE_INT_32(OPER_I_32());
\r
9825 FLAG_Z = ZFLAG_32(src); /* Undocumented */
\r
9826 FLAG_V = VFLAG_CLEAR; /* Undocumented */
\r
9827 FLAG_C = CFLAG_CLEAR; /* Undocumented */
\r
9829 if(src >= 0 && src <= bound)
\r
9833 FLAG_N = (src < 0)<<7;
\r
9834 m68ki_exception_trap(EXCEPTION_CHK);
\r
9837 m68ki_exception_illegal();
\r
9841 void m68k_op_chk2cmp2_8_pcdi(void)
\r
9843 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9845 uint word2 = OPER_I_16();
\r
9846 uint compare = REG_DA[(word2 >> 12) & 15]&0xff;
\r
9847 uint ea = EA_PCDI_8();
\r
9848 uint lower_bound = m68ki_read_pcrel_8(ea);
\r
9849 uint upper_bound = m68ki_read_pcrel_8(ea + 1);
\r
9852 FLAG_C = MAKE_INT_8(compare) - MAKE_INT_8(lower_bound);
\r
9854 FLAG_C = compare - lower_bound;
\r
9855 FLAG_Z = !((upper_bound==compare) | (lower_bound==compare));
\r
9859 m68ki_exception_trap(EXCEPTION_CHK);
\r
9863 FLAG_C = upper_bound - compare;
\r
9864 if(COND_CS() && BIT_B(word2))
\r
9865 m68ki_exception_trap(EXCEPTION_CHK);
\r
9868 m68ki_exception_illegal();
\r
9872 void m68k_op_chk2cmp2_8_pcix(void)
\r
9874 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9876 uint word2 = OPER_I_16();
\r
9877 uint compare = REG_DA[(word2 >> 12) & 15]&0xff;
\r
9878 uint ea = EA_PCIX_8();
\r
9879 uint lower_bound = m68ki_read_pcrel_8(ea);
\r
9880 uint upper_bound = m68ki_read_pcrel_8(ea + 1);
\r
9883 FLAG_C = MAKE_INT_8(compare) - MAKE_INT_8(lower_bound);
\r
9885 FLAG_C = compare - lower_bound;
\r
9886 FLAG_Z = !((upper_bound==compare) | (lower_bound==compare));
\r
9890 m68ki_exception_trap(EXCEPTION_CHK);
\r
9894 FLAG_C = upper_bound - compare;
\r
9895 if(COND_CS() && BIT_B(word2))
\r
9896 m68ki_exception_trap(EXCEPTION_CHK);
\r
9899 m68ki_exception_illegal();
\r
9903 void m68k_op_chk2cmp2_8_ai(void)
\r
9905 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9907 uint word2 = OPER_I_16();
\r
9908 uint compare = REG_DA[(word2 >> 12) & 15]&0xff;
\r
9909 uint ea = EA_AY_AI_8();
\r
9910 uint lower_bound = m68ki_read_8(ea);
\r
9911 uint upper_bound = m68ki_read_8(ea + 1);
\r
9914 FLAG_C = MAKE_INT_8(compare) - MAKE_INT_8(lower_bound);
\r
9916 FLAG_C = compare - lower_bound;
\r
9917 FLAG_Z = !((upper_bound==compare) | (lower_bound==compare));
\r
9921 m68ki_exception_trap(EXCEPTION_CHK);
\r
9925 FLAG_C = upper_bound - compare;
\r
9926 if(COND_CS() && BIT_B(word2))
\r
9927 m68ki_exception_trap(EXCEPTION_CHK);
\r
9930 m68ki_exception_illegal();
\r
9934 void m68k_op_chk2cmp2_8_di(void)
\r
9936 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9938 uint word2 = OPER_I_16();
\r
9939 uint compare = REG_DA[(word2 >> 12) & 15]&0xff;
\r
9940 uint ea = EA_AY_DI_8();
\r
9941 uint lower_bound = m68ki_read_8(ea);
\r
9942 uint upper_bound = m68ki_read_8(ea + 1);
\r
9945 FLAG_C = MAKE_INT_8(compare) - MAKE_INT_8(lower_bound);
\r
9947 FLAG_C = compare - lower_bound;
\r
9948 FLAG_Z = !((upper_bound==compare) | (lower_bound==compare));
\r
9952 m68ki_exception_trap(EXCEPTION_CHK);
\r
9956 FLAG_C = upper_bound - compare;
\r
9957 if(COND_CS() && BIT_B(word2))
\r
9958 m68ki_exception_trap(EXCEPTION_CHK);
\r
9961 m68ki_exception_illegal();
\r
9965 void m68k_op_chk2cmp2_8_ix(void)
\r
9967 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
9969 uint word2 = OPER_I_16();
\r
9970 uint compare = REG_DA[(word2 >> 12) & 15]&0xff;
\r
9971 uint ea = EA_AY_IX_8();
\r
9972 uint lower_bound = m68ki_read_8(ea);
\r
9973 uint upper_bound = m68ki_read_8(ea + 1);
\r
9976 FLAG_C = MAKE_INT_8(compare) - MAKE_INT_8(lower_bound);
\r
9978 FLAG_C = compare - lower_bound;
\r
9979 FLAG_Z = !((upper_bound==compare) | (lower_bound==compare));
\r
9983 m68ki_exception_trap(EXCEPTION_CHK);
\r
9987 FLAG_C = upper_bound - compare;
\r
9988 if(COND_CS() && BIT_B(word2))
\r
9989 m68ki_exception_trap(EXCEPTION_CHK);
\r
9992 m68ki_exception_illegal();
\r
9996 void m68k_op_chk2cmp2_8_aw(void)
\r
9998 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
10000 uint word2 = OPER_I_16();
\r
10001 uint compare = REG_DA[(word2 >> 12) & 15]&0xff;
\r
10002 uint ea = EA_AW_8();
\r
10003 uint lower_bound = m68ki_read_8(ea);
\r
10004 uint upper_bound = m68ki_read_8(ea + 1);
\r
10006 if(!BIT_F(word2))
\r
10007 FLAG_C = MAKE_INT_8(compare) - MAKE_INT_8(lower_bound);
\r
10009 FLAG_C = compare - lower_bound;
\r
10010 FLAG_Z = !((upper_bound==compare) | (lower_bound==compare));
\r
10014 m68ki_exception_trap(EXCEPTION_CHK);
\r
10018 FLAG_C = upper_bound - compare;
\r
10019 if(COND_CS() && BIT_B(word2))
\r
10020 m68ki_exception_trap(EXCEPTION_CHK);
\r
10023 m68ki_exception_illegal();
\r
10027 void m68k_op_chk2cmp2_8_al(void)
\r
10029 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
10031 uint word2 = OPER_I_16();
\r
10032 uint compare = REG_DA[(word2 >> 12) & 15]&0xff;
\r
10033 uint ea = EA_AL_8();
\r
10034 uint lower_bound = m68ki_read_8(ea);
\r
10035 uint upper_bound = m68ki_read_8(ea + 1);
\r
10037 if(!BIT_F(word2))
\r
10038 FLAG_C = MAKE_INT_8(compare) - MAKE_INT_8(lower_bound);
\r
10040 FLAG_C = compare - lower_bound;
\r
10041 FLAG_Z = !((upper_bound==compare) | (lower_bound==compare));
\r
10045 m68ki_exception_trap(EXCEPTION_CHK);
\r
10049 FLAG_C = upper_bound - compare;
\r
10050 if(COND_CS() && BIT_B(word2))
\r
10051 m68ki_exception_trap(EXCEPTION_CHK);
\r
10054 m68ki_exception_illegal();
\r
10058 void m68k_op_chk2cmp2_16_pcdi(void)
\r
10060 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
10062 uint word2 = OPER_I_16();
\r
10063 uint compare = REG_DA[(word2 >> 12) & 15]&0xffff;
\r
10064 uint ea = EA_PCDI_16();
\r
10065 uint lower_bound = m68ki_read_pcrel_16(ea);
\r
10066 uint upper_bound = m68ki_read_pcrel_16(ea + 2);
\r
10068 if(!BIT_F(word2))
\r
10069 FLAG_C = MAKE_INT_16(compare) - MAKE_INT_16(lower_bound);
\r
10071 FLAG_C = compare - lower_bound;
\r
10072 FLAG_Z = !((upper_bound==compare) | (lower_bound==compare));
\r
10073 FLAG_C = CFLAG_16(FLAG_C);
\r
10077 m68ki_exception_trap(EXCEPTION_CHK);
\r
10081 if(!BIT_F(word2))
\r
10082 FLAG_C = MAKE_INT_16(upper_bound) - MAKE_INT_16(compare);
\r
10084 FLAG_C = upper_bound - compare;
\r
10085 FLAG_C = CFLAG_16(FLAG_C);
\r
10086 if(COND_CS() && BIT_B(word2))
\r
10087 m68ki_exception_trap(EXCEPTION_CHK);
\r
10090 m68ki_exception_illegal();
\r
10094 void m68k_op_chk2cmp2_16_pcix(void)
\r
10096 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
10098 uint word2 = OPER_I_16();
\r
10099 uint compare = REG_DA[(word2 >> 12) & 15]&0xffff;
\r
10100 uint ea = EA_PCIX_16();
\r
10101 uint lower_bound = m68ki_read_pcrel_16(ea);
\r
10102 uint upper_bound = m68ki_read_pcrel_16(ea + 2);
\r
10104 if(!BIT_F(word2))
\r
10105 FLAG_C = MAKE_INT_16(compare) - MAKE_INT_16(lower_bound);
\r
10107 FLAG_C = compare - lower_bound;
\r
10108 FLAG_Z = !((upper_bound==compare) | (lower_bound==compare));
\r
10109 FLAG_C = CFLAG_16(FLAG_C);
\r
10113 m68ki_exception_trap(EXCEPTION_CHK);
\r
10117 if(!BIT_F(word2))
\r
10118 FLAG_C = MAKE_INT_16(upper_bound) - MAKE_INT_16(compare);
\r
10120 FLAG_C = upper_bound - compare;
\r
10121 FLAG_C = CFLAG_16(FLAG_C);
\r
10122 if(COND_CS() && BIT_B(word2))
\r
10123 m68ki_exception_trap(EXCEPTION_CHK);
\r
10126 m68ki_exception_illegal();
\r
10130 void m68k_op_chk2cmp2_16_ai(void)
\r
10132 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
10134 uint word2 = OPER_I_16();
\r
10135 uint compare = REG_DA[(word2 >> 12) & 15]&0xffff;
\r
10136 uint ea = EA_AY_AI_16();
\r
10137 uint lower_bound = m68ki_read_16(ea);
\r
10138 uint upper_bound = m68ki_read_16(ea + 2);
\r
10140 if(!BIT_F(word2))
\r
10141 FLAG_C = MAKE_INT_16(compare) - MAKE_INT_16(lower_bound);
\r
10143 FLAG_C = compare - lower_bound;
\r
10145 FLAG_Z = !((upper_bound==compare) | (lower_bound==compare));
\r
10146 FLAG_C = CFLAG_16(FLAG_C);
\r
10150 m68ki_exception_trap(EXCEPTION_CHK);
\r
10153 if(!BIT_F(word2))
\r
10154 FLAG_C = MAKE_INT_16(upper_bound) - MAKE_INT_16(compare);
\r
10156 FLAG_C = upper_bound - compare;
\r
10158 FLAG_C = CFLAG_16(FLAG_C);
\r
10159 if(COND_CS() && BIT_B(word2))
\r
10160 m68ki_exception_trap(EXCEPTION_CHK);
\r
10163 m68ki_exception_illegal();
\r
10167 void m68k_op_chk2cmp2_16_di(void)
\r
10169 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
10171 uint word2 = OPER_I_16();
\r
10172 uint compare = REG_DA[(word2 >> 12) & 15]&0xffff;
\r
10173 uint ea = EA_AY_DI_16();
\r
10174 uint lower_bound = m68ki_read_16(ea);
\r
10175 uint upper_bound = m68ki_read_16(ea + 2);
\r
10177 if(!BIT_F(word2))
\r
10178 FLAG_C = MAKE_INT_16(compare) - MAKE_INT_16(lower_bound);
\r
10180 FLAG_C = compare - lower_bound;
\r
10182 FLAG_Z = !((upper_bound==compare) | (lower_bound==compare));
\r
10183 FLAG_C = CFLAG_16(FLAG_C);
\r
10187 m68ki_exception_trap(EXCEPTION_CHK);
\r
10190 if(!BIT_F(word2))
\r
10191 FLAG_C = MAKE_INT_16(upper_bound) - MAKE_INT_16(compare);
\r
10193 FLAG_C = upper_bound - compare;
\r
10195 FLAG_C = CFLAG_16(FLAG_C);
\r
10196 if(COND_CS() && BIT_B(word2))
\r
10197 m68ki_exception_trap(EXCEPTION_CHK);
\r
10200 m68ki_exception_illegal();
\r
10204 void m68k_op_chk2cmp2_16_ix(void)
\r
10206 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
10208 uint word2 = OPER_I_16();
\r
10209 uint compare = REG_DA[(word2 >> 12) & 15]&0xffff;
\r
10210 uint ea = EA_AY_IX_16();
\r
10211 uint lower_bound = m68ki_read_16(ea);
\r
10212 uint upper_bound = m68ki_read_16(ea + 2);
\r
10214 if(!BIT_F(word2))
\r
10215 FLAG_C = MAKE_INT_16(compare) - MAKE_INT_16(lower_bound);
\r
10217 FLAG_C = compare - lower_bound;
\r
10219 FLAG_Z = !((upper_bound==compare) | (lower_bound==compare));
\r
10220 FLAG_C = CFLAG_16(FLAG_C);
\r
10224 m68ki_exception_trap(EXCEPTION_CHK);
\r
10227 if(!BIT_F(word2))
\r
10228 FLAG_C = MAKE_INT_16(upper_bound) - MAKE_INT_16(compare);
\r
10230 FLAG_C = upper_bound - compare;
\r
10232 FLAG_C = CFLAG_16(FLAG_C);
\r
10233 if(COND_CS() && BIT_B(word2))
\r
10234 m68ki_exception_trap(EXCEPTION_CHK);
\r
10237 m68ki_exception_illegal();
\r
10241 void m68k_op_chk2cmp2_16_aw(void)
\r
10243 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
10245 uint word2 = OPER_I_16();
\r
10246 uint compare = REG_DA[(word2 >> 12) & 15]&0xffff;
\r
10247 uint ea = EA_AW_16();
\r
10248 uint lower_bound = m68ki_read_16(ea);
\r
10249 uint upper_bound = m68ki_read_16(ea + 2);
\r
10251 if(!BIT_F(word2))
\r
10252 FLAG_C = MAKE_INT_16(compare) - MAKE_INT_16(lower_bound);
\r
10254 FLAG_C = compare - lower_bound;
\r
10256 FLAG_Z = !((upper_bound==compare) | (lower_bound==compare));
\r
10257 FLAG_C = CFLAG_16(FLAG_C);
\r
10261 m68ki_exception_trap(EXCEPTION_CHK);
\r
10264 if(!BIT_F(word2))
\r
10265 FLAG_C = MAKE_INT_16(upper_bound) - MAKE_INT_16(compare);
\r
10267 FLAG_C = upper_bound - compare;
\r
10269 FLAG_C = CFLAG_16(FLAG_C);
\r
10270 if(COND_CS() && BIT_B(word2))
\r
10271 m68ki_exception_trap(EXCEPTION_CHK);
\r
10274 m68ki_exception_illegal();
\r
10278 void m68k_op_chk2cmp2_16_al(void)
\r
10280 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
10282 uint word2 = OPER_I_16();
\r
10283 uint compare = REG_DA[(word2 >> 12) & 15]&0xffff;
\r
10284 uint ea = EA_AL_16();
\r
10285 uint lower_bound = m68ki_read_16(ea);
\r
10286 uint upper_bound = m68ki_read_16(ea + 2);
\r
10288 if(!BIT_F(word2))
\r
10289 FLAG_C = MAKE_INT_16(compare) - MAKE_INT_16(lower_bound);
\r
10291 FLAG_C = compare - lower_bound;
\r
10293 FLAG_Z = !((upper_bound==compare) | (lower_bound==compare));
\r
10294 FLAG_C = CFLAG_16(FLAG_C);
\r
10298 m68ki_exception_trap(EXCEPTION_CHK);
\r
10301 if(!BIT_F(word2))
\r
10302 FLAG_C = MAKE_INT_16(upper_bound) - MAKE_INT_16(compare);
\r
10304 FLAG_C = upper_bound - compare;
\r
10306 FLAG_C = CFLAG_16(FLAG_C);
\r
10307 if(COND_CS() && BIT_B(word2))
\r
10308 m68ki_exception_trap(EXCEPTION_CHK);
\r
10311 m68ki_exception_illegal();
\r
10315 void m68k_op_chk2cmp2_32_pcdi(void)
\r
10317 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
10319 uint word2 = OPER_I_16();
\r
10320 uint compare = REG_DA[(word2 >> 12) & 15];
\r
10321 uint ea = EA_PCDI_32();
\r
10322 uint lower_bound = m68ki_read_pcrel_32(ea);
\r
10323 uint upper_bound = m68ki_read_pcrel_32(ea + 4);
\r
10325 FLAG_C = compare - lower_bound;
\r
10326 FLAG_Z = !((upper_bound==compare) | (lower_bound==compare));
\r
10327 FLAG_C = CFLAG_SUB_32(lower_bound, compare, FLAG_C);
\r
10331 m68ki_exception_trap(EXCEPTION_CHK);
\r
10335 FLAG_C = upper_bound - compare;
\r
10336 FLAG_C = CFLAG_SUB_32(compare, upper_bound, FLAG_C);
\r
10337 if(COND_CS() && BIT_B(word2))
\r
10338 m68ki_exception_trap(EXCEPTION_CHK);
\r
10341 m68ki_exception_illegal();
\r
10345 void m68k_op_chk2cmp2_32_pcix(void)
\r
10347 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
10349 uint word2 = OPER_I_16();
\r
10350 uint compare = REG_DA[(word2 >> 12) & 15];
\r
10351 uint ea = EA_PCIX_32();
\r
10352 uint lower_bound = m68ki_read_pcrel_32(ea);
\r
10353 uint upper_bound = m68ki_read_pcrel_32(ea + 4);
\r
10355 FLAG_C = compare - lower_bound;
\r
10356 FLAG_Z = !((upper_bound==compare) | (lower_bound==compare));
\r
10357 FLAG_C = CFLAG_SUB_32(lower_bound, compare, FLAG_C);
\r
10361 m68ki_exception_trap(EXCEPTION_CHK);
\r
10365 FLAG_C = upper_bound - compare;
\r
10366 FLAG_C = CFLAG_SUB_32(compare, upper_bound, FLAG_C);
\r
10367 if(COND_CS() && BIT_B(word2))
\r
10368 m68ki_exception_trap(EXCEPTION_CHK);
\r
10371 m68ki_exception_illegal();
\r
10375 void m68k_op_chk2cmp2_32_ai(void)
\r
10377 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
10379 uint word2 = OPER_I_16();
\r
10380 uint compare = REG_DA[(word2 >> 12) & 15];
\r
10381 uint ea = EA_AY_AI_32();
\r
10382 uint lower_bound = m68ki_read_32(ea);
\r
10383 uint upper_bound = m68ki_read_32(ea + 4);
\r
10385 FLAG_C = compare - lower_bound;
\r
10386 FLAG_Z = !((upper_bound==compare) | (lower_bound==compare));
\r
10387 FLAG_C = CFLAG_SUB_32(lower_bound, compare, FLAG_C);
\r
10391 m68ki_exception_trap(EXCEPTION_CHK);
\r
10395 FLAG_C = upper_bound - compare;
\r
10396 FLAG_C = CFLAG_SUB_32(compare, upper_bound, FLAG_C);
\r
10397 if(COND_CS() && BIT_B(word2))
\r
10398 m68ki_exception_trap(EXCEPTION_CHK);
\r
10401 m68ki_exception_illegal();
\r
10405 void m68k_op_chk2cmp2_32_di(void)
\r
10407 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
10409 uint word2 = OPER_I_16();
\r
10410 uint compare = REG_DA[(word2 >> 12) & 15];
\r
10411 uint ea = EA_AY_DI_32();
\r
10412 uint lower_bound = m68ki_read_32(ea);
\r
10413 uint upper_bound = m68ki_read_32(ea + 4);
\r
10415 FLAG_C = compare - lower_bound;
\r
10416 FLAG_Z = !((upper_bound==compare) | (lower_bound==compare));
\r
10417 FLAG_C = CFLAG_SUB_32(lower_bound, compare, FLAG_C);
\r
10421 m68ki_exception_trap(EXCEPTION_CHK);
\r
10425 FLAG_C = upper_bound - compare;
\r
10426 FLAG_C = CFLAG_SUB_32(compare, upper_bound, FLAG_C);
\r
10427 if(COND_CS() && BIT_B(word2))
\r
10428 m68ki_exception_trap(EXCEPTION_CHK);
\r
10431 m68ki_exception_illegal();
\r
10435 void m68k_op_chk2cmp2_32_ix(void)
\r
10437 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
10439 uint word2 = OPER_I_16();
\r
10440 uint compare = REG_DA[(word2 >> 12) & 15];
\r
10441 uint ea = EA_AY_IX_32();
\r
10442 uint lower_bound = m68ki_read_32(ea);
\r
10443 uint upper_bound = m68ki_read_32(ea + 4);
\r
10445 FLAG_C = compare - lower_bound;
\r
10446 FLAG_Z = !((upper_bound==compare) | (lower_bound==compare));
\r
10447 FLAG_C = CFLAG_SUB_32(lower_bound, compare, FLAG_C);
\r
10451 m68ki_exception_trap(EXCEPTION_CHK);
\r
10455 FLAG_C = upper_bound - compare;
\r
10456 FLAG_C = CFLAG_SUB_32(compare, upper_bound, FLAG_C);
\r
10457 if(COND_CS() && BIT_B(word2))
\r
10458 m68ki_exception_trap(EXCEPTION_CHK);
\r
10461 m68ki_exception_illegal();
\r
10465 void m68k_op_chk2cmp2_32_aw(void)
\r
10467 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
10469 uint word2 = OPER_I_16();
\r
10470 uint compare = REG_DA[(word2 >> 12) & 15];
\r
10471 uint ea = EA_AW_32();
\r
10472 uint lower_bound = m68ki_read_32(ea);
\r
10473 uint upper_bound = m68ki_read_32(ea + 4);
\r
10475 FLAG_C = compare - lower_bound;
\r
10476 FLAG_Z = !((upper_bound==compare) | (lower_bound==compare));
\r
10477 FLAG_C = CFLAG_SUB_32(lower_bound, compare, FLAG_C);
\r
10481 m68ki_exception_trap(EXCEPTION_CHK);
\r
10485 FLAG_C = upper_bound - compare;
\r
10486 FLAG_C = CFLAG_SUB_32(compare, upper_bound, FLAG_C);
\r
10487 if(COND_CS() && BIT_B(word2))
\r
10488 m68ki_exception_trap(EXCEPTION_CHK);
\r
10491 m68ki_exception_illegal();
\r
10495 void m68k_op_chk2cmp2_32_al(void)
\r
10497 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
10499 uint word2 = OPER_I_16();
\r
10500 uint compare = REG_DA[(word2 >> 12) & 15];
\r
10501 uint ea = EA_AL_32();
\r
10502 uint lower_bound = m68ki_read_32(ea);
\r
10503 uint upper_bound = m68ki_read_32(ea + 4);
\r
10505 FLAG_C = compare - lower_bound;
\r
10506 FLAG_Z = !((upper_bound==compare) | (lower_bound==compare));
\r
10507 FLAG_C = CFLAG_SUB_32(lower_bound, compare, FLAG_C);
\r
10511 m68ki_exception_trap(EXCEPTION_CHK);
\r
10515 FLAG_C = upper_bound - compare;
\r
10516 FLAG_C = CFLAG_SUB_32(compare, upper_bound, FLAG_C);
\r
10517 if(COND_CS() && BIT_B(word2))
\r
10518 m68ki_exception_trap(EXCEPTION_CHK);
\r
10521 m68ki_exception_illegal();
\r
10525 void m68k_op_clr_8_d(void)
\r
10527 DY &= 0xffffff00;
\r
10529 FLAG_N = NFLAG_CLEAR;
\r
10530 FLAG_V = VFLAG_CLEAR;
\r
10531 FLAG_C = CFLAG_CLEAR;
\r
10532 FLAG_Z = ZFLAG_SET;
\r
10536 void m68k_op_clr_8_ai(void)
\r
10538 m68ki_write_8(EA_AY_AI_8(), 0);
\r
10540 FLAG_N = NFLAG_CLEAR;
\r
10541 FLAG_V = VFLAG_CLEAR;
\r
10542 FLAG_C = CFLAG_CLEAR;
\r
10543 FLAG_Z = ZFLAG_SET;
\r
10547 void m68k_op_clr_8_pi(void)
\r
10549 m68ki_write_8(EA_AY_PI_8(), 0);
\r
10551 FLAG_N = NFLAG_CLEAR;
\r
10552 FLAG_V = VFLAG_CLEAR;
\r
10553 FLAG_C = CFLAG_CLEAR;
\r
10554 FLAG_Z = ZFLAG_SET;
\r
10558 void m68k_op_clr_8_pi7(void)
\r
10560 m68ki_write_8(EA_A7_PI_8(), 0);
\r
10562 FLAG_N = NFLAG_CLEAR;
\r
10563 FLAG_V = VFLAG_CLEAR;
\r
10564 FLAG_C = CFLAG_CLEAR;
\r
10565 FLAG_Z = ZFLAG_SET;
\r
10569 void m68k_op_clr_8_pd(void)
\r
10571 m68ki_write_8(EA_AY_PD_8(), 0);
\r
10573 FLAG_N = NFLAG_CLEAR;
\r
10574 FLAG_V = VFLAG_CLEAR;
\r
10575 FLAG_C = CFLAG_CLEAR;
\r
10576 FLAG_Z = ZFLAG_SET;
\r
10580 void m68k_op_clr_8_pd7(void)
\r
10582 m68ki_write_8(EA_A7_PD_8(), 0);
\r
10584 FLAG_N = NFLAG_CLEAR;
\r
10585 FLAG_V = VFLAG_CLEAR;
\r
10586 FLAG_C = CFLAG_CLEAR;
\r
10587 FLAG_Z = ZFLAG_SET;
\r
10591 void m68k_op_clr_8_di(void)
\r
10593 m68ki_write_8(EA_AY_DI_8(), 0);
\r
10595 FLAG_N = NFLAG_CLEAR;
\r
10596 FLAG_V = VFLAG_CLEAR;
\r
10597 FLAG_C = CFLAG_CLEAR;
\r
10598 FLAG_Z = ZFLAG_SET;
\r
10602 void m68k_op_clr_8_ix(void)
\r
10604 m68ki_write_8(EA_AY_IX_8(), 0);
\r
10606 FLAG_N = NFLAG_CLEAR;
\r
10607 FLAG_V = VFLAG_CLEAR;
\r
10608 FLAG_C = CFLAG_CLEAR;
\r
10609 FLAG_Z = ZFLAG_SET;
\r
10613 void m68k_op_clr_8_aw(void)
\r
10615 m68ki_write_8(EA_AW_8(), 0);
\r
10617 FLAG_N = NFLAG_CLEAR;
\r
10618 FLAG_V = VFLAG_CLEAR;
\r
10619 FLAG_C = CFLAG_CLEAR;
\r
10620 FLAG_Z = ZFLAG_SET;
\r
10624 void m68k_op_clr_8_al(void)
\r
10626 m68ki_write_8(EA_AL_8(), 0);
\r
10628 FLAG_N = NFLAG_CLEAR;
\r
10629 FLAG_V = VFLAG_CLEAR;
\r
10630 FLAG_C = CFLAG_CLEAR;
\r
10631 FLAG_Z = ZFLAG_SET;
\r
10635 void m68k_op_clr_16_d(void)
\r
10637 DY &= 0xffff0000;
\r
10639 FLAG_N = NFLAG_CLEAR;
\r
10640 FLAG_V = VFLAG_CLEAR;
\r
10641 FLAG_C = CFLAG_CLEAR;
\r
10642 FLAG_Z = ZFLAG_SET;
\r
10646 void m68k_op_clr_16_ai(void)
\r
10648 m68ki_write_16(EA_AY_AI_16(), 0);
\r
10650 FLAG_N = NFLAG_CLEAR;
\r
10651 FLAG_V = VFLAG_CLEAR;
\r
10652 FLAG_C = CFLAG_CLEAR;
\r
10653 FLAG_Z = ZFLAG_SET;
\r
10657 void m68k_op_clr_16_pi(void)
\r
10659 m68ki_write_16(EA_AY_PI_16(), 0);
\r
10661 FLAG_N = NFLAG_CLEAR;
\r
10662 FLAG_V = VFLAG_CLEAR;
\r
10663 FLAG_C = CFLAG_CLEAR;
\r
10664 FLAG_Z = ZFLAG_SET;
\r
10668 void m68k_op_clr_16_pd(void)
\r
10670 m68ki_write_16(EA_AY_PD_16(), 0);
\r
10672 FLAG_N = NFLAG_CLEAR;
\r
10673 FLAG_V = VFLAG_CLEAR;
\r
10674 FLAG_C = CFLAG_CLEAR;
\r
10675 FLAG_Z = ZFLAG_SET;
\r
10679 void m68k_op_clr_16_di(void)
\r
10681 m68ki_write_16(EA_AY_DI_16(), 0);
\r
10683 FLAG_N = NFLAG_CLEAR;
\r
10684 FLAG_V = VFLAG_CLEAR;
\r
10685 FLAG_C = CFLAG_CLEAR;
\r
10686 FLAG_Z = ZFLAG_SET;
\r
10690 void m68k_op_clr_16_ix(void)
\r
10692 m68ki_write_16(EA_AY_IX_16(), 0);
\r
10694 FLAG_N = NFLAG_CLEAR;
\r
10695 FLAG_V = VFLAG_CLEAR;
\r
10696 FLAG_C = CFLAG_CLEAR;
\r
10697 FLAG_Z = ZFLAG_SET;
\r
10701 void m68k_op_clr_16_aw(void)
\r
10703 m68ki_write_16(EA_AW_16(), 0);
\r
10705 FLAG_N = NFLAG_CLEAR;
\r
10706 FLAG_V = VFLAG_CLEAR;
\r
10707 FLAG_C = CFLAG_CLEAR;
\r
10708 FLAG_Z = ZFLAG_SET;
\r
10712 void m68k_op_clr_16_al(void)
\r
10714 m68ki_write_16(EA_AL_16(), 0);
\r
10716 FLAG_N = NFLAG_CLEAR;
\r
10717 FLAG_V = VFLAG_CLEAR;
\r
10718 FLAG_C = CFLAG_CLEAR;
\r
10719 FLAG_Z = ZFLAG_SET;
\r
10723 void m68k_op_clr_32_d(void)
\r
10727 FLAG_N = NFLAG_CLEAR;
\r
10728 FLAG_V = VFLAG_CLEAR;
\r
10729 FLAG_C = CFLAG_CLEAR;
\r
10730 FLAG_Z = ZFLAG_SET;
\r
10734 void m68k_op_clr_32_ai(void)
\r
10736 m68ki_write_32(EA_AY_AI_32(), 0);
\r
10738 FLAG_N = NFLAG_CLEAR;
\r
10739 FLAG_V = VFLAG_CLEAR;
\r
10740 FLAG_C = CFLAG_CLEAR;
\r
10741 FLAG_Z = ZFLAG_SET;
\r
10745 void m68k_op_clr_32_pi(void)
\r
10747 m68ki_write_32(EA_AY_PI_32(), 0);
\r
10749 FLAG_N = NFLAG_CLEAR;
\r
10750 FLAG_V = VFLAG_CLEAR;
\r
10751 FLAG_C = CFLAG_CLEAR;
\r
10752 FLAG_Z = ZFLAG_SET;
\r
10756 void m68k_op_clr_32_pd(void)
\r
10758 m68ki_write_32(EA_AY_PD_32(), 0);
\r
10760 FLAG_N = NFLAG_CLEAR;
\r
10761 FLAG_V = VFLAG_CLEAR;
\r
10762 FLAG_C = CFLAG_CLEAR;
\r
10763 FLAG_Z = ZFLAG_SET;
\r
10767 void m68k_op_clr_32_di(void)
\r
10769 m68ki_write_32(EA_AY_DI_32(), 0);
\r
10771 FLAG_N = NFLAG_CLEAR;
\r
10772 FLAG_V = VFLAG_CLEAR;
\r
10773 FLAG_C = CFLAG_CLEAR;
\r
10774 FLAG_Z = ZFLAG_SET;
\r
10778 void m68k_op_clr_32_ix(void)
\r
10780 m68ki_write_32(EA_AY_IX_32(), 0);
\r
10782 FLAG_N = NFLAG_CLEAR;
\r
10783 FLAG_V = VFLAG_CLEAR;
\r
10784 FLAG_C = CFLAG_CLEAR;
\r
10785 FLAG_Z = ZFLAG_SET;
\r
10789 void m68k_op_clr_32_aw(void)
\r
10791 m68ki_write_32(EA_AW_32(), 0);
\r
10793 FLAG_N = NFLAG_CLEAR;
\r
10794 FLAG_V = VFLAG_CLEAR;
\r
10795 FLAG_C = CFLAG_CLEAR;
\r
10796 FLAG_Z = ZFLAG_SET;
\r
10800 void m68k_op_clr_32_al(void)
\r
10802 m68ki_write_32(EA_AL_32(), 0);
\r
10804 FLAG_N = NFLAG_CLEAR;
\r
10805 FLAG_V = VFLAG_CLEAR;
\r
10806 FLAG_C = CFLAG_CLEAR;
\r
10807 FLAG_Z = ZFLAG_SET;
\r
10811 void m68k_op_cmp_8_d(void)
\r
10813 uint src = MASK_OUT_ABOVE_8(DY);
\r
10814 uint dst = MASK_OUT_ABOVE_8(DX);
\r
10815 uint res = dst - src;
\r
10817 FLAG_N = NFLAG_8(res);
\r
10818 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
10819 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
10820 FLAG_C = CFLAG_8(res);
\r
10824 void m68k_op_cmp_8_ai(void)
\r
10826 uint src = OPER_AY_AI_8();
\r
10827 uint dst = MASK_OUT_ABOVE_8(DX);
\r
10828 uint res = dst - src;
\r
10830 FLAG_N = NFLAG_8(res);
\r
10831 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
10832 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
10833 FLAG_C = CFLAG_8(res);
\r
10837 void m68k_op_cmp_8_pi(void)
\r
10839 uint src = OPER_AY_PI_8();
\r
10840 uint dst = MASK_OUT_ABOVE_8(DX);
\r
10841 uint res = dst - src;
\r
10843 FLAG_N = NFLAG_8(res);
\r
10844 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
10845 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
10846 FLAG_C = CFLAG_8(res);
\r
10850 void m68k_op_cmp_8_pi7(void)
\r
10852 uint src = OPER_A7_PI_8();
\r
10853 uint dst = MASK_OUT_ABOVE_8(DX);
\r
10854 uint res = dst - src;
\r
10856 FLAG_N = NFLAG_8(res);
\r
10857 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
10858 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
10859 FLAG_C = CFLAG_8(res);
\r
10863 void m68k_op_cmp_8_pd(void)
\r
10865 uint src = OPER_AY_PD_8();
\r
10866 uint dst = MASK_OUT_ABOVE_8(DX);
\r
10867 uint res = dst - src;
\r
10869 FLAG_N = NFLAG_8(res);
\r
10870 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
10871 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
10872 FLAG_C = CFLAG_8(res);
\r
10876 void m68k_op_cmp_8_pd7(void)
\r
10878 uint src = OPER_A7_PD_8();
\r
10879 uint dst = MASK_OUT_ABOVE_8(DX);
\r
10880 uint res = dst - src;
\r
10882 FLAG_N = NFLAG_8(res);
\r
10883 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
10884 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
10885 FLAG_C = CFLAG_8(res);
\r
10889 void m68k_op_cmp_8_di(void)
\r
10891 uint src = OPER_AY_DI_8();
\r
10892 uint dst = MASK_OUT_ABOVE_8(DX);
\r
10893 uint res = dst - src;
\r
10895 FLAG_N = NFLAG_8(res);
\r
10896 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
10897 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
10898 FLAG_C = CFLAG_8(res);
\r
10902 void m68k_op_cmp_8_ix(void)
\r
10904 uint src = OPER_AY_IX_8();
\r
10905 uint dst = MASK_OUT_ABOVE_8(DX);
\r
10906 uint res = dst - src;
\r
10908 FLAG_N = NFLAG_8(res);
\r
10909 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
10910 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
10911 FLAG_C = CFLAG_8(res);
\r
10915 void m68k_op_cmp_8_aw(void)
\r
10917 uint src = OPER_AW_8();
\r
10918 uint dst = MASK_OUT_ABOVE_8(DX);
\r
10919 uint res = dst - src;
\r
10921 FLAG_N = NFLAG_8(res);
\r
10922 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
10923 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
10924 FLAG_C = CFLAG_8(res);
\r
10928 void m68k_op_cmp_8_al(void)
\r
10930 uint src = OPER_AL_8();
\r
10931 uint dst = MASK_OUT_ABOVE_8(DX);
\r
10932 uint res = dst - src;
\r
10934 FLAG_N = NFLAG_8(res);
\r
10935 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
10936 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
10937 FLAG_C = CFLAG_8(res);
\r
10941 void m68k_op_cmp_8_pcdi(void)
\r
10943 uint src = OPER_PCDI_8();
\r
10944 uint dst = MASK_OUT_ABOVE_8(DX);
\r
10945 uint res = dst - src;
\r
10947 FLAG_N = NFLAG_8(res);
\r
10948 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
10949 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
10950 FLAG_C = CFLAG_8(res);
\r
10954 void m68k_op_cmp_8_pcix(void)
\r
10956 uint src = OPER_PCIX_8();
\r
10957 uint dst = MASK_OUT_ABOVE_8(DX);
\r
10958 uint res = dst - src;
\r
10960 FLAG_N = NFLAG_8(res);
\r
10961 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
10962 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
10963 FLAG_C = CFLAG_8(res);
\r
10967 void m68k_op_cmp_8_i(void)
\r
10969 uint src = OPER_I_8();
\r
10970 uint dst = MASK_OUT_ABOVE_8(DX);
\r
10971 uint res = dst - src;
\r
10973 FLAG_N = NFLAG_8(res);
\r
10974 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
10975 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
10976 FLAG_C = CFLAG_8(res);
\r
10980 void m68k_op_cmp_16_d(void)
\r
10982 uint src = MASK_OUT_ABOVE_16(DY);
\r
10983 uint dst = MASK_OUT_ABOVE_16(DX);
\r
10984 uint res = dst - src;
\r
10986 FLAG_N = NFLAG_16(res);
\r
10987 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
10988 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
10989 FLAG_C = CFLAG_16(res);
\r
10993 void m68k_op_cmp_16_a(void)
\r
10995 uint src = MASK_OUT_ABOVE_16(AY);
\r
10996 uint dst = MASK_OUT_ABOVE_16(DX);
\r
10997 uint res = dst - src;
\r
10999 FLAG_N = NFLAG_16(res);
\r
11000 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
11001 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
11002 FLAG_C = CFLAG_16(res);
\r
11006 void m68k_op_cmp_16_ai(void)
\r
11008 uint src = OPER_AY_AI_16();
\r
11009 uint dst = MASK_OUT_ABOVE_16(DX);
\r
11010 uint res = dst - src;
\r
11012 FLAG_N = NFLAG_16(res);
\r
11013 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
11014 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
11015 FLAG_C = CFLAG_16(res);
\r
11019 void m68k_op_cmp_16_pi(void)
\r
11021 uint src = OPER_AY_PI_16();
\r
11022 uint dst = MASK_OUT_ABOVE_16(DX);
\r
11023 uint res = dst - src;
\r
11025 FLAG_N = NFLAG_16(res);
\r
11026 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
11027 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
11028 FLAG_C = CFLAG_16(res);
\r
11032 void m68k_op_cmp_16_pd(void)
\r
11034 uint src = OPER_AY_PD_16();
\r
11035 uint dst = MASK_OUT_ABOVE_16(DX);
\r
11036 uint res = dst - src;
\r
11038 FLAG_N = NFLAG_16(res);
\r
11039 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
11040 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
11041 FLAG_C = CFLAG_16(res);
\r
11045 void m68k_op_cmp_16_di(void)
\r
11047 uint src = OPER_AY_DI_16();
\r
11048 uint dst = MASK_OUT_ABOVE_16(DX);
\r
11049 uint res = dst - src;
\r
11051 FLAG_N = NFLAG_16(res);
\r
11052 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
11053 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
11054 FLAG_C = CFLAG_16(res);
\r
11058 void m68k_op_cmp_16_ix(void)
\r
11060 uint src = OPER_AY_IX_16();
\r
11061 uint dst = MASK_OUT_ABOVE_16(DX);
\r
11062 uint res = dst - src;
\r
11064 FLAG_N = NFLAG_16(res);
\r
11065 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
11066 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
11067 FLAG_C = CFLAG_16(res);
\r
11071 void m68k_op_cmp_16_aw(void)
\r
11073 uint src = OPER_AW_16();
\r
11074 uint dst = MASK_OUT_ABOVE_16(DX);
\r
11075 uint res = dst - src;
\r
11077 FLAG_N = NFLAG_16(res);
\r
11078 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
11079 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
11080 FLAG_C = CFLAG_16(res);
\r
11084 void m68k_op_cmp_16_al(void)
\r
11086 uint src = OPER_AL_16();
\r
11087 uint dst = MASK_OUT_ABOVE_16(DX);
\r
11088 uint res = dst - src;
\r
11090 FLAG_N = NFLAG_16(res);
\r
11091 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
11092 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
11093 FLAG_C = CFLAG_16(res);
\r
11097 void m68k_op_cmp_16_pcdi(void)
\r
11099 uint src = OPER_PCDI_16();
\r
11100 uint dst = MASK_OUT_ABOVE_16(DX);
\r
11101 uint res = dst - src;
\r
11103 FLAG_N = NFLAG_16(res);
\r
11104 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
11105 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
11106 FLAG_C = CFLAG_16(res);
\r
11110 void m68k_op_cmp_16_pcix(void)
\r
11112 uint src = OPER_PCIX_16();
\r
11113 uint dst = MASK_OUT_ABOVE_16(DX);
\r
11114 uint res = dst - src;
\r
11116 FLAG_N = NFLAG_16(res);
\r
11117 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
11118 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
11119 FLAG_C = CFLAG_16(res);
\r
11123 void m68k_op_cmp_16_i(void)
\r
11125 uint src = OPER_I_16();
\r
11126 uint dst = MASK_OUT_ABOVE_16(DX);
\r
11127 uint res = dst - src;
\r
11129 FLAG_N = NFLAG_16(res);
\r
11130 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
11131 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
11132 FLAG_C = CFLAG_16(res);
\r
11136 void m68k_op_cmp_32_d(void)
\r
11140 uint res = dst - src;
\r
11142 FLAG_N = NFLAG_32(res);
\r
11143 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11144 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11145 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11149 void m68k_op_cmp_32_a(void)
\r
11153 uint res = dst - src;
\r
11155 FLAG_N = NFLAG_32(res);
\r
11156 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11157 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11158 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11162 void m68k_op_cmp_32_ai(void)
\r
11164 uint src = OPER_AY_AI_32();
\r
11166 uint res = dst - src;
\r
11168 FLAG_N = NFLAG_32(res);
\r
11169 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11170 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11171 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11175 void m68k_op_cmp_32_pi(void)
\r
11177 uint src = OPER_AY_PI_32();
\r
11179 uint res = dst - src;
\r
11181 FLAG_N = NFLAG_32(res);
\r
11182 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11183 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11184 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11188 void m68k_op_cmp_32_pd(void)
\r
11190 uint src = OPER_AY_PD_32();
\r
11192 uint res = dst - src;
\r
11194 FLAG_N = NFLAG_32(res);
\r
11195 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11196 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11197 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11201 void m68k_op_cmp_32_di(void)
\r
11203 uint src = OPER_AY_DI_32();
\r
11205 uint res = dst - src;
\r
11207 FLAG_N = NFLAG_32(res);
\r
11208 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11209 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11210 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11214 void m68k_op_cmp_32_ix(void)
\r
11216 uint src = OPER_AY_IX_32();
\r
11218 uint res = dst - src;
\r
11220 FLAG_N = NFLAG_32(res);
\r
11221 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11222 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11223 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11227 void m68k_op_cmp_32_aw(void)
\r
11229 uint src = OPER_AW_32();
\r
11231 uint res = dst - src;
\r
11233 FLAG_N = NFLAG_32(res);
\r
11234 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11235 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11236 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11240 void m68k_op_cmp_32_al(void)
\r
11242 uint src = OPER_AL_32();
\r
11244 uint res = dst - src;
\r
11246 FLAG_N = NFLAG_32(res);
\r
11247 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11248 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11249 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11253 void m68k_op_cmp_32_pcdi(void)
\r
11255 uint src = OPER_PCDI_32();
\r
11257 uint res = dst - src;
\r
11259 FLAG_N = NFLAG_32(res);
\r
11260 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11261 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11262 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11266 void m68k_op_cmp_32_pcix(void)
\r
11268 uint src = OPER_PCIX_32();
\r
11270 uint res = dst - src;
\r
11272 FLAG_N = NFLAG_32(res);
\r
11273 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11274 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11275 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11279 void m68k_op_cmp_32_i(void)
\r
11281 uint src = OPER_I_32();
\r
11283 uint res = dst - src;
\r
11285 FLAG_N = NFLAG_32(res);
\r
11286 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11287 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11288 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11292 void m68k_op_cmpa_16_d(void)
\r
11294 uint src = MAKE_INT_16(DY);
\r
11296 uint res = dst - src;
\r
11298 FLAG_N = NFLAG_32(res);
\r
11299 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11300 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11301 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11305 void m68k_op_cmpa_16_a(void)
\r
11307 uint src = MAKE_INT_16(AY);
\r
11309 uint res = dst - src;
\r
11311 FLAG_N = NFLAG_32(res);
\r
11312 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11313 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11314 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11318 void m68k_op_cmpa_16_ai(void)
\r
11320 uint src = MAKE_INT_16(OPER_AY_AI_16());
\r
11322 uint res = dst - src;
\r
11324 FLAG_N = NFLAG_32(res);
\r
11325 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11326 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11327 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11331 void m68k_op_cmpa_16_pi(void)
\r
11333 uint src = MAKE_INT_16(OPER_AY_PI_16());
\r
11335 uint res = dst - src;
\r
11337 FLAG_N = NFLAG_32(res);
\r
11338 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11339 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11340 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11344 void m68k_op_cmpa_16_pd(void)
\r
11346 uint src = MAKE_INT_16(OPER_AY_PD_16());
\r
11348 uint res = dst - src;
\r
11350 FLAG_N = NFLAG_32(res);
\r
11351 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11352 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11353 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11357 void m68k_op_cmpa_16_di(void)
\r
11359 uint src = MAKE_INT_16(OPER_AY_DI_16());
\r
11361 uint res = dst - src;
\r
11363 FLAG_N = NFLAG_32(res);
\r
11364 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11365 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11366 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11370 void m68k_op_cmpa_16_ix(void)
\r
11372 uint src = MAKE_INT_16(OPER_AY_IX_16());
\r
11374 uint res = dst - src;
\r
11376 FLAG_N = NFLAG_32(res);
\r
11377 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11378 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11379 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11383 void m68k_op_cmpa_16_aw(void)
\r
11385 uint src = MAKE_INT_16(OPER_AW_16());
\r
11387 uint res = dst - src;
\r
11389 FLAG_N = NFLAG_32(res);
\r
11390 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11391 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11392 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11396 void m68k_op_cmpa_16_al(void)
\r
11398 uint src = MAKE_INT_16(OPER_AL_16());
\r
11400 uint res = dst - src;
\r
11402 FLAG_N = NFLAG_32(res);
\r
11403 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11404 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11405 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11409 void m68k_op_cmpa_16_pcdi(void)
\r
11411 uint src = MAKE_INT_16(OPER_PCDI_16());
\r
11413 uint res = dst - src;
\r
11415 FLAG_N = NFLAG_32(res);
\r
11416 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11417 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11418 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11422 void m68k_op_cmpa_16_pcix(void)
\r
11424 uint src = MAKE_INT_16(OPER_PCIX_16());
\r
11426 uint res = dst - src;
\r
11428 FLAG_N = NFLAG_32(res);
\r
11429 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11430 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11431 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11435 void m68k_op_cmpa_16_i(void)
\r
11437 uint src = MAKE_INT_16(OPER_I_16());
\r
11439 uint res = dst - src;
\r
11441 FLAG_N = NFLAG_32(res);
\r
11442 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11443 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11444 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11448 void m68k_op_cmpa_32_d(void)
\r
11452 uint res = dst - src;
\r
11454 FLAG_N = NFLAG_32(res);
\r
11455 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11456 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11457 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11461 void m68k_op_cmpa_32_a(void)
\r
11465 uint res = dst - src;
\r
11467 FLAG_N = NFLAG_32(res);
\r
11468 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11469 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11470 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11474 void m68k_op_cmpa_32_ai(void)
\r
11476 uint src = OPER_AY_AI_32();
\r
11478 uint res = dst - src;
\r
11480 FLAG_N = NFLAG_32(res);
\r
11481 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11482 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11483 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11487 void m68k_op_cmpa_32_pi(void)
\r
11489 uint src = OPER_AY_PI_32();
\r
11491 uint res = dst - src;
\r
11493 FLAG_N = NFLAG_32(res);
\r
11494 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11495 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11496 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11500 void m68k_op_cmpa_32_pd(void)
\r
11502 uint src = OPER_AY_PD_32();
\r
11504 uint res = dst - src;
\r
11506 FLAG_N = NFLAG_32(res);
\r
11507 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11508 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11509 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11513 void m68k_op_cmpa_32_di(void)
\r
11515 uint src = OPER_AY_DI_32();
\r
11517 uint res = dst - src;
\r
11519 FLAG_N = NFLAG_32(res);
\r
11520 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11521 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11522 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11526 void m68k_op_cmpa_32_ix(void)
\r
11528 uint src = OPER_AY_IX_32();
\r
11530 uint res = dst - src;
\r
11532 FLAG_N = NFLAG_32(res);
\r
11533 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11534 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11535 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11539 void m68k_op_cmpa_32_aw(void)
\r
11541 uint src = OPER_AW_32();
\r
11543 uint res = dst - src;
\r
11545 FLAG_N = NFLAG_32(res);
\r
11546 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11547 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11548 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11552 void m68k_op_cmpa_32_al(void)
\r
11554 uint src = OPER_AL_32();
\r
11556 uint res = dst - src;
\r
11558 FLAG_N = NFLAG_32(res);
\r
11559 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11560 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11561 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11565 void m68k_op_cmpa_32_pcdi(void)
\r
11567 uint src = OPER_PCDI_32();
\r
11569 uint res = dst - src;
\r
11571 FLAG_N = NFLAG_32(res);
\r
11572 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11573 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11574 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11578 void m68k_op_cmpa_32_pcix(void)
\r
11580 uint src = OPER_PCIX_32();
\r
11582 uint res = dst - src;
\r
11584 FLAG_N = NFLAG_32(res);
\r
11585 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11586 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11587 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11591 void m68k_op_cmpa_32_i(void)
\r
11593 uint src = OPER_I_32();
\r
11595 uint res = dst - src;
\r
11597 FLAG_N = NFLAG_32(res);
\r
11598 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11599 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11600 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11604 void m68k_op_cmpi_8_d(void)
\r
11606 uint src = OPER_I_8();
\r
11607 uint dst = MASK_OUT_ABOVE_8(DY);
\r
11608 uint res = dst - src;
\r
11610 FLAG_N = NFLAG_8(res);
\r
11611 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
11612 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
11613 FLAG_C = CFLAG_8(res);
\r
11617 void m68k_op_cmpi_8_ai(void)
\r
11619 uint src = OPER_I_8();
\r
11620 uint dst = OPER_AY_AI_8();
\r
11621 uint res = dst - src;
\r
11623 FLAG_N = NFLAG_8(res);
\r
11624 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
11625 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
11626 FLAG_C = CFLAG_8(res);
\r
11630 void m68k_op_cmpi_8_pi(void)
\r
11632 uint src = OPER_I_8();
\r
11633 uint dst = OPER_AY_PI_8();
\r
11634 uint res = dst - src;
\r
11636 FLAG_N = NFLAG_8(res);
\r
11637 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
11638 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
11639 FLAG_C = CFLAG_8(res);
\r
11643 void m68k_op_cmpi_8_pi7(void)
\r
11645 uint src = OPER_I_8();
\r
11646 uint dst = OPER_A7_PI_8();
\r
11647 uint res = dst - src;
\r
11649 FLAG_N = NFLAG_8(res);
\r
11650 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
11651 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
11652 FLAG_C = CFLAG_8(res);
\r
11656 void m68k_op_cmpi_8_pd(void)
\r
11658 uint src = OPER_I_8();
\r
11659 uint dst = OPER_AY_PD_8();
\r
11660 uint res = dst - src;
\r
11662 FLAG_N = NFLAG_8(res);
\r
11663 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
11664 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
11665 FLAG_C = CFLAG_8(res);
\r
11669 void m68k_op_cmpi_8_pd7(void)
\r
11671 uint src = OPER_I_8();
\r
11672 uint dst = OPER_A7_PD_8();
\r
11673 uint res = dst - src;
\r
11675 FLAG_N = NFLAG_8(res);
\r
11676 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
11677 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
11678 FLAG_C = CFLAG_8(res);
\r
11682 void m68k_op_cmpi_8_di(void)
\r
11684 uint src = OPER_I_8();
\r
11685 uint dst = OPER_AY_DI_8();
\r
11686 uint res = dst - src;
\r
11688 FLAG_N = NFLAG_8(res);
\r
11689 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
11690 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
11691 FLAG_C = CFLAG_8(res);
\r
11695 void m68k_op_cmpi_8_ix(void)
\r
11697 uint src = OPER_I_8();
\r
11698 uint dst = OPER_AY_IX_8();
\r
11699 uint res = dst - src;
\r
11701 FLAG_N = NFLAG_8(res);
\r
11702 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
11703 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
11704 FLAG_C = CFLAG_8(res);
\r
11708 void m68k_op_cmpi_8_aw(void)
\r
11710 uint src = OPER_I_8();
\r
11711 uint dst = OPER_AW_8();
\r
11712 uint res = dst - src;
\r
11714 FLAG_N = NFLAG_8(res);
\r
11715 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
11716 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
11717 FLAG_C = CFLAG_8(res);
\r
11721 void m68k_op_cmpi_8_al(void)
\r
11723 uint src = OPER_I_8();
\r
11724 uint dst = OPER_AL_8();
\r
11725 uint res = dst - src;
\r
11727 FLAG_N = NFLAG_8(res);
\r
11728 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
11729 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
11730 FLAG_C = CFLAG_8(res);
\r
11734 void m68k_op_cmpi_8_pcdi(void)
\r
11736 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
11738 uint src = OPER_I_8();
\r
11739 uint dst = OPER_PCDI_8();
\r
11740 uint res = dst - src;
\r
11742 FLAG_N = NFLAG_8(res);
\r
11743 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
11744 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
11745 FLAG_C = CFLAG_8(res);
\r
11748 m68ki_exception_illegal();
\r
11752 void m68k_op_cmpi_8_pcix(void)
\r
11754 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
11756 uint src = OPER_I_8();
\r
11757 uint dst = OPER_PCIX_8();
\r
11758 uint res = dst - src;
\r
11760 FLAG_N = NFLAG_8(res);
\r
11761 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
11762 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
11763 FLAG_C = CFLAG_8(res);
\r
11766 m68ki_exception_illegal();
\r
11770 void m68k_op_cmpi_16_d(void)
\r
11772 uint src = OPER_I_16();
\r
11773 uint dst = MASK_OUT_ABOVE_16(DY);
\r
11774 uint res = dst - src;
\r
11776 FLAG_N = NFLAG_16(res);
\r
11777 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
11778 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
11779 FLAG_C = CFLAG_16(res);
\r
11783 void m68k_op_cmpi_16_ai(void)
\r
11785 uint src = OPER_I_16();
\r
11786 uint dst = OPER_AY_AI_16();
\r
11787 uint res = dst - src;
\r
11789 FLAG_N = NFLAG_16(res);
\r
11790 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
11791 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
11792 FLAG_C = CFLAG_16(res);
\r
11796 void m68k_op_cmpi_16_pi(void)
\r
11798 uint src = OPER_I_16();
\r
11799 uint dst = OPER_AY_PI_16();
\r
11800 uint res = dst - src;
\r
11802 FLAG_N = NFLAG_16(res);
\r
11803 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
11804 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
11805 FLAG_C = CFLAG_16(res);
\r
11809 void m68k_op_cmpi_16_pd(void)
\r
11811 uint src = OPER_I_16();
\r
11812 uint dst = OPER_AY_PD_16();
\r
11813 uint res = dst - src;
\r
11815 FLAG_N = NFLAG_16(res);
\r
11816 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
11817 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
11818 FLAG_C = CFLAG_16(res);
\r
11822 void m68k_op_cmpi_16_di(void)
\r
11824 uint src = OPER_I_16();
\r
11825 uint dst = OPER_AY_DI_16();
\r
11826 uint res = dst - src;
\r
11828 FLAG_N = NFLAG_16(res);
\r
11829 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
11830 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
11831 FLAG_C = CFLAG_16(res);
\r
11835 void m68k_op_cmpi_16_ix(void)
\r
11837 uint src = OPER_I_16();
\r
11838 uint dst = OPER_AY_IX_16();
\r
11839 uint res = dst - src;
\r
11841 FLAG_N = NFLAG_16(res);
\r
11842 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
11843 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
11844 FLAG_C = CFLAG_16(res);
\r
11848 void m68k_op_cmpi_16_aw(void)
\r
11850 uint src = OPER_I_16();
\r
11851 uint dst = OPER_AW_16();
\r
11852 uint res = dst - src;
\r
11854 FLAG_N = NFLAG_16(res);
\r
11855 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
11856 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
11857 FLAG_C = CFLAG_16(res);
\r
11861 void m68k_op_cmpi_16_al(void)
\r
11863 uint src = OPER_I_16();
\r
11864 uint dst = OPER_AL_16();
\r
11865 uint res = dst - src;
\r
11867 FLAG_N = NFLAG_16(res);
\r
11868 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
11869 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
11870 FLAG_C = CFLAG_16(res);
\r
11874 void m68k_op_cmpi_16_pcdi(void)
\r
11876 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
11878 uint src = OPER_I_16();
\r
11879 uint dst = OPER_PCDI_16();
\r
11880 uint res = dst - src;
\r
11882 FLAG_N = NFLAG_16(res);
\r
11883 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
11884 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
11885 FLAG_C = CFLAG_16(res);
\r
11888 m68ki_exception_illegal();
\r
11892 void m68k_op_cmpi_16_pcix(void)
\r
11894 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
11896 uint src = OPER_I_16();
\r
11897 uint dst = OPER_PCIX_16();
\r
11898 uint res = dst - src;
\r
11900 FLAG_N = NFLAG_16(res);
\r
11901 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
11902 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
11903 FLAG_C = CFLAG_16(res);
\r
11906 m68ki_exception_illegal();
\r
11910 void m68k_op_cmpi_32_d(void)
\r
11912 uint src = OPER_I_32();
\r
11914 uint res = dst - src;
\r
11916 m68ki_cmpild_callback(src, REG_IR & 7); /* auto-disable (see m68kcpu.h) */
\r
11918 FLAG_N = NFLAG_32(res);
\r
11919 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11920 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11921 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11925 void m68k_op_cmpi_32_ai(void)
\r
11927 uint src = OPER_I_32();
\r
11928 uint dst = OPER_AY_AI_32();
\r
11929 uint res = dst - src;
\r
11931 FLAG_N = NFLAG_32(res);
\r
11932 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11933 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11934 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11938 void m68k_op_cmpi_32_pi(void)
\r
11940 uint src = OPER_I_32();
\r
11941 uint dst = OPER_AY_PI_32();
\r
11942 uint res = dst - src;
\r
11944 FLAG_N = NFLAG_32(res);
\r
11945 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11946 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11947 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11951 void m68k_op_cmpi_32_pd(void)
\r
11953 uint src = OPER_I_32();
\r
11954 uint dst = OPER_AY_PD_32();
\r
11955 uint res = dst - src;
\r
11957 FLAG_N = NFLAG_32(res);
\r
11958 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11959 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11960 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11964 void m68k_op_cmpi_32_di(void)
\r
11966 uint src = OPER_I_32();
\r
11967 uint dst = OPER_AY_DI_32();
\r
11968 uint res = dst - src;
\r
11970 FLAG_N = NFLAG_32(res);
\r
11971 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11972 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11973 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11977 void m68k_op_cmpi_32_ix(void)
\r
11979 uint src = OPER_I_32();
\r
11980 uint dst = OPER_AY_IX_32();
\r
11981 uint res = dst - src;
\r
11983 FLAG_N = NFLAG_32(res);
\r
11984 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11985 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11986 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
11990 void m68k_op_cmpi_32_aw(void)
\r
11992 uint src = OPER_I_32();
\r
11993 uint dst = OPER_AW_32();
\r
11994 uint res = dst - src;
\r
11996 FLAG_N = NFLAG_32(res);
\r
11997 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
11998 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
11999 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
12003 void m68k_op_cmpi_32_al(void)
\r
12005 uint src = OPER_I_32();
\r
12006 uint dst = OPER_AL_32();
\r
12007 uint res = dst - src;
\r
12009 FLAG_N = NFLAG_32(res);
\r
12010 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
12011 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
12012 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
12016 void m68k_op_cmpi_32_pcdi(void)
\r
12018 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
12020 uint src = OPER_I_32();
\r
12021 uint dst = OPER_PCDI_32();
\r
12022 uint res = dst - src;
\r
12024 FLAG_N = NFLAG_32(res);
\r
12025 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
12026 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
12027 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
12030 m68ki_exception_illegal();
\r
12034 void m68k_op_cmpi_32_pcix(void)
\r
12036 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
12038 uint src = OPER_I_32();
\r
12039 uint dst = OPER_PCIX_32();
\r
12040 uint res = dst - src;
\r
12042 FLAG_N = NFLAG_32(res);
\r
12043 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
12044 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
12045 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
12048 m68ki_exception_illegal();
\r
12052 void m68k_op_cmpm_8_ax7(void)
\r
12054 uint src = OPER_AY_PI_8();
\r
12055 uint dst = OPER_A7_PI_8();
\r
12056 uint res = dst - src;
\r
12058 FLAG_N = NFLAG_8(res);
\r
12059 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
12060 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
12061 FLAG_C = CFLAG_8(res);
\r
12065 void m68k_op_cmpm_8_ay7(void)
\r
12067 uint src = OPER_A7_PI_8();
\r
12068 uint dst = OPER_AX_PI_8();
\r
12069 uint res = dst - src;
\r
12071 FLAG_N = NFLAG_8(res);
\r
12072 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
12073 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
12074 FLAG_C = CFLAG_8(res);
\r
12078 void m68k_op_cmpm_8_axy7(void)
\r
12080 uint src = OPER_A7_PI_8();
\r
12081 uint dst = OPER_A7_PI_8();
\r
12082 uint res = dst - src;
\r
12084 FLAG_N = NFLAG_8(res);
\r
12085 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
12086 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
12087 FLAG_C = CFLAG_8(res);
\r
12091 void m68k_op_cmpm_8(void)
\r
12093 uint src = OPER_AY_PI_8();
\r
12094 uint dst = OPER_AX_PI_8();
\r
12095 uint res = dst - src;
\r
12097 FLAG_N = NFLAG_8(res);
\r
12098 FLAG_Z = MASK_OUT_ABOVE_8(res);
\r
12099 FLAG_V = VFLAG_SUB_8(src, dst, res);
\r
12100 FLAG_C = CFLAG_8(res);
\r
12104 void m68k_op_cmpm_16(void)
\r
12106 uint src = OPER_AY_PI_16();
\r
12107 uint dst = OPER_AX_PI_16();
\r
12108 uint res = dst - src;
\r
12110 FLAG_N = NFLAG_16(res);
\r
12111 FLAG_Z = MASK_OUT_ABOVE_16(res);
\r
12112 FLAG_V = VFLAG_SUB_16(src, dst, res);
\r
12113 FLAG_C = CFLAG_16(res);
\r
12117 void m68k_op_cmpm_32(void)
\r
12119 uint src = OPER_AY_PI_32();
\r
12120 uint dst = OPER_AX_PI_32();
\r
12121 uint res = dst - src;
\r
12123 FLAG_N = NFLAG_32(res);
\r
12124 FLAG_Z = MASK_OUT_ABOVE_32(res);
\r
12125 FLAG_V = VFLAG_SUB_32(src, dst, res);
\r
12126 FLAG_C = CFLAG_SUB_32(src, dst, res);
\r
12130 void m68k_op_cpbcc_32(void)
\r
12132 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
12134 M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n",
\r
12135 m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR,
\r
12136 m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2))));
\r
12139 m68ki_exception_1111();
\r
12143 void m68k_op_cpdbcc_32(void)
\r
12145 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
12147 M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n",
\r
12148 m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR,
\r
12149 m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2))));
\r
12152 m68ki_exception_1111();
\r
12156 void m68k_op_cpgen_32(void)
\r
12158 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
12160 M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n",
\r
12161 m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR,
\r
12162 m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2))));
\r
12165 m68ki_exception_1111();
\r
12169 void m68k_op_cpscc_32(void)
\r
12171 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
12173 M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n",
\r
12174 m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR,
\r
12175 m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2))));
\r
12178 m68ki_exception_1111();
\r
12182 void m68k_op_cptrapcc_32(void)
\r
12184 if(CPU_TYPE_IS_EC020_PLUS(CPU_TYPE))
\r
12186 M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: called unimplemented instruction %04x (%s)\n",
\r
12187 m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC - 2), REG_IR,
\r
12188 m68k_disassemble_quick(ADDRESS_68K(REG_PC - 2))));
\r
12191 m68ki_exception_1111();
\r
12195 /* ======================================================================== */
\r
12196 /* ============================== END OF FILE ============================= */
\r
12197 /* ======================================================================== */
\r