/[projet1]/public/pc/tools/osdk/main/Osdk/_final_/macro/MACROS.H
Defence Force logotype

Contents of /public/pc/tools/osdk/main/Osdk/_final_/macro/MACROS.H

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1486 - (show annotations)
Sat Jul 28 13:56:23 2018 UTC (13 months, 3 weeks ago) by dbug
File MIME type: text/plain
File size: 84824 byte(s)
Updated the macro file from version 1.29 to 1.30 (fixes in the ADDW_IID, SUBW_IID, ANDW_IID, XORW_IID and ORW_IID which used the wrong register to access the source pointer)
Thanks to Fabrice for the update.
1 /* macros v1.30 for the 6502 code generator, F.Frances */
2
3 #define DB(n)\
4 .byt n ;\
5
6 #define DW(n)\
7 .word n ;\
8
9 #define SPACE(n)\
10 .dsb n ;\
11
12 #define ZERO(n)\
13 .dsb n ;\
14
15 #define ENTER(r,n)\
16 ldx #n ;\
17 lda #r ;\
18 jsr enter ;\
19
20 #define LEAVE\
21 jmp leave ;\
22
23 #define LEAVEW_C(cte1)\
24 ldx #<(cte1) ;\
25 lda #>(cte1) ;\
26 jmp leave ;\
27
28 #define LEAVEW_A(ptr1,y1)\
29 clc ;\
30 lda 0+ptr1 ;\
31 adc #y1 ;\
32 tax ;\
33 lda 1+ptr1 ;\
34 adc #0 ;\
35 jmp leave ;\
36
37 #define LEAVEW_D(tmp1)\
38 ldx tmp1 ;\
39 lda tmp1+1 ;\
40 jmp leave ;\
41
42 #define LEAVEW_I(ptr1,y1)\
43 ldy #y1 ;\
44 lda ptr1,y ;\
45 tax ;\
46 iny ;\
47 lda ptr1,y ;\
48 jmp leave ;\
49
50 #define RET\
51 rts ;\
52
53 #define RETW_C(cte1)\
54 ldx #<(cte1) ;\
55 lda #>(cte1) ;\
56 rts ;\
57
58 #define RETW_A(ptr1,y1)\
59 clc ;\
60 lda 0+ptr1 ;\
61 adc #y1 ;\
62 tax ;\
63 lda 1+ptr1 ;\
64 adc #0 ;\
65 rts ;\
66
67 #define RETW_D(tmp1)\
68 ldx tmp1 ;\
69 lda tmp1+1 ;\
70 rts ;\
71
72 #define CNST_CD(cte1,tmp)\
73 ldx #<(cte1) ;\
74 stx tmp ;\
75 lda #>(cte1) ;\
76 sta tmp+1 ;\
77
78 #define ADDR_CD(adr1,tmp)\
79 ldx #<(adr1) ;\
80 stx tmp ;\
81 lda #>(adr1) ;\
82 sta tmp+1 ;\
83
84 #define ADDR_AD(ptr1,y1,tmp2)\
85 clc ;\
86 lda 0+ptr1 ;\
87 adc #y1 ;\
88 sta tmp2 ;\
89 lda 1+ptr1 ;\
90 adc #0 ;\
91 sta tmp2+1 ;\
92
93 #define CZBW_CD(cte1,tmp2)\
94 lda #cte1 ;\
95 sta tmp2 ;\
96 lda #0 ;\
97 sta tmp2+1 ;\
98
99 #define CZBW_CI(cte1,ptr2,y2)\
100 ldy #y2 ;\
101 lda #cte1 ;\
102 sta ptr2,y ;\
103 iny ;\
104 lda #0 ;\
105 sta ptr2,y ;\
106
107 #define CZBW_DD(tmp1,tmp2)\
108 lda tmp1 ;\
109 sta tmp2 ;\
110 lda #0 ;\
111 sta tmp2+1 ;\
112
113 #define CZBW_DI(tmp1,ptr2,y2)\
114 ldy #y2 ;\
115 lda tmp1 ;\
116 sta ptr2,y ;\
117 iny ;\
118 lda #0 ;\
119 sta ptr2,y ;\
120
121 #define CZBW_ID(ptr1,y1,tmp2)\
122 ldy #y1 ;\
123 lda ptr1,y ;\
124 sta tmp2 ;\
125 lda #0 ;\
126 sta tmp2+1 ;\
127
128 #define CZBW_II(ptr1,y1,ptr2,y2)\
129 ldy #y1 ;\
130 lda ptr1,y ;\
131 ldy #y2 ;\
132 sta ptr2,y ;\
133 iny ;\
134 lda #0 ;\
135 sta ptr2,y ;\
136
137 #define CWB_CD(cte1,tmp2)\
138 lda #< cte1 ;\
139 sta tmp2 ;\
140
141 #define CWB_CI(cte1,ptr2,y2)\
142 ldy #y2 ;\
143 lda #< cte1 ;\
144 sta ptr2,y ;\
145
146 #define CWB_DD(tmp1,tmp2)\
147 lda tmp1 ;\
148 sta tmp2 ;\
149
150 #define CWB_DI(tmp1,ptr2,y2)\
151 ldy #y2 ;\
152 lda tmp1 ;\
153 sta ptr2,y ;\
154
155 #define CWB_ID(ptr1,y1,tmp2)\
156 ldy #y1 ;\
157 lda ptr1,y ;\
158 sta tmp2 ;\
159
160 #define CWB_II(ptr1,y1,ptr2,y2)\
161 ldy #y1 ;\
162 lda ptr1,y ;\
163 ldy #y2 ;\
164 sta ptr2,y ;\
165
166 #define MOVW_DD(tmp1,tmp2)\
167 lda tmp1 ;\
168 sta tmp2 ;\
169 lda tmp1+1 ;\
170 sta tmp2+1 ;\
171
172 #define MOVW_DI(tmp1,ptr2,y2)\
173 ldy #y2 ;\
174 lda tmp1 ;\
175 sta ptr2,y ;\
176 iny ;\
177 lda tmp1+1 ;\
178 sta ptr2,y ;\
179
180 #define MOVW_ID(ptr1,y1,tmp2)\
181 ldy #y1 ;\
182 lda ptr1,y ;\
183 sta tmp2 ;\
184 iny ;\
185 lda ptr1,y ;\
186 sta tmp2+1 ;\
187
188 #define MOVW_II(ptr1,y1,ptr2,y2)\
189 ldy #y1 ;\
190 lda ptr1,y ;\
191 ldy #y2 ;\
192 sta ptr2,y ;\
193 ldy #y1+1 ;\
194 lda ptr1,y ;\
195 ldy #y2+1 ;\
196 sta ptr2,y ;\
197
198 #define MOVW_CD(cte1,tmp2)\
199 lda #<(cte1) ;\
200 sta tmp2 ;\
201 lda #>(cte1) ;\
202 sta tmp2+1 ;\
203
204 #define MOVW_CI(cte1,ptr2,y2)\
205 ldy #y2 ;\
206 lda #<(cte1) ;\
207 sta ptr2,y ;\
208 iny ;\
209 lda #>(cte1)+1 ;\
210 sta ptr2,y ;\
211
212 #define MOVW_AD(ptr1,y1,tmp2)\
213 clc ;\
214 lda 0+ptr1 ;\
215 adc #y1 ;\
216 sta tmp2 ;\
217 lda 1+ptr1 ;\
218 adc #0 ;\
219 sta tmp2+1 ;\
220
221 #define MOVW_AI(ptr1,y1,ptr2,y2)\
222 clc ;\
223 lda 0+ptr1 ;\
224 adc #y1 ;\
225 ldy #y2 ;\
226 sta ptr2,y ;\
227 iny ;\
228 lda 1+ptr1 ;\
229 adc #0 ;\
230 sta ptr2,y ;\
231
232 #define CSBW_CD(cte1,tmp2)\
233 lda #0 ;\
234 ldx #cte1 ;\
235 stx tmp2 ;\
236 .( ;\
237 bpl skip ;\
238 lda #$FF ;\
239 skip ;\
240 .) ;\
241 sta tmp2+1 ;\
242
243 #define CSBW_CI(cte1,ptr2,y2)\
244 ldy #y2 ;\
245 ldx #0 ;\
246 lda #cte1 ;\
247 sta ptr2,y ;\
248 .( ;\
249 bpl skip ;\
250 ldx #$FF ;\
251 skip ;\
252 .) ;\
253 txa ;\
254 iny ;\
255 sta ptr2,y ;\
256
257 #define CSBW_DD(tmp1,tmp2)\
258 lda #0 ;\
259 ldx tmp1 ;\
260 stx tmp2 ;\
261 .( ;\
262 bpl skip ;\
263 lda #$FF ;\
264 skip ;\
265 .) ;\
266 sta tmp2+1 ;\
267
268 #define CSBW_DI(tmp1,ptr2,y2)\
269 ldy #y2 ;\
270 ldx #0 ;\
271 lda tmp1 ;\
272 sta ptr2,y ;\
273 .( ;\
274 bpl skip ;\
275 ldx #$FF ;\
276 skip ;\
277 .) ;\
278 txa ;\
279 iny ;\
280 sta ptr2,y ;\
281
282 #define CSBW_ID(ptr1,y1,tmp2)\
283 ldy #y1 ;\
284 ldx #0 ;\
285 lda ptr1,y ;\
286 sta tmp2 ;\
287 .( ;\
288 bpl skip ;\
289 ldx #$FF ;\
290 skip ;\
291 .) ;\
292 txa ;\
293 sta tmp2+1 ;\
294
295 #define CSBW_II(ptr1,y1,ptr2,y2)\
296 ldy #y1 ;\
297 ldx #0 ;\
298 lda ptr1,y ;\
299 ldy #y2 ;\
300 sta ptr2,y ;\
301 .( ;\
302 bpl skip ;\
303 ldx #$FF ;\
304 skip ;\
305 .) ;\
306 txa ;\
307 iny ;\
308 sta ptr2,y ;\
309
310 #define INDIRB_CD(var1,tmp2)\
311 lda var1 ;\
312 sta tmp2 ;\
313
314 #define INDIRB_ZD(ptr1,tmp2)\
315 ldy #0 ;\
316 lda (ptr1),y ;\
317 sta tmp2 ;\
318
319 #define INDIRB_DD(var1,tmp2)\
320 ldx var1 ;\
321 lda var1+1 ;\
322 stx tmp ;\
323 sta tmp+1 ;\
324 ldy #0 ;\
325 lda (tmp),y ;\
326 sta tmp2 ;\
327
328 #define INDIRB_AD(ptr1,y1,tmp2)\
329 ldy #y1 ;\
330 lda ptr1,y ;\
331 sta tmp2 ;\
332
333 #define INDIRB_ID(ptr1,y1,tmp2)\
334 ldy #y1 ;\
335 lda ptr1,y ;\
336 sta tmp ;\
337 iny ;\
338 lda ptr1,y ;\
339 sta tmp+1 ;\
340 ldy #0 ;\
341 lda (tmp),y ;\
342 sta tmp2 ;\
343
344 #define INDIRB_CI(var1,ptr2,y2)\
345 ldy #y2 ;\
346 lda var1 ;\
347 sta ptr2,y ;\
348
349 #define INDIRB_ZI(ptr1,ptr2,y2)\
350 ldy #0 ;\
351 lda (ptr1),y ;\
352 ldy #y2 ;\
353 sta ptr2,y ;\
354
355 #define INDIRB_DI(var1,ptr2,y2)\
356 ldx var1 ;\
357 lda var1+1 ;\
358 stx tmp ;\
359 sta tmp+1 ;\
360 ldy #0 ;\
361 lda (tmp),y ;\
362 ldy #y2 ;\
363 sta ptr2,y ;\
364
365 #define INDIRB_AI(ptr1,y1,ptr2,y2)\
366 ldy #y1 ;\
367 lda ptr1,y ;\
368 ldy #y2 ;\
369 sta ptr2,y ;\
370
371 #define INDIRB_II(ptr1,y1,ptr2,y2)\
372 ldy #y1 ;\
373 lda ptr1,y ;\
374 sta tmp ;\
375 iny ;\
376 lda ptr1,y ;\
377 sta tmp+1 ;\
378 ldy #0 ;\
379 lda (tmp),y ;\
380 ldy #y2 ;\
381 sta ptr2,y ;\
382
383 #define INDIRW_CD(var1,tmp2)\
384 lda var1 ;\
385 sta tmp2 ;\
386 lda var1+1 ;\
387 sta tmp2+1 ;\
388
389 #define INDIRW_ZD(ptr1,tmp2)\
390 ldy #0 ;\
391 lda (ptr1),y ;\
392 tax ;\
393 iny ;\
394 lda (ptr1),y ;\
395 stx tmp2 ;\
396 sta tmp2+1 ;\
397
398 #define INDIRW_DD(var1,tmp2)\
399 ldx var1 ;\
400 lda var1+1 ;\
401 stx tmp ;\
402 sta tmp+1 ;\
403 ldy #0 ;\
404 lda (tmp),y ;\
405 sta tmp2 ;\
406 iny ;\
407 lda (tmp),y ;\
408 sta tmp2+1 ;\
409
410 #define INDIRW_AD(ptr1,y1,tmp2)\
411 ldy #y1 ;\
412 lda ptr1,y ;\
413 sta tmp2 ;\
414 iny ;\
415 lda ptr1,y ;\
416 sta tmp2+1 ;\
417
418 #define INDIRW_ID(ptr1,y1,tmp2)\
419 ldy #y1 ;\
420 lda ptr1,y ;\
421 sta tmp ;\
422 iny ;\
423 lda ptr1,y ;\
424 sta tmp+1 ;\
425 ldy #0 ;\
426 lda (tmp),y ;\
427 sta tmp2 ;\
428 iny ;\
429 lda (tmp),y ;\
430 sta tmp2+1 ;\
431
432 #define INDIRW_CI(var1,ptr2,y2)\
433 ldy #y2 ;\
434 lda var1 ;\
435 sta ptr2,y ;\
436 iny ;\
437 lda var1+1 ;\
438 sta ptr2,y ;\
439
440 #define INDIRW_ZI(ptr1,ptr2,y2)\
441 ldy #0 ;\
442 lda (ptr1),y ;\
443 ldy #y2 ;\
444 sta ptr2,y ;\
445 ldy #1 ;\
446 lda (ptr1),y ;\
447 ldy #y2+1 ;\
448 sta ptr2,y ;\
449
450 #define INDIRW_DI(var1,ptr2,y2)\
451 ldx var1 ;\
452 lda var1+1 ;\
453 stx tmp ;\
454 sta tmp+1 ;\
455 ldy #0 ;\
456 lda (tmp),y ;\
457 ldy #y2 ;\
458 sta ptr2,y ;\
459 ldy #1 ;\
460 lda (tmp),y ;\
461 ldy #y2+1 ;\
462 sta ptr2,y ;\
463
464 #define INDIRW_AI(ptr1,y1,ptr2,y2)\
465 ldy #y1 ;\
466 lda ptr1,y ;\
467 ldy #y2 ;\
468 sta ptr2,y ;\
469 ldy #y1+1 ;\
470 lda ptr1,y ;\
471 ldy #y2+1 ;\
472 sta ptr2,y ;\
473
474 #define INDIRW_II(ptr1,y1,ptr2,y2)\
475 ldy #y1 ;\
476 lda ptr1,y ;\
477 sta tmp ;\
478 iny ;\
479 lda ptr1,y ;\
480 sta tmp+1 ;\
481 ldy #0 ;\
482 lda (tmp),y ;\
483 ldy #y2 ;\
484 sta ptr2,y ;\
485 ldy #1 ;\
486 lda (tmp),y ;\
487 ldy #y2+1 ;\
488 sta ptr2,y ;\
489
490 #define INDIRS_CD(var1,tmp2)\
491 lda #<(var1) ;\
492 sta tmp2 ;\
493 lda #>(var1) ;\
494 sta tmp2+1 ;\
495
496 #define INDIRS_DD(var1,tmp2)\
497 lda var1 ;\
498 sta tmp2 ;\
499 lda var1+1 ;\
500 sta tmp2+1 ;\
501
502 #define NEGI_DD(tmp1,tmp2)\
503 lda #0 ;\
504 sec ;\
505 sbc tmp1 ;\
506 sta tmp2 ;\
507 lda #0 ;\
508 sbc tmp1+1 ;\
509 sta tmp2+1 ;\
510
511 #define NEGI_DI(tmp1,ptr2,y2)\
512 ldy #y2 ;\
513 lda #0 ;\
514 sec ;\
515 sbc tmp1 ;\
516 sta ptr2,y ;\
517 iny ;\
518 lda #0 ;\
519 sbc tmp1+1 ;\
520 sta ptr2,y ;\
521
522 #define NEGI_ID(ptr1,y1,tmp2)\
523 ldy #y1 ;\
524 lda #0 ;\
525 sec ;\
526 sbc ptr1,y ;\
527 sta tmp2 ;\
528 iny ;\
529 lda #0 ;\
530 sbc ptr1,y ;\
531 sta tmp2+1 ;\
532
533 #define NEGI_II(ptr1,y1,ptr2,y2)\
534 ldy #y1 ;\
535 lda #0 ;\
536 sec ;\
537 sbc ptr1,y ;\
538 ldy #y2 ;\
539 sta ptr2,y ;\
540 ldy #y1+1 ;\
541 lda #0 ;\
542 sbc ptr1,y ;\
543 ldy #y2+1 ;\
544 sta ptr2,y ;\
545
546 /* 16 bits increment - Zero page variant */
547 #define INCW_Z(tmp1)\
548 inc tmp1 ;\
549 .( ;\
550 bne skip ;\
551 inc tmp1+1 ;\
552 skip ;\
553 .) ;\
554
555 /* 16 bits increment - Memory variant */
556 #define INCW_D(var1)\
557 inc var1 ;\
558 .( ;\
559 bne skip ;\
560 inc var1+1 ;\
561 skip ;\
562 .) ;\
563
564 /* 16 bits decrement - Zero page variant */
565 #define DECW_Z(tmp1)\
566 lda tmp1 ;\
567 .( ;\
568 bne skip ;\
569 dec tmp1+1 ;\
570 skip ;\
571 .) ;\
572 dec tmp1 ;\
573
574 /* 16 bits decrement - Memory variant */
575 #define DECW_D(var1)\
576 lda var1 ;\
577 .( ;\
578 bne skip ;\
579 dec var1+1 ;\
580 skip ;\
581 .) ;\
582 dec var1 ;\
583
584 #define ADDW_DDD(tmp1,tmp2,tmp3)\
585 clc ;\
586 lda tmp1 ;\
587 adc tmp2 ;\
588 sta tmp3 ;\
589 lda tmp1+1 ;\
590 adc tmp2+1 ;\
591 sta tmp3+1 ;\
592
593 #define ADDW_IDD(ptr1,y1,tmp2,tmp3)\
594 clc ;\
595 ldy #y1 ;\
596 lda ptr1,y ;\
597 adc tmp2 ;\
598 sta tmp3 ;\
599 iny ;\
600 lda ptr1,y ;\
601 adc tmp2+1 ;\
602 sta tmp3+1 ;\
603
604 #define ADDW_DID(tmp1,ptr2,y2,tmp3)\
605 clc ;\
606 lda tmp1 ;\
607 ldy #y2 ;\
608 adc ptr2,y ;\
609 sta tmp3 ;\
610 iny ;\
611 lda tmp1+1 ;\
612 adc ptr2,y ;\
613 sta tmp3+1 ;\
614
615 #define ADDW_IID(ptr1,y1,ptr2,y2,tmp3)\
616 clc ;\
617 ldy #y1 ;\
618 lda ptr1,y ;\
619 ldy #y2 ;\
620 adc ptr2,y ;\
621 sta tmp3 ;\
622 ldy #y1+1 ;\
623 lda ptr1,y ;\
624 ldy #y2+1 ;\
625 adc ptr2,y ;\
626 sta tmp3+1 ;\
627
628 #define ADDW_DDI(tmp1,tmp2,ptr3,y3)\
629 clc ;\
630 lda tmp1 ;\
631 adc tmp2 ;\
632 ldy #y3 ;\
633 sta ptr3,y ;\
634 iny ;\
635 lda tmp1+1 ;\
636 adc tmp2+1 ;\
637 sta ptr3,y ;\
638
639 #define ADDW_IDI(ptr1,y1,tmp2,ptr3,y3)\
640 clc ;\
641 ldy #y1 ;\
642 lda ptr1,y ;\
643 adc tmp2 ;\
644 ldy #y3 ;\
645 sta ptr3,y ;\
646 ldy #y1+1 ;\
647 lda ptr1,y ;\
648 adc tmp2+1 ;\
649 ldy #y3+1 ;\
650 sta ptr3,y ;\
651
652 #define ADDW_DII(tmp1,ptr2,y2,ptr3,y3)\
653 clc ;\
654 lda tmp1 ;\
655 ldy #y2 ;\
656 adc ptr2,y ;\
657 ldy #y3 ;\
658 sta ptr3,y ;\
659 lda tmp1+1 ;\
660 ldy #y2+1 ;\
661 adc ptr2,y ;\
662 ldy #y3+1 ;\
663 sta ptr3,y ;\
664
665 #define ADDW_III(ptr1,y1,ptr2,y2,ptr3,y3)\
666 clc ;\
667 ldy #y1 ;\
668 lda ptr1,y ;\
669 ldy #y2 ;\
670 adc ptr2,y ;\
671 ldy #y3 ;\
672 sta ptr3,y ;\
673 ldy #y1+1 ;\
674 lda ptr1,y ;\
675 ldy #y2+1 ;\
676 adc ptr2,y ;\
677 ldy #y3+1 ;\
678 sta ptr3,y ;\
679
680 #define ADDW_DCD(tmp2,cte1,tmp3)\
681 clc ;\
682 lda #<(cte1) ;\
683 adc tmp2 ;\
684 sta tmp3 ;\
685 lda #>(cte1) ;\
686 adc tmp2+1 ;\
687 sta tmp3+1 ;\
688
689 #define ADDW_DAD(tmp2,ptr1,y1,tmp3)\
690 clc ;\
691 lda 0+ptr1 ;\
692 adc #y1 ;\
693 tax ;\
694 lda 1+ptr1 ;\
695 adc #0 ;\
696 sta tmp+1 ;\
697 txa ;\
698 adc tmp2 ;\
699 sta tmp3 ;\
700 lda tmp+1 ;\
701 adc tmp2+1 ;\
702 sta tmp3+1 ;\
703
704 #define ADDW_ICD(ptr2,y2,cte1,tmp3)\
705 clc ;\
706 lda #<(cte1) ;\
707 ldy #y2 ;\
708 adc ptr2,y ;\
709 sta tmp3 ;\
710 iny ;\
711 lda #>(cte1) ;\
712 adc ptr2,y ;\
713 sta tmp3+1 ;\
714
715 #define ADDW_IAD(ptr2,y2,ptr1,y1,tmp3)\
716 clc ;\
717 lda 0+ptr1 ;\
718 adc #y1 ;\
719 tax ;\
720 lda 1+ptr1 ;\
721 adc #0 ;\
722 sta tmp+1 ;\
723 txa ;\
724 ldy #y2 ;\
725 adc ptr2,y ;\
726 sta tmp3 ;\
727 iny ;\
728 lda tmp+1 ;\
729 adc ptr2,y ;\
730 sta tmp3+1 ;\
731
732 #define ADDW_DCI(tmp2,cte1,ptr3,y3)\
733 clc ;\
734 lda #<(cte1) ;\
735 adc tmp2 ;\
736 ldy #y3 ;\
737 sta ptr3,y ;\
738 iny ;\
739 lda #>(cte1) ;\
740 adc tmp2+1 ;\
741 sta ptr3,y ;\
742
743 #define ADDW_DAI(tmp2,ptr1,y1,ptr3,y3)\
744 clc ;\
745 lda 0+ptr1 ;\
746 adc #y1 ;\
747 tax ;\
748 lda 1+ptr1 ;\
749 adc #0 ;\
750 sta tmp+1 ;\
751 txa ;\
752 adc tmp2 ;\
753 ldy #y3 ;\
754 sta ptr3,y ;\
755 iny ;\
756 lda tmp+1 ;\
757 adc tmp2+1 ;\
758 sta ptr3,y ;\
759
760 #define ADDW_ICI(ptr2,y2,cte1,ptr3,y3)\
761 clc ;\
762 lda #<(cte1) ;\
763 ldy #y2 ;\
764 adc ptr2,y ;\
765 ldy #y3 ;\
766 sta ptr3,y ;\
767 lda #>(cte1) ;\
768 ldy #y2+1 ;\
769 adc ptr2,y ;\
770 ldy #y3+1 ;\
771 sta ptr3,y ;\
772
773 #define ADDW_IAI(ptr2,y2,ptr1,y1,ptr3,y3)\
774 clc ;\
775 lda 0+ptr1 ;\
776 adc #y1 ;\
777 tax ;\
778 lda 1+ptr1 ;\
779 adc #0 ;\
780 sta tmp+1 ;\
781 txa ;\
782 ldy #y2 ;\
783 adc ptr2,y ;\
784 ldy #y3 ;\
785 sta ptr3,y ;\
786 lda tmp+1 ;\
787 ldy #y2+1 ;\
788 adc ptr2,y ;\
789 ldy #y3+1 ;\
790 sta ptr3,y ;\
791
792 #define SUBW_DCD(tmp1,cte2,tmp3)\
793 sec ;\
794 lda tmp1 ;\
795 sbc #<(cte2) ;\
796 sta tmp3 ;\
797 lda tmp1+1 ;\
798 sbc #>(cte2) ;\
799 sta tmp3+1 ;\
800
801 #define SUBW_CDD(cte1,tmp2,tmp3)\
802 sec ;\
803 lda #<(cte1) ;\
804 sbc tmp2 ;\
805 sta tmp3 ;\
806 lda #>(cte1) ;\
807 sbc tmp2+1 ;\
808 sta tmp3+1 ;\
809
810 #define SUBW_ADD(ptr1,y1,tmp2,tmp3)\
811 clc ;\
812 lda 0+ptr1 ;\
813 adc #y1 ;\
814 tax ;\
815 lda 1+ptr1 ;\
816 adc #0 ;\
817 sta tmp+1 ;\
818 sec ;\
819 txa ;\
820 sbc tmp2 ;\
821 sta tmp3 ;\
822 lda tmp+1 ;\
823 sbc tmp2+1 ;\
824 sta tmp3+1 ;\
825
826 #define SUBW_ICD(ptr1,y1,cte2,tmp3)\
827 sec ;\
828 ldy #y1 ;\
829 lda ptr1,y ;\
830 sbc #<(cte2) ;\
831 sta tmp3 ;\
832 iny ;\
833 lda ptr1,y ;\
834 sbc #>(cte2) ;\
835 sta tmp3+1 ;\
836
837 #define SUBW_CID(cte1,ptr2,y2,tmp3)\
838 sec ;\
839 ldy #y2 ;\
840 lda #<(cte1) ;\
841 sbc ptr2,y ;\
842 sta tmp3 ;\
843 iny ;\
844 lda #>(cte1) ;\
845 sbc ptr2,y ;\
846 sta tmp3+1 ;\
847
848 #define SUBW_AID(ptr1,y1,ptr2,y2,tmp3)\
849 clc ;\
850 lda 0+ptr1 ;\
851 adc #y1 ;\
852 tax ;\
853 lda 1+ptr1 ;\
854 adc #0 ;\
855 sta tmp+1 ;\
856 sec ;\
857 ldy #y2 ;\
858 txa ;\
859 sbc ptr2,y ;\
860 sta tmp3 ;\
861 iny ;\
862 lda tmp+1 ;\
863 sbc ptr2,y ;\
864 sta tmp3+1 ;\
865
866 #define SUBW_DCI(tmp1,cte2,ptr3,y3)\
867 sec ;\
868 ldy #y3 ;\
869 lda tmp1 ;\
870 sbc #<(cte2) ;\
871 sta ptr3,y ;\
872 iny ;\
873 lda tmp1+1 ;\
874 sbc #>(cte2) ;\
875 sta ptr3,y ;\
876
877 #define SUBW_CDI(cte1,tmp2,ptr3,y3)\
878 sec ;\
879 ldy #y3 ;\
880 lda #<(cte1) ;\
881 sbc tmp2 ;\
882 sta ptr3,y ;\
883 iny ;\
884 lda #>(cte1) ;\
885 sbc tmp2+1 ;\
886 sta ptr3,y ;\
887
888 #define SUBW_ADI(ptr1,y1,tmp2,ptr3,y3)\
889 clc ;\
890 lda 0+ptr1 ;\
891 adc #y1 ;\
892 tax ;\
893 lda 1+ptr1 ;\
894 adc #0 ;\
895 sta tmp+1 ;\
896 sec ;\
897 ldy #y3 ;\
898 txa ;\
899 sbc tmp2 ;\
900 sta ptr3,y ;\
901 iny ;\
902 lda tmp+1 ;\
903 sbc tmp2+1 ;\
904 sta ptr3,y ;\
905
906 #define SUBW_ICI(ptr1,y1,cte2,ptr3,y3)\
907 sec ;\
908 ldy #y1 ;\
909 lda ptr1,y ;\
910 sbc #<(cte2) ;\
911 ldy #y3 ;\
912 sta ptr3,y ;\
913 ldy #y1+1 ;\
914 lda ptr1,y ;\
915 sbc #>(cte2) ;\
916 ldy #y3+1 ;\
917 sta ptr3,y ;\
918
919 #define SUBW_CII(cte1,ptr2,y2,ptr3,y3)\
920 sec ;\
921 lda #<(cte1) ;\
922 ldy #y2 ;\
923 sbc ptr2,y ;\
924 ldy #y3 ;\
925 sta ptr3,y ;\
926 lda #>(cte1) ;\
927 ldy #y2+1 ;\
928 sbc ptr2,y ;\
929 ldy #y3+1 ;\
930 sta ptr3,y ;\
931
932 #define SUBW_AII(ptr1,y1,ptr2,y2,ptr3,y3)\
933 clc ;\
934 lda 0+ptr1 ;\
935 adc #y1 ;\
936 tax ;\
937 lda 1+ptr1 ;\
938 adc #0 ;\
939 sta tmp+1 ;\
940 sec ;\
941 txa ;\
942 ldy #y2 ;\
943 sbc ptr2,y ;\
944 ldy #y3 ;\
945 sta ptr3,y ;\
946 lda tmp+1 ;\
947 ldy #y2+1 ;\
948 sbc ptr2,y ;\
949 ldy #y3+1 ;\
950 sta ptr3,y ;\
951
952 #define SUBW_DDD(tmp1,tmp2,tmp3)\
953 sec ;\
954 lda tmp1 ;\
955 sbc tmp2 ;\
956 sta tmp3 ;\
957 lda tmp1+1 ;\
958 sbc tmp2+1 ;\
959 sta tmp3+1 ;\
960
961 #define SUBW_IDD(ptr1,y1,tmp2,tmp3)\
962 sec ;\
963 ldy #y1 ;\
964 lda ptr1,y ;\
965 sbc tmp2 ;\
966 sta tmp3 ;\
967 iny ;\
968 lda ptr1,y ;\
969 sbc tmp2+1 ;\
970 sta tmp3+1 ;\
971
972 #define SUBW_DID(tmp1,ptr2,y2,tmp3)\
973 sec ;\
974 lda tmp1 ;\
975 ldy #y2 ;\
976 sbc ptr2,y ;\
977 sta tmp3 ;\
978 iny ;\
979 lda tmp1+1 ;\
980 sbc ptr2,y ;\
981 sta tmp3+1 ;\
982
983 #define SUBW_IID(ptr1,y1,ptr2,y2,tmp3)\
984 sec ;\
985 ldy #y1 ;\
986 lda ptr1,y ;\
987 ldy #y2 ;\
988 sbc ptr2,y ;\
989 sta tmp3 ;\
990 ldy #y1+1 ;\
991 lda ptr1,y ;\
992 ldy #y2+1 ;\
993 sbc ptr2,y ;\
994 sta tmp3+1 ;\
995
996 #define SUBW_DDI(tmp1,tmp2,ptr3,y3)\
997 sec ;\
998 lda tmp1 ;\
999 sbc tmp2 ;\
1000 ldy #y3 ;\
1001 sta ptr3,y ;\
1002 iny ;\
1003 lda tmp1+1 ;\
1004 sbc tmp2+1 ;\
1005 sta ptr3,y ;\
1006
1007 #define SUBW_IDI(ptr1,y1,tmp2,ptr3,y3)\
1008 sec ;\
1009 ldy #y1 ;\
1010 lda ptr1,y ;\
1011 sbc tmp2 ;\
1012 ldy #y3 ;\
1013 sta ptr3,y ;\
1014 ldy #y1+1 ;\
1015 lda ptr1,y ;\
1016 sbc tmp2+1 ;\
1017 ldy #y3+1 ;\
1018 sta ptr3,y ;\
1019
1020 #define SUBW_DII(tmp1,ptr2,y2,ptr3,y3)\
1021 sec ;\
1022 lda tmp1 ;\
1023 ldy #y2 ;\
1024 sbc ptr2,y ;\
1025 ldy #y3 ;\
1026 sta ptr3,y ;\
1027 lda tmp1+1 ;\
1028 ldy #y2+1 ;\
1029 sbc ptr2,y ;\
1030 ldy #y3+1 ;\
1031 sta ptr3,y ;\
1032
1033 #define SUBW_III(ptr1,y1,ptr2,y2,ptr3,y3)\
1034 sec ;\
1035 ldy #y1 ;\
1036 lda ptr1,y ;\
1037 ldy #y2 ;\
1038 sbc ptr2,y ;\
1039 ldy #y3 ;\
1040 sta ptr3,y ;\
1041 ldy #y1+1 ;\
1042 lda ptr1,y ;\
1043 ldy #y2+1 ;\
1044 sbc ptr2,y ;\
1045 ldy #y3+1 ;\
1046 sta ptr3+1 ;\
1047
1048 #define COMW_DD(tmp1,tmp2)\
1049 lda tmp1 ;\
1050 eor #$FF ;\
1051 sta tmp2 ;\
1052 lda tmp1+1 ;\
1053 eor #$FF ;\
1054 sta tmp2+1 ;\
1055
1056 #define COMW_DI(tmp1,ptr2,y2)\
1057 ldy #y2 ;\
1058 lda tmp1 ;\
1059 eor #$FF ;\
1060 sta ptr2,y ;\
1061 iny ;\
1062 lda tmp1+1 ;\
1063 eor #$FF ;\
1064 sta ptr2,y ;\
1065
1066 #define COMW_ID(ptr1,y1,tmp2)\
1067 ldy #y1 ;\
1068 lda ptr1,y ;\
1069 eor #$FF ;\
1070 sta tmp2 ;\
1071 iny ;\
1072 lda ptr1,y ;\
1073 eor #$FF ;\
1074 sta tmp2+1 ;\
1075
1076 #define COMW_II(ptr1,y1,ptr2,y2)\
1077 ldy #y1 ;\
1078 lda ptr1,y ;\
1079 eor #$FF ;\
1080 ldy #y2 ;\
1081 sta ptr2,y ;\
1082 ldy #y1+1 ;\
1083 lda ptr1,y ;\
1084 eor #$FF ;\
1085 ldy #y2+1 ;\
1086 sta ptr2+1 ;\
1087
1088 #define ANDW_DDD(tmp1,tmp2,tmp3)\
1089 lda tmp1 ;\
1090 and tmp2 ;\
1091 sta tmp3 ;\
1092 lda tmp1+1 ;\
1093 and tmp2+1 ;\
1094 sta tmp3+1 ;\
1095
1096 #define ANDW_IDD(ptr1,y1,tmp2,tmp3)\
1097 ldy #y1 ;\
1098 lda ptr1,y ;\
1099 and tmp2 ;\
1100 sta tmp3 ;\
1101 iny ;\
1102 lda ptr1,y ;\
1103 and tmp2+1 ;\
1104 sta tmp3+1 ;\
1105
1106 #define ANDW_DID(tmp1,ptr2,y2,tmp3)\
1107 lda tmp1 ;\
1108 ldy #y2 ;\
1109 and ptr2,y ;\
1110 sta tmp3 ;\
1111 iny ;\
1112 lda tmp1+1 ;\
1113 and ptr2,y ;\
1114 sta tmp3+1 ;\
1115
1116 #define ANDW_IID(ptr1,y1,ptr2,y2,tmp3)\
1117 ldy #y1 ;\
1118 lda ptr1,y ;\
1119 ldy #y2 ;\
1120 and ptr2,y ;\
1121 sta tmp3 ;\
1122 ldy #y1+1 ;\
1123 lda ptr1,y ;\
1124 ldy #y2+1 ;\
1125 and ptr2,y ;\
1126 sta tmp3+1 ;\
1127
1128 #define ANDW_DDI(tmp1,tmp2,ptr3,y3)\
1129 lda tmp1 ;\
1130 and tmp2 ;\
1131 ldy #y3 ;\
1132 sta ptr3,y ;\
1133 iny ;\
1134 lda tmp1+1 ;\
1135 and tmp2+1 ;\
1136 sta ptr3,y ;\
1137
1138 #define ANDW_IDI(ptr1,y1,tmp2,ptr3,y3)\
1139 ldy #y1 ;\
1140 lda ptr1,y ;\
1141 and tmp2 ;\
1142 ldy #y3 ;\
1143 sta ptr3,y ;\
1144 ldy #y1+1 ;\
1145 lda ptr1,y ;\
1146 and tmp2+1 ;\
1147 ldy #y3+1 ;\
1148 sta ptr3,y ;\
1149
1150 #define ANDW_DII(tmp1,ptr2,y2,ptr3,y3)\
1151 lda tmp1 ;\
1152 ldy #y2 ;\
1153 and ptr2,y ;\
1154 ldy #y3 ;\
1155 sta ptr3,y ;\
1156 lda tmp1+1 ;\
1157 ldy #y2+1 ;\
1158 and ptr2,y ;\
1159 ldy #y3+1 ;\
1160 sta ptr3,y ;\
1161
1162 #define ANDW_III(ptr1,y1,ptr2,y2,ptr3,y3)\
1163 ldy #y1 ;\
1164 lda ptr1,y ;\
1165 ldy #y2 ;\
1166 and ptr2,y ;\
1167 ldy #y3 ;\
1168 sta ptr3,y ;\
1169 ldy #y1+1 ;\
1170 lda ptr1,y ;\
1171 ldy #y2+1 ;\
1172 and ptr2,y ;\
1173 ldy #y3+1 ;\
1174 sta ptr3+1 ;\
1175
1176 #define ANDW_DCD(tmp2,cte1,tmp3)\
1177 lda #<(cte1) ;\
1178 and tmp2 ;\
1179 sta tmp3 ;\
1180 lda #>(cte1) ;\
1181 and tmp2+1 ;\
1182 sta tmp3+1 ;\
1183
1184 #define ANDW_ICD(ptr2,y2,cte1,tmp3)\
1185 lda #<(cte1) ;\
1186 ldy #y2 ;\
1187 and ptr2,y ;\
1188 sta tmp3 ;\
1189 iny ;\
1190 lda #>(cte1) ;\
1191 and ptr2,y ;\
1192 sta tmp3+1 ;\
1193
1194 #define ANDW_DCI(tmp2,cte1,ptr3,y3)\
1195 lda #<(cte1) ;\
1196 and tmp2 ;\
1197 ldy #y3 ;\
1198 sta ptr3,y ;\
1199 iny ;\
1200 lda #>(cte1) ;\
1201 and tmp2+1 ;\
1202 sta ptr3,y ;\
1203
1204 #define ANDW_ICI(ptr2,y2,cte1,ptr3,y3)\
1205 lda #<(cte1) ;\
1206 ldy #y2 ;\
1207 and ptr2,y ;\
1208 ldy #y3 ;\
1209 sta ptr3,y ;\
1210 lda #>(cte1) ;\
1211 ldy #y2+1 ;\
1212 and ptr2,y ;\
1213 ldy #y3+1 ;\
1214 sta ptr3,y ;\
1215
1216 #define XORW_DDD(tmp1,tmp2,tmp3)\
1217 lda tmp1 ;\
1218 eor tmp2 ;\
1219 sta tmp3 ;\
1220 lda tmp1+1 ;\
1221 eor tmp2+1 ;\
1222 sta tmp3+1 ;\
1223
1224 #define XORW_IDD(ptr1,y1,tmp2,tmp3)\
1225 ldy #y1 ;\
1226 lda ptr1,y ;\
1227 eor tmp2 ;\
1228 sta tmp3 ;\
1229 iny ;\
1230 lda ptr1,y ;\
1231 eor tmp2+1 ;\
1232 sta tmp3+1 ;\
1233
1234 #define XORW_DID(tmp1,ptr2,y2,tmp3)\
1235 lda tmp1 ;\
1236 ldy #y2 ;\
1237 eor ptr2,y ;\
1238 sta tmp3 ;\
1239 iny ;\
1240 lda tmp1+1 ;\
1241 eor ptr2,y ;\
1242 sta tmp3+1 ;\
1243
1244 #define XORW_IID(ptr1,y1,ptr2,y2,tmp3)\
1245 ldy #y1 ;\
1246 lda ptr1,y ;\
1247 ldy #y2 ;\
1248 eor ptr2,y ;\
1249 sta tmp3 ;\
1250 ldy #y1+1 ;\
1251 lda ptr1,y ;\
1252 ldy #y2+1 ;\
1253 eor ptr2,y ;\
1254 sta tmp3+1 ;\
1255
1256 #define XORW_DDI(tmp1,tmp2,ptr3,y3)\
1257 lda tmp1 ;\
1258 eor tmp2 ;\
1259 ldy #y3 ;\
1260 sta ptr3,y ;\
1261 iny ;\
1262 lda tmp1+1 ;\
1263 eor tmp2+1 ;\
1264 sta ptr3,y ;\
1265
1266 #define XORW_IDI(ptr1,y1,tmp2,ptr3,y3)\
1267 ldy #y1 ;\
1268 lda ptr1,y ;\
1269 eor tmp2 ;\
1270 ldy #y3 ;\
1271 sta ptr3,y ;\
1272 ldy #y1+1 ;\
1273 lda ptr1,y ;\
1274 eor tmp2+1 ;\
1275 ldy #y3+1 ;\
1276 sta ptr3,y ;\
1277
1278 #define XORW_DII(tmp1,ptr2,y2,ptr3,y3)\
1279 lda tmp1 ;\
1280 ldy #y2 ;\
1281 eor ptr2,y ;\
1282 ldy #y3 ;\
1283 sta ptr3,y ;\
1284 lda tmp1+1 ;\
1285 ldy #y2+1 ;\
1286 eor ptr2,y ;\
1287 ldy #y3+1 ;\
1288 sta ptr3,y ;\
1289
1290 #define XORW_III(ptr1,y1,ptr2,y2,ptr3,y3)\
1291 ldy #y1 ;\
1292 lda ptr1,y ;\
1293 ldy #y2 ;\
1294 eor ptr2,y ;\
1295 ldy #y3 ;\
1296 sta ptr3,y ;\
1297 ldy #y1+1 ;\
1298 lda ptr1,y ;\
1299 ldy #y2+1 ;\
1300 eor ptr2,y ;\
1301 ldy #y3+1 ;\
1302 sta ptr3+1 ;\
1303
1304 #define XORW_DCD(tmp2,cte1,tmp3)\
1305 lda #<(cte1) ;\
1306 eor tmp2 ;\
1307 sta tmp3 ;\
1308 lda #>(cte1) ;\
1309 eor tmp2+1 ;\
1310 sta tmp3+1 ;\
1311
1312 #define XORW_ICD(ptr2,y2,cte1,tmp3)\
1313 lda #<(cte1) ;\
1314 ldy #y2 ;\
1315 eor ptr2,y ;\
1316 sta tmp3 ;\
1317 iny ;\
1318 lda #>(cte1) ;\
1319 eor ptr2,y ;\
1320 sta tmp3+1 ;\
1321
1322 #define XORW_DCI(tmp2,cte1,ptr3,y3)\
1323 lda #<(cte1) ;\
1324 eor tmp2 ;\
1325 ldy #y3 ;\
1326 sta ptr3,y ;\
1327 iny ;\
1328 lda #>(cte1) ;\
1329 eor tmp2+1 ;\
1330 sta ptr3,y ;\
1331
1332 #define XORW_ICI(ptr2,y2,cte1,ptr3,y3)\
1333 lda #<(cte1) ;\
1334 ldy #y2 ;\
1335 eor ptr2,y ;\
1336 ldy #y3 ;\
1337 sta ptr3,y ;\
1338 lda #>(cte1) ;\
1339 ldy #y2+1 ;\
1340 eor ptr2,y ;\
1341 ldy #y3+1 ;\
1342 sta ptr3,y ;\
1343
1344 #define ORW_DDD(tmp1,tmp2,tmp3)\
1345 lda tmp1 ;\
1346 ora tmp2 ;\
1347 sta tmp3 ;\
1348 lda tmp1+1 ;\
1349 ora tmp2+1 ;\
1350 sta tmp3+1 ;\
1351
1352 #define ORW_IDD(ptr1,y1,tmp2,tmp3)\
1353 ldy #y1 ;\
1354 lda ptr1,y ;\
1355 ora tmp2 ;\
1356 sta tmp3 ;\
1357 iny ;\
1358 lda ptr1,y ;\
1359 ora tmp2+1 ;\
1360 sta tmp3+1 ;\
1361
1362 #define ORW_DID(tmp1,ptr2,y2,tmp3)\
1363 lda tmp1 ;\
1364 ldy #y2 ;\
1365 ora ptr2,y ;\
1366 sta tmp3 ;\
1367 iny ;\
1368 lda tmp1+1 ;\
1369 ora ptr2,y ;\
1370 sta tmp3+1 ;\
1371
1372 #define ORW_IID(ptr1,y1,ptr2,y2,tmp3)\
1373 ldy #y1 ;\
1374 lda ptr1,y ;\
1375 ldy #y2 ;\
1376 ora ptr2,y ;\
1377 sta tmp3 ;\
1378 ldy #y1+1 ;\
1379 lda ptr1,y ;\
1380 ldy #y2+1 ;\
1381 ora ptr2,y ;\
1382 sta tmp3+1 ;\
1383
1384 #define ORW_DDI(tmp1,tmp2,ptr3,y3)\
1385 lda tmp1 ;\
1386 ora tmp2 ;\
1387 ldy #y3 ;\
1388 sta ptr3,y ;\
1389 iny ;\
1390 lda tmp1+1 ;\
1391 ora tmp2+1 ;\
1392 sta ptr3,y ;\
1393
1394 #define ORW_IDI(ptr1,y1,tmp2,ptr3,y3)\
1395 ldy #y1 ;\
1396 lda ptr1,y ;\
1397 ora tmp2 ;\
1398 ldy #y3 ;\
1399 sta ptr3,y ;\
1400 ldy #y1+1 ;\
1401 lda ptr1,y ;\
1402 ora tmp2+1 ;\
1403 ldy #y3+1 ;\
1404 sta ptr3,y ;\
1405
1406 #define ORW_DII(tmp1,ptr2,y2,ptr3,y3)\
1407 lda tmp1 ;\
1408 ldy #y2 ;\
1409 ora ptr2,y ;\
1410 ldy #y3 ;\
1411 sta ptr3,y ;\
1412 lda tmp1+1 ;\
1413 ldy #y2+1 ;\
1414 ora ptr2,y ;\
1415 ldy #y3+1 ;\
1416 sta ptr3,y ;\
1417
1418 #define ORW_III(ptr1,y1,ptr2,y2,ptr3,y3)\
1419 ldy #y1 ;\
1420 lda ptr1,y ;\
1421 ldy #y2 ;\
1422 ora ptr2,y ;\
1423 ldy #y3 ;\
1424 sta ptr3,y ;\
1425 ldy #y1+1 ;\
1426 lda ptr1,y ;\
1427 ldy #y2+1 ;\
1428 ora ptr2,y ;\
1429 ldy #y3+1 ;\
1430 sta ptr3+1 ;\
1431
1432 #define ORW_DCD(tmp2,cte1,tmp3)\
1433 lda #<(cte1) ;\
1434 ora tmp2 ;\
1435 sta tmp3 ;\
1436 lda #>(cte1) ;\
1437 ora tmp2+1 ;\
1438 sta tmp3+1 ;\
1439
1440 #define ORW_ICD(ptr2,y2,cte1,tmp3)\
1441 lda #<(cte1) ;\
1442 ldy #y2 ;\
1443 ora ptr2,y ;\
1444 sta tmp3 ;\
1445 iny ;\
1446 lda #>(cte1) ;\
1447 ora ptr2,y ;\
1448 sta tmp3+1 ;\
1449
1450 #define ORW_DCI(tmp2,cte1,ptr3,y3)\
1451 lda #<(cte1) ;\
1452 ora tmp2 ;\
1453 ldy #y3 ;\
1454 sta ptr3,y ;\
1455 iny ;\
1456 lda #>(cte1) ;\
1457 ora tmp2+1 ;\
1458 sta ptr3,y ;\
1459
1460 #define ORW_ICI(ptr2,y2,cte1,ptr3,y3)\
1461 lda #<(cte1) ;\
1462 ldy #y2 ;\
1463 ora ptr2,y ;\
1464 ldy #y3 ;\
1465 sta ptr3,y ;\
1466 lda #>(cte1) ;\
1467 ldy #y2+1 ;\
1468 ora ptr2,y ;\
1469 ldy #y3+1 ;\
1470 sta ptr3,y ;\
1471
1472 #define DIVI_DDD(tmp1,tmp2,tmp3)\
1473 lda tmp1 ;\
1474 sta op1 ;\
1475 lda tmp1+1 ;\
1476 sta op1+1 ;\
1477 lda tmp2 ;\
1478 sta op2 ;\
1479 lda tmp2+1 ;\
1480 sta op2+1 ;\
1481 jsr div16i ;\
1482 stx tmp3 ;\
1483 sta tmp3+1 ;\
1484
1485 #define DIVI_IDD(ptr1,y1,tmp2,tmp3)\
1486 ldy #y1 ;\
1487 lda ptr1,y ;\
1488 sta op1 ;\
1489 iny ;\
1490 lda ptr1,y ;\
1491 sta op1+1 ;\
1492 lda tmp2 ;\
1493 sta op2 ;\
1494 lda tmp2+1 ;\
1495 sta op2+1 ;\
1496 jsr div16i ;\
1497 stx tmp3 ;\
1498 sta tmp3+1 ;\
1499
1500 #define DIVI_DID(tmp1,ptr2,y2,tmp3)\
1501 lda tmp1 ;\
1502 sta op1 ;\
1503 lda tmp1+1 ;\
1504 sta op1+1 ;\
1505 ldy #y2 ;\
1506 lda ptr2,y ;\
1507 sta op2 ;\
1508 iny ;\
1509 lda ptr2,y ;\
1510 sta op2+1 ;\
1511 jsr div16i ;\
1512 stx tmp3 ;\
1513 sta tmp3+1 ;\
1514
1515 #define DIVI_IID(ptr1,y1,ptr2,y2,tmp3)\
1516 ldy #y1 ;\
1517 lda ptr1,y ;\
1518 sta op1 ;\
1519 iny ;\
1520 lda ptr1,y ;\
1521 sta op1+1 ;\
1522 ldy #y2 ;\
1523 lda ptr2,y ;\
1524 sta op2 ;\
1525 iny ;\
1526 lda ptr2,y ;\
1527 sta op2+1 ;\
1528 jsr div16i ;\
1529 stx tmp3 ;\
1530 sta tmp3+1 ;\
1531
1532 #define DIVI_DDI(tmp1,tmp2,ptr3,y3)\
1533 lda tmp1 ;\
1534 sta op1 ;\
1535 lda tmp1+1 ;\
1536 sta op1+1 ;\
1537 lda tmp2 ;\
1538 sta op2 ;\
1539 lda tmp2+1 ;\
1540 sta op2+1 ;\
1541 jsr div16i ;\
1542 ldy #y3+1 ;\
1543 sta ptr3,y ;\
1544 dey ;\
1545 txa ;\
1546 sta ptr3,y ;\
1547
1548 #define DIVI_IDI(ptr1,y1,tmp2,ptr3,y3)\
1549 ldy #y1 ;\
1550 lda ptr1,y ;\
1551 sta op1 ;\
1552 iny ;\
1553 lda ptr1,y ;\
1554 sta op1+1 ;\
1555 lda tmp2 ;\
1556 sta op2 ;\
1557 lda tmp2+1 ;\
1558 sta op2+1 ;\
1559 jsr div16i ;\
1560 ldy #y3+1 ;\
1561 sta ptr3,y ;\
1562 dey ;\
1563 txa ;\
1564 sta ptr3,y ;\
1565
1566 #define DIVI_DII(tmp1,ptr2,y2,ptr3,y3)\
1567 lda tmp1 ;\
1568 sta op1 ;\
1569 lda tmp1+1 ;\
1570 sta op1+1 ;\
1571 ldy #y2 ;\
1572 lda ptr2,y ;\
1573 sta op2 ;\
1574 iny ;\
1575 lda ptr2,y ;\
1576 sta op2+1 ;\
1577 jsr div16i ;\
1578 ldy #y3+1 ;\
1579 sta ptr3,y ;\
1580 dey ;\
1581 txa ;\
1582 sta ptr3,y ;\
1583
1584 #define DIVI_III(ptr1,y1,ptr2,y2,ptr3,y3)\
1585 ldy #y1 ;\
1586 lda ptr1,y ;\
1587 sta op1 ;\
1588 iny ;\
1589 lda ptr1,y ;\
1590 sta op1+1 ;\
1591 ldy #y2 ;\
1592 lda ptr2,y ;\
1593 sta op2 ;\
1594 iny ;\
1595 lda ptr2,y ;\
1596 sta op2+1 ;\
1597 jsr div16i ;\
1598 ldy #y3+1 ;\
1599 sta ptr3,y ;\
1600 dey ;\
1601 txa ;\
1602 sta ptr3,y ;\
1603
1604 #define DIVI_CDD(cte1,tmp2,tmp3)\
1605 lda #<(cte1) ;\
1606 sta op1 ;\
1607 lda #>(cte1) ;\
1608 sta op1+1 ;\
1609 lda tmp2 ;\
1610 sta op2 ;\
1611 lda tmp2+1 ;\
1612 sta op2+1 ;\
1613 jsr div16i ;\
1614 stx tmp3 ;\
1615 sta tmp3+1 ;\
1616
1617 #define DIVI_CID(cte1,ptr2,y2,tmp3)\
1618 lda #<(cte1) ;\
1619 sta op1 ;\
1620 lda #>(cte1) ;\
1621 sta op1+1 ;\
1622 ldy #y2 ;\
1623 lda ptr2,y ;\
1624 sta op2 ;\
1625 iny ;\
1626 lda ptr2,y ;\
1627 sta op2+1 ;\
1628 jsr div16i ;\
1629 stx tmp3 ;\
1630 sta tmp3+1 ;\
1631
1632 #define DIVI_CDI(cte1,tmp2,ptr3,y3)\
1633 lda #<(cte1) ;\
1634 sta op1 ;\
1635 lda #>(cte1) ;\
1636 sta op1+1 ;\
1637 lda tmp2 ;\
1638 sta op2 ;\
1639 lda tmp2+1 ;\
1640 sta op2+1 ;\
1641 jsr div16i ;\
1642 ldy #y3+1 ;\
1643 sta ptr3,y ;\
1644 dey ;\
1645 txa ;\
1646 sta ptr3,y ;\
1647
1648 #define DIVI_CII(cte1,ptr2,y2,ptr3,y3)\
1649 lda #<(cte1) ;\
1650 sta op1 ;\
1651 lda #>(cte1) ;\
1652 sta op1+1 ;\
1653 ldy #y2 ;\
1654 lda ptr2,y ;\
1655 sta op2 ;\
1656 iny ;\
1657 lda ptr2,y ;\
1658 sta op2+1 ;\
1659 jsr div16i ;\
1660 ldy #y3+1 ;\
1661 sta ptr3,y ;\
1662 dey ;\
1663 txa ;\
1664 sta ptr3,y ;\
1665
1666 #define DIVI_DCD(tmp1,cte2,tmp3)\
1667 lda tmp1 ;\
1668 sta op1 ;\
1669 lda tmp1+1 ;\
1670 sta op1+1 ;\
1671 lda #<(cte2) ;\
1672 sta op2 ;\
1673 lda #>(cte2) ;\
1674 sta op2+1 ;\
1675 jsr div16i ;\
1676 stx tmp3 ;\
1677 sta tmp3+1 ;\
1678
1679 #define DIVI_ICD(ptr1,y1,cte2,tmp3)\
1680 ldy #y1 ;\
1681 lda ptr1,y ;\
1682 sta op1 ;\
1683 iny ;\
1684 lda ptr1,y ;\
1685 sta op1+1 ;\
1686 lda #<(cte2) ;\
1687 sta op2 ;\
1688 lda #>(cte2) ;\
1689 sta op2+1 ;\
1690 jsr div16i ;\
1691 stx tmp3 ;\
1692 sta tmp3+1 ;\
1693
1694 #define DIVI_DCI(tmp1,cte2,ptr3,y3)\
1695 lda tmp1 ;\
1696 sta op1 ;\
1697 lda tmp1+1 ;\
1698 sta op1+1 ;\
1699 lda #<(cte2) ;\
1700 sta op2 ;\
1701 lda #>(cte2) ;\
1702 sta op2+1 ;\
1703 jsr div16i ;\
1704 ldy #y3+1 ;\
1705 sta ptr3,y ;\
1706 dey ;\
1707 txa ;\
1708 sta ptr3,y ;\
1709
1710 #define DIVI_ICI(ptr1,y1,cte2,ptr3,y3)\
1711 ldy #y1 ;\
1712 lda ptr1,y ;\
1713 sta op1 ;\
1714 iny ;\
1715 lda ptr1,y ;\
1716 sta op1+1 ;\
1717 lda #<(cte2) ;\
1718 sta op2 ;\
1719 lda #>(cte2) ;\
1720 sta op2+1 ;\
1721 jsr div16i ;\
1722 ldy #y3+1 ;\
1723 sta ptr3,y ;\
1724 dey ;\
1725 txa ;\
1726 sta ptr3,y ;\
1727
1728 #define DIVU_DDD(tmp1,tmp2,tmp3)\
1729 lda tmp1 ;\
1730 sta op1 ;\
1731 lda tmp1+1 ;\
1732 sta op1+1 ;\
1733 lda tmp2 ;\
1734 sta op2 ;\
1735 lda tmp2+1 ;\
1736 sta op2+1 ;\
1737 jsr div16u ;\
1738 stx tmp3 ;\
1739 sta tmp3+1 ;\
1740
1741 #define DIVU_IDD(ptr1,y1,tmp2,tmp3)\
1742 ldy #y1 ;\
1743 lda ptr1,y ;\
1744 sta op1 ;\
1745 iny ;\
1746 lda ptr1,y ;\
1747 sta op1+1 ;\
1748 lda tmp2 ;\
1749 sta op2 ;\
1750 lda tmp2+1 ;\
1751 sta op2+1 ;\
1752 jsr div16u ;\
1753 stx tmp3 ;\
1754 sta tmp3+1 ;\
1755
1756 #define DIVU_DID(tmp1,ptr2,y2,tmp3)\
1757 lda tmp1 ;\
1758 sta op1 ;\
1759 lda tmp1+1 ;\
1760 sta op1+1 ;\
1761 ldy #y2 ;\
1762 lda ptr2,y ;\
1763 sta op2 ;\
1764 iny ;\
1765 lda ptr2,y ;\
1766 sta op2+1 ;\
1767 jsr div16u ;\
1768 stx tmp3 ;\
1769 sta tmp3+1 ;\
1770
1771 #define DIVU_IID(ptr1,y1,ptr2,y2,tmp3)\
1772 ldy #y1 ;\
1773 lda ptr1,y ;\
1774 sta op1 ;\
1775 iny ;\
1776 lda ptr1,y ;\
1777 sta op1+1 ;\
1778 ldy #y2 ;\
1779 lda ptr2,y ;\
1780 sta op2 ;\
1781 iny ;\
1782 lda ptr2,y ;\
1783 sta op2+1 ;\
1784 jsr div16u ;\
1785 stx tmp3 ;\
1786 sta tmp3+1 ;\
1787
1788 #define DIVU_DDI(tmp1,tmp2,ptr3,y3)\
1789 lda tmp1 ;\
1790 sta op1 ;\
1791 lda tmp1+1 ;\
1792 sta op1+1 ;\
1793 lda tmp2 ;\
1794 sta op2 ;\
1795 lda tmp2+1 ;\
1796 sta op2+1 ;\
1797 jsr div16u ;\
1798 ldy #y3+1 ;\
1799 sta ptr3,y ;\
1800 dey ;\
1801 txa ;\
1802 sta ptr3,y ;\
1803
1804 #define DIVU_IDI(ptr1,y1,tmp2,ptr3,y3)\
1805 ldy #y1 ;\
1806 lda ptr1,y ;\
1807 sta op1 ;\
1808 iny ;\
1809 lda ptr1,y ;\
1810 sta op1+1 ;\
1811 lda tmp2 ;\
1812 sta op2 ;\
1813 lda tmp2+1 ;\
1814 sta op2+1 ;\
1815 jsr div16u ;\
1816 ldy #y3+1 ;\
1817 sta ptr3,y ;\
1818 dey ;\
1819 txa ;\
1820 sta ptr3,y ;\
1821
1822 #define DIVU_DII(tmp1,ptr2,y2,ptr3,y3)\
1823 lda tmp1 ;\
1824 sta op1 ;\
1825 lda tmp1+1 ;\
1826 sta op1+1 ;\
1827 ldy #y2 ;\
1828 lda ptr2,y ;\
1829 sta op2 ;\
1830 iny ;\
1831 lda ptr2,y ;\
1832 sta op2+1 ;\
1833 jsr div16u ;\
1834 ldy #y3+1 ;\
1835 sta ptr3,y ;\
1836 dey ;\
1837 txa ;\
1838 sta ptr3,y ;\
1839
1840 #define DIVU_III(ptr1,y1,ptr2,y2,ptr3,y3)\
1841 ldy #y1 ;\
1842 lda ptr1,y ;\
1843 sta op1 ;\
1844 iny ;\
1845 lda ptr1,y ;\
1846 sta op1+1 ;\
1847 ldy #y2 ;\
1848 lda ptr2,y ;\
1849 sta op2 ;\
1850 iny ;\
1851 lda ptr2,y ;\
1852 sta op2+1 ;\
1853 jsr div16u ;\
1854 ldy #y3+1 ;\
1855 sta ptr3,y ;\
1856 dey ;\
1857 txa ;\
1858 sta ptr3,y ;\
1859
1860 #define DIVU_CDD(cte1,tmp2,tmp3)\
1861 lda #<(cte1) ;\
1862 sta op1 ;\
1863 lda #>(cte1) ;\
1864 sta op1+1 ;\
1865 lda tmp2 ;\
1866 sta op2 ;\
1867 lda tmp2+1 ;\
1868 sta op2+1 ;\
1869 jsr div16u ;\
1870 stx tmp3 ;\
1871 sta tmp3+1 ;\
1872
1873 #define DIVU_CID(cte1,ptr2,y2,tmp3)\
1874 lda #<(cte1) ;\
1875 sta op1 ;\
1876 lda #>(cte1) ;\
1877 sta op1+1 ;\
1878 ldy #y2 ;\
1879 lda ptr2,y ;\
1880 sta op2 ;\
1881 iny ;\
1882 lda ptr2,y ;\
1883 sta op2+1 ;\
1884 jsr div16u ;\
1885 stx tmp3 ;\
1886 sta tmp3+1 ;\
1887
1888 #define DIVU_CDI(cte1,tmp2,ptr3,y3)\
1889 lda #<(cte1) ;\
1890 sta op1 ;\
1891 lda #>(cte1) ;\
1892 sta op1+1 ;\
1893 lda tmp2 ;\
1894 sta op2 ;\
1895 lda tmp2+1 ;\
1896 sta op2+1 ;\
1897 jsr div16u ;\
1898 ldy #y3+1 ;\
1899 sta ptr3,y ;\
1900 dey ;\
1901 txa ;\
1902 sta ptr3,y ;\
1903
1904 #define DIVU_CII(cte1,ptr2,y2,ptr3,y3)\
1905 lda #<(cte1) ;\
1906 sta op1 ;\
1907 lda #>(cte1) ;\
1908 sta op1+1 ;\
1909 ldy #y2 ;\
1910 lda ptr2,y ;\
1911 sta op2 ;\
1912 iny ;\
1913 lda ptr2,y ;\
1914 sta op2+1 ;\
1915 jsr div16u ;\
1916 ldy #y3+1 ;\
1917 sta ptr3,y ;\
1918 dey ;\
1919 txa ;\
1920 sta ptr3,y ;\
1921
1922 #define DIVU_DCD(tmp1,cte2,tmp3)\
1923 lda tmp1 ;\
1924 sta op1 ;\
1925 lda tmp1+1 ;\
1926 sta op1+1 ;\
1927 lda #<(cte2) ;\
1928 sta op2 ;\
1929 lda #>(cte2) ;\
1930 sta op2+1 ;\
1931 jsr div16u ;\
1932 stx tmp3 ;\
1933 sta tmp3+1 ;\
1934
1935 #define DIVU_ICD(ptr1,y1,cte2,tmp3)\
1936 ldy #y1 ;\
1937 lda ptr1,y ;\
1938 sta op1 ;\
1939 iny ;\
1940 lda ptr1,y ;\
1941 sta op1+1 ;\
1942 lda #<(cte2) ;\
1943 sta op2 ;\
1944 lda #>(cte2) ;\
1945 sta op2+1 ;\
1946 jsr div16u ;\
1947 stx tmp3 ;\
1948 sta tmp3+1 ;\
1949
1950 #define DIVU_DCI(tmp1,cte2,ptr3,y3)\
1951 lda tmp1 ;\
1952 sta op1 ;\
1953 lda tmp1+1 ;\
1954 sta op1+1 ;\
1955 lda #<(cte2) ;\
1956 sta op2 ;\
1957 lda #>(cte2) ;\
1958 sta op2+1 ;\
1959 jsr div16u ;\
1960 ldy #y3+1 ;\
1961 sta ptr3,y ;\
1962 dey ;\
1963 txa ;\
1964 sta ptr3,y ;\
1965
1966 #define DIVU_ICI(ptr1,y1,cte2,ptr3,y3)\
1967 ldy #y1 ;\
1968 lda ptr1,y ;\
1969 sta op1 ;\
1970 iny ;\
1971 lda ptr1,y ;\
1972 sta op1+1 ;\
1973 lda #<(cte2) ;\
1974 sta op2 ;\
1975 lda #>(cte2) ;\
1976 sta op2+1 ;\
1977 jsr div16u ;\
1978 ldy #y3+1 ;\
1979 sta ptr3,y ;\
1980 dey ;\
1981 txa ;\
1982 sta ptr3,y ;\
1983
1984 #define MODU_DDD(tmp1,tmp2,tmp3)\
1985 lda tmp1 ;\
1986 sta op1 ;\
1987 lda tmp1+1 ;\
1988 sta op1+1 ;\
1989 lda tmp2 ;\
1990 sta op2 ;\
1991 lda tmp2+1 ;\
1992 sta op2+1 ;\
1993 jsr mod16u ;\
1994 stx tmp3 ;\
1995 sta tmp3+1 ;\
1996
1997 #define MODU_IDD(ptr1,y1,tmp2,tmp3)\
1998 ldy #y1 ;\
1999 lda ptr1,y ;\
2000 sta op1 ;\
2001 iny ;\
2002 lda ptr1,y ;\
2003 sta op1+1 ;\
2004 lda tmp2 ;\
2005 sta op2 ;\
2006 lda tmp2+1 ;\
2007 sta op2+1 ;\
2008 jsr mod16u ;\
2009 stx tmp3 ;\
2010 sta tmp3+1 ;\
2011
2012 #define MODU_DID(tmp1,ptr2,y2,tmp3)\
2013 lda tmp1 ;\
2014 sta op1 ;\
2015 lda tmp1+1 ;\
2016 sta op1+1 ;\
2017 ldy #y2 ;\
2018 lda ptr2,y ;\
2019 sta op2 ;\
2020 iny ;\
2021 lda ptr2,y ;\
2022 sta op2+1 ;\
2023 jsr mod16u ;\
2024 stx tmp3 ;\
2025 sta tmp3+1 ;\
2026
2027 #define MODU_IID(ptr1,y1,ptr2,y2,tmp3)\
2028 ldy #y1 ;\
2029 lda ptr1,y ;\
2030 sta op1 ;\
2031 iny ;\
2032 lda ptr1,y ;\
2033 sta op1+1 ;\
2034 ldy #y2 ;\
2035 lda ptr2,y ;\
2036 sta op2 ;\
2037 iny ;\
2038 lda ptr2,y ;\
2039 sta op2+1 ;\
2040 jsr mod16u ;\
2041 stx tmp3 ;\
2042 sta tmp3+1 ;\
2043
2044 #define MODU_DDI(tmp1,tmp2,ptr3,y3)\
2045 lda tmp1 ;\
2046 sta op1 ;\
2047 lda tmp1+1 ;\
2048 sta op1+1 ;\
2049 lda tmp2 ;\
2050 sta op2 ;\
2051 lda tmp2+1 ;\
2052 sta op2+1 ;\
2053 jsr mod16u ;\
2054 ldy #y3+1 ;\
2055 sta ptr3,y ;\
2056 dey ;\
2057 txa ;\
2058 sta ptr3,y ;\
2059
2060 #define MODU_IDI(ptr1,y1,tmp2,ptr3,y3)\
2061 ldy #y1 ;\
2062 lda ptr1,y ;\
2063 sta op1 ;\
2064 iny ;\
2065 lda ptr1,y ;\
2066 sta op1+1 ;\
2067 lda tmp2 ;\
2068 sta op2 ;\
2069 lda tmp2+1 ;\
2070 sta op2+1 ;\
2071 jsr mod16u ;\
2072 ldy #y3+1 ;\
2073 sta ptr3,y ;\
2074 dey ;\
2075 txa ;\
2076 sta ptr3,y ;\
2077
2078 #define MODU_DII(tmp1,ptr2,y2,ptr3,y3)\
2079 lda tmp1 ;\
2080 sta op1 ;\
2081 lda tmp1+1 ;\
2082 sta op1+1 ;\
2083 ldy #y2 ;\
2084 lda ptr2,y ;\
2085 sta op2 ;\
2086 iny ;\
2087 lda ptr2,y ;\
2088 sta op2+1 ;\
2089 jsr mod16u ;\
2090 ldy #y3+1 ;\
2091 sta ptr3,y ;\
2092 dey ;\
2093 txa ;\
2094 sta ptr3,y ;\
2095
2096 #define MODU_III(ptr1,y1,ptr2,y2,ptr3,y3)\
2097 ldy #y1 ;\
2098 lda ptr1,y ;\
2099 sta op1 ;\
2100 iny ;\
2101 lda ptr1,y ;\
2102 sta op1+1 ;\
2103 ldy #y2 ;\
2104 lda ptr2,y ;\
2105 sta op2 ;\
2106 iny ;\
2107 lda ptr2,y ;\
2108 sta op2+1 ;\
2109 jsr mod16u ;\
2110 ldy #y3+1 ;\
2111 sta ptr3,y ;\
2112 dey ;\
2113 txa ;\
2114 sta ptr3,y ;\
2115
2116 #define MODU_CDD(cte1,tmp2,tmp3)\
2117 lda #<(cte1) ;\
2118 sta op1 ;\
2119 lda #>(cte1) ;\
2120 sta op1+1 ;\
2121 lda tmp2 ;\
2122 sta op2 ;\
2123 lda tmp2+1 ;\
2124 sta op2+1 ;\
2125 jsr mod16u ;\
2126 stx tmp3 ;\
2127 sta tmp3+1 ;\
2128
2129 #define MODU_CID(cte1,ptr2,y2,tmp3)\
2130 lda #<(cte1) ;\
2131 sta op1 ;\
2132 lda #>(cte1) ;\
2133 sta op1+1 ;\
2134 ldy #y2 ;\
2135 lda ptr2,y ;\
2136 sta op2 ;\
2137 iny ;\
2138 lda ptr2,y ;\
2139 sta op2+1 ;\
2140 jsr mod16u ;\
2141 stx tmp3 ;\
2142 sta tmp3+1 ;\
2143
2144 #define MODU_CDI(cte1,tmp2,ptr3,y3)\
2145 lda #<(cte1) ;\
2146 sta op1 ;\
2147 lda #>(cte1) ;\
2148 sta op1+1 ;\
2149 lda tmp2 ;\
2150 sta op2 ;\
2151 lda tmp2+1 ;\
2152 sta op2+1 ;\
2153 jsr mod16u ;\
2154 ldy #y3+1 ;\
2155 sta ptr3,y ;\
2156 dey ;\
2157 txa ;\
2158 sta ptr3,y ;\
2159
2160 #define MODU_CII(cte1,ptr2,y2,ptr3,y3)\
2161 lda #<(cte1) ;\
2162 sta op1 ;\
2163 lda #>(cte1) ;\
2164 sta op1+1 ;\
2165 ldy #y2 ;\
2166 lda ptr2,y ;\
2167 sta op2 ;\
2168 iny ;\
2169 lda ptr2,y ;\
2170 sta op2+1 ;\
2171 jsr mod16u ;\
2172 ldy #y3+1 ;\
2173 sta ptr3,y ;\
2174 dey ;\
2175 txa ;\
2176 sta ptr3,y ;\
2177
2178 #define MODU_DCD(tmp1,cte2,tmp3)\
2179 lda tmp1 ;\
2180 sta op1 ;\
2181 lda tmp1+1 ;\
2182 sta op1+1 ;\
2183 lda #<(cte2) ;\
2184 sta op2 ;\
2185 lda #>(cte2) ;\
2186 sta op2+1 ;\
2187 jsr mod16u ;\
2188 stx tmp3 ;\
2189 sta tmp3+1 ;\
2190
2191 #define MODU_ICD(ptr1,y1,cte2,tmp3)\
2192 ldy #y1 ;\
2193 lda ptr1,y ;\
2194 sta op1 ;\
2195 iny ;\
2196 lda ptr1,y ;\
2197 sta op1+1 ;\
2198 lda #<(cte2) ;\
2199 sta op2 ;\
2200 lda #>(cte2) ;\
2201 sta op2+1 ;\
2202 jsr mod16u ;\
2203 stx tmp3 ;\
2204 sta tmp3+1 ;\
2205
2206 #define MODU_DCI(tmp1,cte2,ptr3,y3)\
2207 lda tmp1 ;\
2208 sta op1 ;\
2209 lda tmp1+1 ;\
2210 sta op1+1 ;\
2211 lda #<(cte2) ;\
2212 sta op2 ;\
2213 lda #>(cte2) ;\
2214 sta op2+1 ;\
2215 jsr mod16u ;\
2216 ldy #y3+1 ;\
2217 sta ptr3,y ;\
2218 dey ;\
2219 txa ;\
2220 sta ptr3,y ;\
2221
2222 #define MODU_ICI(ptr1,y1,cte2,ptr3,y3)\
2223 ldy #y1 ;\
2224 lda ptr1,y ;\
2225 sta op1 ;\
2226 iny ;\
2227 lda ptr1,y ;\
2228 sta op1+1 ;\
2229 lda #<(cte2) ;\
2230 sta op2 ;\
2231 lda #>(cte2) ;\
2232 sta op2+1 ;\
2233 jsr mod16u ;\
2234 ldy #y3+1 ;\
2235 sta ptr3,y ;\
2236 dey ;\
2237 txa ;\
2238 sta ptr3,y ;\
2239
2240 #define MODI_DDD(tmp1,tmp2,tmp3)\
2241 lda tmp1 ;\
2242 sta op1 ;\
2243 lda tmp1+1 ;\
2244 sta op1+1 ;\
2245 lda tmp2 ;\
2246 sta op2 ;\
2247 lda tmp2+1 ;\
2248 sta op2+1 ;\
2249 jsr mod16i ;\
2250 stx tmp3 ;\
2251 sta tmp3+1 ;\
2252
2253 #define MODI_IDD(ptr1,y1,tmp2,tmp3)\
2254 ldy #y1 ;\
2255 lda ptr1,y ;\
2256 sta op1 ;\
2257 iny ;\
2258 lda ptr1,y ;\
2259 sta op1+1 ;\
2260 lda tmp2 ;\
2261 sta op2 ;\
2262 lda tmp2+1 ;\
2263 sta op2+1 ;\
2264 jsr mod16i ;\
2265 stx tmp3 ;\
2266 sta tmp3+1 ;\
2267
2268 #define MODI_DID(tmp1,ptr2,y2,tmp3)\
2269 lda tmp1 ;\
2270 sta op1 ;\
2271 lda tmp1+1 ;\
2272 sta op1+1 ;\
2273 ldy #y2 ;\
2274 lda ptr2,y ;\
2275 sta op2 ;\
2276 iny ;\
2277 lda ptr2,y ;\
2278 sta op2+1 ;\
2279 jsr mod16i ;\
2280 stx tmp3 ;\
2281 sta tmp3+1 ;\
2282
2283 #define MODI_IID(ptr1,y1,ptr2,y2,tmp3)\
2284 ldy #y1 ;\
2285 lda ptr1,y ;\
2286 sta op1 ;\
2287 iny ;\
2288 lda ptr1,y ;\
2289 sta op1+1 ;\
2290 ldy #y2 ;\
2291 lda ptr2,y ;\
2292 sta op2 ;\
2293 iny ;\
2294 lda ptr2,y ;\
2295 sta op2+1 ;\
2296 jsr mod16i ;\
2297 stx tmp3 ;\
2298 sta tmp3+1 ;\
2299
2300 #define MODI_DDI(tmp1,tmp2,ptr3,y3)\
2301 lda tmp1 ;\
2302 sta op1 ;\
2303 lda tmp1+1 ;\
2304 sta op1+1 ;\
2305 lda tmp2 ;\
2306 sta op2 ;\
2307 lda tmp2+1 ;\
2308 sta op2+1 ;\
2309 jsr mod16i ;\
2310 ldy #y3+1 ;\
2311 sta ptr3,y ;\
2312 dey ;\
2313 txa ;\
2314 sta ptr3,y ;\
2315
2316 #define MODI_IDI(ptr1,y1,tmp2,ptr3,y3)\
2317 ldy #y1 ;\
2318 lda ptr1,y ;\
2319 sta op1 ;\
2320 iny ;\
2321 lda ptr1,y ;\
2322 sta op1+1 ;\
2323 lda tmp2 ;\
2324 sta op2 ;\
2325 lda tmp2+1 ;\
2326 sta op2+1 ;\
2327 jsr mod16i ;\
2328 ldy #y3+1 ;\
2329 sta ptr3,y ;\
2330 dey ;\
2331 txa ;\
2332 sta ptr3,y ;\
2333
2334 #define MODI_DII(tmp1,ptr2,y2,ptr3,y3)\
2335 lda tmp1 ;\
2336 sta op1 ;\
2337 lda tmp1+1 ;\
2338 sta op1+1 ;\
2339 ldy #y2 ;\
2340 lda ptr2,y ;\
2341 sta op2 ;\
2342 iny ;\
2343 lda ptr2,y ;\
2344 sta op2+1 ;\
2345 jsr mod16i ;\
2346 ldy #y3+1 ;\
2347 sta ptr3,y ;\
2348 dey ;\
2349 txa ;\
2350 sta ptr3,y ;\
2351
2352 #define MODI_III(ptr1,y1,ptr2,y2,ptr3,y3)\
2353 ldy #y1 ;\
2354 lda ptr1,y ;\
2355 sta op1 ;\
2356 iny ;\
2357 lda ptr1,y ;\
2358 sta op1+1 ;\
2359 ldy #y2 ;\
2360 lda ptr2,y ;\
2361 sta op2 ;\
2362 iny ;\
2363 lda ptr2,y ;\
2364 sta op2+1 ;\
2365 jsr mod16i ;\
2366 ldy #y3+1 ;\
2367 sta ptr3,y ;\
2368 dey ;\
2369 txa ;\
2370 sta ptr3,y ;\
2371
2372 #define MODI_CDD(cte1,tmp2,tmp3)\
2373 lda #<(cte1) ;\
2374 sta op1 ;\
2375 lda #>(cte1) ;\
2376 sta op1+1 ;\
2377 lda tmp2 ;\
2378 sta op2 ;\
2379 lda tmp2+1 ;\
2380 sta op2+1 ;\
2381 jsr mod16i ;\
2382 stx tmp3 ;\
2383 sta tmp3+1 ;\
2384
2385 #define MODI_CID(cte1,ptr2,y2,tmp3)\
2386 lda #<(cte1) ;\
2387 sta op1 ;\
2388 lda #>(cte1) ;\
2389 sta op1+1 ;\
2390 ldy #y2 ;\
2391 lda ptr2,y ;\
2392 sta op2 ;\
2393 iny ;\
2394 lda ptr2,y ;\
2395 sta op2+1 ;\
2396 jsr mod16i ;\
2397 stx tmp3 ;\
2398 sta tmp3+1 ;\
2399
2400 #define MODI_CDI(cte1,tmp2,ptr3,y3)\
2401 lda #<(cte1) ;\
2402 sta op1 ;\
2403 lda #>(cte1) ;\
2404 sta op1+1 ;\
2405 lda tmp2 ;\
2406 sta op2 ;\
2407 lda tmp2+1 ;\
2408 sta op2+1 ;\
2409 jsr mod16i ;\
2410 ldy #y3+1 ;\
2411 sta ptr3,y ;\
2412 dey ;\
2413 txa ;\
2414 sta ptr3,y ;\
2415
2416 #define MODI_CII(cte1,ptr2,y2,ptr3,y3)\
2417 lda #<(cte1) ;\
2418 sta op1 ;\
2419 lda #>(cte1) ;\
2420 sta op1+1 ;\
2421 ldy #y2 ;\
2422 lda ptr2,y ;\
2423 sta op2 ;\
2424 iny ;\
2425 lda ptr2,y ;\
2426 sta op2+1 ;\
2427 jsr mod16i ;\
2428 ldy #y3+1 ;\
2429 sta ptr3,y ;\
2430 dey ;\
2431 txa ;\
2432 sta ptr3,y ;\
2433
2434 #define MODI_DCD(tmp1,cte2,tmp3)\
2435 lda tmp1 ;\
2436 sta op1 ;\
2437 lda tmp1+1 ;\
2438 sta op1+1 ;\
2439 lda #<(cte2) ;\
2440 sta op2 ;\
2441 lda #>(cte2) ;\
2442 sta op2+1 ;\
2443 jsr mod16i ;\
2444 stx tmp3 ;\
2445 sta tmp3+1 ;\
2446
2447 #define MODI_ICD(ptr1,y1,cte2,tmp3)\
2448 ldy #y1 ;\
2449 lda ptr1,y ;\
2450 sta op1 ;\
2451 iny ;\
2452 lda ptr1,y ;\
2453 sta op1+1 ;\
2454 lda #<(cte2) ;\
2455 sta op2 ;\
2456 lda #>(cte2) ;\
2457 sta op2+1 ;\
2458 jsr mod16i ;\
2459 stx tmp3 ;\
2460 sta tmp3+1 ;\
2461
2462 #define MODI_DCI(tmp1,cte2,ptr3,y3)\
2463 lda tmp1 ;\
2464 sta op1 ;\
2465 lda tmp1+1 ;\
2466 sta op1+1 ;\
2467 lda #<(cte2) ;\
2468 sta op2 ;\
2469 lda #>(cte2) ;\
2470 sta op2+1 ;\
2471 jsr mod16i ;\
2472 ldy #y3+1 ;\
2473 sta ptr3,y ;\
2474 dey ;\
2475 txa ;\
2476 sta ptr3,y ;\
2477
2478 #define MODI_ICI(ptr1,y1,cte2,ptr3,y3)\
2479 ldy #y1 ;\
2480 lda ptr1,y ;\
2481 sta op1 ;\
2482 iny ;\
2483 lda ptr1,y ;\
2484 sta op1+1 ;\
2485 lda #<(cte2) ;\
2486 sta op2 ;\
2487 lda #>(cte2) ;\
2488 sta op2+1 ;\
2489 jsr mod16i ;\
2490 ldy #y3+1 ;\
2491 sta ptr3,y ;\
2492 dey ;\
2493 txa ;\
2494 sta ptr3,y ;\
2495
2496 #define MULU_DDD(tmp1,tmp2,tmp3)\
2497 lda tmp1 ;\
2498 sta op1 ;\
2499 lda tmp1+1 ;\
2500 sta op1+1 ;\
2501 lda tmp2 ;\
2502 sta op2 ;\
2503 lda tmp2+1 ;\
2504 sta op2+1 ;\
2505 jsr mul16u ;\
2506 stx tmp3 ;\
2507 sta tmp3+1 ;\
2508
2509 #define MULU_IDD(ptr1,y1,tmp2,tmp3)\
2510 ldy #y1 ;\
2511 lda ptr1,y ;\
2512 sta op1 ;\
2513 iny ;\
2514 lda ptr1,y ;\
2515 sta op1+1 ;\
2516 lda tmp2 ;\
2517 sta op2 ;\
2518 lda tmp2+1 ;\
2519 sta op2+1 ;\
2520 jsr mul16u ;\
2521 stx tmp3 ;\
2522 sta tmp3+1 ;\
2523
2524 #define MULU_DID(tmp1,ptr2,y2,tmp3)\
2525 lda tmp1 ;\
2526 sta op1 ;\
2527 lda tmp1+1 ;\
2528 sta op1+1 ;\
2529 ldy #y2 ;\
2530 lda ptr2,y ;\
2531 sta op2 ;\
2532 iny ;\
2533 lda ptr2,y ;\
2534 sta op2+1 ;\
2535 jsr mul16u ;\
2536 stx tmp3 ;\
2537 sta tmp3+1 ;\
2538
2539 #define MULU_IID(ptr1,y1,ptr2,y2,tmp3)\
2540 ldy #y1 ;\
2541 lda ptr1,y ;\
2542 sta op1 ;\
2543 iny ;\
2544 lda ptr1,y ;\
2545 sta op1+1 ;\
2546 ldy #y2 ;\
2547 lda ptr2,y ;\
2548 sta op2 ;\
2549 iny ;\
2550 lda ptr2,y ;\
2551 sta op2+1 ;\
2552 jsr mul16u ;\
2553 stx tmp3 ;\
2554 sta tmp3+1 ;\
2555
2556 #define MULU_DDI(tmp1,tmp2,ptr3,y3)\
2557 lda tmp1 ;\
2558 sta op1 ;\
2559 lda tmp1+1 ;\
2560 sta op1+1 ;\
2561 lda tmp2 ;\
2562 sta op2 ;\
2563 lda tmp2+1 ;\
2564 sta op2+1 ;\
2565 jsr mul16u ;\
2566 ldy #y3+1 ;\
2567 sta ptr3,y ;\
2568 dey ;\
2569 txa ;\
2570 sta ptr3,y ;\
2571
2572 #define MULU_IDI(ptr1,y1,tmp2,ptr3,y3)\
2573 ldy #y1 ;\
2574 lda ptr1,y ;\
2575 sta op1 ;\
2576 iny ;\
2577 lda ptr1,y ;\
2578 sta op1+1 ;\
2579 lda tmp2 ;\
2580 sta op2 ;\
2581 lda tmp2+1 ;\
2582 sta op2+1 ;\
2583 jsr mul16u ;\
2584 ldy #y3+1 ;\
2585 sta ptr3,y ;\
2586 dey ;\
2587 txa ;\
2588 sta ptr3,y ;\
2589
2590 #define MULU_DII(tmp1,ptr2,y2,ptr3,y3)\
2591 lda tmp1 ;\
2592 sta op1 ;\
2593 lda tmp1+1 ;\
2594 sta op1+1 ;\
2595 ldy #y2 ;\
2596 lda ptr2,y ;\
2597 sta op2 ;\
2598 iny ;\
2599 lda ptr2,y ;\
2600 sta op2+1 ;\
2601 jsr mul16u ;\
2602 ldy #y3+1 ;\
2603 sta ptr3,y ;\
2604 dey ;\
2605 txa ;\
2606 sta ptr3,y ;\
2607
2608 #define MULU_III(ptr1,y1,ptr2,y2,ptr3,y3)\
2609 ldy #y1 ;\
2610 lda ptr1,y ;\
2611 sta op1 ;\
2612 iny ;\
2613 lda ptr1,y ;\
2614 sta op1+1 ;\
2615 ldy #y2 ;\
2616 lda ptr2,y ;\
2617 sta op2 ;\
2618 iny ;\
2619 lda ptr2,y ;\
2620 sta op2+1 ;\
2621 jsr mul16u ;\
2622 ldy #y3+1 ;\
2623 sta ptr3,y ;\
2624 dey ;\
2625 txa ;\
2626 sta ptr3,y ;\
2627
2628 #define MULU_CDD(cte1,tmp2,tmp3)\
2629 lda #<(cte1) ;\
2630 sta op1 ;\
2631 lda #>(cte1) ;\
2632 sta op1+1 ;\
2633 lda tmp2 ;\
2634 sta op2 ;\
2635 lda tmp2+1 ;\
2636 sta op2+1 ;\
2637 jsr mul16u ;\
2638 stx tmp3 ;\
2639 sta tmp3+1 ;\
2640
2641 #define MULU_CID(cte1,ptr2,y2,tmp3)\
2642 lda #<(cte1) ;\
2643 sta op1 ;\
2644 lda #>(cte1) ;\
2645 sta op1+1 ;\
2646 ldy #y2 ;\
2647 lda ptr2,y ;\
2648 sta op2 ;\
2649 iny ;\
2650 lda ptr2,y ;\
2651 sta op2+1 ;\
2652 jsr mul16u ;\
2653 stx tmp3 ;\
2654 sta tmp3+1 ;\
2655
2656 #define MULU_CDI(cte1,tmp2,ptr3,y3)\
2657 lda #<(cte1) ;\
2658 sta op1 ;\
2659 lda #>(cte1) ;\
2660 sta op1+1 ;\
2661 lda tmp2 ;\
2662 sta op2 ;\
2663 lda tmp2+1 ;\
2664 sta op2+1 ;\
2665 jsr mul16u ;\
2666 ldy #y3+1 ;\
2667 sta ptr3,y ;\
2668 dey ;\
2669 txa ;\
2670 sta ptr3,y ;\
2671
2672 #define MULU_CII(cte1,ptr2,y2,ptr3,y3)\
2673 lda #<(cte1) ;\
2674 sta op1 ;\
2675 lda #>(cte1) ;\
2676 sta op1+1 ;\
2677 ldy #y2 ;\
2678 lda ptr2,y ;\
2679 sta op2 ;\
2680 iny ;\
2681 lda ptr2,y ;\
2682 sta op2+1 ;\
2683 jsr mul16u ;\
2684 ldy #y3+1 ;\
2685 sta ptr3,y ;\
2686 dey ;\
2687 txa ;\
2688 sta ptr3,y ;\
2689
2690 #define MULU_DCD(tmp1,cte2,tmp3)\
2691 lda tmp1 ;\
2692 sta op1 ;\
2693 lda tmp1+1 ;\
2694 sta op1+1 ;\
2695 lda #<(cte2) ;\
2696 sta op2 ;\
2697 lda #>(cte2) ;\
2698 sta op2+1 ;\
2699 jsr mul16u ;\
2700 stx tmp3 ;\
2701 sta tmp3+1 ;\
2702
2703 #define MULU_ICD(ptr1,y1,cte2,tmp3)\
2704 ldy #y1 ;\
2705 lda ptr1,y ;\
2706 sta op1 ;\
2707 iny ;\
2708 lda ptr1,y ;\
2709 sta op1+1 ;\
2710 lda #<(cte2) ;\
2711 sta op2 ;\
2712 lda #>(cte2) ;\
2713 sta op2+1 ;\
2714 jsr mul16u ;\
2715 stx tmp3 ;\
2716 sta tmp3+1 ;\
2717
2718 #define MULU_DCI(tmp1,cte2,ptr3,y3)\
2719 lda tmp1 ;\
2720 sta op1 ;\
2721 lda tmp1+1 ;\
2722 sta op1+1 ;\
2723 lda #<(cte2) ;\
2724 sta op2 ;\
2725 lda #>(cte2) ;\
2726 sta op2+1 ;\
2727 jsr mul16u ;\
2728 ldy #y3+1 ;\
2729 sta ptr3,y ;\
2730 dey ;\
2731 txa ;\
2732 sta ptr3,y ;\
2733
2734 #define MULU_ICI(ptr1,y1,cte2,ptr3,y3)\
2735 ldy #y1 ;\
2736 lda ptr1,y ;\
2737 sta op1 ;\
2738 iny ;\
2739 lda ptr1,y ;\
2740 sta op1+1 ;\
2741 lda #<(cte2) ;\
2742 sta op2 ;\
2743 lda #>(cte2) ;\
2744 sta op2+1 ;\
2745 jsr mul16u ;\
2746 ldy #y3+1 ;\
2747 sta ptr3,y ;\
2748 dey ;\
2749 txa ;\
2750 sta ptr3,y ;\
2751
2752 #define MULI_DDD(tmp1,tmp2,tmp3)\
2753 lda tmp1 ;\
2754 sta op1 ;\
2755 lda tmp1+1 ;\
2756 sta op1+1 ;\
2757 lda tmp2 ;\
2758 sta op2 ;\
2759 lda tmp2+1 ;\
2760 sta op2+1 ;\
2761 jsr mul16i ;\
2762 stx tmp3 ;\
2763 sta tmp3+1 ;\
2764
2765 #define MULI_IDD(ptr1,y1,tmp2,tmp3)\
2766 ldy #y1 ;\
2767 lda ptr1,y ;\
2768 sta op1 ;\
2769 iny ;\
2770 lda ptr1,y ;\
2771 sta op1+1 ;\
2772 lda tmp2 ;\
2773 sta op2 ;\
2774 lda tmp2+1 ;\
2775 sta op2+1 ;\
2776 jsr mul16i ;\
2777 stx tmp3 ;\
2778 sta tmp3+1 ;\
2779
2780 #define MULI_DID(tmp1,ptr2,y2,tmp3)\
2781 lda tmp1 ;\
2782 sta op1 ;\
2783 lda tmp1+1 ;\
2784 sta op1+1 ;\
2785 ldy #y2 ;\
2786 lda ptr2,y ;\
2787 sta op2 ;\
2788 iny ;\
2789 lda ptr2,y ;\
2790 sta op2+1 ;\
2791 jsr mul16i ;\
2792 stx tmp3 ;\
2793 sta tmp3+1 ;\
2794
2795 #define MULI_IID(ptr1,y1,ptr2,y2,tmp3)\
2796 ldy #y1 ;\
2797 lda ptr1,y ;\
2798 sta op1 ;\
2799 iny ;\
2800 lda ptr1,y ;\
2801 sta op1+1 ;\
2802 ldy #y2 ;\
2803 lda ptr2,y ;\
2804 sta op2 ;\
2805 iny ;\
2806 lda ptr2,y ;\
2807 sta op2+1 ;\
2808 jsr mul16i ;\
2809 stx tmp3 ;\
2810 sta tmp3+1 ;\
2811
2812 #define MULI_DDI(tmp1,tmp2,ptr3,y3)\
2813 lda tmp1 ;\
2814 sta op1 ;\
2815 lda tmp1+1 ;\
2816 sta op1+1 ;\
2817 lda tmp2 ;\
2818 sta op2 ;\
2819 lda tmp2+1 ;\
2820 sta op2+1 ;\
2821 jsr mul16i ;\
2822 ldy #y3+1 ;\
2823 sta ptr3,y ;\
2824 dey ;\
2825 txa ;\
2826 sta ptr3,y ;\
2827
2828 #define MULI_IDI(ptr1,y1,tmp2,ptr3,y3)\
2829 ldy #y1 ;\
2830 lda ptr1,y ;\
2831 sta op1 ;\
2832 iny ;\
2833 lda ptr1,y ;\
2834 sta op1+1 ;\
2835 lda tmp2 ;\
2836 sta op2 ;\
2837 lda tmp2+1 ;\
2838 sta op2+1 ;\
2839 jsr mul16i ;\
2840 ldy #y3+1 ;\
2841 sta ptr3,y ;\
2842 dey ;\
2843 txa ;\
2844 sta ptr3,y ;\
2845
2846 #define MULI_DII(tmp1,ptr2,y2,ptr3,y3)\
2847 lda tmp1 ;\
2848 sta op1 ;\
2849 lda tmp1+1 ;\
2850 sta op1+1 ;\
2851 ldy #y2 ;\
2852 lda ptr2,y ;\
2853 sta op2 ;\
2854 iny ;\
2855 lda ptr2,y ;\
2856 sta op2+1 ;\
2857 jsr mul16i ;\
2858 ldy #y3+1 ;\
2859 sta ptr3,y ;\
2860 dey ;\
2861 txa ;\
2862 sta ptr3,y ;\
2863
2864 #define MULI_III(ptr1,y1,ptr2,y2,ptr3,y3)\
2865 ldy #y1 ;\
2866 lda ptr1,y ;\
2867 sta op1 ;\
2868 iny ;\
2869 lda ptr1,y ;\
2870 sta op1+1 ;\
2871 ldy #y2 ;\
2872 lda ptr2,y ;\
2873 sta op2 ;\
2874 iny ;\
2875 lda ptr2,y ;\
2876 sta op2+1 ;\
2877 jsr mul16i ;\
2878 ldy #y3+1 ;\
2879 sta ptr3,y ;\
2880 dey ;\
2881 txa ;\
2882 sta ptr3,y ;\
2883
2884 #define MULI_CDD(cte1,tmp2,tmp3)\
2885 lda #<(cte1) ;\
2886 sta op1 ;\
2887 lda #>(cte1) ;\
2888 sta op1+1 ;\
2889 lda tmp2 ;\
2890 sta op2 ;\
2891 lda tmp2+1 ;\
2892 sta op2+1 ;\
2893 jsr mul16i ;\
2894 stx tmp3 ;\
2895 sta tmp3+1 ;\
2896
2897 #define MULI_CID(cte1,ptr2,y2,tmp3)\
2898 lda #<(cte1) ;\
2899 sta op1 ;\
2900 lda #>(cte1) ;\
2901 sta op1+1 ;\
2902 ldy #y2 ;\
2903 lda ptr2,y ;\
2904 sta op2 ;\
2905 iny ;\
2906 lda ptr2,y ;\
2907 sta op2+1 ;\
2908 jsr mul16i ;\
2909 stx tmp3 ;\
2910 sta tmp3+1 ;\
2911
2912 #define MULI_CDI(cte1,tmp2,ptr3,y3)\
2913 lda #<(cte1) ;\
2914 sta op1 ;\
2915 lda #>(cte1) ;\
2916 sta op1+1 ;\
2917 lda tmp2 ;\
2918 sta op2 ;\
2919 lda tmp2+1 ;\
2920 sta op2+1 ;\
2921 jsr mul16i ;\
2922 ldy #y3+1 ;\
2923 sta ptr3,y ;\
2924 dey ;\
2925 txa ;\
2926 sta ptr3,y ;\
2927
2928 #define MULI_CII(cte1,ptr2,y2,ptr3,y3)\
2929 lda #<(cte1) ;\
2930 sta op1 ;\
2931 lda #>(cte1) ;\
2932 sta op1+1 ;\
2933 ldy #y2 ;\
2934 lda ptr2,y ;\
2935 sta op2 ;\
2936 iny ;\
2937 lda ptr2,y ;\
2938 sta op2+1 ;\
2939 jsr mul16i ;\
2940 ldy #y3+1 ;\
2941 sta ptr3,y ;\
2942 dey ;\
2943 txa ;\
2944 sta ptr3,y ;\
2945
2946 #define MULI_DCD(tmp1,cte2,tmp3)\
2947 lda tmp1 ;\
2948 sta op1 ;\
2949 lda tmp1+1 ;\
2950 sta op1+1 ;\
2951 lda #<(cte2) ;\
2952 sta op2 ;\
2953 lda #>(cte2) ;\
2954 sta op2+1 ;\
2955 jsr mul16i ;\
2956 stx tmp3 ;\
2957 sta tmp3+1 ;\
2958
2959 #define MULI_ICD(ptr1,y1,cte2,tmp3)\
2960 ldy #y1 ;\
2961 lda ptr1,y ;\
2962 sta op1 ;\
2963 iny ;\
2964 lda ptr1,y ;\
2965 sta op1+1 ;\
2966 lda #<(cte2) ;\
2967 sta op2 ;\
2968 lda #>(cte2) ;\
2969 sta op2+1 ;\
2970 jsr mul16i ;\
2971 stx tmp3 ;\
2972 sta tmp3+1 ;\
2973
2974 #define MULI_DCI(tmp1,cte2,ptr3,y3)\
2975 lda tmp1 ;\
2976 sta op1 ;\
2977 lda tmp1+1 ;\
2978 sta op1+1 ;\
2979 lda #<(cte2) ;\
2980 sta op2 ;\
2981 lda #>(cte2) ;\
2982 sta op2+1 ;\
2983 jsr mul16i ;\
2984 ldy #y3+1 ;\
2985 sta ptr3,y ;\
2986 dey ;\
2987 txa ;\
2988 sta ptr3,y ;\
2989
2990 #define MULI_ICI(ptr1,y1,cte2,ptr3,y3)\
2991 ldy #y1 ;\
2992 lda ptr1,y ;\
2993 sta op1 ;\
2994 iny ;\
2995 lda ptr1,y ;\
2996 sta op1+1 ;\
2997 lda #<(cte2) ;\
2998 sta op2 ;\
2999 lda #>(cte2) ;\
3000 sta op2+1 ;\
3001 jsr mul16i ;\
3002 ldy #y3+1 ;\
3003 sta ptr3,y ;\
3004 dey ;\
3005 txa ;\
3006 sta ptr3,y ;\
3007
3008 #define LSH1W_DD(tmp1,tmp2)\
3009 lda tmp1 ;\
3010 asl ;\
3011 sta tmp2 ;\
3012 lda tmp1+1 ;\
3013 rol ;\
3014 sta tmp2+1 ;\
3015
3016 #define LSH1W_ID(ptr1,y1,tmp2)\
3017 ldy #y1 ;\
3018 lda ptr1,y ;\
3019 asl ;\
3020 sta tmp2 ;\
3021 iny ;\
3022 lda ptr1,y ;\
3023 rol ;\
3024 sta tmp2+1 ;\
3025
3026 #define LSH1W_DI(tmp1,ptr2,y2)\
3027 ldy #y2 ;\
3028 lda tmp1 ;\
3029 asl ;\
3030 sta ptr2,y ;\
3031 iny ;\
3032 lda tmp1+1 ;\
3033 rol ;\
3034 sta ptr2,y ;\
3035
3036 #define LSH1W_II(ptr1,y1,ptr2,y2)\
3037 ldy #y1 ;\
3038 lda ptr1,y ;\
3039 asl ;\
3040 ldy #y2 ;\
3041 sta ptr2,y ;\
3042 ldy #y1+1 ;\
3043 lda ptr1,y ;\
3044 rol ;\
3045 ldy #y2+1 ;\
3046 sta ptr2,y ;\
3047
3048 #define LSHW\
3049 beq *+8 ;\
3050 asl tmp ;\
3051 rol ;\
3052 dex ;\
3053 bne *-4 ;\
3054 ldx tmp ;\
3055
3056 #define LSHW_DDD(tmp1,tmp2,tmp3)\
3057 lda tmp1 ;\
3058 sta tmp ;\
3059 lda tmp1+1 ;\
3060 ldx tmp2 ;\
3061 LSHW ;\
3062 stx tmp3 ;\
3063 sta tmp3+1 ;\
3064
3065 #define LSHW_DCD(tmp1,cte2,tmp3)\
3066 lda tmp1 ;\
3067 sta tmp ;\
3068 lda tmp1+1 ;\
3069 ldx #cte2 ;\
3070 LSHW ;\
3071 stx tmp3 ;\
3072 sta tmp3+1 ;\
3073
3074 #define LSHW_DID(tmp1,ptr2,y2,tmp3)\
3075 ldy #y2 ;\
3076 lda ptr2,y ;\
3077 tax ;\
3078 lda tmp1 ;\
3079 sta tmp ;\
3080 lda tmp1+1 ;\
3081 LSHW ;\
3082 stx tmp3 ;\
3083 sta tmp3+1 ;\
3084
3085 #define LSHW_CDD(cte1,tmp2,tmp3)\
3086 lda #<(cte1) ;\
3087 sta tmp ;\
3088 lda #>(cte1) ;\
3089 ldx tmp2 ;\
3090 LSHW ;\
3091 stx tmp3 ;\
3092 sta tmp3+1 ;\
3093
3094 #define LSHW_CID(cte1,ptr2,y2,tmp3)\
3095 ldy #y2 ;\
3096 lda ptr2,y ;\
3097 tax ;\
3098 lda #<(cte1) ;\
3099 sta tmp ;\
3100 lda #>(cte1)+1 ;\
3101 LSHW ;\
3102 stx tmp3 ;\
3103 sta tmp3+1 ;\
3104
3105 #define LSHW_IDD(ptr1,y1,tmp2,tmp3)\
3106 ldy #y1 ;\
3107 lda ptr1,y ;\
3108 sta tmp ;\
3109 iny ;\
3110 lda ptr1,y ;\
3111 ldx tmp2 ;\
3112 LSHW ;\
3113 stx tmp3 ;\
3114 sta tmp3+1 ;\
3115
3116 #define LSHW_ICD(ptr1,y1,cte2,tmp3)\
3117 ldy #y1 ;\
3118 lda ptr1,y ;\
3119 sta tmp ;\
3120 iny ;\
3121 lda ptr1,y ;\
3122 ldx #cte2 ;\
3123 LSHW ;\
3124 stx tmp3 ;\
3125 sta tmp3+1 ;\
3126
3127 #define LSHW_IID(ptr1,y1,ptr2,y2,tmp3)\
3128 ldy #y2 ;\
3129 lda ptr2,y ;\
3130 tax ;\
3131 ldy #y1 ;\
3132 lda ptr1,y ;\
3133 sta tmp ;\
3134 iny ;\
3135 lda ptr1,y ;\
3136 LSHW ;\
3137 stx tmp3 ;\
3138 sta tmp3+1 ;\
3139
3140 #define LSHW_DDI(tmp1,tmp2,ptr3,y3)\
3141 lda tmp1 ;\
3142 sta tmp ;\
3143 lda tmp1+1 ;\
3144 ldx tmp2 ;\
3145 LSHW ;\
3146 ldy #y3+1 ;\
3147 sta ptr3,y ;\
3148 dey ;\
3149 txa ;\
3150 sta ptr3,y ;\
3151
3152 #define LSHW_DCI(tmp1,cte2,ptr3,y3)\
3153 lda tmp1 ;\
3154 sta tmp ;\
3155 lda tmp1+1 ;\
3156 ldx #cte2 ;\
3157 LSHW ;\
3158 ldy #y3+1 ;\
3159 sta ptr3,y ;\
3160 dey ;\
3161 txa ;\
3162 sta ptr3,y ;\
3163
3164 #define LSHW_DII(tmp1,ptr2,y2,ptr3,y3)\
3165 ldy #y2 ;\
3166 lda ptr2,y ;\
3167 tax ;\
3168 lda tmp1 ;\
3169 sta tmp ;\
3170 lda tmp1+1 ;\
3171 LSHW ;\
3172 ldy #y3+1 ;\
3173 sta ptr3,y ;\
3174 dey ;\
3175 txa ;\
3176 sta ptr3,y ;\
3177
3178 #define LSHW_CDI(cte1,tmp2,ptr3,y3)\
3179 lda #<(cte1) ;\
3180 sta tmp ;\
3181 lda #>(cte1) ;\
3182 ldx tmp2 ;\
3183 LSHW ;\
3184 ldy #y3+1 ;\
3185 sta ptr3,y ;\
3186 dey ;\
3187 txa ;\
3188 sta ptr3,y ;\
3189
3190 #define LSHW_CII(cte1,ptr2,y2,ptr3,y3)\
3191 ldy #y2 ;\
3192 lda ptr2,y ;\
3193 tax ;\
3194 lda #<(cte1) ;\
3195 sta tmp ;\
3196 lda #>(cte1)+1 ;\
3197 LSHW ;\
3198 ldy #y3+1 ;\
3199 sta ptr3,y ;\
3200 dey ;\
3201 txa ;\
3202 sta ptr3,y ;\
3203
3204 #define LSHW_IDI(ptr1,y1,tmp2,ptr3,y3)\
3205 ldy #y1 ;\
3206 lda ptr1,y ;\
3207 sta tmp ;\
3208 iny ;\
3209 lda ptr1,y ;\
3210 ldx tmp2 ;\
3211 LSHW ;\
3212 ldy #y3+1 ;\
3213 sta ptr3,y ;\
3214 dey ;\
3215 txa ;\
3216 sta ptr3,y ;\
3217
3218 #define LSHW_ICI(ptr1,y1,cte2,ptr3,y3)\
3219 ldy #y1 ;\
3220 lda ptr1,y ;\
3221 sta tmp ;\
3222 iny ;\
3223 lda ptr1,y ;\
3224 ldx #cte2 ;\
3225 LSHW ;\
3226 ldy #y3+1 ;\
3227 sta ptr3,y ;\
3228 dey ;\
3229 txa ;\
3230 sta ptr3,y ;\
3231
3232 #define LSHW_III(ptr1,y1,ptr2,y2,ptr3,y3)\
3233 ldy #y2 ;\
3234 lda ptr2,y ;\
3235 tax ;\
3236 ldy #y1 ;\
3237 lda ptr1,y ;\
3238 sta tmp ;\
3239 iny ;\
3240 lda ptr1,y ;\
3241 LSHW ;\
3242 ldy #y3+1 ;\
3243 sta ptr3,y ;\
3244 dey ;\
3245 txa ;\
3246 sta ptr3,y ;\
3247
3248 #define RSHW\
3249 beq *+8 ;\
3250 lsr ;\
3251 ror tmp ;\
3252 dex ;\
3253 bne *-4 ;\
3254 ldx tmp ;\
3255
3256 #define RSHW_DDD(tmp1,tmp2,tmp3)\
3257 lda tmp1 ;\
3258 sta tmp ;\
3259 lda tmp1+1 ;\
3260 ldx tmp2 ;\
3261 RSHW ;\
3262 stx tmp3 ;\
3263 sta tmp3+1 ;\
3264
3265 #define RSHW_DCD(tmp1,cte2,tmp3)\
3266 lda tmp1 ;\
3267 sta tmp ;\
3268 lda tmp1+1 ;\
3269 ldx #cte2 ;\
3270 RSHW ;\
3271 stx tmp3 ;\
3272 sta tmp3+1 ;\
3273
3274 #define RSHW_DID(tmp1,ptr2,y2,tmp3)\
3275 ldy #y2 ;\
3276 lda ptr2,y ;\
3277 tax ;\
3278 lda tmp1 ;\
3279 sta tmp ;\
3280 lda tmp1+1 ;\
3281 RSHW ;\
3282 stx tmp3 ;\
3283 sta tmp3+1 ;\
3284
3285 #define RSHW_CDD(cte1,tmp2,tmp3)\
3286 lda #<(cte1) ;\
3287 sta tmp ;\
3288 lda #>(cte1) ;\
3289 ldx tmp2 ;\
3290 RSHW ;\
3291 stx tmp3 ;\
3292 sta tmp3+1 ;\
3293
3294 #define RSHW_CID(cte1,ptr2,y2,tmp3)\
3295 ldy #y2 ;\
3296 lda ptr2,y ;\
3297 tax ;\
3298 lda #<(cte1) ;\
3299 sta tmp ;\
3300 lda #>(cte1)+1 ;\
3301 RSHW ;\
3302 stx tmp3 ;\
3303 sta tmp3+1 ;\
3304
3305 #define RSHW_IDD(ptr1,y1,tmp2,tmp3)\
3306 ldy #y1 ;\
3307 lda ptr1,y ;\
3308 sta tmp ;\
3309 iny ;\
3310 lda ptr1,y ;\
3311 ldx tmp2 ;\
3312 RSHW ;\
3313 stx tmp3 ;\
3314 sta tmp3+1 ;\
3315
3316 #define RSHW_ICD(ptr1,y1,cte2,tmp3)\
3317 ldy #y1 ;\
3318 lda ptr1,y ;\
3319 sta tmp ;\
3320 iny ;\
3321 lda ptr1,y ;\
3322 ldx #cte2 ;\
3323 RSHW ;\
3324 stx tmp3 ;\
3325 sta tmp3+1 ;\
3326
3327 #define RSHW_IID(ptr1,y1,ptr2,y2,tmp3)\
3328 ldy #y2 ;\
3329 lda ptr2,y ;\
3330 tax ;\
3331 ldy #y1 ;\
3332 lda ptr1,y ;\
3333 sta tmp ;\
3334 iny ;\
3335 lda ptr1,y ;\
3336 RSHW ;\
3337 stx tmp3 ;\
3338 sta tmp3+1 ;\
3339
3340 #define RSHW_DDI(tmp1,tmp2,ptr3,y3)\
3341 lda tmp1 ;\
3342 sta tmp ;\
3343 lda tmp1+1 ;\
3344 ldx tmp2 ;\
3345 RSHW ;\
3346 ldy #y3+1 ;\
3347 sta ptr3,y ;\
3348 dey ;\
3349 txa ;\
3350 sta ptr3,y ;\
3351
3352 #define RSHW_DCI(tmp1,cte2,ptr3,y3)\
3353 lda tmp1 ;\
3354 sta tmp ;\
3355 lda tmp1+1 ;\
3356 ldx #cte2 ;\
3357 RSHW ;\
3358 ldy #y3+1 ;\
3359 sta ptr3,y ;\
3360 dey ;\
3361 txa ;\
3362 sta ptr3,y ;\
3363
3364 #define RSHW_DII(tmp1,ptr2,y2,ptr3,y3)\
3365 ldy #y2 ;\
3366 lda ptr2,y ;\
3367 tax ;\
3368 lda tmp1 ;\
3369 sta tmp ;\
3370 lda tmp1+1 ;\
3371 RSHW ;\
3372 ldy #y3+1 ;\
3373 sta ptr3,y ;\
3374 dey ;\
3375 txa ;\
3376 sta ptr3,y ;\
3377
3378 #define RSHW_CDI(cte1,tmp2,ptr3,y3)\
3379 lda #<(cte1) ;\
3380 sta tmp ;\
3381 lda #>(cte1) ;\
3382 ldx tmp2 ;\
3383 RSHW ;\
3384 ldy #y3+1 ;\
3385 sta ptr3,y ;\
3386 dey ;\
3387 txa ;\
3388 sta ptr3,y ;\
3389
3390 #define RSHW_CII(cte1,ptr2,y2,ptr3,y3)\
3391 ldy #y2 ;\
3392 lda ptr2,y ;\
3393 tax ;\
3394 lda #<(cte1) ;\
3395 sta tmp ;\
3396 lda #>(cte1)+1 ;\
3397 RSHW ;\
3398 ldy #y3+1 ;\
3399 sta ptr3,y ;\
3400 dey ;\
3401 txa ;\
3402 sta ptr3,y ;\
3403
3404 #define RSHW_IDI(ptr1,y1,tmp2,ptr3,y3)\
3405 ldy #y1 ;\
3406 lda ptr1,y ;\
3407 sta tmp ;\
3408 iny ;\
3409 lda ptr1,y ;\
3410 ldx tmp2 ;\
3411 RSHW ;\
3412 ldy #y3+1 ;\
3413 sta ptr3,y ;\
3414 dey ;\
3415 txa ;\
3416 sta ptr3,y ;\
3417
3418 #define RSHW_ICI(ptr1,y1,cte2,ptr3,y3)\
3419 ldy #y1 ;\
3420 lda ptr1,y ;\
3421 sta tmp ;\
3422 iny ;\
3423 lda ptr1,y ;\
3424 ldx #cte2 ;\
3425 RSHW ;\
3426 ldy #y3+1 ;\
3427 sta ptr3,y ;\
3428 dey ;\
3429 txa ;\
3430 sta ptr3,y ;\
3431
3432 #define RSHW_III(ptr1,y1,ptr2,y2,ptr3,y3)\
3433 ldy #y2 ;\
3434 lda ptr2,y ;\
3435 tax ;\
3436 ldy #y1 ;\
3437 lda ptr1,y ;\
3438 sta tmp ;\
3439 iny ;\
3440 lda ptr1,y ;\
3441 RSHW ;\
3442 ldy #y3+1 ;\
3443 sta ptr3,y ;\
3444 dey ;\
3445 txa ;\
3446 sta ptr3,y ;\
3447
3448 #define ASGNB_CC(cte1,var2)\
3449 lda #<(cte1) ;\
3450 sta var2 ;\
3451
3452 #define ASGNB_CZ(cte1,ptr2)\
3453 ldy #0 ;\
3454 lda #<(cte1) ;\
3455 sta (ptr2),y ;\
3456
3457 #define ASGNB_CD(cte1,var2)\
3458 lda var2 ;\
3459 sta tmp ;\
3460 lda var2+1 ;\
3461 sta tmp+1 ;\
3462 ldy #0 ;\
3463 lda #<(cte1) ;\
3464 sta (tmp),y ;\
3465
3466 #define ASGNB_CA(cte1,ptr2,y2)\
3467 ldy #y2 ;\
3468 lda #<(cte1) ;\
3469 sta ptr2,y ;\
3470
3471 #define ASGNB_CI(cte1,ptr2,y2)\
3472 ldy #y2 ;\
3473 lda ptr2,y ;\
3474 sta tmp ;\
3475 iny ;\
3476 lda ptr2,y ;\
3477 sta tmp+1 ;\
3478 lda #<(cte1) ;\
3479 ldy #0 ;\
3480 sta (tmp),y ;\
3481
3482 #define ASGNB_DC(tmp1,var2)\
3483 lda tmp1 ;\
3484 sta var2 ;\
3485
3486 #define ASGNB_DZ(tmp1,ptr2)\
3487 ldy #0 ;\
3488 lda tmp1 ;\
3489 sta (ptr2),y ;\
3490
3491 #define ASGNB_DD(tmp1,var2)\
3492 lda var2 ;\
3493 sta tmp ;\
3494 lda var2+1 ;\
3495 sta tmp+1 ;\
3496 ldy #0 ;\
3497 lda tmp1 ;\
3498 sta (tmp),y ;\
3499
3500 #define ASGNB_DA(tmp1,ptr2,y2)\
3501 ldy #y2 ;\
3502 lda tmp1 ;\
3503 sta ptr2,y ;\
3504
3505 #define ASGNB_DI(tmp1,ptr2,y2)\
3506 ldy #y2 ;\
3507 lda ptr2,y ;\
3508 sta tmp ;\
3509 iny ;\
3510 lda ptr2,y ;\
3511 sta tmp+1 ;\
3512 ldy #0 ;\
3513 lda tmp1 ;\
3514 sta (tmp),y ;\
3515
3516 #define ASGNB_IC(ptr1,y1,var2)\
3517 ldy #y1 ;\
3518 lda ptr1,y ;\
3519 sta var2 ;\
3520
3521 #define ASGNB_IZ(ptr1,y1,ptr2)\
3522 ldy #y1 ;\
3523 lda ptr1,y ;\
3524 ldy #0 ;\
3525 sta (ptr2),y ;\
3526
3527 #define ASGNB_ID(ptr1,y1,var2)\
3528 lda var2 ;\
3529 sta tmp ;\
3530 lda var2+1 ;\
3531 sta tmp+1 ;\
3532 ldy #y1 ;\
3533 lda ptr1,y ;\
3534 ldy #0 ;\
3535 sta (tmp),y ;\
3536
3537 #define ASGNB_IA(ptr1,y1,ptr2,y2)\
3538 ldy #y1 ;\
3539 lda ptr1,y ;\
3540 ldy #y2 ;\
3541 sta ptr2,y ;\
3542
3543 #define ASGNB_II(ptr1,y1,ptr2,y2)\
3544 ldy #y2 ;\
3545 lda ptr2,y ;\
3546 sta tmp ;\
3547 iny ;\
3548 lda ptr2,y ;\
3549 sta tmp+1 ;\
3550 ldy #y1 ;\
3551 lda ptr1,y ;\
3552 ldy #0 ;\
3553 sta (tmp),y ;\
3554
3555 #define ASGNW_CC(cte1,var2)\
3556 lda #<(cte1) ;\
3557 sta var2 ;\
3558 lda #>(cte1) ;\
3559 sta var2+1 ;\
3560
3561 #define ASGNW_CZ(cte1,ptr2)\
3562 ldy #0 ;\
3563 lda #<(cte1) ;\
3564 sta (ptr2),y ;\
3565 iny ;\
3566 lda #>(cte1) ;\
3567 sta (ptr2),y ;\
3568
3569 #define ASGNW_CD(cte1,var2)\
3570 lda var2 ;\
3571 sta tmp ;\
3572 lda var2+1 ;\
3573 sta tmp+1 ;\
3574 ldy #0 ;\
3575 lda #<(cte1) ;\
3576 sta (tmp),y ;\
3577 iny ;\
3578 lda #>(cte1) ;\
3579 sta (tmp),y ;\
3580
3581 #define ASGNW_CA(cte1,ptr2,y2)\
3582 ldy #y2 ;\
3583 lda #<(cte1) ;\
3584 sta ptr2,y ;\
3585 iny ;\
3586 lda #>(cte1) ;\
3587 sta ptr2,y ;\
3588
3589 #define ASGNW_CI(cte1,ptr2,y2)\
3590 ldy #y2 ;\
3591 lda ptr2,y ;\
3592 sta tmp ;\
3593 iny ;\
3594 lda ptr2,y ;\
3595 sta tmp+1 ;\
3596 ldy #0 ;\
3597 lda #<(cte1) ;\
3598 sta (tmp),y ;\
3599 iny ;\
3600 lda #>(cte1) ;\
3601 sta (tmp),y ;\
3602
3603 #define ASGNW_DC(tmp1,var2)\
3604 lda tmp1 ;\
3605 sta var2 ;\
3606 lda tmp1+1 ;\
3607 sta var2+1 ;\
3608
3609 #define ASGNW_DZ(tmp1,ptr2)\
3610 ldy #0 ;\
3611 lda tmp1 ;\
3612 sta (ptr2),y ;\
3613 iny ;\
3614 lda tmp1+1 ;\
3615 sta (ptr2),y ;\
3616
3617 #define ASGNW_DD(tmp1,var2)\
3618 lda var2 ;\
3619 sta tmp ;\
3620 lda var2+1 ;\
3621 sta tmp+1 ;\
3622 ldy #0 ;\
3623 lda tmp1 ;\
3624 sta (tmp),y ;\
3625 iny ;\
3626 lda tmp1+1 ;\
3627 sta (tmp),y ;\
3628
3629 #define ASGNW_DA(tmp1,ptr2,y2)\
3630 ldy #y2 ;\
3631 lda tmp1 ;\
3632 sta ptr2,y ;\
3633 iny ;\
3634 lda tmp1+1 ;\
3635 sta ptr2,y ;\
3636
3637 #define ASGNW_DI(tmp1,ptr2,y2)\
3638 ldy #y2 ;\
3639 lda ptr2,y ;\
3640 sta tmp ;\
3641 iny ;\
3642 lda ptr2,y ;\
3643 sta tmp+1 ;\
3644 ldy #0 ;\
3645 lda tmp1 ;\
3646 sta (tmp),y ;\
3647 iny ;\
3648 lda tmp1+1 ;\
3649 sta (tmp),y ;\
3650
3651 #define ASGNW_AC(ptr1,y1,var2)\
3652 clc ;\
3653 lda 0+ptr1 ;\
3654 adc #y1 ;\
3655 sta var2 ;\
3656 lda 1+ptr1 ;\
3657 adc #0 ;\
3658 sta var2+1 ;\
3659
3660 #define ASGNW_AZ(ptr1,y1,ptr2)\
3661 clc ;\
3662 lda 0+ptr1 ;\
3663 adc #y1 ;\
3664 ldy #0 ;\
3665 sta (ptr2),y ;\
3666 iny ;\
3667 lda 1+ptr1 ;\
3668 adc #0 ;\
3669 sta (ptr2),y ;\
3670
3671 #define ASGNW_AD(ptr1,y1,var2)\
3672 lda var2 ;\
3673 sta tmp ;\
3674 lda var2+1 ;\
3675 sta tmp+1 ;\
3676 clc ;\
3677 lda 0+ptr1 ;\
3678 adc #y1 ;\
3679 ldy #0 ;\
3680 sta (tmp),y ;\
3681 iny ;\
3682 lda 1+ptr1 ;\
3683 adc #0 ;\
3684 sta (tmp),y ;\
3685
3686 #define ASGNW_AA(ptr1,y1,ptr2,y2)\
3687 clc ;\
3688 lda 0+ptr1 ;\
3689 adc #y1 ;\
3690 ldy #y2 ;\
3691 sta ptr2,y ;\
3692 iny ;\
3693 lda 1+ptr1 ;\
3694 adc #0 ;\
3695 sta ptr2,y ;\
3696
3697 #define ASGNW_AI(ptr1,y1,ptr2,y2)\
3698 ldy #y2 ;\
3699 lda ptr2,y ;\
3700 sta tmp ;\
3701 iny ;\
3702 lda ptr2,y ;\
3703 sta tmp+1 ;\
3704 clc ;\
3705 lda 0+ptr1 ;\
3706 adc #y1 ;\
3707 ldy #0 ;\
3708 sta (tmp),y ;\
3709 iny ;\
3710 lda 1+ptr1 ;\
3711 adc #0 ;\
3712 sta (tmp),y ;\
3713
3714 #define ASGNW_IC(ptr1,y1,var2)\
3715 ldy #y1 ;\
3716 lda ptr1,y ;\
3717 sta var2 ;\
3718 iny ;\
3719 lda ptr1,y ;\
3720 sta var2+1 ;\
3721
3722 #define ASGNW_IZ(ptr1,y1,ptr2)\
3723 ldy #y1 ;\
3724 lda ptr1,y ;\
3725 ldy #0 ;\
3726 sta (ptr2),y ;\
3727 ldy #y1+1 ;\
3728 lda ptr1,y ;\
3729 ldy #1 ;\
3730 sta (ptr2),y ;\
3731
3732 #define ASGNW_ID(ptr1,y1,var2)\
3733 lda var2 ;\
3734 sta tmp ;\
3735 lda var2+1 ;\
3736 sta tmp+1 ;\
3737 ldy #y1 ;\
3738 lda ptr1,y ;\
3739 ldy #0 ;\
3740 sta (tmp),y ;\
3741 ldy #y1+1 ;\
3742 lda ptr1,y ;\
3743 ldy #1 ;\
3744 sta (tmp),y ;\
3745
3746 #define ASGNW_IA(ptr1,y1,ptr2,y2)\
3747 ldy #y1 ;\
3748 lda ptr1,y ;\
3749 ldy #y2 ;\
3750 sta ptr2,y ;\
3751 ldy #y1+1 ;\
3752 lda ptr1,y ;\
3753 ldy #y2+1 ;\
3754 sta ptr2,y ;\
3755
3756 #define ASGNW_II(ptr1,y1,ptr2,y2)\
3757 ldy #y2 ;\
3758 lda ptr2,y ;\
3759 sta tmp ;\
3760 iny ;\
3761 lda ptr2,y ;\
3762 sta tmp+1 ;\
3763 ldy #y1 ;\
3764 lda ptr1,y ;\
3765 ldy #0 ;\
3766 sta (tmp),y ;\
3767 ldy #y1+1 ;\
3768 lda ptr1,y ;\
3769 ldy #1 ;\
3770 sta (tmp),y ;\
3771
3772 #define ASGNS_CC(adr1,adr2,length) \
3773 ldx #0 ;\
3774 lda adr1,x ;\
3775 sta adr2,x ;\
3776 inx ;\
3777 cpx #length ;\
3778 bne *-9 ;\
3779
3780 #define ASGNS_DC(adr1,adr2,length) \
3781 ldx adr1 ;\
3782 lda adr1+1 ;\
3783 stx *+9 ;\
3784 sta *+7 ;\
3785 ldx #0 ;\
3786 lda $1234,x ;\
3787 sta adr2,x ;\
3788 inx ;\
3789 cpx #length ;\
3790 bne *-9 ;\
3791
3792 #define ASGNS_AC(ptr1,y1,adr2,length) \
3793 ldx #0 ;\
3794 ldy #y1 ;\
3795 lda ptr1,y ;\
3796 sta adr2,x ;\
3797 iny ;\
3798 inx ;\
3799 cpx #length ;\
3800 bne *-9 ;\
3801
3802 #define ASGNS_IC(ptr1,y1,adr2,length) \
3803 ldy #y1 ;\
3804 lda ptr1,y ;\
3805 sta *+12 ;\
3806 iny ;\
3807 lda ptr1,y ;\
3808 sta *+7 ;\
3809 ldx #0 ;\
3810 lda $1234,x ;\
3811 sta adr2,x ;\
3812 inx ;\
3813 cpx #length ;\
3814 bne *-9 ;\
3815
3816 #define ASGNS_CD(adr1,adr2,length) \
3817 ldx adr2 ;\
3818 lda adr2+1 ;\
3819 stx *+12 ;\
3820 sta *+10 ;\
3821 ldx #0 ;\
3822 lda adr1,x ;\
3823 sta $1234,x ;\
3824 inx ;\
3825 cpx #length ;\
3826 bne *-9 ;\
3827
3828 #define ASGNS_DD(adr1,adr2,length) \
3829 ldy adr2 ;\
3830 lda adr2+1 ;\
3831 pha ;\
3832 ldx adr1 ;\
3833 lda adr1+1 ;\
3834 stx *+16 ;\
3835 sta *+14 ;\
3836 pla ;\
3837 sty *+12 ;\
3838 sta *+10 ;\
3839 ldx #0 ;\
3840 lda $1234,x ;\
3841 sta $5678,x ;\
3842 inx ;\
3843 cpx #length ;\
3844 bne *-9 ;\
3845
3846 #define ASGNS_AD(ptr1,y1,adr2,length) \
3847 ldx adr2 ;\
3848 lda adr2+1 ;\
3849 stx *+13 ;\
3850 sta *+11 ;\
3851 ldx #0 ;\
3852 ldy #y1 ;\
3853 lda ptr1,y ;\
3854 sta $1234,x ;\
3855 iny ;\
3856 inx ;\
3857 cpx #length ;\
3858 bne *-9 ;\
3859
3860 #define ASGNS_ID(ptr1,y1,adr2,length) \
3861 ldx adr2 ;\
3862 lda adr2+1 ;\
3863 stx *+25 ;\
3864 sta *+23 ;\
3865 ldy #y1 ;\
3866 lda ptr1,y ;\
3867 sta *+12 ;\
3868 iny ;\
3869 lda ptr1,y ;\
3870 sta *+7 ;\
3871 ldx #0 ;\
3872 lda $1234,x ;\
3873 sta $5678,x ;\
3874 inx ;\
3875 cpx #length ;\
3876 bne *-9 ;\
3877
3878 #define ASGNS_CA(adr1,ptr2,y2,length)\
3879 ldx #0 ;\
3880 ldy #y2 ;\
3881 lda adr1,x ;\
3882 sta ptr2,y ;\
3883 inx ;\
3884 iny ;\
3885 cpx #length ;\
3886 bne *-9 ;\
3887
3888 #define ASGNS_DA(adr1,ptr2,y2,length) \
3889 ldx adr1 ;\
3890 lda adr1+1 ;\
3891 stx *+11 ;\
3892 sta *+9 ;\
3893 ldx #0 ;\
3894 ldy #y2 ;\
3895 lda $1234,x ;\
3896 sta ptr2,y ;\
3897 inx ;\
3898 iny ;\
3899 cpx #length ;\
3900 bne *-9 ;\
3901
3902 #define ASGNS_AA(ptr1,y1,ptr2,y2,length)\
3903 ldy #y1 ;\
3904 sty tmp ;\
3905 ldy #y2 ;\
3906 sty tmp+1 ;\
3907 ldx #length ;\
3908 ldy tmp ;\
3909 lda ptr1,y ;\
3910 iny ;\
3911 sty tmp ;\
3912 ldy tmp+1 ;\
3913 sta ptr2,y ;\
3914 iny ;\
3915 sty tmp+1 ;\
3916 dex ;\
3917 bne *-15 ;\
3918
3919 #define ASGNS_IA(ptr1,y1,ptr2,y2,length)\
3920 ldy #y1 ;\
3921 lda ptr1,y ;\
3922 sta *+14 ;\
3923 iny ;\
3924 lda ptr1,y ;\
3925 sta *+9 ;\
3926 ldx #0 ;\
3927 ldy #y2 ;\
3928 lda $1234,x ;\
3929 sta ptr2,y ;\
3930 inx ;\
3931 iny ;\
3932 cpx #length ;\
3933 bne *-9 ;\
3934
3935 #define ASGNS_CI(adr1,ptr2,y2,length) \
3936 ldy #y2 ;\
3937 lda ptr2,y ;\
3938 sta *+15 ;\
3939 iny ;\
3940 lda ptr2,y ;\
3941 sta *+10 ;\
3942 ldx #0 ;\
3943 lda adr1,x ;\
3944 sta $1234,x ;\
3945 inx ;\
3946 cpx #length ;\
3947 bne *-9 ;\
3948
3949 #define ASGNS_DI(adr1,ptr2,y2,length) \
3950 ldx adr1 ;\
3951 lda adr1+1 ;\
3952 stx *+22 ;\
3953 sta *+20 ;\
3954 ldy #y2 ;\
3955 lda ptr2,y ;\
3956 sta *+15 ;\
3957 iny ;\
3958 lda ptr2,y ;\
3959 sta *+10 ;\
3960 ldx #0 ;\
3961 lda $1234,x ;\
3962 sta $5678,x ;\
3963 inx ;\
3964 cpx #length ;\
3965 bne *-9 ;\
3966
3967 #define ASGNS_AI(ptr1,y1,ptr2,y2,length) \
3968 ldy #y2 ;\
3969 lda ptr2,y ;\
3970 sta *+16 ;\
3971 iny ;\
3972 lda ptr2,y ;\
3973 sta *+11 ;\
3974 ldx #0 ;\
3975 ldy #y1 ;\
3976 lda ptr1,y ;\
3977 sta $1234,x ;\
3978 iny ;\
3979 inx ;\
3980 cpx #length ;\
3981 bne *-9 ;\
3982
3983 #define ASGNS_II(ptr1,y1,ptr2,y2,length) \
3984 ldy #y1 ;\
3985 lda ptr1,y ;\
3986 sta *+25 ;\
3987 iny ;\
3988 lda ptr1,y ;\
3989 sta *+20 ;\
3990 ldy #y2 ;\
3991 lda ptr2,y ;\
3992 sta *+15 ;\
3993 iny ;\
3994 lda ptr2,y ;\
3995 sta *+10 ;\
3996 ldx #0 ;\
3997 lda $1234,x ;\
3998 sta $5678,x ;\
3999 inx ;\
4000 cpx #length ;\
4001 bne *-9 ;\
4002
4003 #define EQ0W_D(tmp,label)\
4004 lda tmp ;\
4005 ora tmp+1 ;\
4006 bne *+5 ;\
4007 jmp label ;\
4008
4009 #define EQ0W_I(ptr,y2,label)\
4010 ldy #y2 ;\
4011 lda ptr,y ;\
4012 iny ;\
4013 ora ptr,y ;\
4014 bne *+5 ;\
4015 jmp label ;\
4016
4017 #define EQW_DC(tmp2,cte1,label)\
4018 lda #<(cte1) ;\
4019 eor tmp2 ;\
4020 sta tmp ;\
4021 lda #>(cte1) ;\
4022 eor tmp2+1 ;\
4023 ora tmp ;\
4024 bne *+5 ;\
4025 jmp label ;\
4026
4027 #define EQW_DA(tmp2,ptr1,y1,label)\
4028 clc ;\
4029 lda 0+ptr1 ;\
4030 adc #y1 ;\
4031 eor tmp2 ;\
4032 sta tmp ;\
4033 lda 1+ptr1 ;\
4034 adc #0 ;\
4035 eor tmp2+1 ;\
4036 ora tmp ;\
4037 bne *+5 ;\
4038 jmp label ;\
4039
4040 #define EQW_IC(ptr2,y2,cte1,label)\
4041 lda #<(cte1) ;\
4042 ldy #y2 ;\
4043 cmp ptr2,y ;\
4044 bne *+12 ;\
4045 iny ;\
4046 lda #>(cte1) ;\
4047 cmp ptr2,y ;\
4048 bne *+5 ;\
4049 jmp label ;\
4050
4051 #define EQW_IA(ptr2,y2,ptr1,y1,label)\
4052 clc ;\
4053 lda 0+ptr1 ;\
4054 adc #y1 ;\
4055 ldy #y2 ;\
4056 eor ptr2,y ;\
4057 sta tmp ;\
4058 iny ;\
4059 lda 1+ptr1 ;\
4060 adc #0 ;\
4061 eor ptr2,y ;\
4062 ora tmp ;\
4063 bne *+5 ;\
4064 jmp label ;\
4065
4066 #define EQW_DD(tmp1,tmp2,label)\
4067 lda tmp1 ;\
4068 eor tmp2 ;\
4069 sta tmp ;\
4070 lda tmp1+1 ;\
4071 eor tmp2+1 ;\
4072 ora tmp ;\
4073 bne *+5 ;\
4074 jmp label ;\
4075
4076 #define EQW_DI(tmp1,ptr2,y2,label)\
4077 lda tmp1 ;\
4078 ldy #y2 ;\
4079 eor ptr2,y ;\
4080 sta tmp ;\
4081 iny ;\
4082 lda tmp1+1 ;\
4083 eor ptr2,y ;\
4084 ora tmp ;\
4085 bne *+5 ;\
4086 jmp label ;\
4087
4088 #define EQW_ID(ptr1,y1,tmp2,label)\
4089 ldy #y1 ;\
4090 lda ptr1,y ;\
4091 eor tmp2 ;\
4092 sta tmp ;\
4093 iny ;\
4094 lda ptr1,y ;\
4095 eor tmp2+1 ;\
4096 ora tmp ;\
4097 bne *+5 ;\
4098 jmp label ;\
4099
4100 #define EQW_II(ptr1,y1,ptr2,y2,label)\
4101 ldy #y1 ;\
4102 lda ptr1,y ;\
4103 ldy #y2 ;\
4104 cmp ptr2,y ;\
4105 bne *+15 ;\
4106 ldy #y1+1 ;\
4107 lda ptr1,y ;\
4108 ldy #y2+1 ;\
4109 cmp ptr2,y ;\
4110 bne *+5 ;\
4111 jmp label ;\
4112
4113 #define NE0W_D(tmp,label)\
4114 lda tmp ;\
4115 ora tmp+1 ;\
4116 beq *+5 ;\
4117 jmp label ;\
4118
4119 #define NE0W_I(ptr,y2,label)\
4120 ldy #y2 ;\
4121 lda ptr,y ;\
4122 iny ;\
4123 ora ptr,y ;\
4124 beq *+5 ;\
4125 jmp label ;\
4126
4127 #define NEW_DC(tmp2,cte1,label)\
4128 lda #<(cte1) ;\
4129 eor tmp2 ;\
4130 sta tmp ;\
4131 lda #>(cte1) ;\
4132 eor tmp2+1 ;\
4133 ora tmp ;\
4134 beq *+5 ;\
4135 jmp label ;\
4136
4137 #define NEW_DA(tmp2,ptr1,y1,label)\
4138 clc ;\
4139 lda 0+ptr1 ;\
4140 adc #y1 ;\
4141 eor tmp2 ;\
4142 sta tmp ;\
4143 lda 1+ptr1 ;\
4144 adc #0 ;\
4145 eor tmp2+1 ;\
4146 ora tmp ;\
4147 beq *+5 ;\
4148 jmp label ;\
4149
4150 #define NEW_IC(ptr2,y2,cte1,label)\
4151 lda #<(cte1) ;\
4152 ldy #y2 ;\
4153 cmp ptr2,y ;\
4154 beq *+5 ;\
4155 jmp label ;\
4156 iny ;\
4157 lda #>(cte1) ;\
4158 cmp ptr2,y ;\
4159 beq *+5 ;\
4160 jmp label ;\
4161
4162 #define NEW_IA(ptr2,y2,ptr1,y1,label)\
4163 clc ;\
4164 lda 0+ptr1 ;\
4165 adc #y1 ;\
4166 ldy #y2 ;\
4167 eor ptr2,y ;\
4168 sta tmp ;\
4169 iny ;\
4170 lda 1+ptr1 ;\
4171 adc #0 ;\
4172 eor ptr2,y ;\
4173 ora tmp ;\
4174 beq *+5 ;\
4175 jmp label ;\
4176
4177 #define NEW_DD(tmp1,tmp2,label)\
4178 lda tmp1 ;\
4179 eor tmp2 ;\
4180 sta tmp ;\
4181 lda tmp1+1 ;\
4182 eor tmp2+1 ;\
4183 ora tmp ;\
4184 beq *+5 ;\
4185 jmp label ;\
4186
4187 #define NEW_DI(tmp1,ptr2,y2,label)\
4188 lda tmp1 ;\
4189 ldy #y2 ;\
4190 eor ptr2,y ;\
4191 sta tmp ;\
4192 iny ;\
4193 lda tmp1+1 ;\
4194 eor ptr2,y ;\
4195 ora tmp ;\
4196 beq *+5 ;\
4197 jmp label ;\
4198
4199 #define NEW_ID(ptr1,y1,tmp2,label)\
4200 ldy #y1 ;\
4201 lda ptr1,y ;\
4202 eor tmp2 ;\
4203 sta tmp ;\
4204 iny ;\
4205 lda ptr1,y ;\
4206 eor tmp2+1 ;\
4207 ora tmp ;\
4208 beq *+5 ;\
4209 jmp label ;\
4210
4211 #define NEW_II(ptr1,y1,ptr2,y2,label)\
4212 ldy #y1 ;\
4213 lda ptr1,y ;\
4214 ldy #y2 ;\
4215 cmp ptr2,y ;\
4216 beq *+5 ;\
4217 jmp label ;\
4218 ldy #y1+1 ;\
4219 lda ptr1,y ;\
4220 ldy #y2+1 ;\
4221 cmp ptr2,y ;\
4222 beq *+5 ;\
4223 jmp label ;\
4224
4225 #define GEI(label)\
4226 bvc *+4 ;\
4227 eor #$80 ;\
4228 bmi *+5 ;\
4229 jmp label ;\
4230
4231 #define GEU(label)\
4232 bcc *+5 ;\
4233 jmp label ;\
4234
4235 #define GEI_DC(tmp1,cte2,label)\
4236 lda tmp1 ;\
4237 cmp #<(cte2) ;\
4238 lda tmp1+1 ;\
4239 sbc #>(cte2) ;\
4240 GEI(label) ;\
4241
4242 #define GEI_DD(tmp1,tmp2,label)\
4243 lda tmp1 ;\
4244 cmp tmp2 ;\
4245 lda tmp1+1 ;\
4246 sbc tmp2+1 ;\
4247 GEI(label) ;\
4248
4249 #define GEI_DI(tmp1,ptr2,y2,label)\
4250 lda tmp1 ;\
4251 ldy #y2 ;\
4252 cmp ptr2,y ;\
4253 iny ;\
4254 lda tmp1+1 ;\
4255 sbc ptr2,y ;\
4256 GEI(label) ;\
4257
4258 #define GEI_IC(ptr1,y1,cte2,label)\
4259 ldy #y1 ;\
4260 lda ptr1,y ;\
4261 cmp #<(cte2) ;\
4262 iny ;\
4263 lda ptr1,y ;\
4264 sbc #>(cte2) ;\
4265 GEI(label) ;\
4266
4267 #define GEI_ID(ptr1,y1,tmp2,label)\
4268 ldy #y1 ;\
4269 lda ptr1,y ;\
4270 cmp tmp2 ;\
4271 iny ;\
4272 lda ptr1,y ;\
4273 sbc tmp2+1 ;\
4274 GEI(label) ;\
4275
4276 #define GEI_II(ptr1,y1,ptr2,y2,label)\
4277 ldy #y1 ;\
4278 lda ptr1,y ;\
4279 ldy #y2 ;\
4280 cmp ptr2,y ;\
4281 ldy #y1+1 ;\
4282 lda ptr1,y ;\
4283 ldy #y2+1 ;\
4284 sbc ptr2,y ;\
4285 GEI(label) ;\
4286
4287 #define GEI_CD(cte1,tmp2,label)\
4288 lda #<(cte1) ;\
4289 cmp tmp2 ;\
4290 lda #>(cte1) ;\
4291 sbc tmp2+1 ;\
4292 GEI(label) ;\
4293
4294 #define GEI_CI(cte1,ptr2,y2,label)\
4295 lda #<(cte1) ;\
4296 ldy #y2 ;\
4297 cmp ptr2,y ;\
4298 iny ;\
4299 lda #>(cte1) ;\
4300 sbc ptr2,y ;\
4301 GEI(label) ;\
4302
4303 #define GEU_DC(tmp1,cte2,label)\
4304 lda tmp1 ;\
4305 cmp #<(cte2) ;\
4306 lda tmp1+1 ;\
4307 sbc #>(cte2) ;\
4308 GEU(label) ;\
4309
4310 #define GEU_DD(tmp1,tmp2,label)\
4311 lda tmp1 ;\
4312 cmp tmp2 ;\
4313 lda tmp1+1 ;\
4314 sbc tmp2+1 ;\
4315 GEU(label) ;\
4316
4317 #define GEU_DI(tmp1,ptr2,y2,label)\
4318 lda tmp1 ;\
4319 ldy #y2 ;\
4320 cmp ptr2,y ;\
4321 iny ;\
4322 lda tmp1+1 ;\
4323 sbc ptr2,y ;\
4324 GEU(label) ;\
4325
4326 #define GEU_IC(ptr1,y1,cte2,label)\
4327 ldy #y1 ;\
4328 lda ptr1,y ;\
4329 cmp #<(cte2) ;\
4330 iny ;\
4331 lda ptr1,y ;\
4332 sbc #>(cte2) ;\
4333 GEU(label) ;\
4334
4335 #define GEU_ID(ptr1,y1,tmp2,label)\
4336 ldy #y1 ;\
4337 lda ptr1,y ;\
4338 cmp tmp2 ;\
4339 iny ;\
4340 lda ptr1,y ;\
4341 sbc tmp2+1 ;\
4342 GEU(label) ;\
4343
4344 #define GEU_II(ptr1,y1,ptr2,y2,label)\
4345 ldy #y1 ;\
4346 lda ptr1,y ;\
4347 ldy #y2 ;\
4348 cmp ptr2,y ;\
4349 ldy #y1+1 ;\
4350 lda ptr1,y ;\
4351 ldy #y2+1 ;\
4352 sbc ptr2,y ;\
4353 GEU(label) ;\
4354
4355 #define GEU_CD(cte1,tmp2,label)\
4356 lda #<(cte1) ;\
4357 cmp tmp2 ;\
4358 lda #>(cte1) ;\
4359 sbc tmp2+1 ;\
4360 GEU(label) ;\
4361
4362 #define GEU_CI(cte1,ptr2,y2,label)\
4363 lda #<(cte1) ;\
4364 ldy #y2 ;\
4365 cmp ptr2,y ;\
4366 iny ;\
4367 lda #>(cte1) ;\
4368 sbc ptr2,y ;\
4369 GEU(label) ;\
4370
4371 #define LTI(label)\
4372 .( ;\
4373 bvc *+4 ;\
4374 eor #$80 ;\
4375 bpl skip ;\
4376 jmp label ;\
4377 skip ;\
4378 .) ;\
4379
4380 #define LTU(label)\
4381 bcs *+5 ;\
4382 jmp label ;\
4383
4384 #define LTI_DC(tmp1,cte2,label)\
4385 lda tmp1 ;\
4386 cmp #<(cte2) ;\
4387 lda tmp1+1 ;\
4388 sbc #>(cte2) ;\
4389 LTI(label) ;\
4390
4391 #define LTI_DD(tmp1,tmp2,label)\
4392 lda tmp1 ;\
4393 cmp tmp2 ;\
4394 lda tmp1+1 ;\
4395 sbc tmp2+1 ;\
4396 LTI(label) ;\
4397
4398 #define LTI_DI(tmp1,ptr2,y2,label)\
4399 lda tmp1 ;\
4400 ldy #y2 ;\
4401 cmp ptr2,y ;\
4402 iny ;\
4403 lda tmp1+1 ;\
4404 sbc ptr2,y ;\
4405 LTI(label) ;\
4406
4407 #define LTI_IC(ptr1,y1,cte2,label)\
4408 ldy #y1 ;\
4409 lda ptr1,y ;\
4410 cmp #<(cte2) ;\
4411 iny ;\
4412 lda ptr1,y ;\
4413 sbc #>(cte2) ;\
4414 LTI(label) ;\
4415
4416 #define LTI_ID(ptr1,y1,tmp2,label)\
4417 ldy #y1 ;\
4418 lda ptr1,y ;\
4419 cmp tmp2 ;\
4420 iny ;\
4421 lda ptr1,y ;\
4422 sbc tmp2+1 ;\
4423 LTI(label) ;\
4424
4425 #define LTI_II(ptr1,y1,ptr2,y2,label)\
4426 ldy #y1 ;\
4427 lda ptr1,y ;\
4428 ldy #y2 ;\
4429 cmp ptr2,y ;\
4430 ldy #y1+1 ;\
4431 lda ptr1,y ;\
4432 ldy #y2+1 ;\
4433 sbc ptr2,y ;\
4434 LTI(label) ;\
4435
4436 #define LTI_CD(cte1,tmp2,label)\
4437 lda #<(cte1) ;\
4438 cmp tmp2 ;\
4439 lda #>(cte1) ;\
4440 sbc tmp2+1 ;\
4441 LTI(label) ;\
4442
4443 #define LTI_CI(cte1,ptr2,y2,label)\
4444 lda #<(cte1) ;\
4445 ldy #y2 ;\
4446 cmp ptr2,y ;\
4447 iny ;\
4448 lda #>(cte1) ;\
4449 sbc ptr2,y ;\
4450 LTI(label) ;\
4451
4452 #define LTU_DC(tmp1,cte2,label)\
4453 lda tmp1 ;\
4454 cmp #<(cte2) ;\
4455 lda tmp1+1 ;\
4456 sbc #>(cte2) ;\
4457 LTU(label) ;\
4458
4459 #define LTU_DD(tmp1,tmp2,label)\
4460 lda tmp1 ;\
4461 cmp tmp2 ;\
4462 lda tmp1+1 ;\
4463 sbc tmp2+1 ;\
4464 LTU(label) ;\
4465
4466 #define LTU_DI(tmp1,ptr2,y2,label)\
4467 lda tmp1 ;\
4468 ldy #y2 ;\
4469 cmp ptr2,y ;\
4470 iny ;\
4471 lda tmp1+1 ;\
4472 sbc ptr2,y ;\
4473 LTU(label) ;\
4474
4475 #define LTU_IC(ptr1,y1,cte2,label)\
4476 ldy #y1 ;\
4477 lda ptr1,y ;\
4478 cmp #<(cte2) ;\
4479 iny ;\
4480 lda ptr1,y ;\
4481 sbc #>(cte2) ;\
4482 LTU(label) ;\
4483
4484 #define LTU_ID(ptr1,y1,tmp2,label)\
4485 ldy #y1 ;\
4486 lda ptr1,y ;\
4487 cmp tmp2 ;\
4488 iny ;\
4489 lda ptr1,y ;\
4490 sbc tmp2+1 ;\
4491 LTU(label) ;\
4492
4493 #define LTU_II(ptr1,y1,ptr2,y2,label)\
4494 ldy #y1 ;\
4495 lda ptr1,y ;\
4496 ldy #y2 ;\
4497 cmp ptr2,y ;\
4498 ldy #y1+1 ;\
4499 lda ptr1,y ;\
4500 ldy #y2+1 ;\
4501 sbc ptr2,y ;\
4502 LTU(label) ;\
4503
4504 #define LTU_CD(cte1,tmp2,label)\
4505 lda #<(cte1) ;\
4506 cmp tmp2 ;\
4507 lda #>(cte1) ;\
4508 sbc tmp2+1 ;\
4509 LTU(label) ;\
4510
4511 #define LTU_CI(cte1,ptr2,y2,label)\
4512 lda #<(cte1) ;\
4513 ldy #y2 ;\
4514 cmp ptr2,y ;\
4515 iny ;\
4516 lda #>(cte1) ;\
4517 sbc ptr2,y ;\
4518 LTU(label) ;\
4519
4520 #define GTI_DC(tmp1,cte2,label)\
4521 LTI_CD(cte2,tmp1,label) ;\
4522
4523 #define GTI_DD(tmp1,tmp2,label)\
4524 LTI_DD(tmp2,tmp1,label) ;\
4525
4526 #define GTI_DI(tmp1,ptr2,y2,label)\
4527 LTI_ID(tmp2,y2,tmp1,label) ;\
4528
4529 #define GTI_IC(ptr1,y1,cte2,label)\
4530 LTI_CI(cte2,ptr1,y1,label) ;\
4531
4532 #define GTI_ID(ptr1,y1,tmp2,label)\
4533 LTI_DI(tmp2,ptr1,y1,label) ;\
4534
4535 #define GTI_II(ptr1,y1,ptr2,y2,label)\
4536 LTI_II(ptr2,y2,ptr1,y1,label) ;\
4537
4538 #define GTI_CD(cte1,tmp2,label)\
4539 LTI_DC(tmp2,cte1,label) ;\
4540
4541 #define GTI_CI(cte1,ptr2,y2,label)\
4542 LTI_IC(ptr2,y2,cte1,label) ;\
4543
4544 #define LEI_DC(tmp1,cte2,label)\
4545 GEI_CD(cte2,tmp1,label) ;\
4546
4547 #define LEI_DD(tmp1,tmp2,label)\
4548 GEI_DD(tmp2,tmp1,label) ;\
4549
4550 #define LEI_DI(tmp1,ptr2,y2,label)\
4551 GEI_ID(tmp2,y2,tmp1,label) ;\
4552
4553 #define LEI_IC(ptr1,y1,cte2,label)\
4554 GEI_CI(cte2,ptr1,y1,label) ;\
4555
4556 #define LEI_ID(ptr1,y1,tmp2,label)\
4557 GEI_DI(tmp2,ptr1,y1,label) ;\
4558
4559 #define LEI_II(ptr1,y1,ptr2,y2,label)\
4560 GEI_II(ptr2,y2,ptr1,y1,label) ;\
4561
4562 #define LEI_CD(cte1,tmp2,label)\
4563 GEI_DC(tmp2,cte1,label) ;\
4564
4565 #define LEI_CI(cte1,ptr2,y2,label)\
4566 GEI_IC(ptr2,y2,cte1,label) ;\
4567
4568 #define GTU_DC(tmp1,cte2,label)\
4569 LTU_CD(cte2,tmp1,label) ;\
4570
4571 #define GTU_DD(tmp1,tmp2,label)\
4572 LTU_DD(tmp2,tmp1,label) ;\
4573
4574 #define GTU_DI(tmp1,ptr2,y2,label)\
4575 LTU_ID(tmp2,y2,tmp1,label) ;\
4576
4577 #define GTU_IC(ptr1,y1,cte2,label)\
4578 LTU_CI(cte2,ptr1,y1,label) ;\
4579
4580 #define GTU_ID(ptr1,y1,tmp2,label)\
4581 LTU_DI(tmp2,ptr1,y1,label) ;\
4582
4583 #define GTU_II(ptr1,y1,ptr2,y2,label)\
4584 LTU_II(ptr2,y2,ptr1,y1,label) ;\
4585
4586 #define GTU_CD(cte1,tmp2,label)\
4587 LTU_DC(tmp2,cte1,label) ;\
4588
4589 #define GTU_CI(cte1,ptr2,y2,label)\
4590 LTU_IC(ptr2,y2,cte1,label) ;\
4591
4592 #define LEU_DC(tmp1,cte2,label)\
4593 GEU_CD(cte2,tmp1,label) ;\
4594
4595 #define LEU_DD(tmp1,tmp2,label)\
4596 GEU_DD(tmp2,tmp1,label) ;\
4597
4598 #define LEU_DI(tmp1,ptr2,y2,label)\
4599 GEU_ID(tmp2,y2,tmp1,label) ;\
4600
4601 #define LEU_IC(ptr1,y1,cte2,label)\
4602 GEU_CI(cte2,ptr1,y1,label) ;\
4603
4604 #define LEU_ID(ptr1,y1,tmp2,label)\
4605 GEU_DI(tmp2,ptr1,y1,label) ;\
4606
4607 #define LEU_II(ptr1,y1,ptr2,y2,label)\
4608 GEU_II(ptr2,y2,ptr1,y1,label) ;\
4609
4610 #define LEU_CD(cte1,tmp2,label)\
4611 GEU_DC(tmp2,cte1,label) ;\
4612
4613 #define LEU_CI(cte1,ptr2,y2,label)\
4614 GEU_IC(ptr2,y2,cte1,label) ;\
4615
4616 #define ARGW_C(cte,ptr,y2)\
4617 lda #<(cte) ;\
4618 ldy #y2 ;\
4619 sta ptr,y ;\
4620 iny ;\
4621 lda #>(cte) ;\
4622 sta ptr,y ;\
4623
4624 #define ARGW_D(tmp,ptr,y2)\
4625 lda tmp ;\
4626 ldy #y2 ;\
4627 sta ptr,y ;\
4628 iny ;\
4629 lda tmp+1 ;\
4630 sta ptr,y ;\
4631
4632 #define ARGW_A(ptr1,y1,ptr,y2)\
4633 clc ;\
4634 lda 0+ptr1 ;\
4635 adc #y1 ;\
4636 ldy #y2 ;\
4637 sta ptr,y ;\
4638 iny ;\
4639 lda 1+ptr1 ;\
4640 adc #0 ;\
4641 sta ptr,y ;\
4642
4643 #define ARGW_I(ptr1,y1,ptr,y2)\
4644 ldy #y1 ;\
4645 lda ptr1,y ;\
4646 ldy #y2 ;\
4647 sta ptr,y ;\
4648 ldy #y1+1 ;\
4649 lda ptr1,y ;\
4650 ldy #y2+1 ;\
4651 sta ptr,y ;\
4652
4653 #define CALLV_C(adr,size)\
4654 ldy #size ;\
4655 jsr adr ;\
4656
4657 #define CALLV_D(tmp,size)\
4658 .( ;\
4659 lda tmp ;\
4660 sta call+1;\
4661 lda tmp+1 ;\
4662 sta call+2 ;\
4663 ldy #size ;\
4664 call ;\
4665 jsr 0000 ;\
4666 .) ;\
4667
4668 #define CALLV_I(ptr,y2,size)\
4669 .( ;\
4670 ldy #y2 ;\
4671 lda ptr,y ;\
4672 sta call+1 ;\
4673 iny ;\
4674 lda ptr,y ;\
4675 sta call+2 ;\
4676 ldy #size ;\
4677 call ;\
4678 jsr 0000 ;\
4679 .) ;\
4680
4681 #define CALLW_CD(adr,size,tmp)\
4682 ldy #size ;\
4683 jsr adr ;\
4684 stx tmp ;\
4685 sta tmp+1 ;\
4686
4687 #define CALLW_DD(tmp1,size,tmp)\
4688 CALLV_D(tmp1,size) \
4689 stx tmp ;\
4690 sta tmp+1 ;\
4691
4692 #define CALLW_ID(ptr,y2,size,tmp)\
4693 CALLV_I(ptr,y2,size) \
4694 stx tmp ;\
4695 sta tmp+1 ;\
4696
4697 #define CALLW_CI(adr,size,ptr,y2)\
4698 ldy #size ;\
4699 jsr adr ;\
4700 ldy #y2+1 ;\
4701 sta ptr,y ;\
4702 dey ;\
4703 txa ;\
4704 sta ptr,y ;\
4705
4706 #define CALLW_II(ptr,y0,size,ptr2,y2)\
4707 CALLV_I(ptr,y0,size) \
4708 ldy #y2+1 ;\
4709 sta ptr2,y ;\
4710 dey ;\
4711 txa ;\
4712 sta ptr2,y ;\
4713
4714
4715 #define JUMP_C(label)\
4716 jmp label ;\
4717
4718 #define JUMP_D(tmp)\
4719 .( ;\
4720 lda tmp ;\
4721 sta jump+1 ;\
4722 lda tmp+1 ;\
4723 sta jump+2 ;\
4724 jump ;\
4725 jmp 0000 ;\
4726 .) ;\
4727
4728 #define JUMP_I(ptr1,y1)\
4729 .( ;\
4730 ldy #y1 ;\
4731 lda ptr1,y ;\
4732 sta jump+1 ;\
4733 iny ;\
4734 lda ptr1,y ;\
4735 sta jump+2 ;\
4736 jump ;\
4737 jmp 0000 ;\
4738 .) ;\
4739
4740 #define FLOAD1_C(tmp)\
4741 lda #<(tmp) ;\
4742 ldy #>(tmp) ;\
4743 jsr load_acc1 ;\
4744
4745 #define FLOAD1_D(tmp)\
4746 lda tmp ;\
4747 ldy tmp+1 ;\
4748 jsr load_acc1 ;\
4749
4750 #define FLOAD1_A(ptr1,y1)\
4751 clc ;\
4752 lda 0+ptr1 ;\
4753 adc #y1 ;\
4754 tax ;\
4755 lda 1+ptr1 ;\
4756 adc #0 ;\
4757 tay ;\
4758 txa ;\
4759 jsr load_acc1 ;\
4760
4761 #define FLOAD1_I(ptr1,y1)\
4762 ldy #y1 ;\
4763 lda ptr1,y ;\
4764 tax ;\
4765 iny ;\
4766 lda ptr1,y ;\
4767 tay ;\
4768 txa ;\
4769 jsr load_acc1 ;\
4770
4771 #define FLOAD2_C(tmp)\
4772 lda #<(tmp) ;\
4773 ldy #>(tmp) ;\
4774 jsr load_acc2 ;\
4775
4776 #define FLOAD2_D(tmp)\
4777 lda tmp ;\
4778 ldy tmp+1 ;\
4779 jsr load_acc2 ;\
4780
4781 #define FLOAD2_A(ptr1,y1)\
4782 clc ;\
4783 lda 0+ptr1 ;\
4784 adc #y1 ;\
4785 tax ;\
4786 lda 1+ptr1 ;\
4787 adc #0 ;\
4788 tay ;\
4789 txa ;\
4790 jsr load_acc2 ;\
4791
4792 #define FLOAD2_I(ptr1,y1)\
4793 ldy #y1 ;\
4794 lda ptr1,y ;\
4795 tax ;\
4796 iny ;\
4797 lda ptr1,y ;\
4798 tay ;\
4799 txa ;\
4800 jsr load_acc2 ;\
4801
4802 #define FSTORE_C(tmp)\
4803 ldx #<(tmp) ;\
4804 ldy #>(tmp) ;\
4805 jsr store_acc ;\
4806
4807 #define FSTORE_D(tmp)\
4808 ldx tmp ;\
4809 ldy tmp+1 ;\
4810 jsr store_acc ;\
4811
4812 #define FSTORE_A(ptr1,y1)\
4813 clc ;\
4814 lda 0+ptr1 ;\
4815 adc #y1 ;\
4816 tax ;\
4817 lda 1+ptr1 ;\
4818 adc #0 ;\
4819 tay ;\
4820 jsr store_acc ;\
4821
4822 #define FSTORE_I(ptr1,y1)\
4823 ldy #y1 ;\
4824 lda ptr1,y ;\
4825 tax ;\
4826 iny ;\
4827 lda ptr1,y ;\
4828 tay ;\
4829 jsr store_acc ;\
4830
4831 #define FADD\
4832 jsr fadd ;\
4833
4834 #define ADDF_DDD(tmp1,tmp2,tmp3)\
4835 FLOAD1_C(tmp1) ;\
4836 FLOAD2_C(tmp2) ;\
4837 FADD ;\
4838 FSTORE_C(tmp3) ;\
4839
4840 #define ADDF_IDD(ptr1,y1,tmp2,tmp3)\
4841 FLOAD1_A(ptr1,y1) ;\
4842 FLOAD2_C(tmp2) ;\
4843 FADD ;\
4844 FSTORE_C(tmp3) ;\
4845
4846 #define ADDF_DID(tmp1,ptr2,y2,tmp3)\
4847 FLOAD1_C(tmp1) ;\
4848 FLOAD2_A(ptr2,y2) ;\
4849 FADD ;\
4850 FSTORE_C(tmp3) ;\
4851
4852 #define ADDF_IID(ptr1,y1,ptr2,y2,tmp3)\
4853 FLOAD1_A(ptr1,y1) ;\
4854 FLOAD2_A(ptr2,y2) ;\
4855 FADD ;\
4856 FSTORE_C(tmp3) ;\
4857
4858 #define ADDF_DDI(tmp1,tmp2,ptr3,y3)\
4859 FLOAD1_C(tmp1) ;\
4860 FLOAD2_C(tmp2) ;\
4861 FADD ;\
4862 FSTORE_A(ptr3,y3) ;\
4863
4864 #define ADDF_IDI(ptr1,y1,tmp2,ptr3,y3)\
4865 FLOAD1_A(ptr1,y1) ;\
4866 FLOAD2_C(tmp2) ;\
4867 FADD ;\
4868 FSTORE_A(ptr3,y3) ;\
4869
4870 #define ADDF_DII(tmp1,ptr2,y2,ptr3,y3)\
4871 FLOAD1_C(tmp1) ;\
4872 FLOAD2_A(ptr2,y2) ;\
4873 FADD ;\
4874 FSTORE_A(ptr3,y3) ;\
4875
4876 #define ADDF_III(ptr1,y1,ptr2,y2,ptr3,y3)\
4877 FLOAD1_A(ptr1,y1) ;\
4878 FLOAD2_A(ptr2,y2) ;\
4879 FADD ;\
4880 FSTORE_A(ptr3,y3) ;\
4881
4882 #define FSUB\
4883 jsr fsub ;\
4884
4885 #define SUBF_DDD(tmp1,tmp2,tmp3)\
4886 FLOAD1_C(tmp2) ;\
4887 FLOAD2_C(tmp1) ;\
4888 FSUB ;\
4889 FSTORE_C(tmp3) ;\
4890
4891 #define SUBF_IDD(ptr1,y1,tmp2,tmp3)\
4892 FLOAD1_C(tmp2) ;\
4893 FLOAD2_A(ptr1,y1) ;\
4894 FSUB ;\
4895 FSTORE_C(tmp3) ;\
4896
4897 #define SUBF_DID(tmp1,ptr2,y2,tmp3)\
4898 FLOAD1_A(ptr2,y2) ;\
4899 FLOAD2_C(tmp1) ;\
4900 FSUB ;\
4901 FSTORE_C(tmp3) ;\
4902
4903 #define SUBF_IID(ptr1,y1,ptr2,y2,tmp3)\
4904 FLOAD1_A(ptr2,y2) ;\
4905 FLOAD2_A(ptr1,y1) ;\
4906 FSUB ;\
4907 FSTORE_C(tmp3) ;\
4908
4909 #define SUBF_DDI(tmp1,tmp2,ptr3,y3)\
4910 FLOAD1_C(tmp2) ;\
4911 FLOAD2_C(tmp1) ;\
4912 FSUB ;\
4913 FSTORE_A(ptr3,y3) ;\
4914
4915 #define SUBF_IDI(ptr1,y1,tmp2,ptr3,y3)\
4916 FLOAD1_C(tmp2) ;\
4917 FLOAD2_A(ptr1,y1) ;\
4918 FSUB ;\
4919 FSTORE_A(ptr3,y3) ;\
4920
4921 #define SUBF_DII(tmp1,ptr2,y2,ptr3,y3)\
4922 FLOAD1_A(ptr2,y2) ;\
4923 FLOAD2_C(tmp1) ;\
4924 FSUB ;\
4925 FSTORE_A(ptr3,y3) ;\
4926
4927 #define SUBF_III(ptr1,y1,ptr2,y2,ptr3,y3)\
4928 FLOAD1_A(ptr2,y2) ;\
4929 FLOAD2_A(ptr1,y1) ;\
4930 FSUB ;\
4931 FSTORE_A(ptr3,y3) ;\
4932
4933 #define FMUL\
4934 jsr fmul ;\
4935
4936 #define MULF_DDD(tmp1,tmp2,tmp3)\
4937 FLOAD1_C(tmp2) ;\
4938 FLOAD2_C(tmp1) ;\
4939 FMUL ;\
4940 FSTORE_C(tmp3) ;\
4941
4942 #define MULF_IDD(ptr1,y1,tmp2,tmp3)\
4943 FLOAD1_C(tmp2) ;\
4944 FLOAD2_A(ptr1,y1) ;\
4945 FMUL ;\
4946 FSTORE_C(tmp3) ;\
4947
4948 #define MULF_DID(tmp1,ptr2,y2,tmp3)\
4949 FLOAD1_A(ptr2,y2) ;\
4950 FLOAD2_C(tmp1) ;\
4951 FMUL ;\
4952 FSTORE_C(tmp3) ;\
4953
4954 #define MULF_IID(ptr1,y1,ptr2,y2,tmp3)\
4955 FLOAD1_A(ptr2,y2) ;\
4956 FLOAD2_A(ptr1,y1) ;\
4957 FMUL ;\
4958 FSTORE_C(tmp3) ;\
4959
4960 #define MULF_DDI(tmp1,tmp2,ptr3,y3)\
4961 FLOAD1_C(tmp2) ;\
4962 FLOAD2_C(tmp1) ;\
4963 FMUL ;\
4964 FSTORE_A(ptr3,y3) ;\
4965
4966 #define MULF_IDI(ptr1,y1,tmp2,ptr3,y3)\
4967 FLOAD1_C(tmp2) ;\
4968 FLOAD2_A(ptr1,y1) ;\
4969 FMUL ;\
4970 FSTORE_A(ptr3,y3) ;\
4971
4972 #define MULF_DII(tmp1,ptr2,y2,ptr3,y3)\
4973 FLOAD1_A(ptr2,y2) ;\
4974 FLOAD2_C(tmp1) ;\
4975 FMUL ;\
4976 FSTORE_A(ptr3,y3) ;\
4977
4978 #define MULF_III(ptr1,y1,ptr2,y2,ptr3,y3)\
4979 FLOAD1_A(ptr2,y2) ;\
4980 FLOAD2_A(ptr1,y1) ;\
4981 FMUL ;\
4982 FSTORE_A(ptr3,y3) ;\
4983
4984 #define FDIV\
4985 jsr fdiv ;\
4986
4987 #define DIVF_DDD(tmp1,tmp2,tmp3)\
4988 FLOAD1_C(tmp2) ;\
4989 FLOAD2_C(tmp1) ;\
4990 FDIV ;\
4991 FSTORE_C(tmp3) ;\
4992
4993 #define DIVF_IDD(ptr1,y1,tmp2,tmp3)\
4994 FLOAD1_C(tmp2) ;\
4995 FLOAD2_A(ptr1,y1) ;\
4996 FDIV ;\
4997 FSTORE_C(tmp3) ;\
4998
4999 #define DIVF_DID(tmp1,ptr2,y2,tmp3)\
5000 FLOAD1_A(ptr2,y2) ;\
5001 FLOAD2_C(tmp1) ;\
5002 FDIV ;\
5003 FSTORE_C(tmp3) ;\
5004
5005 #define DIVF_IID(ptr1,y1,ptr2,y2,tmp3)\
5006 FLOAD1_A(ptr2,y2) ;\
5007 FLOAD2_A(ptr1,y1) ;\
5008 FDIV ;\
5009 FSTORE_C(tmp3) ;\
5010
5011 #define DIVF_DDI(tmp1,tmp2,ptr3,y3)\
5012 FLOAD1_C(tmp2) ;\
5013 FLOAD2_C(tmp1) ;\
5014 FDIV ;\
5015 FSTORE_A(ptr3,y3) ;\
5016
5017 #define DIVF_IDI(ptr1,y1,tmp2,ptr3,y3)\
5018 FLOAD1_C(tmp2) ;\
5019 FLOAD2_A(ptr1,y1) ;\
5020 FDIV ;\
5021 FSTORE_A(ptr3,y3) ;\
5022
5023 #define DIVF_DII(tmp1,ptr2,y2,ptr3,y3)\
5024 FLOAD1_A(ptr2,y2) ;\
5025 FLOAD2_C(tmp1) ;\
5026 FDIV ;\
5027 FSTORE_A(ptr3,y3) ;\
5028
5029 #define DIVF_III(ptr1,y1,ptr2,y2,ptr3,y3)\
5030 FLOAD1_A(ptr2,y2) ;\
5031 FLOAD2_A(ptr1,y1) ;\
5032 FDIV ;\
5033 FSTORE_A(ptr3,y3) ;\
5034
5035 #define FNEG\
5036 jsr fneg ;\
5037
5038 #define NEGF_DD(tmp1,tmp2)\
5039 FLOAD1_C(tmp1) ;\
5040 FNEG ;\
5041 FSTORE_C(tmp2) ;\
5042
5043 #define NEGF_ID(ptr1,y1,tmp2)\
5044 FLOAD1_A(ptr1,y1) ;\
5045 FNEG ;\
5046 FSTORE_C(tmp2) ;\
5047
5048 #define NEGF_DI(tmp1,ptr2,y2)\
5049 FLOAD1_C(tmp1) ;\
5050 FNEG ;\
5051 FSTORE_A(ptr2,y2) ;\
5052
5053 #define NEGF_II(ptr1,y1,ptr2,y2)\
5054 FLOAD1_A(ptr1,y1) ;\
5055 FNEG ;\
5056 FSTORE_A(ptr2,y2) ;\
5057
5058 #define INDIRF_CD(tmp1,tmp2)\
5059 FLOAD1_C(tmp1) ;\
5060 FSTORE_C(tmp2) ;\
5061
5062 #define INDIRF_CI(tmp1,ptr2,y2)\
5063 FLOAD1_C(tmp1) ;\
5064 FSTORE_A(ptr2,y2) ;\
5065
5066 #define INDIRF_DD(tmp1,tmp2)\
5067 FLOAD1_D(tmp1) ;\
5068 FSTORE_C(tmp2) ;\
5069
5070 #define INDIRF_DI(tmp1,ptr2,y2)\
5071 FLOAD1_D(tmp1) ;\
5072 FSTORE_A(ptr2,y2) ;\
5073
5074 #define INDIRF_AD(ptr1,y1,tmp2)\
5075 FLOAD1_A(ptr1,y1) ;\
5076 FSTORE_C(tmp2) ;\
5077
5078 #define INDIRF_AI(ptr1,y1,ptr2,y2)\
5079 FLOAD1_A(ptr1,y1) ;\
5080 FSTORE_A(ptr2,y2) ;\
5081
5082 #define INDIRF_ID(ptr1,y1,tmp2)\
5083 FLOAD1_I(ptr1,y1) ;\
5084 FSTORE_C(tmp2) ;\
5085
5086 #define INDIRF_II(ptr1,y1,ptr2,y2)\
5087 FLOAD1_I(ptr1,y1) ;\
5088 FSTORE_A(ptr2,y2) ;\
5089
5090 #define MOVF_DD(tmp1,tmp2)\
5091 INDIRF_CD(tmp1,tmp2) ;\
5092
5093 #define MOVF_DI(tmp1,ptr2,y2)\
5094 INDIRF_CI(tmp1,ptr2,y2) ;\
5095
5096 #define MOVF_ID(ptr1,y1,tmp2)\
5097 INDIRF_AD(ptr1,y1,tmp2) ;\
5098
5099 #define MOVF_II(ptr1,y1,ptr2,y2)\
5100 INDIRF_AI(ptr1,y1,ptr2,y2) ;\
5101
5102 #define CFI_D(tmp1)\
5103 jsr cfi ;\
5104 sta tmp1 ;\
5105 stx tmp1+1 ;\
5106
5107 #define CFI_I(ptr1,y1)\
5108 jsr cfi ;\
5109 ldy #y1 ;\
5110 sta ptr1,y ;\
5111 iny ;\
5112 txa ;\
5113 sta ptr1,y ;\
5114
5115 #define CFI_DD(tmp1,tmp2)\
5116 FLOAD1_C(tmp1) ;\
5117 CFI_D(tmp2) ;\
5118
5119 #define CFI_DI(tmp1,ptr2,y2)\
5120 FLOAD1_C(tmp1) ;\
5121 CFI_I(ptr2,y2) ;\
5122
5123 #define CFI_ID(ptr1,y1,tmp2)\
5124 FLOAD1_A(ptr1,y1) ;\
5125 CFI_D(tmp2) ;\
5126
5127 #define CFI_II(ptr1,y1,ptr2,y2)\
5128 FLOAD1_A(ptr1,y1) ;\
5129 CFI_I(ptr2,y2) ;\
5130
5131 #define CIF_C(cte)\
5132 ldy #<(cte) ;\
5133 lda #>(cte) ;\
5134 jsr cif ;\
5135
5136 #define CIF_D(tmp1)\
5137 ldy tmp1 ;\
5138 lda tmp1+1 ;\
5139 jsr cif ;\
5140
5141 #define CIF_I(ptr1,y1)\
5142 ldy #y1 ;\
5143 iny ;\
5144 lda ptr1,y ;\
5145 tax ;\
5146 dey ;\
5147 lda ptr1,y ;\
5148 tay ;\
5149 txa ;\
5150 jsr cif ;\
5151
5152 #define CIF_CD(cte,tmp) \
5153 CIF_C(cte) ;\
5154 FSTORE_C(tmp) ;\
5155
5156 #define CIF_CI(cte,ptr1,y1) \
5157 CIF_C(cte) ;\
5158 FSTORE_A(ptr1,y1) ;\
5159
5160 #define CIF_DD(tmp1,tmp2)\
5161 CIF_D(tmp1) ;\
5162 FSTORE_C(tmp2) ;\
5163
5164 #define CIF_DI(tmp1,ptr2,y2)\
5165 CIF_D(tmp1) ;\
5166 FSTORE_A(ptr2,y2) ;\
5167
5168 #define CIF_ID(ptr1,y1,tmp2)\
5169 CIF_I(ptr1,y1) ;\
5170 FSTORE_C(tmp2) ;\
5171
5172 #define CIF_II(ptr1,y1,ptr2,y2)\
5173 CIF_I(ptr1,y1) ;\
5174 FSTORE_A(ptr2,y2) ;\
5175
5176 #define RETF_D(tmp1)\
5177 FLOAD1_C(tmp1) ;\
5178 rts ;\
5179
5180 #define RETF_I(ptr1,y1)\
5181 FLOAD1_A(ptr1,y1) ;\
5182 rts ;\
5183
5184 #define LEAVEF_D(tmp1)\
5185 FLOAD1_C(tmp1) ;\
5186 jmp leave ;\
5187
5188 #define LEAVEF_I(ptr1,y1)\
5189 FLOAD1_A(ptr1,y1) ;\
5190 jmp leave ;\
5191
5192 #define ASGNF_DC(tmp1,tmp2)\
5193 FLOAD1_C(tmp1) ;\
5194 FSTORE_C(tmp2) ;\
5195
5196 #define ASGNF_DA(tmp1,ptr2,y2)\
5197 FLOAD1_C(tmp1) ;\
5198 FSTORE_A(ptr2,y2) ;\
5199
5200 #define ASGNF_DZ(tmp1,tmp2)\
5201 FLOAD1_C(tmp1) ;\
5202 FSTORE_D(tmp2) ;\
5203
5204 #define ASGNF_DD(tmp1,tmp2)\
5205 FLOAD1_C(tmp1) ;\
5206 FSTORE_D(tmp2) ;\
5207
5208 #define ASGNF_DI(tmp1,ptr2,y2)\
5209 FLOAD1_C(tmp1) ;\
5210 FSTORE_I(ptr2,y2) ;\
5211
5212 #define ASGNF_IC(ptr1,y1,tmp2)\
5213 FLOAD1_A(ptr1,y1) ;\
5214 FSTORE_C(tmp2) ;\
5215
5216 #define ASGNF_IZ(ptr1,y1,tmp2)\
5217 FLOAD1_A(ptr1,y1) ;\
5218 FSTORE_D(tmp2) ;\
5219
5220 #define ASGNF_ID(ptr1,y1,tmp2)\
5221 FLOAD1_A(ptr1,y1) ;\
5222 FSTORE_D(tmp2) ;\
5223
5224 #define ASGNF_IA(ptr1,y1,ptr2,y2)\
5225 FLOAD1_A(ptr1,y1) ;\
5226 FSTORE_A(ptr2,y2) ;\
5227
5228 #define ASGNF_II(ptr1,y1,ptr2,y2)\
5229 FLOAD1_A(ptr1,y1) ;\
5230 FSTORE_I(ptr2,y2) ;\
5231
5232 #define ARGF_D(tmp1,ptr2,y2)\
5233 FLOAD1_C(tmp1) ;\
5234 FSTORE_A(ptr2,y2) ;\
5235
5236 #define ARGF_I(ptr1,y1,ptr2,y2)\
5237 FLOAD1_A(ptr1,y1) ;\
5238 FSTORE_A(ptr2,y2) ;\
5239
5240 #define ARGS_C(adr,ptr2,y2,size) \
5241 ASGNS_CA(adr,ptr2,y2,size) ;\
5242
5243 #define ARGS_D(tmp1,ptr2,y2,size)\
5244 ASGNS_DA(tmp1,ptr2,y2,size) ;\
5245
5246 #define ARGS_A(ptr1,y1,ptr2,y2,size) \
5247 ASGNS_AA(ptr1,y1,ptr2,y2,size) ;\
5248
5249 #define ARGS_I(ptr1,y1,ptr2,y2,size)\
5250 ASGNS_IA(ptr1,y1,ptr2,y2,size) ;\
5251
5252 #define CALLF_CD(adr,size,tmp)\
5253 ldy #size ;\
5254 jsr adr ;\
5255 FSTORE_C(tmp) ;\
5256
5257 #define CALLF_DD(tmp1,size,tmp)\
5258 lda tmp1 ;\
5259 sta *+11 ;\
5260 lda tmp1+1 ;\
5261 sta *+7 ;\
5262 ldy #size ;\
5263 jsr 0000 ;\
5264 FSTORE_C(tmp) ;\
5265
5266 #define CALLF_ID(ptr,y2,size,tmp)\
5267 ldy #y2 ;\
5268 lda ptr,y ;\
5269 sta jsrvect+1 ;\
5270 iny ;\
5271 lda ptr,y ;\
5272 sta jsrvect+2 ;\
5273 ldy #size ;\
5274 jsr jsrvect ;\
5275 FSTORE_C(tmp) ;\
5276
5277 #define CALLF_CI(adr,size,ptr2,y2)\
5278 ldy #size ;\
5279 jsr adr ;\
5280 FSTORE_A(ptr2,y2) ;\
5281
5282 #define CALLF_II(ptr,y0,size,ptr2,y2)\
5283 ldy #y0 ;\
5284 lda ptr,y ;\
5285 sta jsrvect+1 ;\
5286 iny ;\
5287 lda ptr,y ;\
5288 sta jsrvect+2 ;\
5289 ldy #size ;\
5290 jsr jsrvect ;\
5291 FSTORE_A(ptr2,y2) ;\
5292
5293 #define FCOMP_D(tmp1)\
5294 lda #<(tmp1) ;\
5295 ldy #>(tmp1) ;\
5296 jsr fcomp ;\
5297
5298 #define FCOMP_I(ptr1,y1)\
5299 clc ;\
5300 lda 0+ptr1 ;\
5301 adc #y1 ;\
5302 tax ;\
5303 lda 1+ptr1 ;\
5304 adc #0 ;\
5305 tay ;\
5306 txa ;\
5307 jsr fcomp ;\
5308
5309 #define EQF_DD(tmp1,tmp2,label)\
5310 FLOAD1_C(tmp1) ;\
5311 FCOMP_D(tmp2) ;\
5312 bne *+5 ;\
5313 jmp label ;\
5314
5315 #define EQF_DI(tmp1,ptr2,y2,label)\
5316 FLOAD1_C(tmp1) ;\
5317 FCOMP_I(ptr2,y2) ;\
5318 bne *+5 ;\
5319 jmp label ;\
5320
5321 #define EQF_ID(ptr1,y1,tmp2,label)\
5322 FLOAD1_A(ptr1,y1) ;\
5323 FCOMP_D(tmp2) ;\
5324 bne *+5 ;\
5325 jmp label ;\
5326
5327 #define EQF_II(ptr1,y1,ptr2,y2,label)\
5328 FLOAD1_A(ptr1,y1) ;\
5329 FCOMP_I(ptr2,y2) ;\
5330 bne *+5 ;\
5331 jmp label ;\
5332
5333 #define NEF_DD(tmp1,tmp2,label)\
5334 FLOAD1_C(tmp1) ;\
5335 FCOMP_D(tmp2) ;\
5336 beq *+5 ;\
5337 jmp label ;\
5338
5339 #define NEF_DI(tmp1,ptr2,y2,label)\
5340 FLOAD1_C(tmp1) ;\
5341 FCOMP_I(ptr2,y2) ;\
5342 beq *+5 ;\
5343 jmp label ;\
5344
5345 #define NEF_ID(ptr1,y1,tmp2,label)\
5346 FLOAD1_A(ptr1,y1) ;\
5347 FCOMP_D(tmp2) ;\
5348 beq *+5 ;\
5349 jmp label ;\
5350
5351 #define NEF_II(ptr1,y1,ptr2,y2,label)\
5352 FLOAD1_A(ptr1,y1) ;\
5353 FCOMP_I(ptr2,y2) ;\
5354 beq *+5 ;\
5355 jmp label ;\
5356
5357 #define GEF_DD(tmp1,tmp2,label)\
5358 FLOAD1_C(tmp1) ;\
5359 FCOMP_D(tmp2) ;\
5360 bmi *+5 ;\
5361 jmp label ;\
5362
5363 #define GEF_DI(tmp1,ptr2,y2,label)\
5364 FLOAD1_C(tmp1) ;\
5365 FCOMP_I(ptr2,y2) ;\
5366 bmi *+5 ;\
5367 jmp label ;\
5368
5369 #define GEF_ID(ptr1,y1,tmp2,label)\
5370 FLOAD1_A(ptr1,y1) ;\
5371 FCOMP_D(tmp2) ;\
5372 bmi *+5 ;\
5373 jmp label ;\
5374
5375 #define GEF_II(ptr1,y1,ptr2,y2,label)\
5376 FLOAD1_A(ptr1,y1) ;\
5377 FCOMP_I(ptr2,y2) ;\
5378 bmi *+5 ;\
5379 jmp label ;\
5380
5381 #define LTF_DD(tmp1,tmp2,label)\
5382 FLOAD1_C(tmp1) ;\
5383 FCOMP_D(tmp2) ;\
5384 bpl *+5 ;\
5385 jmp label ;\
5386
5387 #define LTF_DI(tmp1,ptr2,y2,label)\
5388 FLOAD1_C(tmp1) ;\
5389 FCOMP_I(ptr2,y2) ;\
5390 bpl *+5 ;\
5391 jmp label ;\
5392
5393 #define LTF_ID(ptr1,y1,tmp2,label)\
5394 FLOAD1_A(ptr1,y1) ;\
5395 FCOMP_D(tmp2) ;\
5396 bpl *+5 ;\
5397 jmp label ;\
5398
5399 #define LTF_II(ptr1,y1,ptr2,y2,label)\
5400 FLOAD1_A(ptr1,y1) ;\
5401 FCOMP_I(ptr2,y2) ;\
5402 bpl *+5 ;\
5403 jmp label ;\
5404
5405 #define GTF_DD(tmp1,tmp2,label)\
5406 FLOAD1_C(tmp1) ;\
5407 FCOMP_D(tmp2) ;\
5408 beq *+7 ;\
5409 bmi *+5 ;\
5410 jmp label ;\
5411
5412 #define GTF_DI(tmp1,ptr2,y2,label)\
5413 FLOAD1_C(tmp1) ;\
5414 FCOMP_I(ptr2,y2) ;\
5415 beq *+7 ;\
5416 bmi *+5 ;\
5417 jmp label ;\
5418
5419 #define GTF_ID(ptr1,y1,tmp2,label)\
5420 FLOAD1_A(ptr1,y1) ;\
5421 FCOMP_D(tmp2) ;\
5422 beq *+7 ;\
5423 bmi *+5 ;\
5424 jmp label ;\
5425
5426 #define GTF_II(ptr1,y1,ptr2,y2,label)\
5427 FLOAD1_A(ptr1,y1) ;\
5428 FCOMP_I(ptr2,y2) ;\
5429 beq *+7 ;\
5430 bmi *+5 ;\
5431 jmp label ;\
5432
5433 #define LEF_DD(tmp1,tmp2,label)\
5434 FLOAD1_C(tmp1) ;\
5435 FCOMP_D(tmp2) ;\
5436 beq *+4 ;\
5437 bpl *+5 ;\
5438 jmp label ;\
5439
5440 #define LEF_DI(tmp1,ptr2,y2,label)\
5441 FLOAD1_C(tmp1) ;\
5442 FCOMP_I(ptr2,y2) ;\
5443 beq *+4 ;\
5444 bpl *+5 ;\
5445 jmp label ;\
5446
5447 #define LEF_ID(ptr1,y1,tmp2,label)\
5448 FLOAD1_A(ptr1,y1) ;\
5449 FCOMP_D(tmp2) ;\
5450 beq *+4 ;\
5451 bpl *+5 ;\
5452 jmp label ;\
5453
5454 #define LEF_II(ptr1,y1,ptr2,y2,label)\
5455 FLOAD1_A(ptr1,y1) ;\
5456 FCOMP_I(ptr2,y2) ;\
5457 beq *+4 ;\
5458 bpl *+5 ;\
5459 jmp label ;\
5460

  ViewVC Help
Powered by ViewVC 1.1.26