/[projet1]/public/oric/games/Dungeon Demo/BAK1/MACROS.H
Defence Force logotype

Contents of /public/oric/games/Dungeon Demo/BAK1/MACROS.H

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1376 - (show annotations)
Mon Jul 25 19:48:05 2016 UTC (3 years, 3 months ago) by dbug
File MIME type: text/plain
File size: 63223 byte(s)
Added the complete (not cleaned up, pure legacy) source code and assets for the 1996 Dungeon Master tech demo.
To get that to actually work, you need (at least):
- A dos machine (or a Windows 95/Windows 98)
- The Wacom compiler
- The old version of the Oric Compiler toolchain (the OSDK ancestor)

1 /* macros for the 16 bit code generator (version 1.19) F.Frances */
2
3 #define DB(n)\
4 BYTE n ;\
5
6 #define DW(n)\
7 WORD n ;\
8
9 #define SPACE(n)\
10 RESERVE n ;\
11
12 #define ZERO(n)\
13 RESERVE 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 #LOW(cte1) ;\
25 lda #HIGH(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 #LOW(cte1) ;\
55 lda #HIGH(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 #LOW(cte1) ;\
74 stx tmp ;\
75 lda #HIGH(cte1) ;\
76 sta tmp+1 ;\
77
78 #define ADDR_CD(adr1,tmp)\
79 ldx #LOW(adr1) ;\
80 stx tmp ;\
81 lda #HIGH(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 #LOW cte1 ;\
139 sta tmp2 ;\
140
141 #define CWB_CI(cte1,ptr2,y2)\
142 ldy #y2 ;\
143 lda #LOW 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 #LOW(cte1) ;\
200 sta tmp2 ;\
201 lda #HIGH(cte1) ;\
202 sta tmp2+1 ;\
203
204 #define MOVW_CI(cte1,ptr2,y2)\
205 ldy #y2 ;\
206 lda #LOW(cte1) ;\
207 sta ptr2,y ;\
208 iny ;\
209 lda #HIGH(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 bpl *+4 ;\
237 lda #$FF ;\
238 sta tmp2+1 ;\
239
240 #define CSBW_CI(cte1,ptr2,y2)\
241 ldy #y2 ;\
242 ldx #0 ;\
243 lda #cte1 ;\
244 sta ptr2,y ;\
245 bpl *+4 ;\
246 ldx #$FF ;\
247 txa ;\
248 iny ;\
249 sta ptr2,y ;\
250
251 #define CSBW_DD(tmp1,tmp2)\
252 lda #0 ;\
253 ldx tmp1 ;\
254 stx tmp2 ;\
255 bpl *+4 ;\
256 lda #$FF ;\
257 sta tmp2+1 ;\
258
259 #define CSBW_DI(tmp1,ptr2,y2)\
260 ldy #y2 ;\
261 ldx #0 ;\
262 lda tmp1 ;\
263 sta ptr2,y ;\
264 bpl *+4 ;\
265 ldx #$FF ;\
266 txa ;\
267 iny ;\
268 sta ptr2,y ;\
269
270 #define CSBW_ID(ptr1,y1,tmp2)\
271 ldy #y1 ;\
272 ldx #0 ;\
273 lda ptr1,y ;\
274 sta tmp2 ;\
275 bpl *+4 ;\
276 ldx #$FF ;\
277 txa ;\
278 sta tmp2+1 ;\
279
280 #define CSBW_II(ptr1,y1,ptr2,y2)\
281 ldy #y1 ;\
282 ldx #0 ;\
283 lda ptr1,y ;\
284 ldy #y2 ;\
285 sta ptr2,y ;\
286 bpl *+4 ;\
287 ldx #$FF ;\
288 txa ;\
289 iny ;\
290 sta ptr2,y ;\
291
292 #define INDIRB_CD(var1,tmp2)\
293 lda var1 ;\
294 sta tmp2 ;\
295
296 #define INDIRB_ZD(ptr1,tmp2)\
297 ldy #0 ;\
298 lda (ptr1),y ;\
299 sta tmp2 ;\
300
301 #define INDIRB_DD(var1,tmp2)\
302 ldx var1 ;\
303 lda var1+1 ;\
304 stx tmp ;\
305 sta tmp+1 ;\
306 ldy #0 ;\
307 lda (tmp),y ;\
308 sta tmp2 ;\
309
310 #define INDIRB_AD(ptr1,y1,tmp2)\
311 ldy #y1 ;\
312 lda ptr1,y ;\
313 sta tmp2 ;\
314
315 #define INDIRB_ID(ptr1,y1,tmp2)\
316 ldy #y1 ;\
317 lda ptr1,y ;\
318 sta tmp ;\
319 iny ;\
320 lda ptr1,y ;\
321 sta tmp+1 ;\
322 ldy #0 ;\
323 lda (tmp),y ;\
324 sta tmp2 ;\
325
326 #define INDIRB_CI(var1,ptr2,y2)\
327 ldy #y2 ;\
328 lda var1 ;\
329 sta ptr2,y ;\
330
331 #define INDIRB_ZI(ptr1,ptr2,y2)\
332 ldy #0 ;\
333 lda (ptr1),y ;\
334 ldy #y2 ;\
335 sta ptr2,y ;\
336
337 #define INDIRB_DI(var1,ptr2,y2)\
338 ldx var1 ;\
339 lda var1+1 ;\
340 stx tmp ;\
341 sta tmp+1 ;\
342 ldy #0 ;\
343 lda (tmp),y ;\
344 ldy #y2 ;\
345 sta ptr2,y ;\
346
347 #define INDIRB_AI(ptr1,y1,ptr2,y2)\
348 ldy #y1 ;\
349 lda ptr1,y ;\
350 ldy #y2 ;\
351 sta ptr2,y ;\
352
353 #define INDIRB_II(ptr1,y1,ptr2,y2)\
354 ldy #y1 ;\
355 lda ptr1,y ;\
356 sta tmp ;\
357 iny ;\
358 lda ptr1,y ;\
359 sta tmp+1 ;\
360 ldy #0 ;\
361 lda (tmp),y ;\
362 ldy #y2 ;\
363 sta ptr2,y ;\
364
365 #define INDIRW_CD(var1,tmp2)\
366 lda var1 ;\
367 sta tmp2 ;\
368 lda var1+1 ;\
369 sta tmp2+1 ;\
370
371 #define INDIRW_ZD(ptr1,tmp2)\
372 ldy #0 ;\
373 lda (ptr1),y ;\
374 tax ;\
375 iny ;\
376 lda (ptr1),y ;\
377 stx tmp2 ;\
378 sta tmp2+1 ;\
379
380 #define INDIRW_DD(var1,tmp2)\
381 ldx var1 ;\
382 lda var1+1 ;\
383 stx tmp ;\
384 sta tmp+1 ;\
385 ldy #0 ;\
386 lda (tmp),y ;\
387 sta tmp2 ;\
388 iny ;\
389 lda (tmp),y ;\
390 sta tmp2+1 ;\
391
392 #define INDIRW_AD(ptr1,y1,tmp2)\
393 ldy #y1 ;\
394 lda ptr1,y ;\
395 sta tmp2 ;\
396 iny ;\
397 lda ptr1,y ;\
398 sta tmp2+1 ;\
399
400 #define INDIRW_ID(ptr1,y1,tmp2)\
401 ldy #y1 ;\
402 lda ptr1,y ;\
403 sta tmp ;\
404 iny ;\
405 lda ptr1,y ;\
406 sta tmp+1 ;\
407 ldy #0 ;\
408 lda (tmp),y ;\
409 sta tmp2 ;\
410 iny ;\
411 lda (tmp),y ;\
412 sta tmp2+1 ;\
413
414 #define INDIRW_CI(var1,ptr2,y2)\
415 ldy #y2 ;\
416 lda var1 ;\
417 sta ptr2,y ;\
418 iny ;\
419 lda var1+1 ;\
420 sta ptr2,y ;\
421
422 #define INDIRW_ZI(ptr1,ptr2,y2)\
423 ldy #0 ;\
424 lda (ptr1),y ;\
425 ldy #y2 ;\
426 sta ptr2,y ;\
427 ldy #1 ;\
428 lda (ptr1),y ;\
429 ldy #y2+1 ;\
430 sta ptr2,y ;\
431
432 #define INDIRW_DI(var1,ptr2,y2)\
433 ldx var1 ;\
434 lda var1+1 ;\
435 stx tmp ;\
436 sta tmp+1 ;\
437 ldy #0 ;\
438 lda (tmp),y ;\
439 ldy #y2 ;\
440 sta ptr2,y ;\
441 ldy #1 ;\
442 lda (tmp),y ;\
443 ldy #y2+1 ;\
444 sta ptr2,y ;\
445
446 #define INDIRW_AI(ptr1,y1,ptr2,y2)\
447 ldy #y1 ;\
448 lda ptr1,y ;\
449 ldy #y2 ;\
450 sta ptr2,y ;\
451 ldy #y1+1 ;\
452 lda ptr1,y ;\
453 ldy #y2+1 ;\
454 sta ptr2,y ;\
455
456 #define INDIRW_II(ptr1,y1,ptr2,y2)\
457 ldy #y1 ;\
458 lda ptr1,y ;\
459 sta tmp ;\
460 iny ;\
461 lda ptr1,y ;\
462 sta tmp+1 ;\
463 ldy #0 ;\
464 lda (tmp),y ;\
465 ldy #y2 ;\
466 sta ptr2,y ;\
467 ldy #1 ;\
468 lda (tmp),y ;\
469 ldy #y2+1 ;\
470 sta ptr2,y ;\
471
472 #define NEGI_DD(tmp1,tmp2)\
473 lda #0 ;\
474 sec ;\
475 sbc tmp1 ;\
476 sta tmp2 ;\
477 lda #0 ;\
478 sbc tmp1+1 ;\
479 sta tmp2+1 ;\
480
481 #define NEGI_DI(tmp1,ptr2,y2)\
482 ldy #y2 ;\
483 lda #0 ;\
484 sec ;\
485 sbc tmp1 ;\
486 sta ptr2,y ;\
487 iny ;\
488 lda #0 ;\
489 sbc tmp1+1 ;\
490 sta ptr2,y ;\
491
492 #define NEGI_ID(ptr1,y1,tmp2)\
493 ldy #y1 ;\
494 lda #0 ;\
495 sec ;\
496 sbc ptr1,y ;\
497 sta tmp2 ;\
498 iny ;\
499 lda #0 ;\
500 sbc ptr1,y ;\
501 sta tmp2+1 ;\
502
503 #define NEGI_II(ptr1,y1,ptr2,y2)\
504 ldy #y1 ;\
505 lda #0 ;\
506 sec ;\
507 sbc ptr1,y ;\
508 ldy #y2 ;\
509 sta ptr2,y ;\
510 ldy #y1+1 ;\
511 lda #0 ;\
512 sbc ptr1,y ;\
513 ldy #y2+1 ;\
514 sta ptr2,y ;\
515
516 #define INCW_Z(tmp1)\
517 inc tmp1 ;\
518 bne *+4 ;\
519 inc tmp1+1 ;\
520
521 #define INCW_D(var1)\
522 inc var1 ;\
523 bne *+5 ;\
524 inc var1+1 ;\
525
526 #define DECW_Z(tmp1)\
527 lda tmp1 ;\
528 bne *+4 ;\
529 dec tmp1+1 ;\
530 dec tmp1 ;\
531
532 #define DECW_D(var1)\
533 lda var1 ;\
534 bne *+5 ;\
535 dec var1+1 ;\
536 dec var1 ;\
537
538 #define ADDW_DDD(tmp1,tmp2,tmp3)\
539 clc ;\
540 lda tmp1 ;\
541 adc tmp2 ;\
542 sta tmp3 ;\
543 lda tmp1+1 ;\
544 adc tmp2+1 ;\
545 sta tmp3+1 ;\
546
547 #define ADDW_IDD(ptr1,y1,tmp2,tmp3)\
548 clc ;\
549 ldy #y1 ;\
550 lda ptr1,y ;\
551 adc tmp2 ;\
552 sta tmp3 ;\
553 iny ;\
554 lda ptr1,y ;\
555 adc tmp2+1 ;\
556 sta tmp3+1 ;\
557
558 #define ADDW_DID(tmp1,ptr2,y2,tmp3)\
559 clc ;\
560 lda tmp1 ;\
561 ldy #y2 ;\
562 adc ptr2,y ;\
563 sta tmp3 ;\
564 iny ;\
565 lda tmp1+1 ;\
566 adc ptr2,y ;\
567 sta tmp3+1 ;\
568
569 #define ADDW_IID(ptr1,y1,ptr2,y2,tmp3)\
570 clc ;\
571 ldy #y1 ;\
572 lda ptr1,y ;\
573 ldy #y2 ;\
574 adc ptr2,y ;\
575 sta tmp3 ;\
576 lda #y1+1 ;\
577 lda ptr1,y ;\
578 ldy #y2+1 ;\
579 adc ptr2,y ;\
580 sta tmp3+1 ;\
581
582 #define ADDW_DDI(tmp1,tmp2,ptr3,y3)\
583 clc ;\
584 lda tmp1 ;\
585 adc tmp2 ;\
586 ldy #y3 ;\
587 sta ptr3,y ;\
588 iny ;\
589 lda tmp1+1 ;\
590 adc tmp2+1 ;\
591 sta ptr3,y ;\
592
593 #define ADDW_IDI(ptr1,y1,tmp2,ptr3,y3)\
594 clc ;\
595 ldy #y1 ;\
596 lda ptr1,y ;\
597 adc tmp2 ;\
598 ldy #y3 ;\
599 sta ptr3,y ;\
600 ldy #y1+1 ;\
601 lda ptr1,y ;\
602 adc tmp2+1 ;\
603 ldy #y3+1 ;\
604 sta ptr3,y ;\
605
606 #define ADDW_DII(tmp1,ptr2,y2,ptr3,y3)\
607 clc ;\
608 lda tmp1 ;\
609 ldy #y2 ;\
610 adc ptr2,y ;\
611 ldy #y3 ;\
612 sta ptr3,y ;\
613 lda tmp1+1 ;\
614 ldy #y2+1 ;\
615 adc ptr2,y ;\
616 ldy #y3+1 ;\
617 sta ptr3,y ;\
618
619 #define ADDW_III(ptr1,y1,ptr2,y2,ptr3,y3)\
620 clc ;\
621 ldy #y1 ;\
622 lda ptr1,y ;\
623 ldy #y2 ;\
624 adc ptr2,y ;\
625 ldy #y3 ;\
626 sta ptr3,y ;\
627 ldy #y1+1 ;\
628 lda ptr1,y ;\
629 ldy #y2+1 ;\
630 adc ptr2,y ;\
631 ldy #y3+1 ;\
632 sta ptr3+1 ;\
633
634 #define ADDW_DCD(tmp2,cte1,tmp3)\
635 clc ;\
636 lda #LOW(cte1) ;\
637 adc tmp2 ;\
638 sta tmp3 ;\
639 lda #HIGH(cte1) ;\
640 adc tmp2+1 ;\
641 sta tmp3+1 ;\
642
643 #define ADDW_DAD(tmp2,ptr1,y1,tmp3)\
644 clc ;\
645 lda 0+ptr1 ;\
646 adc #y1 ;\
647 tax ;\
648 lda 1+ptr1 ;\
649 adc #0 ;\
650 sta tmp+1 ;\
651 txa ;\
652 adc tmp2 ;\
653 sta tmp3 ;\
654 lda tmp+1 ;\
655 adc tmp2+1 ;\
656 sta tmp3+1 ;\
657
658 #define ADDW_ICD(ptr2,y2,cte1,tmp3)\
659 clc ;\
660 lda #LOW(cte1) ;\
661 ldy #y2 ;\
662 adc ptr2,y ;\
663 sta tmp3 ;\
664 iny ;\
665 lda #HIGH(cte1) ;\
666 adc ptr2,y ;\
667 sta tmp3+1 ;\
668
669 #define ADDW_IAD(ptr2,y2,ptr1,y1,tmp3)\
670 clc ;\
671 lda 0+ptr1 ;\
672 adc #y1 ;\
673 tax ;\
674 lda 1+ptr1 ;\
675 adc #0 ;\
676 sta tmp+1 ;\
677 txa ;\
678 ldy #y2 ;\
679 adc ptr2,y ;\
680 sta tmp3 ;\
681 iny ;\
682 lda tmp+1 ;\
683 adc ptr2,y ;\
684 sta tmp3+1 ;\
685
686 #define ADDW_DCI(tmp2,cte1,ptr3,y3)\
687 clc ;\
688 lda #LOW(cte1) ;\
689 adc tmp2 ;\
690 ldy #y3 ;\
691 sta ptr3,y ;\
692 iny ;\
693 lda #HIGH(cte1) ;\
694 adc tmp2+1 ;\
695 sta ptr3,y ;\
696
697 #define ADDW_DAI(tmp2,ptr1,y1,ptr3,y3)\
698 clc ;\
699 lda 0+ptr1 ;\
700 adc #y1 ;\
701 tax ;\
702 lda 1+ptr1 ;\
703 adc #0 ;\
704 sta tmp+1 ;\
705 txa ;\
706 adc tmp2 ;\
707 ldy #y3
708 sta ptr3,y ;\
709 iny
710 lda tmp+1 ;\
711 adc tmp2+1 ;\
712 sta ptr3,y ;\
713
714 #define ADDW_ICI(ptr2,y2,cte1,ptr3,y3)\
715 clc ;\
716 lda #LOW(cte1) ;\
717 ldy #y2 ;\
718 adc ptr2,y ;\
719 ldy #y3 ;\
720 sta ptr3,y ;\
721 lda #HIGH(cte1) ;\
722 ldy #y2+1 ;\
723 adc ptr2,y ;\
724 ldy #y3+1 ;\
725 sta ptr3,y ;\
726
727 #define ADDW_IAI(ptr2,y2,ptr1,y1,ptr3,y3)\
728 clc ;\
729 lda 0+ptr1 ;\
730 adc #y1 ;\
731 tax ;\
732 lda 1+ptr1 ;\
733 adc #0 ;\
734 sta tmp+1 ;\
735 txa ;\
736 ldy #y2 ;\
737 adc ptr2,y ;\
738 ldy #y3 ;\
739 sta ptr3,y ;\
740 lda tmp+1 ;\
741 ldy #y2+1 ;\
742 adc ptr2,y ;\
743 ldy #y3+1 ;\
744 sta ptr3,y ;\
745
746 #define SUBW_DCD(tmp1,cte2,tmp3)\
747 sec ;\
748 lda tmp1 ;\
749 sbc #LOW(cte2) ;\
750 sta tmp3 ;\
751 lda tmp1+1 ;\
752 sbc #HIGH(cte2) ;\
753 sta tmp3+1 ;\
754
755 #define SUBW_CDD(cte1,tmp2,tmp3)\
756 sec ;\
757 lda #LOW(cte1) ;\
758 sbc tmp2 ;\
759 sta tmp3 ;\
760 lda #HIGH(cte1) ;\
761 sbc tmp2+1 ;\
762 sta tmp3+1 ;\
763
764 #define SUBW_ADD(ptr1,y1,tmp2,tmp3)\
765 clc ;\
766 lda 0+ptr1 ;\
767 adc #y1 ;\
768 tax ;\
769 lda 1+ptr1 ;\
770 adc #0 ;\
771 sta tmp+1 ;\
772 sec ;\
773 txa ;\
774 sbc tmp2 ;\
775 sta tmp3 ;\
776 lda tmp+1 ;\
777 sbc tmp2+1 ;\
778 sta tmp3+1 ;\
779
780 #define SUBW_ICD(ptr1,y1,cte2,tmp3)\
781 sec ;\
782 ldy #y1 ;\
783 lda ptr1,y ;\
784 sbc #LOW(cte2) ;\
785 sta tmp3 ;\
786 iny ;\
787 lda ptr1,y ;\
788 sbc #HIGH(cte2) ;\
789 sta tmp3+1 ;\
790
791 #define SUBW_CID(cte1,ptr2,y2,tmp3)\
792 sec ;\
793 ldy #y2 ;\
794 lda #LOW(cte1) ;\
795 sbc ptr2,y ;\
796 sta tmp3 ;\
797 iny ;\
798 lda #HIGH(cte1) ;\
799 sbc ptr2,y ;\
800 sta tmp3+1 ;\
801
802 #define SUBW_AID(ptr1,y1,ptr2,y2,tmp3)\
803 clc ;\
804 lda 0+ptr1 ;\
805 adc #y1 ;\
806 tax ;\
807 lda 1+ptr1 ;\
808 adc #0 ;\
809 sta tmp+1 ;\
810 sec ;\
811 ldy #y2 ;\
812 txa ;\
813 sbc ptr2,y ;\
814 sta tmp3 ;\
815 iny ;\
816 lda tmp+1 ;\
817 sbc ptr2,y ;\
818 sta tmp3+1 ;\
819
820 #define SUBW_DCI(tmp1,cte2,ptr3,y3)\
821 sec ;\
822 ldy #y3 ;\
823 lda tmp1 ;\
824 sbc #LOW(cte2) ;\
825 sta ptr3,y ;\
826 iny ;\
827 lda tmp1+1 ;\
828 sbc #HIGH(cte2) ;\
829 sta ptr3,y ;\
830
831 #define SUBW_CDI(cte1,tmp2,ptr3,y3)\
832 sec ;\
833 ldy #y3 ;\
834 lda #LOW(cte1) ;\
835 sbc tmp2 ;\
836 sta ptr3,y ;\
837 iny ;\
838 lda #HIGH(cte1) ;\
839 sbc tmp2+1 ;\
840 sta ptr3,y ;\
841
842 #define SUBW_ADI(ptr1,y1,tmp2,ptr3,y3)\
843 clc ;\
844 lda 0+ptr1 ;\
845 adc #y1 ;\
846 tax ;\
847 lda 1+ptr1 ;\
848 adc #0 ;\
849 sta tmp+1 ;\
850 sec ;\
851 ldy #y3 ;\
852 txa ;\
853 sbc tmp2 ;\
854 sta ptr3,y ;\
855 iny ;\
856 lda tmp+1 ;\
857 sbc tmp2+1 ;\
858 sta ptr3,y ;\
859
860 #define SUBW_ICI(ptr1,y1,cte2,ptr3,y3)\
861 sec ;\
862 ldy #y1 ;\
863 lda ptr1,y ;\
864 sbc #LOW(cte2) ;\
865 ldy #y3 ;\
866 sta ptr3,y ;\
867 ldy #y1+1 ;\
868 lda ptr1,y ;\
869 sbc #HIGH(cte2) ;\
870 ldy #y3+1 ;\
871 sta ptr3,y ;\
872
873 #define SUBW_CII(cte1,ptr2,y2,ptr3,y3)\
874 sec ;\
875 lda #LOW(cte1) ;\
876 ldy #y2 ;\
877 sbc ptr2,y ;\
878 ldy #y3 ;\
879 sta ptr3,y ;\
880 lda #HIGH(cte1) ;\
881 ldy #y2+1 ;\
882 sbc ptr2,y ;\
883 ldy #y3+1 ;\
884 sta ptr3,y ;\
885
886 #define SUBW_AII(ptr1,y1,ptr2,y2,ptr3,y3)\
887 clc ;\
888 lda 0+ptr1 ;\
889 adc #y1 ;\
890 tax ;\
891 lda 1+ptr1 ;\
892 adc #0 ;\
893 sta tmp+1 ;\
894 sec ;\
895 txa ;\
896 ldy #y2 ;\
897 sbc ptr2,y ;\
898 ldy #y3 ;\
899 sta ptr3,y ;\
900 lda tmp+1 ;\
901 ldy #y2+1 ;\
902 sbc ptr2,y ;\
903 ldy #y3+1 ;\
904 sta ptr3,y ;\
905
906 #define SUBW_DDD(tmp1,tmp2,tmp3)\
907 sec ;\
908 lda tmp1 ;\
909 sbc tmp2 ;\
910 sta tmp3 ;\
911 lda tmp1+1 ;\
912 sbc tmp2+1 ;\
913 sta tmp3+1 ;\
914
915 #define SUBW_IDD(ptr1,y1,tmp2,tmp3)\
916 sec ;\
917 ldy #y1 ;\
918 lda ptr1,y ;\
919 sbc tmp2 ;\
920 sta tmp3 ;\
921 iny ;\
922 lda ptr1,y ;\
923 sbc tmp2+1 ;\
924 sta tmp3+1 ;\
925
926 #define SUBW_DID(tmp1,ptr2,y2,tmp3)\
927 sec ;\
928 lda tmp1 ;\
929 ldy #y2 ;\
930 sbc ptr2,y ;\
931 sta tmp3 ;\
932 iny ;\
933 lda tmp1+1 ;\
934 sbc ptr2,y ;\
935 sta tmp3+1 ;\
936
937 #define SUBW_IID(ptr1,y1,ptr2,y2,tmp3)\
938 sec ;\
939 ldy #y1 ;\
940 lda ptr1,y ;\
941 ldy #y2 ;\
942 sbc ptr2,y ;\
943 sta tmp3 ;\
944 lda #y1+1 ;\
945 lda ptr1,y ;\
946 ldy #y2+1 ;\
947 sbc ptr2,y ;\
948 sta tmp3+1 ;\
949
950 #define SUBW_DDI(tmp1,tmp2,ptr3,y3)\
951 sec ;\
952 lda tmp1 ;\
953 sbc tmp2 ;\
954 ldy #y3 ;\
955 sta ptr3,y ;\
956 iny ;\
957 lda tmp1+1 ;\
958 sbc tmp2+1 ;\
959 sta ptr3,y ;\
960
961 #define SUBW_IDI(ptr1,y1,tmp2,ptr3,y3)\
962 sec ;\
963 ldy #y1 ;\
964 lda ptr1,y ;\
965 sbc tmp2 ;\
966 ldy #y3 ;\
967 sta ptr3,y ;\
968 ldy #y1+1 ;\
969 lda ptr1,y ;\
970 sbc tmp2+1 ;\
971 ldy #y3+1 ;\
972 sta ptr3,y ;\
973
974 #define SUBW_DII(tmp1,ptr2,y2,ptr3,y3)\
975 sec ;\
976 lda tmp1 ;\
977 ldy #y2 ;\
978 sbc ptr2,y ;\
979 ldy #y3 ;\
980 sta ptr3,y ;\
981 lda tmp1+1 ;\
982 ldy #y2+1 ;\
983 sbc ptr2,y ;\
984 ldy #y3+1 ;\
985 sta ptr3,y ;\
986
987 #define SUBW_III(ptr1,y1,ptr2,y2,ptr3,y3)\
988 sec ;\
989 ldy #y1 ;\
990 lda ptr1,y ;\
991 ldy #y2 ;\
992 sbc ptr2,y ;\
993 ldy #y3 ;\
994 sta ptr3,y ;\
995 ldy #y1+1 ;\
996 lda ptr1,y ;\
997 ldy #y2+1 ;\
998 sbc ptr2,y ;\
999 ldy #y3+1 ;\
1000 sta ptr3+1 ;\
1001
1002 #define COMW_DD(tmp1,tmp2)\
1003 lda tmp1 ;\
1004 eor #$FF ;\
1005 sta tmp2 ;\
1006 lda tmp1+1 ;\
1007 eor #$FF ;\
1008 sta tmp2+1 ;\
1009
1010 #define COMW_DI(tmp1,ptr2,y2)\
1011 ldy #y2 ;\
1012 lda tmp1 ;\
1013 eor #$FF ;\
1014 sta ptr2,y ;\
1015 iny ;\
1016 lda tmp1+1 ;\
1017 eor #$FF ;\
1018 sta ptr2,y ;\
1019
1020 #define COMW_ID(ptr1,y1,tmp2)\
1021 ldy #y1 ;\
1022 lda ptr1,y ;\
1023 eor #$FF ;\
1024 sta tmp2 ;\
1025 iny ;\
1026 lda ptr1,y ;\
1027 eor #$FF ;\
1028 sta tmp2+1 ;\
1029
1030 #define COMW_II(ptr1,y1,ptr2,y2)\
1031 ldy #y1 ;\
1032 lda ptr1,y ;\
1033 eor #$FF ;\
1034 ldy #y2 ;\
1035 sta ptr2,y ;\
1036 ldy #y1+1 ;\
1037 lda ptr1,y ;\
1038 eor #$FF ;\
1039 ldy #y2+1 ;\
1040 sta ptr2+1 ;\
1041
1042 #define ANDW_DDD(tmp1,tmp2,tmp3)\
1043 lda tmp1 ;\
1044 and tmp2 ;\
1045 sta tmp3 ;\
1046 lda tmp1+1 ;\
1047 and tmp2+1 ;\
1048 sta tmp3+1 ;\
1049
1050 #define ANDW_IDD(ptr1,y1,tmp2,tmp3)\
1051 ldy #y1 ;\
1052 lda ptr1,y ;\
1053 and tmp2 ;\
1054 sta tmp3 ;\
1055 iny ;\
1056 lda ptr1,y ;\
1057 and tmp2+1 ;\
1058 sta tmp3+1 ;\
1059
1060 #define ANDW_DID(tmp1,ptr2,y2,tmp3)\
1061 lda tmp1 ;\
1062 ldy #y2 ;\
1063 and ptr2,y ;\
1064 sta tmp3 ;\
1065 iny ;\
1066 lda tmp1+1 ;\
1067 and ptr2,y ;\
1068 sta tmp3+1 ;\
1069
1070 #define ANDW_IID(ptr1,y1,ptr2,y2,tmp3)\
1071 ldy #y1 ;\
1072 lda ptr1,y ;\
1073 ldy #y2 ;\
1074 and ptr2,y ;\
1075 sta tmp3 ;\
1076 lda #y1+1 ;\
1077 lda ptr1,y ;\
1078 ldy #y2+1 ;\
1079 and ptr2,y ;\
1080 sta tmp3+1 ;\
1081
1082 #define ANDW_DDI(tmp1,tmp2,ptr3,y3)\
1083 lda tmp1 ;\
1084 and tmp2 ;\
1085 ldy #y3 ;\
1086 sta ptr3,y ;\
1087 iny ;\
1088 lda tmp1+1 ;\
1089 and tmp2+1 ;\
1090 sta ptr3,y ;\
1091
1092 #define ANDW_IDI(ptr1,y1,tmp2,ptr3,y3)\
1093 ldy #y1 ;\
1094 lda ptr1,y ;\
1095 and tmp2 ;\
1096 ldy #y3 ;\
1097 sta ptr3,y ;\
1098 ldy #y1+1 ;\
1099 lda ptr1,y ;\
1100 and tmp2+1 ;\
1101 ldy #y3+1 ;\
1102 sta ptr3,y ;\
1103
1104 #define ANDW_DII(tmp1,ptr2,y2,ptr3,y3)\
1105 lda tmp1 ;\
1106 ldy #y2 ;\
1107 and ptr2,y ;\
1108 ldy #y3 ;\
1109 sta ptr3,y ;\
1110 lda tmp1+1 ;\
1111 ldy #y2+1 ;\
1112 and ptr2,y ;\
1113 ldy #y3+1 ;\
1114 sta ptr3,y ;\
1115
1116 #define ANDW_III(ptr1,y1,ptr2,y2,ptr3,y3)\
1117 ldy #y1 ;\
1118 lda ptr1,y ;\
1119 ldy #y2 ;\
1120 and ptr2,y ;\
1121 ldy #y3 ;\
1122 sta ptr3,y ;\
1123 ldy #y1+1 ;\
1124 lda ptr1,y ;\
1125 ldy #y2+1 ;\
1126 and ptr2,y ;\
1127 ldy #y3+1 ;\
1128 sta ptr3+1 ;\
1129
1130 #define ANDW_DCD(tmp2,cte1,tmp3)\
1131 lda #LOW(cte1) ;\
1132 and tmp2 ;\
1133 sta tmp3 ;\
1134 lda #HIGH(cte1) ;\
1135 and tmp2+1 ;\
1136 sta tmp3+1 ;\
1137
1138 #define ANDW_ICD(ptr2,y2,cte1,tmp3)\
1139 lda #LOW(cte1) ;\
1140 ldy #y2 ;\
1141 and ptr2,y ;\
1142 sta tmp3 ;\
1143 iny ;\
1144 lda #HIGH(cte1) ;\
1145 and ptr2,y ;\
1146 sta tmp3+1 ;\
1147
1148 #define ANDW_DCI(tmp2,cte1,ptr3,y3)\
1149 lda #LOW(cte1) ;\
1150 and tmp2 ;\
1151 ldy #y3 ;\
1152 sta ptr3,y ;\
1153 iny ;\
1154 lda #HIGH(cte1) ;\
1155 and tmp2+1 ;\
1156 sta ptr3,y ;\
1157
1158 #define ANDW_ICI(ptr2,y2,cte1,ptr3,y3)\
1159 lda #LOW(cte1) ;\
1160 ldy #y2 ;\
1161 and ptr2,y ;\
1162 ldy #y3 ;\
1163 sta ptr3,y ;\
1164 lda #HIGH(cte1) ;\
1165 ldy #y2+1 ;\
1166 and ptr2,y ;\
1167 ldy #y3+1 ;\
1168 sta ptr3,y ;\
1169
1170 #define XORW_DDD(tmp1,tmp2,tmp3)\
1171 lda tmp1 ;\
1172 eor tmp2 ;\
1173 sta tmp3 ;\
1174 lda tmp1+1 ;\
1175 eor tmp2+1 ;\
1176 sta tmp3+1 ;\
1177
1178 #define XORW_IDD(ptr1,y1,tmp2,tmp3)\
1179 ldy #y1 ;\
1180 lda ptr1,y ;\
1181 eor tmp2 ;\
1182 sta tmp3 ;\
1183 iny ;\
1184 lda ptr1,y ;\
1185 eor tmp2+1 ;\
1186 sta tmp3+1 ;\
1187
1188 #define XORW_DID(tmp1,ptr2,y2,tmp3)\
1189 lda tmp1 ;\
1190 ldy #y2 ;\
1191 eor ptr2,y ;\
1192 sta tmp3 ;\
1193 iny ;\
1194 lda tmp1+1 ;\
1195 eor ptr2,y ;\
1196 sta tmp3+1 ;\
1197
1198 #define XORW_IID(ptr1,y1,ptr2,y2,tmp3)\
1199 ldy #y1 ;\
1200 lda ptr1,y ;\
1201 ldy #y2 ;\
1202 eor ptr2,y ;\
1203 sta tmp3 ;\
1204 lda #y1+1 ;\
1205 lda ptr1,y ;\
1206 ldy #y2+1 ;\
1207 eor ptr2,y ;\
1208 sta tmp3+1 ;\
1209
1210 #define XORW_DDI(tmp1,tmp2,ptr3,y3)\
1211 lda tmp1 ;\
1212 eor tmp2 ;\
1213 ldy #y3 ;\
1214 sta ptr3,y ;\
1215 iny ;\
1216 lda tmp1+1 ;\
1217 eor tmp2+1 ;\
1218 sta ptr3,y ;\
1219
1220 #define XORW_IDI(ptr1,y1,tmp2,ptr3,y3)\
1221 ldy #y1 ;\
1222 lda ptr1,y ;\
1223 eor tmp2 ;\
1224 ldy #y3 ;\
1225 sta ptr3,y ;\
1226 ldy #y1+1 ;\
1227 lda ptr1,y ;\
1228 eor tmp2+1 ;\
1229 ldy #y3+1 ;\
1230 sta ptr3,y ;\
1231
1232 #define XORW_DII(tmp1,ptr2,y2,ptr3,y3)\
1233 lda tmp1 ;\
1234 ldy #y2 ;\
1235 eor ptr2,y ;\
1236 ldy #y3 ;\
1237 sta ptr3,y ;\
1238 lda tmp1+1 ;\
1239 ldy #y2+1 ;\
1240 eor ptr2,y ;\
1241 ldy #y3+1 ;\
1242 sta ptr3,y ;\
1243
1244 #define XORW_III(ptr1,y1,ptr2,y2,ptr3,y3)\
1245 ldy #y1 ;\
1246 lda ptr1,y ;\
1247 ldy #y2 ;\
1248 eor ptr2,y ;\
1249 ldy #y3 ;\
1250 sta ptr3,y ;\
1251 ldy #y1+1 ;\
1252 lda ptr1,y ;\
1253 ldy #y2+1 ;\
1254 eor ptr2,y ;\
1255 ldy #y3+1 ;\
1256 sta ptr3+1 ;\
1257
1258 #define XORW_DCD(tmp2,cte1,tmp3)\
1259 lda #LOW(cte1) ;\
1260 eor tmp2 ;\
1261 sta tmp3 ;\
1262 lda #HIGH(cte1) ;\
1263 eor tmp2+1 ;\
1264 sta tmp3+1 ;\
1265
1266 #define XORW_ICD(ptr2,y2,cte1,tmp3)\
1267 lda #LOW(cte1) ;\
1268 ldy #y2 ;\
1269 eor ptr2,y ;\
1270 sta tmp3 ;\
1271 iny ;\
1272 lda #HIGH(cte1) ;\
1273 eor ptr2,y ;\
1274 sta tmp3+1 ;\
1275
1276 #define XORW_DCI(tmp2,cte1,ptr3,y3)\
1277 lda #LOW(cte1) ;\
1278 eor tmp2 ;\
1279 ldy #y3 ;\
1280 sta ptr3,y ;\
1281 iny ;\
1282 lda #HIGH(cte1) ;\
1283 eor tmp2+1 ;\
1284 sta ptr3,y ;\
1285
1286 #define XORW_ICI(ptr2,y2,cte1,ptr3,y3)\
1287 lda #LOW(cte1) ;\
1288 ldy #y2 ;\
1289 eor ptr2,y ;\
1290 ldy #y3 ;\
1291 sta ptr3,y ;\
1292 lda #HIGH(cte1) ;\
1293 ldy #y2+1 ;\
1294 eor ptr2,y ;\
1295 ldy #y3+1 ;\
1296 sta ptr3,y ;\
1297
1298 #define ORW_DDD(tmp1,tmp2,tmp3)\
1299 lda tmp1 ;\
1300 ora tmp2 ;\
1301 sta tmp3 ;\
1302 lda tmp1+1 ;\
1303 ora tmp2+1 ;\
1304 sta tmp3+1 ;\
1305
1306 #define ORW_IDD(ptr1,y1,tmp2,tmp3)\
1307 ldy #y1 ;\
1308 lda ptr1,y ;\
1309 ora tmp2 ;\
1310 sta tmp3 ;\
1311 iny ;\
1312 lda ptr1,y ;\
1313 ora tmp2+1 ;\
1314 sta tmp3+1 ;\
1315
1316 #define ORW_DID(tmp1,ptr2,y2,tmp3)\
1317 lda tmp1 ;\
1318 ldy #y2 ;\
1319 ora ptr2,y ;\
1320 sta tmp3 ;\
1321 iny ;\
1322 lda tmp1+1 ;\
1323 ora ptr2,y ;\
1324 sta tmp3+1 ;\
1325
1326 #define ORW_IID(ptr1,y1,ptr2,y2,tmp3)\
1327 ldy #y1 ;\
1328 lda ptr1,y ;\
1329 ldy #y2 ;\
1330 ora ptr2,y ;\
1331 sta tmp3 ;\
1332 lda #y1+1 ;\
1333 lda ptr1,y ;\
1334 ldy #y2+1 ;\
1335 ora ptr2,y ;\
1336 sta tmp3+1 ;\
1337
1338 #define ORW_DDI(tmp1,tmp2,ptr3,y3)\
1339 lda tmp1 ;\
1340 ora tmp2 ;\
1341 ldy #y3 ;\
1342 sta ptr3,y ;\
1343 iny ;\
1344 lda tmp1+1 ;\
1345 ora tmp2+1 ;\
1346 sta ptr3,y ;\
1347
1348 #define ORW_IDI(ptr1,y1,tmp2,ptr3,y3)\
1349 ldy #y1 ;\
1350 lda ptr1,y ;\
1351 ora tmp2 ;\
1352 ldy #y3 ;\
1353 sta ptr3,y ;\
1354 ldy #y1+1 ;\
1355 lda ptr1,y ;\
1356 ora tmp2+1 ;\
1357 ldy #y3+1 ;\
1358 sta ptr3,y ;\
1359
1360 #define ORW_DII(tmp1,ptr2,y2,ptr3,y3)\
1361 lda tmp1 ;\
1362 ldy #y2 ;\
1363 ora ptr2,y ;\
1364 ldy #y3 ;\
1365 sta ptr3,y ;\
1366 lda tmp1+1 ;\
1367 ldy #y2+1 ;\
1368 ora ptr2,y ;\
1369 ldy #y3+1 ;\
1370 sta ptr3,y ;\
1371
1372 #define ORW_III(ptr1,y1,ptr2,y2,ptr3,y3)\
1373 ldy #y1 ;\
1374 lda ptr1,y ;\
1375 ldy #y2 ;\
1376 ora ptr2,y ;\
1377 ldy #y3 ;\
1378 sta ptr3,y ;\
1379 ldy #y1+1 ;\
1380 lda ptr1,y ;\
1381 ldy #y2+1 ;\
1382 ora ptr2,y ;\
1383 ldy #y3+1 ;\
1384 sta ptr3+1 ;\
1385
1386 #define ORW_DCD(tmp2,cte1,tmp3)\
1387 lda #LOW(cte1) ;\
1388 ora tmp2 ;\
1389 sta tmp3 ;\
1390 lda #HIGH(cte1) ;\
1391 ora tmp2+1 ;\
1392 sta tmp3+1 ;\
1393
1394 #define ORW_ICD(ptr2,y2,cte1,tmp3)\
1395 lda #LOW(cte1) ;\
1396 ldy #y2 ;\
1397 ora ptr2,y ;\
1398 sta tmp3 ;\
1399 iny ;\
1400 lda #HIGH(cte1) ;\
1401 ora ptr2,y ;\
1402 sta tmp3+1 ;\
1403
1404 #define ORW_DCI(tmp2,cte1,ptr3,y3)\
1405 lda #LOW(cte1) ;\
1406 ora tmp2 ;\
1407 ldy #y3 ;\
1408 sta ptr3,y ;\
1409 iny ;\
1410 lda #HIGH(cte1) ;\
1411 ora tmp2+1 ;\
1412 sta ptr3,y ;\
1413
1414 #define ORW_ICI(ptr2,y2,cte1,ptr3,y3)\
1415 lda #LOW(cte1) ;\
1416 ldy #y2 ;\
1417 ora ptr2,y ;\
1418 ldy #y3 ;\
1419 sta ptr3,y ;\
1420 lda #HIGH(cte1) ;\
1421 ldy #y2+1 ;\
1422 ora ptr2,y ;\
1423 ldy #y3+1 ;\
1424 sta ptr3,y ;\
1425
1426 #define DIVI_DDD(tmp1,tmp2,tmp3)\
1427 lda tmp1 ;\
1428 sta op1 ;\
1429 lda tmp1+1 ;\
1430 sta op1+1 ;\
1431 lda tmp2 ;\
1432 sta op2 ;\
1433 lda tmp2+1 ;\
1434 sta op2+1 ;\
1435 jsr div16i ;\
1436 stx tmp3 ;\
1437 sta tmp3+1 ;\
1438
1439 #define DIVI_IDD(ptr1,y1,tmp2,tmp3)\
1440 ldy #y1 ;\
1441 lda ptr1,y ;\
1442 sta op1 ;\
1443 iny ;\
1444 lda ptr1,y ;\
1445 sta op1+1 ;\
1446 lda tmp2 ;\
1447 sta op2 ;\
1448 lda tmp2+1 ;\
1449 sta op2+1 ;\
1450 jsr div16i ;\
1451 stx tmp3 ;\
1452 sta tmp3+1 ;\
1453
1454 #define DIVI_DID(tmp1,ptr2,y2,tmp3)\
1455 lda tmp1 ;\
1456 sta op1 ;\
1457 lda tmp1+1 ;\
1458 sta op1+1 ;\
1459 ldy #y2 ;\
1460 lda ptr2,y ;\
1461 sta op2 ;\
1462 iny ;\
1463 lda ptr2,y ;\
1464 sta op2+1 ;\
1465 jsr div16i ;\
1466 stx tmp3 ;\
1467 sta tmp3+1 ;\
1468
1469 #define DIVI_IID(ptr1,y1,ptr2,y2,tmp3)\
1470 ldy #y1 ;\
1471 lda ptr1,y ;\
1472 sta op1 ;\
1473 iny ;\
1474 lda ptr1,y ;\
1475 sta op1+1 ;\
1476 ldy #y2 ;\
1477 lda ptr2,y ;\
1478 sta op2 ;\
1479 iny ;\
1480 lda ptr2,y ;\
1481 sta op2+1 ;\
1482 jsr div16i ;\
1483 stx tmp3 ;\
1484 sta tmp3+1 ;\
1485
1486 #define DIVI_DDI(tmp1,tmp2,ptr3,y3)\
1487 lda tmp1 ;\
1488 sta op1 ;\
1489 lda tmp1+1 ;\
1490 sta op1+1 ;\
1491 lda tmp2 ;\
1492 sta op2 ;\
1493 lda tmp2+1 ;\
1494 sta op2+1 ;\
1495 jsr div16i ;\
1496 ldy #y3+1 ;\
1497 sta ptr3,y ;\
1498 dey ;\
1499 txa ;\
1500 sta ptr3,y ;\
1501
1502 #define DIVI_IDI(ptr1,y1,tmp2,ptr3,y3)\
1503 ldy #y1 ;\
1504 lda ptr1,y ;\
1505 sta op1 ;\
1506 iny ;\
1507 lda ptr1,y ;\
1508 sta op1+1 ;\
1509 lda tmp2 ;\
1510 sta op2 ;\
1511 lda tmp2+1 ;\
1512 sta op2+1 ;\
1513 jsr div16i ;\
1514 ldy #y3+1 ;\
1515 sta ptr3,y ;\
1516 dey ;\
1517 txa ;\
1518 sta ptr3,y ;\
1519
1520 #define DIVI_DII(tmp1,ptr2,y2,ptr3,y3)\
1521 lda tmp1 ;\
1522 sta op1 ;\
1523 lda tmp1+1 ;\
1524 sta op1+1 ;\
1525 ldy #y2 ;\
1526 lda ptr2,y ;\
1527 sta op2 ;\
1528 iny ;\
1529 lda ptr2,y ;\
1530 sta op2+1 ;\
1531 jsr div16i ;\
1532 ldy #y3+1 ;\
1533 sta ptr3,y ;\
1534 dey ;\
1535 txa ;\
1536 sta ptr3,y ;\
1537
1538 #define DIVI_III(ptr1,y1,ptr2,y2,ptr3,y3)\
1539 ldy #y1 ;\
1540 lda ptr1,y ;\
1541 sta op1 ;\
1542 iny ;\
1543 lda ptr1,y ;\
1544 sta op1+1 ;\
1545 ldy #y2 ;\
1546 lda ptr2,y ;\
1547 sta op2 ;\
1548 iny ;\
1549 lda ptr2,y ;\
1550 sta op2+1 ;\
1551 jsr div16i ;\
1552 ldy #y3+1 ;\
1553 sta ptr3,y ;\
1554 dey ;\
1555 txa ;\
1556 sta ptr3,y ;\
1557
1558 #define DIVI_CDD(cte1,tmp2,tmp3)\
1559 lda #LOW(cte1) ;\
1560 sta op1 ;\
1561 lda #HIGH(cte1) ;\
1562 sta op1+1 ;\
1563 lda tmp2 ;\
1564 sta op2 ;\
1565 lda tmp2+1 ;\
1566 sta op2+1 ;\
1567 jsr div16i ;\
1568 stx tmp3 ;\
1569 sta tmp3+1 ;\
1570
1571 #define DIVI_CID(cte1,ptr2,y2,tmp3)\
1572 lda #LOW(cte1) ;\
1573 sta op1 ;\
1574 lda #HIGH(cte1) ;\
1575 sta op1+1 ;\
1576 ldy #y2 ;\
1577 lda ptr2,y ;\
1578 sta op2 ;\
1579 iny ;\
1580 lda ptr2,y ;\
1581 sta op2+1 ;\
1582 jsr div16i ;\
1583 stx tmp3 ;\
1584 sta tmp3+1 ;\
1585
1586 #define DIVI_CDI(cte1,tmp2,ptr3,y3)\
1587 lda #LOW(cte1) ;\
1588 sta op1 ;\
1589 lda #HIGH(cte1) ;\
1590 sta op1+1 ;\
1591 lda tmp2 ;\
1592 sta op2 ;\
1593 lda tmp2+1 ;\
1594 sta op2+1 ;\
1595 jsr div16i ;\
1596 ldy #y3+1 ;\
1597 sta ptr3,y ;\
1598 dey ;\
1599 txa ;\
1600 sta ptr3,y ;\
1601
1602 #define DIVI_CII(cte1,ptr2,y2,ptr3,y3)\
1603 lda #LOW(cte1) ;\
1604 sta op1 ;\
1605 lda #HIGH(cte1) ;\
1606 sta op1+1 ;\
1607 ldy #y2 ;\
1608 lda ptr2,y ;\
1609 sta op2 ;\
1610 iny ;\
1611 lda ptr2,y ;\
1612 sta op2+1 ;\
1613 jsr div16i ;\
1614 ldy #y3+1 ;\
1615 sta ptr3,y ;\
1616 dey ;\
1617 txa ;\
1618 sta ptr3,y ;\
1619
1620 #define DIVI_DCD(tmp1,cte2,tmp3)\
1621 lda tmp1 ;\
1622 sta op1 ;\
1623 lda tmp1+1 ;\
1624 sta op1+1 ;\
1625 lda #LOW(cte2) ;\
1626 sta op2 ;\
1627 lda #HIGH(cte2) ;\
1628 sta op2+1 ;\
1629 jsr div16i ;\
1630 stx tmp3 ;\
1631 sta tmp3+1 ;\
1632
1633 #define DIVI_ICD(ptr1,y1,cte2,tmp3)\
1634 ldy #y1 ;\
1635 lda ptr1,y ;\
1636 sta op1 ;\
1637 iny ;\
1638 lda ptr1,y ;\
1639 sta op1+1 ;\
1640 lda #LOW(cte2) ;\
1641 sta op2 ;\
1642 lda #HIGH(cte2) ;\
1643 sta op2+1 ;\
1644 jsr div16i ;\
1645 stx tmp3 ;\
1646 sta tmp3+1 ;\
1647
1648 #define DIVI_DCI(tmp1,cte2,ptr3,y3)\
1649 lda tmp1 ;\
1650 sta op1 ;\
1651 lda tmp1+1 ;\
1652 sta op1+1 ;\
1653 lda #LOW(cte2) ;\
1654 sta op2 ;\
1655 lda #HIGH(cte2) ;\
1656 sta op2+1 ;\
1657 jsr div16i ;\
1658 ldy #y3+1 ;\
1659 sta ptr3,y ;\
1660 dey ;\
1661 txa ;\
1662 sta ptr3,y ;\
1663
1664 #define DIVI_ICI(ptr1,y1,cte2,ptr3,y3)\
1665 ldy #y1 ;\
1666 lda ptr1,y ;\
1667 sta op1 ;\
1668 iny ;\
1669 lda ptr1,y ;\
1670 sta op1+1 ;\
1671 lda #LOW(cte2) ;\
1672 sta op2 ;\
1673 lda #HIGH(cte2) ;\
1674 sta op2+1 ;\
1675 jsr div16i ;\
1676 ldy #y3+1 ;\
1677 sta ptr3,y ;\
1678 dey ;\
1679 txa ;\
1680 sta ptr3,y ;\
1681
1682 #define DIVU_DDD(tmp1,tmp2,tmp3)\
1683 lda tmp1 ;\
1684 sta op1 ;\
1685 lda tmp1+1 ;\
1686 sta op1+1 ;\
1687 lda tmp2 ;\
1688 sta op2 ;\
1689 lda tmp2+1 ;\
1690 sta op2+1 ;\
1691 jsr div16u ;\
1692 stx tmp3 ;\
1693 sta tmp3+1 ;\
1694
1695 #define DIVU_IDD(ptr1,y1,tmp2,tmp3)\
1696 ldy #y1 ;\
1697 lda ptr1,y ;\
1698 sta op1 ;\
1699 iny ;\
1700 lda ptr1,y ;\
1701 sta op1+1 ;\
1702 lda tmp2 ;\
1703 sta op2 ;\
1704 lda tmp2+1 ;\
1705 sta op2+1 ;\
1706 jsr div16u ;\
1707 stx tmp3 ;\
1708 sta tmp3+1 ;\
1709
1710 #define DIVU_DID(tmp1,ptr2,y2,tmp3)\
1711 lda tmp1 ;\
1712 sta op1 ;\
1713 lda tmp1+1 ;\
1714 sta op1+1 ;\
1715 ldy #y2 ;\
1716 lda ptr2,y ;\
1717 sta op2 ;\
1718 iny ;\
1719 lda ptr2,y ;\
1720 sta op2+1 ;\
1721 jsr div16u ;\
1722 stx tmp3 ;\
1723 sta tmp3+1 ;\
1724
1725 #define DIVU_IID(ptr1,y1,ptr2,y2,tmp3)\
1726 ldy #y1 ;\
1727 lda ptr1,y ;\
1728 sta op1 ;\
1729 iny ;\
1730 lda ptr1,y ;\
1731 sta op1+1 ;\
1732 ldy #y2 ;\
1733 lda ptr2,y ;\
1734 sta op2 ;\
1735 iny ;\
1736 lda ptr2,y ;\
1737 sta op2+1 ;\
1738 jsr div16u ;\
1739 stx tmp3 ;\
1740 sta tmp3+1 ;\
1741
1742 #define DIVU_DDI(tmp1,tmp2,ptr3,y3)\
1743 lda tmp1 ;\
1744 sta op1 ;\
1745 lda tmp1+1 ;\
1746 sta op1+1 ;\
1747 lda tmp2 ;\
1748 sta op2 ;\
1749 lda tmp2+1 ;\
1750 sta op2+1 ;\
1751 jsr div16u ;\
1752 ldy #y3+1 ;\
1753 sta ptr3,y ;\
1754 dey ;\
1755 txa ;\
1756 sta ptr3,y ;\
1757
1758 #define DIVU_IDI(ptr1,y1,tmp2,ptr3,y3)\
1759 ldy #y1 ;\
1760 lda ptr1,y ;\
1761 sta op1 ;\
1762 iny ;\
1763 lda ptr1,y ;\
1764 sta op1+1 ;\
1765 lda tmp2 ;\
1766 sta op2 ;\
1767 lda tmp2+1 ;\
1768 sta op2+1 ;\
1769 jsr div16u ;\
1770 ldy #y3+1 ;\
1771 sta ptr3,y ;\
1772 dey ;\
1773 txa ;\
1774 sta ptr3,y ;\
1775
1776 #define DIVU_DII(tmp1,ptr2,y2,ptr3,y3)\
1777 lda tmp1 ;\
1778 sta op1 ;\
1779 lda tmp1+1 ;\
1780 sta op1+1 ;\
1781 ldy #y2 ;\
1782 lda ptr2,y ;\
1783 sta op2 ;\
1784 iny ;\
1785 lda ptr2,y ;\
1786 sta op2+1 ;\
1787 jsr div16u ;\
1788 ldy #y3+1 ;\
1789 sta ptr3,y ;\
1790 dey ;\
1791 txa ;\
1792 sta ptr3,y ;\
1793
1794 #define DIVU_III(ptr1,y1,ptr2,y2,ptr3,y3)\
1795 ldy #y1 ;\
1796 lda ptr1,y ;\
1797 sta op1 ;\
1798 iny ;\
1799 lda ptr1,y ;\
1800 sta op1+1 ;\
1801 ldy #y2 ;\
1802 lda ptr2,y ;\
1803 sta op2 ;\
1804 iny ;\
1805 lda ptr2,y ;\
1806 sta op2+1 ;\
1807 jsr div16u ;\
1808 ldy #y3+1 ;\
1809 sta ptr3,y ;\
1810 dey ;\
1811 txa ;\
1812 sta ptr3,y ;\
1813
1814 #define DIVU_CDD(cte1,tmp2,tmp3)\
1815 lda #LOW(cte1) ;\
1816 sta op1 ;\
1817 lda #HIGH(cte1) ;\
1818 sta op1+1 ;\
1819 lda tmp2 ;\
1820 sta op2 ;\
1821 lda tmp2+1 ;\
1822 sta op2+1 ;\
1823 jsr div16u ;\
1824 stx tmp3 ;\
1825 sta tmp3+1 ;\
1826
1827 #define DIVU_CID(cte1,ptr2,y2,tmp3)\
1828 lda #LOW(cte1) ;\
1829 sta op1 ;\
1830 lda #HIGH(cte1) ;\
1831 sta op1+1 ;\
1832 ldy #y2 ;\
1833 lda ptr2,y ;\
1834 sta op2 ;\
1835 iny ;\
1836 lda ptr2,y ;\
1837 sta op2+1 ;\
1838 jsr div16u ;\
1839 stx tmp3 ;\
1840 sta tmp3+1 ;\
1841
1842 #define DIVU_CDI(cte1,tmp2,ptr3,y3)\
1843 lda #LOW(cte1) ;\
1844 sta op1 ;\
1845 lda #HIGH(cte1) ;\
1846 sta op1+1 ;\
1847 lda tmp2 ;\
1848 sta op2 ;\
1849 lda tmp2+1 ;\
1850 sta op2+1 ;\
1851 jsr div16u ;\
1852 ldy #y3+1 ;\
1853 sta ptr3,y ;\
1854 dey ;\
1855 txa ;\
1856 sta ptr3,y ;\
1857
1858 #define DIVU_CII(cte1,ptr2,y2,ptr3,y3)\
1859 lda #LOW(cte1) ;\
1860 sta op1 ;\
1861 lda #HIGH(cte1) ;\
1862 sta op1+1 ;\
1863 ldy #y2 ;\
1864 lda ptr2,y ;\
1865 sta op2 ;\
1866 iny ;\
1867 lda ptr2,y ;\
1868 sta op2+1 ;\
1869 jsr div16u ;\
1870 ldy #y3+1 ;\
1871 sta ptr3,y ;\
1872 dey ;\
1873 txa ;\
1874 sta ptr3,y ;\
1875
1876 #define DIVU_DCD(tmp1,cte2,tmp3)\
1877 lda tmp1 ;\
1878 sta op1 ;\
1879 lda tmp1+1 ;\
1880 sta op1+1 ;\
1881 lda #LOW(cte2) ;\
1882 sta op2 ;\
1883 lda #HIGH(cte2) ;\
1884 sta op2+1 ;\
1885 jsr div16u ;\
1886 stx tmp3 ;\
1887 sta tmp3+1 ;\
1888
1889 #define DIVU_ICD(ptr1,y1,cte2,tmp3)\
1890 ldy #y1 ;\
1891 lda ptr1,y ;\
1892 sta op1 ;\
1893 iny ;\
1894 lda ptr1,y ;\
1895 sta op1+1 ;\
1896 lda #LOW(cte2) ;\
1897 sta op2 ;\
1898 lda #HIGH(cte2) ;\
1899 sta op2+1 ;\
1900 jsr div16u ;\
1901 stx tmp3 ;\
1902 sta tmp3+1 ;\
1903
1904 #define DIVU_DCI(tmp1,cte2,ptr3,y3)\
1905 lda tmp1 ;\
1906 sta op1 ;\
1907 lda tmp1+1 ;\
1908 sta op1+1 ;\
1909 lda #LOW(cte2) ;\
1910 sta op2 ;\
1911 lda #HIGH(cte2) ;\
1912 sta op2+1 ;\
1913 jsr div16u ;\
1914 ldy #y3+1 ;\
1915 sta ptr3,y ;\
1916 dey ;\
1917 txa ;\
1918 sta ptr3,y ;\
1919
1920 #define DIVU_ICI(ptr1,y1,cte2,ptr3,y3)\
1921 ldy #y1 ;\
1922 lda ptr1,y ;\
1923 sta op1 ;\
1924 iny ;\
1925 lda ptr1,y ;\
1926 sta op1+1 ;\
1927 lda #LOW(cte2) ;\
1928 sta op2 ;\
1929 lda #HIGH(cte2) ;\
1930 sta op2+1 ;\
1931 jsr div16u ;\
1932 ldy #y3+1 ;\
1933 sta ptr3,y ;\
1934 dey ;\
1935 txa ;\
1936 sta ptr3,y ;\
1937
1938 #define MODU_DDD(tmp1,tmp2,tmp3)\
1939 lda tmp1 ;\
1940 sta op1 ;\
1941 lda tmp1+1 ;\
1942 sta op1+1 ;\
1943 lda tmp2 ;\
1944 sta op2 ;\
1945 lda tmp2+1 ;\
1946 sta op2+1 ;\
1947 jsr mod16u ;\
1948 stx tmp3 ;\
1949 sta tmp3+1 ;\
1950
1951 #define MODU_IDD(ptr1,y1,tmp2,tmp3)\
1952 ldy #y1 ;\
1953 lda ptr1,y ;\
1954 sta op1 ;\
1955 iny ;\
1956 lda ptr1,y ;\
1957 sta op1+1 ;\
1958 lda tmp2 ;\
1959 sta op2 ;\
1960 lda tmp2+1 ;\
1961 sta op2+1 ;\
1962 jsr mod16u ;\
1963 stx tmp3 ;\
1964 sta tmp3+1 ;\
1965
1966 #define MODU_DID(tmp1,ptr2,y2,tmp3)\
1967 lda tmp1 ;\
1968 sta op1 ;\
1969 lda tmp1+1 ;\
1970 sta op1+1 ;\
1971 ldy #y2 ;\
1972 lda ptr2,y ;\
1973 sta op2 ;\
1974 iny ;\
1975 lda ptr2,y ;\
1976 sta op2+1 ;\
1977 jsr mod16u ;\
1978 stx tmp3 ;\
1979 sta tmp3+1 ;\
1980
1981 #define MODU_IID(ptr1,y1,ptr2,y2,tmp3)\
1982 ldy #y1 ;\
1983 lda ptr1,y ;\
1984 sta op1 ;\
1985 iny ;\
1986 lda ptr1,y ;\
1987 sta op1+1 ;\
1988 ldy #y2 ;\
1989 lda ptr2,y ;\
1990 sta op2 ;\
1991 iny ;\
1992 lda ptr2,y ;\
1993 sta op2+1 ;\
1994 jsr mod16u ;\
1995 stx tmp3 ;\
1996 sta tmp3+1 ;\
1997
1998 #define MODU_DDI(tmp1,tmp2,ptr3,y3)\
1999 lda tmp1 ;\
2000 sta op1 ;\
2001 lda tmp1+1 ;\
2002 sta op1+1 ;\
2003 lda tmp2 ;\
2004 sta op2 ;\
2005 lda tmp2+1 ;\
2006 sta op2+1 ;\
2007 jsr mod16u ;\
2008 ldy #y3+1 ;\
2009 sta ptr3,y ;\
2010 dey ;\
2011 txa ;\
2012 sta ptr3,y ;\
2013
2014 #define MODU_IDI(ptr1,y1,tmp2,ptr3,y3)\
2015 ldy #y1 ;\
2016 lda ptr1,y ;\
2017 sta op1 ;\
2018 iny ;\
2019 lda ptr1,y ;\
2020 sta op1+1 ;\
2021 lda tmp2 ;\
2022 sta op2 ;\
2023 lda tmp2+1 ;\
2024 sta op2+1 ;\
2025 jsr mod16u ;\
2026 ldy #y3+1 ;\
2027 sta ptr3,y ;\
2028 dey ;\
2029 txa ;\
2030 sta ptr3,y ;\
2031
2032 #define MODU_DII(tmp1,ptr2,y2,ptr3,y3)\
2033 lda tmp1 ;\
2034 sta op1 ;\
2035 lda tmp1+1 ;\
2036 sta op1+1 ;\
2037 ldy #y2 ;\
2038 lda ptr2,y ;\
2039 sta op2 ;\
2040 iny ;\
2041 lda ptr2,y ;\
2042 sta op2+1 ;\
2043 jsr mod16u ;\
2044 ldy #y3+1 ;\
2045 sta ptr3,y ;\
2046 dey ;\
2047 txa ;\
2048 sta ptr3,y ;\
2049
2050 #define MODU_III(ptr1,y1,ptr2,y2,ptr3,y3)\
2051 ldy #y1 ;\
2052 lda ptr1,y ;\
2053 sta op1 ;\
2054 iny ;\
2055 lda ptr1,y ;\
2056 sta op1+1 ;\
2057 ldy #y2 ;\
2058 lda ptr2,y ;\
2059 sta op2 ;\
2060 iny ;\
2061 lda ptr2,y ;\
2062 sta op2+1 ;\
2063 jsr mod16u ;\
2064 ldy #y3+1 ;\
2065 sta ptr3,y ;\
2066 dey ;\
2067 txa ;\
2068 sta ptr3,y ;\
2069
2070 #define MODU_CDD(cte1,tmp2,tmp3)\
2071 lda #LOW(cte1) ;\
2072 sta op1 ;\
2073 lda #HIGH(cte1) ;\
2074 sta op1+1 ;\
2075 lda tmp2 ;\
2076 sta op2 ;\
2077 lda tmp2+1 ;\
2078 sta op2+1 ;\
2079 jsr mod16u ;\
2080 stx tmp3 ;\
2081 sta tmp3+1 ;\
2082
2083 #define MODU_CID(cte1,ptr2,y2,tmp3)\
2084 lda #LOW(cte1) ;\
2085 sta op1 ;\
2086 lda #HIGH(cte1) ;\
2087 sta op1+1 ;\
2088 ldy #y2 ;\
2089 lda ptr2,y ;\
2090 sta op2 ;\
2091 iny ;\
2092 lda ptr2,y ;\
2093 sta op2+1 ;\
2094 jsr mod16u ;\
2095 stx tmp3 ;\
2096 sta tmp3+1 ;\
2097
2098 #define MODU_CDI(cte1,tmp2,ptr3,y3)\
2099 lda #LOW(cte1) ;\
2100 sta op1 ;\
2101 lda #HIGH(cte1) ;\
2102 sta op1+1 ;\
2103 lda tmp2 ;\
2104 sta op2 ;\
2105 lda tmp2+1 ;\
2106 sta op2+1 ;\
2107 jsr mod16u ;\
2108 ldy #y3+1 ;\
2109 sta ptr3,y ;\
2110 dey ;\
2111 txa ;\
2112 sta ptr3,y ;\
2113
2114 #define MODU_CII(cte1,ptr2,y2,ptr3,y3)\
2115 lda #LOW(cte1) ;\
2116 sta op1 ;\
2117 lda #HIGH(cte1) ;\
2118 sta op1+1 ;\
2119 ldy #y2 ;\
2120 lda ptr2,y ;\
2121 sta op2 ;\
2122 iny ;\
2123 lda ptr2,y ;\
2124 sta op2+1 ;\
2125 jsr mod16u ;\
2126 ldy #y3+1 ;\
2127 sta ptr3,y ;\
2128 dey ;\
2129 txa ;\
2130 sta ptr3,y ;\
2131
2132 #define MODU_DCD(tmp1,cte2,tmp3)\
2133 lda tmp1 ;\
2134 sta op1 ;\
2135 lda tmp1+1 ;\
2136 sta op1+1 ;\
2137 lda #LOW(cte2) ;\
2138 sta op2 ;\
2139 lda #HIGH(cte2) ;\
2140 sta op2+1 ;\
2141 jsr mod16u ;\
2142 stx tmp3 ;\
2143 sta tmp3+1 ;\
2144
2145 #define MODU_ICD(ptr1,y1,cte2,tmp3)\
2146 ldy #y1 ;\
2147 lda ptr1,y ;\
2148 sta op1 ;\
2149 iny ;\
2150 lda ptr1,y ;\
2151 sta op1+1 ;\
2152 lda #LOW(cte2) ;\
2153 sta op2 ;\
2154 lda #HIGH(cte2) ;\
2155 sta op2+1 ;\
2156 jsr mod16u ;\
2157 stx tmp3 ;\
2158 sta tmp3+1 ;\
2159
2160 #define MODU_DCI(tmp1,cte2,ptr3,y3)\
2161 lda tmp1 ;\
2162 sta op1 ;\
2163 lda tmp1+1 ;\
2164 sta op1+1 ;\
2165 lda #LOW(cte2) ;\
2166 sta op2 ;\
2167 lda #HIGH(cte2) ;\
2168 sta op2+1 ;\
2169 jsr mod16u ;\
2170 ldy #y3+1 ;\
2171 sta ptr3,y ;\
2172 dey ;\
2173 txa ;\
2174 sta ptr3,y ;\
2175
2176 #define MODU_ICI(ptr1,y1,cte2,ptr3,y3)\
2177 ldy #y1 ;\
2178 lda ptr1,y ;\
2179 sta op1 ;\
2180 iny ;\
2181 lda ptr1,y ;\
2182 sta op1+1 ;\
2183 lda #LOW(cte2) ;\
2184 sta op2 ;\
2185 lda #HIGH(cte2) ;\
2186 sta op2+1 ;\
2187 jsr mod16u ;\
2188 ldy #y3+1 ;\
2189 sta ptr3,y ;\
2190 dey ;\
2191 txa ;\
2192 sta ptr3,y ;\
2193
2194 #define MODI_DDD(tmp1,tmp2,tmp3)\
2195 lda tmp1 ;\
2196 sta op1 ;\
2197 lda tmp1+1 ;\
2198 sta op1+1 ;\
2199 lda tmp2 ;\
2200 sta op2 ;\
2201 lda tmp2+1 ;\
2202 sta op2+1 ;\
2203 jsr mod16i ;\
2204 stx tmp3 ;\
2205 sta tmp3+1 ;\
2206
2207 #define MODI_IDD(ptr1,y1,tmp2,tmp3)\
2208 ldy #y1 ;\
2209 lda ptr1,y ;\
2210 sta op1 ;\
2211 iny ;\
2212 lda ptr1,y ;\
2213 sta op1+1 ;\
2214 lda tmp2 ;\
2215 sta op2 ;\
2216 lda tmp2+1 ;\
2217 sta op2+1 ;\
2218 jsr mod16i ;\
2219 stx tmp3 ;\
2220 sta tmp3+1 ;\
2221
2222 #define MODI_DID(tmp1,ptr2,y2,tmp3)\
2223 lda tmp1 ;\
2224 sta op1 ;\
2225 lda tmp1+1 ;\
2226 sta op1+1 ;\
2227 ldy #y2 ;\
2228 lda ptr2,y ;\
2229 sta op2 ;\
2230 iny ;\
2231 lda ptr2,y ;\
2232 sta op2+1 ;\
2233 jsr mod16i ;\
2234 stx tmp3 ;\
2235 sta tmp3+1 ;\
2236
2237 #define MODI_IID(ptr1,y1,ptr2,y2,tmp3)\
2238 ldy #y1 ;\
2239 lda ptr1,y ;\
2240 sta op1 ;\
2241 iny ;\
2242 lda ptr1,y ;\
2243 sta op1+1 ;\
2244 ldy #y2 ;\
2245 lda ptr2,y ;\
2246 sta op2 ;\
2247 iny ;\
2248 lda ptr2,y ;\
2249 sta op2+1 ;\
2250 jsr mod16i ;\
2251 stx tmp3 ;\
2252 sta tmp3+1 ;\
2253
2254 #define MODI_DDI(tmp1,tmp2,ptr3,y3)\
2255 lda tmp1 ;\
2256 sta op1 ;\
2257 lda tmp1+1 ;\
2258 sta op1+1 ;\
2259 lda tmp2 ;\
2260 sta op2 ;\
2261 lda tmp2+1 ;\
2262 sta op2+1 ;\
2263 jsr mod16i ;\
2264 ldy #y3+1 ;\
2265 sta ptr3,y ;\
2266 dey ;\
2267 txa ;\
2268 sta ptr3,y ;\
2269
2270 #define MODI_IDI(ptr1,y1,tmp2,ptr3,y3)\
2271 ldy #y1 ;\
2272 lda ptr1,y ;\
2273 sta op1 ;\
2274 iny ;\
2275 lda ptr1,y ;\
2276 sta op1+1 ;\
2277 lda tmp2 ;\
2278 sta op2 ;\
2279 lda tmp2+1 ;\
2280 sta op2+1 ;\
2281 jsr mod16i ;\
2282 ldy #y3+1 ;\
2283 sta ptr3,y ;\
2284 dey ;\
2285 txa ;\
2286 sta ptr3,y ;\
2287
2288 #define MODI_DII(tmp1,ptr2,y2,ptr3,y3)\
2289 lda tmp1 ;\
2290 sta op1 ;\
2291 lda tmp1+1 ;\
2292 sta op1+1 ;\
2293 ldy #y2 ;\
2294 lda ptr2,y ;\
2295 sta op2 ;\
2296 iny ;\
2297 lda ptr2,y ;\
2298 sta op2+1 ;\
2299 jsr mod16i ;\
2300 ldy #y3+1 ;\
2301 sta ptr3,y ;\
2302 dey ;\
2303 txa ;\
2304 sta ptr3,y ;\
2305
2306 #define MODI_III(ptr1,y1,ptr2,y2,ptr3,y3)\
2307 ldy #y1 ;\
2308 lda ptr1,y ;\
2309 sta op1 ;\
2310 iny ;\
2311 lda ptr1,y ;\
2312 sta op1+1 ;\
2313 ldy #y2 ;\
2314 lda ptr2,y ;\
2315 sta op2 ;\
2316 iny ;\
2317 lda ptr2,y ;\
2318 sta op2+1 ;\
2319 jsr mod16i ;\
2320 ldy #y3+1 ;\
2321 sta ptr3,y ;\
2322 dey ;\
2323 txa ;\
2324 sta ptr3,y ;\
2325
2326 #define MODI_CDD(cte1,tmp2,tmp3)\
2327 lda #LOW(cte1) ;\
2328 sta op1 ;\
2329 lda #HIGH(cte1) ;\
2330 sta op1+1 ;\
2331 lda tmp2 ;\
2332 sta op2 ;\
2333 lda tmp2+1 ;\
2334 sta op2+1 ;\
2335 jsr mod16i ;\
2336 stx tmp3 ;\
2337 sta tmp3+1 ;\
2338
2339 #define MODI_CID(cte1,ptr2,y2,tmp3)\
2340 lda #LOW(cte1) ;\
2341 sta op1 ;\
2342 lda #HIGH(cte1) ;\
2343 sta op1+1 ;\
2344 ldy #y2 ;\
2345 lda ptr2,y ;\
2346 sta op2 ;\
2347 iny ;\
2348 lda ptr2,y ;\
2349 sta op2+1 ;\
2350 jsr mod16i ;\
2351 stx tmp3 ;\
2352 sta tmp3+1 ;\
2353
2354 #define MODI_CDI(cte1,tmp2,ptr3,y3)\
2355 lda #LOW(cte1) ;\
2356 sta op1 ;\
2357 lda #HIGH(cte1) ;\
2358 sta op1+1 ;\
2359 lda tmp2 ;\
2360 sta op2 ;\
2361 lda tmp2+1 ;\
2362 sta op2+1 ;\
2363 jsr mod16i ;\
2364 ldy #y3+1 ;\
2365 sta ptr3,y ;\
2366 dey ;\
2367 txa ;\
2368 sta ptr3,y ;\
2369
2370 #define MODI_CII(cte1,ptr2,y2,ptr3,y3)\
2371 lda #LOW(cte1) ;\
2372 sta op1 ;\
2373 lda #HIGH(cte1) ;\
2374 sta op1+1 ;\
2375 ldy #y2 ;\
2376 lda ptr2,y ;\
2377 sta op2 ;\
2378 iny ;\
2379 lda ptr2,y ;\
2380 sta op2+1 ;\
2381 jsr mod16i ;\
2382 ldy #y3+1 ;\
2383 sta ptr3,y ;\
2384 dey ;\
2385 txa ;\
2386 sta ptr3,y ;\
2387
2388 #define MODI_DCD(tmp1,cte2,tmp3)\
2389 lda tmp1 ;\
2390 sta op1 ;\
2391 lda tmp1+1 ;\
2392 sta op1+1 ;\
2393 lda #LOW(cte2) ;\
2394 sta op2 ;\
2395 lda #HIGH(cte2) ;\
2396 sta op2+1 ;\
2397 jsr mod16i ;\
2398 stx tmp3 ;\
2399 sta tmp3+1 ;\
2400
2401 #define MODI_ICD(ptr1,y1,cte2,tmp3)\
2402 ldy #y1 ;\
2403 lda ptr1,y ;\
2404 sta op1 ;\
2405 iny ;\
2406 lda ptr1,y ;\
2407 sta op1+1 ;\
2408 lda #LOW(cte2) ;\
2409 sta op2 ;\
2410 lda #HIGH(cte2) ;\
2411 sta op2+1 ;\
2412 jsr mod16i ;\
2413 stx tmp3 ;\
2414 sta tmp3+1 ;\
2415
2416 #define MODI_DCI(tmp1,cte2,ptr3,y3)\
2417 lda tmp1 ;\
2418 sta op1 ;\
2419 lda tmp1+1 ;\
2420 sta op1+1 ;\
2421 lda #LOW(cte2) ;\
2422 sta op2 ;\
2423 lda #HIGH(cte2) ;\
2424 sta op2+1 ;\
2425 jsr mod16i ;\
2426 ldy #y3+1 ;\
2427 sta ptr3,y ;\
2428 dey ;\
2429 txa ;\
2430 sta ptr3,y ;\
2431
2432 #define MODI_ICI(ptr1,y1,cte2,ptr3,y3)\
2433 ldy #y1 ;\
2434 lda ptr1,y ;\
2435 sta op1 ;\
2436 iny ;\
2437 lda ptr1,y ;\
2438 sta op1+1 ;\
2439 lda #LOW(cte2) ;\
2440 sta op2 ;\
2441 lda #HIGH(cte2) ;\
2442 sta op2+1 ;\
2443 jsr mod16i ;\
2444 ldy #y3+1 ;\
2445 sta ptr3,y ;\
2446 dey ;\
2447 txa ;\
2448 sta ptr3,y ;\
2449
2450 #define MULU_DDD(tmp1,tmp2,tmp3)\
2451 lda tmp1 ;\
2452 sta op1 ;\
2453 lda tmp1+1 ;\
2454 sta op1+1 ;\
2455 lda tmp2 ;\
2456 sta op2 ;\
2457 lda tmp2+1 ;\
2458 sta op2+1 ;\
2459 jsr mul16u ;\
2460 stx tmp3 ;\
2461 sta tmp3+1 ;\
2462
2463 #define MULU_IDD(ptr1,y1,tmp2,tmp3)\
2464 ldy #y1 ;\
2465 lda ptr1,y ;\
2466 sta op1 ;\
2467 iny ;\
2468 lda ptr1,y ;\
2469 sta op1+1 ;\
2470 lda tmp2 ;\
2471 sta op2 ;\
2472 lda tmp2+1 ;\
2473 sta op2+1 ;\
2474 jsr mul16u ;\
2475 stx tmp3 ;\
2476 sta tmp3+1 ;\
2477
2478 #define MULU_DID(tmp1,ptr2,y2,tmp3)\
2479 lda tmp1 ;\
2480 sta op1 ;\
2481 lda tmp1+1 ;\
2482 sta op1+1 ;\
2483 ldy #y2 ;\
2484 lda ptr2,y ;\
2485 sta op2 ;\
2486 iny ;\
2487 lda ptr2,y ;\
2488 sta op2+1 ;\
2489 jsr mul16u ;\
2490 stx tmp3 ;\
2491 sta tmp3+1 ;\
2492
2493 #define MULU_IID(ptr1,y1,ptr2,y2,tmp3)\
2494 ldy #y1 ;\
2495 lda ptr1,y ;\
2496 sta op1 ;\
2497 iny ;\
2498 lda ptr1,y ;\
2499 sta op1+1 ;\
2500 ldy #y2 ;\
2501 lda ptr2,y ;\
2502 sta op2 ;\
2503 iny ;\
2504 lda ptr2,y ;\
2505 sta op2+1 ;\
2506 jsr mul16u ;\
2507 stx tmp3 ;\
2508 sta tmp3+1 ;\
2509
2510 #define MULU_DDI(tmp1,tmp2,ptr3,y3)\
2511 lda tmp1 ;\
2512 sta op1 ;\
2513 lda tmp1+1 ;\
2514 sta op1+1 ;\
2515 lda tmp2 ;\
2516 sta op2 ;\
2517 lda tmp2+1 ;\
2518 sta op2+1 ;\
2519 jsr mul16u ;\
2520 ldy #y3+1 ;\
2521 sta ptr3,y ;\
2522 dey ;\
2523 txa ;\
2524 sta ptr3,y ;\
2525
2526 #define MULU_IDI(ptr1,y1,tmp2,ptr3,y3)\
2527 ldy #y1 ;\
2528 lda ptr1,y ;\
2529 sta op1 ;\
2530 iny ;\
2531 lda ptr1,y ;\
2532 sta op1+1 ;\
2533 lda tmp2 ;\
2534 sta op2 ;\
2535 lda tmp2+1 ;\
2536 sta op2+1 ;\
2537 jsr mul16u ;\
2538 ldy #y3+1 ;\
2539 sta ptr3,y ;\
2540 dey ;\
2541 txa ;\
2542 sta ptr3,y ;\
2543
2544 #define MULU_DII(tmp1,ptr2,y2,ptr3,y3)\
2545 lda tmp1 ;\
2546 sta op1 ;\
2547 lda tmp1+1 ;\
2548 sta op1+1 ;\
2549 ldy #y2 ;\
2550 lda ptr2,y ;\
2551 sta op2 ;\
2552 iny ;\
2553 lda ptr2,y ;\
2554 sta op2+1 ;\
2555 jsr mul16u ;\
2556 ldy #y3+1 ;\
2557 sta ptr3,y ;\
2558 dey ;\
2559 txa ;\
2560 sta ptr3,y ;\
2561
2562 #define MULU_III(ptr1,y1,ptr2,y2,ptr3,y3)\
2563 ldy #y1 ;\
2564 lda ptr1,y ;\
2565 sta op1 ;\
2566 iny ;\
2567 lda ptr1,y ;\
2568 sta op1+1 ;\
2569 ldy #y2 ;\
2570 lda ptr2,y ;\
2571 sta op2 ;\
2572 iny ;\
2573 lda ptr2,y ;\
2574 sta op2+1 ;\
2575 jsr mul16u ;\
2576 ldy #y3+1 ;\
2577 sta ptr3,y ;\
2578 dey ;\
2579 txa ;\
2580 sta ptr3,y ;\
2581
2582 #define MULU_CDD(cte1,tmp2,tmp3)\
2583 lda #LOW(cte1) ;\
2584 sta op1 ;\
2585 lda #HIGH(cte1) ;\
2586 sta op1+1 ;\
2587 lda tmp2 ;\
2588 sta op2 ;\
2589 lda tmp2+1 ;\
2590 sta op2+1 ;\
2591 jsr mul16u ;\
2592 stx tmp3 ;\
2593 sta tmp3+1 ;\
2594
2595 #define MULU_CID(cte1,ptr2,y2,tmp3)\
2596 lda #LOW(cte1) ;\
2597 sta op1 ;\
2598 lda #HIGH(cte1) ;\
2599 sta op1+1 ;\
2600 ldy #y2 ;\
2601 lda ptr2,y ;\
2602 sta op2 ;\
2603 iny ;\
2604 lda ptr2,y ;\
2605 sta op2+1 ;\
2606 jsr mul16u ;\
2607 stx tmp3 ;\
2608 sta tmp3+1 ;\
2609
2610 #define MULU_CDI(cte1,tmp2,ptr3,y3)\
2611 lda #LOW(cte1) ;\
2612 sta op1 ;\
2613 lda #HIGH(cte1) ;\
2614 sta op1+1 ;\
2615 lda tmp2 ;\
2616 sta op2 ;\
2617 lda tmp2+1 ;\
2618 sta op2+1 ;\
2619 jsr mul16u ;\
2620 ldy #y3+1 ;\
2621 sta ptr3,y ;\
2622 dey ;\
2623 txa ;\
2624 sta ptr3,y ;\
2625
2626 #define MULU_CII(cte1,ptr2,y2,ptr3,y3)\
2627 lda #LOW(cte1) ;\
2628 sta op1 ;\
2629 lda #HIGH(cte1) ;\
2630 sta op1+1 ;\
2631 ldy #y2 ;\
2632 lda ptr2,y ;\
2633 sta op2 ;\
2634 iny ;\
2635 lda ptr2,y ;\
2636 sta op2+1 ;\
2637 jsr mul16u ;\
2638 ldy #y3+1 ;\
2639 sta ptr3,y ;\
2640 dey ;\
2641 txa ;\
2642 sta ptr3,y ;\
2643
2644 #define MULU_DCD(tmp1,cte2,tmp3)\
2645 lda tmp1 ;\
2646 sta op1 ;\
2647 lda tmp1+1 ;\
2648 sta op1+1 ;\
2649 lda #LOW(cte2) ;\
2650 sta op2 ;\
2651 lda #HIGH(cte2) ;\
2652 sta op2+1 ;\
2653 jsr mul16u ;\
2654 stx tmp3 ;\
2655 sta tmp3+1 ;\
2656
2657 #define MULU_ICD(ptr1,y1,cte2,tmp3)\
2658 ldy #y1 ;\
2659 lda ptr1,y ;\
2660 sta op1 ;\
2661 iny ;\
2662 lda ptr1,y ;\
2663 sta op1+1 ;\
2664 lda #LOW(cte2) ;\
2665 sta op2 ;\
2666 lda #HIGH(cte2) ;\
2667 sta op2+1 ;\
2668 jsr mul16u ;\
2669 stx tmp3 ;\
2670 sta tmp3+1 ;\
2671
2672 #define MULU_DCI(tmp1,cte2,ptr3,y3)\
2673 lda tmp1 ;\
2674 sta op1 ;\
2675 lda tmp1+1 ;\
2676 sta op1+1 ;\
2677 lda #LOW(cte2) ;\
2678 sta op2 ;\
2679 lda #HIGH(cte2) ;\
2680 sta op2+1 ;\
2681 jsr mul16u ;\
2682 ldy #y3+1 ;\
2683 sta ptr3,y ;\
2684 dey ;\
2685 txa ;\
2686 sta ptr3,y ;\
2687
2688 #define MULU_ICI(ptr1,y1,cte2,ptr3,y3)\
2689 ldy #y1 ;\
2690 lda ptr1,y ;\
2691 sta op1 ;\
2692 iny ;\
2693 lda ptr1,y ;\
2694 sta op1+1 ;\
2695 lda #LOW(cte2) ;\
2696 sta op2 ;\
2697 lda #HIGH(cte2) ;\
2698 sta op2+1 ;\
2699 jsr mul16u ;\
2700 ldy #y3+1 ;\
2701 sta ptr3,y ;\
2702 dey ;\
2703 txa ;\
2704 sta ptr3,y ;\
2705
2706 #define MULI_DDD(tmp1,tmp2,tmp3)\
2707 lda tmp1 ;\
2708 sta op1 ;\
2709 lda tmp1+1 ;\
2710 sta op1+1 ;\
2711 lda tmp2 ;\
2712 sta op2 ;\
2713 lda tmp2+1 ;\
2714 sta op2+1 ;\
2715 jsr mul16i ;\
2716 stx tmp3 ;\
2717 sta tmp3+1 ;\
2718
2719 #define MULI_IDD(ptr1,y1,tmp2,tmp3)\
2720 ldy #y1 ;\
2721 lda ptr1,y ;\
2722 sta op1 ;\
2723 iny ;\
2724 lda ptr1,y ;\
2725 sta op1+1 ;\
2726 lda tmp2 ;\
2727 sta op2 ;\
2728 lda tmp2+1 ;\
2729 sta op2+1 ;\
2730 jsr mul16i ;\
2731 stx tmp3 ;\
2732 sta tmp3+1 ;\
2733
2734 #define MULI_DID(tmp1,ptr2,y2,tmp3)\
2735 lda tmp1 ;\
2736 sta op1 ;\
2737 lda tmp1+1 ;\
2738 sta op1+1 ;\
2739 ldy #y2 ;\
2740 lda ptr2,y ;\
2741 sta op2 ;\
2742 iny ;\
2743 lda ptr2,y ;\
2744 sta op2+1 ;\
2745 jsr mul16i ;\
2746 stx tmp3 ;\
2747 sta tmp3+1 ;\
2748
2749 #define MULI_IID(ptr1,y1,ptr2,y2,tmp3)\
2750 ldy #y1 ;\
2751 lda ptr1,y ;\
2752 sta op1 ;\
2753 iny ;\
2754 lda ptr1,y ;\
2755 sta op1+1 ;\
2756 ldy #y2 ;\
2757 lda ptr2,y ;\
2758 sta op2 ;\
2759 iny ;\
2760 lda ptr2,y ;\
2761 sta op2+1 ;\
2762 jsr mul16i ;\
2763 stx tmp3 ;\
2764 sta tmp3+1 ;\
2765
2766 #define MULI_DDI(tmp1,tmp2,ptr3,y3)\
2767 lda tmp1 ;\
2768 sta op1 ;\
2769 lda tmp1+1 ;\
2770 sta op1+1 ;\
2771 lda tmp2 ;\
2772 sta op2 ;\
2773 lda tmp2+1 ;\
2774 sta op2+1 ;\
2775 jsr mul16i ;\
2776 ldy #y3+1 ;\
2777 sta ptr3,y ;\
2778 dey ;\
2779 txa ;\
2780 sta ptr3,y ;\
2781
2782 #define MULI_IDI(ptr1,y1,tmp2,ptr3,y3)\
2783 ldy #y1 ;\
2784 lda ptr1,y ;\
2785 sta op1 ;\
2786 iny ;\
2787 lda ptr1,y ;\
2788 sta op1+1 ;\
2789 lda tmp2 ;\
2790 sta op2 ;\
2791 lda tmp2+1 ;\
2792 sta op2+1 ;\
2793 jsr mul16i ;\
2794 ldy #y3+1 ;\
2795 sta ptr3,y ;\
2796 dey ;\
2797 txa ;\
2798 sta ptr3,y ;\
2799
2800 #define MULI_DII(tmp1,ptr2,y2,ptr3,y3)\
2801 lda tmp1 ;\
2802 sta op1 ;\
2803 lda tmp1+1 ;\
2804 sta op1+1 ;\
2805 ldy #y2 ;\
2806 lda ptr2,y ;\
2807 sta op2 ;\
2808 iny ;\
2809 lda ptr2,y ;\
2810 sta op2+1 ;\
2811 jsr mul16i ;\
2812 ldy #y3+1 ;\
2813 sta ptr3,y ;\
2814 dey ;\
2815 txa ;\
2816 sta ptr3,y ;\
2817
2818 #define MULI_III(ptr1,y1,ptr2,y2,ptr3,y3)\
2819 ldy #y1 ;\
2820 lda ptr1,y ;\
2821 sta op1 ;\
2822 iny ;\
2823 lda ptr1,y ;\
2824 sta op1+1 ;\
2825 ldy #y2 ;\
2826 lda ptr2,y ;\
2827 sta op2 ;\
2828 iny ;\
2829 lda ptr2,y ;\
2830 sta op2+1 ;\
2831 jsr mul16i ;\
2832 ldy #y3+1 ;\
2833 sta ptr3,y ;\
2834 dey ;\
2835 txa ;\
2836 sta ptr3,y ;\
2837
2838 #define MULI_CDD(cte1,tmp2,tmp3)\
2839 lda #LOW(cte1) ;\
2840 sta op1 ;\
2841 lda #HIGH(cte1) ;\
2842 sta op1+1 ;\
2843 lda tmp2 ;\
2844 sta op2 ;\
2845 lda tmp2+1 ;\
2846 sta op2+1 ;\
2847 jsr mul16i ;\
2848 stx tmp3 ;\
2849 sta tmp3+1 ;\
2850
2851 #define MULI_CID(cte1,ptr2,y2,tmp3)\
2852 lda #LOW(cte1) ;\
2853 sta op1 ;\
2854 lda #HIGH(cte1) ;\
2855 sta op1+1 ;\
2856 ldy #y2 ;\
2857 lda ptr2,y ;\
2858 sta op2 ;\
2859 iny ;\
2860 lda ptr2,y ;\
2861 sta op2+1 ;\
2862 jsr mul16i ;\
2863 stx tmp3 ;\
2864 sta tmp3+1 ;\
2865
2866 #define MULI_CDI(cte1,tmp2,ptr3,y3)\
2867 lda #LOW(cte1) ;\
2868 sta op1 ;\
2869 lda #HIGH(cte1) ;\
2870 sta op1+1 ;\
2871 lda tmp2 ;\
2872 sta op2 ;\
2873 lda tmp2+1 ;\
2874 sta op2+1 ;\
2875 jsr mul16i ;\
2876 ldy #y3+1 ;\
2877 sta ptr3,y ;\
2878 dey ;\
2879 txa ;\
2880 sta ptr3,y ;\
2881
2882 #define MULI_CII(cte1,ptr2,y2,ptr3,y3)\
2883 lda #LOW(cte1) ;\
2884 sta op1 ;\
2885 lda #HIGH(cte1) ;\
2886 sta op1+1 ;\
2887 ldy #y2 ;\
2888 lda ptr2,y ;\
2889 sta op2 ;\
2890 iny ;\
2891 lda ptr2,y ;\
2892 sta op2+1 ;\
2893 jsr mul16i ;\
2894 ldy #y3+1 ;\
2895 sta ptr3,y ;\
2896 dey ;\
2897 txa ;\
2898 sta ptr3,y ;\
2899
2900 #define MULI_DCD(tmp1,cte2,tmp3)\
2901 lda tmp1 ;\
2902 sta op1 ;\
2903 lda tmp1+1 ;\
2904 sta op1+1 ;\
2905 lda #LOW(cte2) ;\
2906 sta op2 ;\
2907 lda #HIGH(cte2) ;\
2908 sta op2+1 ;\
2909 jsr mul16i ;\
2910 stx tmp3 ;\
2911 sta tmp3+1 ;\
2912
2913 #define MULI_ICD(ptr1,y1,cte2,tmp3)\
2914 ldy #y1 ;\
2915 lda ptr1,y ;\
2916 sta op1 ;\
2917 iny ;\
2918 lda ptr1,y ;\
2919 sta op1+1 ;\
2920 lda #LOW(cte2) ;\
2921 sta op2 ;\
2922 lda #HIGH(cte2) ;\
2923 sta op2+1 ;\
2924 jsr mul16i ;\
2925 stx tmp3 ;\
2926 sta tmp3+1 ;\
2927
2928 #define MULI_DCI(tmp1,cte2,ptr3,y3)\
2929 lda tmp1 ;\
2930 sta op1 ;\
2931 lda tmp1+1 ;\
2932 sta op1+1 ;\
2933 lda #LOW(cte2) ;\
2934 sta op2 ;\
2935 lda #HIGH(cte2) ;\
2936 sta op2+1 ;\
2937 jsr mul16i ;\
2938 ldy #y3+1 ;\
2939 sta ptr3,y ;\
2940 dey ;\
2941 txa ;\
2942 sta ptr3,y ;\
2943
2944 #define MULI_ICI(ptr1,y1,cte2,ptr3,y3)\
2945 ldy #y1 ;\
2946 lda ptr1,y ;\
2947 sta op1 ;\
2948 iny ;\
2949 lda ptr1,y ;\
2950 sta op1+1 ;\
2951 lda #LOW(cte2) ;\
2952 sta op2 ;\
2953 lda #HIGH(cte2) ;\
2954 sta op2+1 ;\
2955 jsr mul16i ;\
2956 ldy #y3+1 ;\
2957 sta ptr3,y ;\
2958 dey ;\
2959 txa ;\
2960 sta ptr3,y ;\
2961
2962 #define LSH1W_DD(tmp1,tmp2)\
2963 lda tmp1 ;\
2964 asl a ;\
2965 sta tmp2 ;\
2966 lda tmp1+1 ;\
2967 rol a ;\
2968 sta tmp2+1 ;\
2969
2970 #define LSH1W_ID(ptr1,y1,tmp2)\
2971 ldy #y1 ;\
2972 lda ptr1,y ;\
2973 asl a ;\
2974 sta tmp2 ;\
2975 iny ;\
2976 lda ptr1,y ;\
2977 rol a ;\
2978 sta tmp2+1 ;\
2979
2980 #define LSH1W_DI(tmp1,ptr2,y2)\
2981 ldy #y2 ;\
2982 lda tmp1 ;\
2983 asl a ;\
2984 sta ptr2,y ;\
2985 iny ;\
2986 lda tmp1+1 ;\
2987 rol a ;\
2988 sta ptr2,y ;\
2989
2990 #define LSH1W_II(ptr1,y1,ptr2,y2)\
2991 ldy #y1 ;\
2992 lda ptr1,y ;\
2993 asl a ;\
2994 ldy #y2 ;\
2995 sta ptr2,y ;\
2996 ldy #y1+1 ;\
2997 lda ptr1,y ;\
2998 rol a ;\
2999 ldy #y2+1 ;\
3000 sta ptr2,y ;\
3001
3002 #define LSHW\
3003 beq *+8 ;\
3004 asl tmp ;\
3005 rol a ;\
3006 dex ;\
3007 bne *-4 ;\
3008 ldx tmp
3009
3010 #define LSHW_DDD(tmp1,tmp2,tmp3)\
3011 lda tmp1 ;\
3012 sta tmp ;\
3013 lda tmp1+1 ;\
3014 ldx tmp2 ;\
3015 LSHW ;\
3016 stx tmp3 ;\
3017 sta tmp3+1 ;\
3018
3019 #define LSHW_DCD(tmp1,cte2,tmp3)\
3020 lda tmp1 ;\
3021 sta tmp ;\
3022 lda tmp1+1 ;\
3023 ldx #cte2 ;\
3024 LSHW ;\
3025 stx tmp3 ;\
3026 sta tmp3+1 ;\
3027
3028 #define LSHW_DID(tmp1,ptr2,y2,tmp3)\
3029 ldy #y2 ;\
3030 lda ptr2,y ;\
3031 tax ;\
3032 lda tmp1 ;\
3033 sta tmp ;\
3034 lda tmp1+1 ;\
3035 LSHW ;\
3036 stx tmp3 ;\
3037 sta tmp3+1 ;\
3038
3039 #define LSHW_CDD(cte1,tmp2,tmp3)\
3040 lda #LOW(cte1) ;\
3041 sta tmp ;\
3042 lda #HIGH(cte1) ;\
3043 ldx tmp2 ;\
3044 LSHW ;\
3045 stx tmp3 ;\
3046 sta tmp3+1 ;\
3047
3048 #define LSHW_CID(cte1,ptr2,y2,tmp3)\
3049 ldy #y2 ;\
3050 lda ptr2,y ;\
3051 tax ;\
3052 lda #LOW(cte1) ;\
3053 sta tmp ;\
3054 lda #HIGH(cte1)+1 ;\
3055 LSHW ;\
3056 stx tmp3 ;\
3057 sta tmp3+1 ;\
3058
3059 #define LSHW_IDD(ptr1,y1,tmp2,tmp3)\
3060 ldy #y1 ;\
3061 lda ptr1,y ;\
3062 sta tmp ;\
3063 iny ;\
3064 lda ptr1,y ;\
3065 ldx tmp2 ;\
3066 LSHW ;\
3067 stx tmp3 ;\
3068 sta tmp3+1 ;\
3069
3070 #define LSHW_ICD(ptr1,y1,cte2,tmp3)\
3071 ldy #y1 ;\
3072 lda ptr1,y ;\
3073 sta tmp ;\
3074 iny ;\
3075 lda ptr1,y ;\
3076 ldx #cte2 ;\
3077 LSHW ;\
3078 stx tmp3 ;\
3079 sta tmp3+1 ;\
3080
3081 #define LSHW_IID(ptr1,y1,ptr2,y2,tmp3)\
3082 ldy #y2 ;\
3083 lda ptr2,y ;\
3084 tax ;\
3085 ldy #y1 ;\
3086 lda ptr1,y ;\
3087 sta tmp ;\
3088 iny ;\
3089 lda ptr1,y ;\
3090 LSHW ;\
3091 stx tmp3 ;\
3092 sta tmp3+1 ;\
3093
3094 #define LSHW_DDI(tmp1,tmp2,ptr3,y3)\
3095 lda tmp1 ;\
3096 sta tmp ;\
3097 lda tmp1+1 ;\
3098 ldx tmp2 ;\
3099 LSHW ;\
3100 ldy #y3+1 ;\
3101 sta ptr3,y ;\
3102 dey ;\
3103 txa ;\
3104 sta ptr3,y ;\
3105
3106 #define LSHW_DCI(tmp1,cte2,ptr3,y3)\
3107 lda tmp1 ;\
3108 sta tmp ;\
3109 lda tmp1+1 ;\
3110 ldx #cte2 ;\
3111 LSHW ;\
3112 ldy #y3+1 ;\
3113 sta ptr3,y ;\
3114 dey ;\
3115 txa ;\
3116 sta ptr3,y ;\
3117
3118 #define LSHW_DII(tmp1,ptr2,y2,ptr3,y3)\
3119 ldy #y2 ;\
3120 lda ptr2,y ;\
3121 tax ;\
3122 lda tmp1 ;\
3123 sta tmp ;\
3124 lda tmp1+1 ;\
3125 LSHW ;\
3126 ldy #y3+1 ;\
3127 sta ptr3,y ;\
3128 dey ;\
3129 txa ;\
3130 sta ptr3,y ;\
3131
3132 #define LSHW_CDI(cte1,tmp2,ptr3,y3)\
3133 lda #LOW(cte1) ;\
3134 sta tmp ;\
3135 lda #HIGH(cte1) ;\
3136 ldx tmp2 ;\
3137 LSHW ;\
3138 ldy #y3+1 ;\
3139 sta ptr3,y ;\
3140 dey ;\
3141 txa ;\
3142 sta ptr3,y ;\
3143
3144 #define LSHW_CII(cte1,ptr2,y2,ptr3,y3)\
3145 ldy #y2 ;\
3146 lda ptr2,y ;\
3147 tax ;\
3148 lda #LOW(cte1) ;\
3149 sta tmp ;\
3150 lda #HIGH(cte1)+1 ;\
3151 LSHW ;\
3152 ldy #y3+1 ;\
3153 sta ptr3,y ;\
3154 dey ;\
3155 txa ;\
3156 sta ptr3,y ;\
3157
3158 #define LSHW_IDI(ptr1,y1,tmp2,ptr3,y3)\
3159 ldy #y1 ;\
3160 lda ptr1,y ;\
3161 sta tmp ;\
3162 iny ;\
3163 lda ptr1,y ;\
3164 ldx tmp2 ;\
3165 LSHW ;\
3166 ldy #y3+1 ;\
3167 sta ptr3,y ;\
3168 dey ;\
3169 txa ;\
3170 sta ptr3,y ;\
3171
3172 #define LSHW_ICI(ptr1,y1,cte2,ptr3,y3)\
3173 ldy #y1 ;\
3174 lda ptr1,y ;\
3175 sta tmp ;\
3176 iny ;\
3177 lda ptr1,y ;\
3178 ldx #cte2 ;\
3179 LSHW ;\
3180 ldy #y3+1 ;\
3181 sta ptr3,y ;\
3182 dey ;\
3183 txa ;\
3184 sta ptr3,y ;\
3185
3186 #define LSHW_III(ptr1,y1,ptr2,y2,ptr3,y3)\
3187 ldy #y2 ;\
3188 lda ptr2,y ;\
3189 tax ;\
3190 ldy #y1 ;\
3191 lda ptr1,y ;\
3192 sta tmp ;\
3193 iny ;\
3194 lda ptr1,y ;\
3195 LSHW ;\
3196 ldy #y3+1 ;\
3197 sta ptr3,y ;\
3198 dey ;\
3199 txa ;\
3200 sta ptr3,y ;\
3201
3202 #define RSHW\
3203 beq *+8 ;\
3204 lsr a ;\
3205 ror tmp ;\
3206 dex ;\
3207 bne *-4 ;\
3208 ldx tmp
3209
3210 #define RSHW_DDD(tmp1,tmp2,tmp3)\
3211 lda tmp1 ;\
3212 sta tmp ;\
3213 lda tmp1+1 ;\
3214 ldx tmp2 ;\
3215 RSHW ;\
3216 stx tmp3 ;\
3217 sta tmp3+1 ;\
3218
3219 #define RSHW_DCD(tmp1,cte2,tmp3)\
3220 lda tmp1 ;\
3221 sta tmp ;\
3222 lda tmp1+1 ;\
3223 ldx #cte2 ;\
3224 RSHW ;\
3225 stx tmp3 ;\
3226 sta tmp3+1 ;\
3227
3228 #define RSHW_DID(tmp1,ptr2,y2,tmp3)\
3229 ldy #y2 ;\
3230 lda ptr2,y ;\
3231 tax ;\
3232 lda tmp1 ;\
3233 sta tmp ;\
3234 lda tmp1+1 ;\
3235 RSHW ;\
3236 stx tmp3 ;\
3237 sta tmp3+1 ;\
3238
3239 #define RSHW_CDD(cte1,tmp2,tmp3)\
3240 lda #LOW(cte1) ;\
3241 sta tmp ;\
3242 lda #HIGH(cte1) ;\
3243 ldx tmp2 ;\
3244 RSHW ;\
3245 stx tmp3 ;\
3246 sta tmp3+1 ;\
3247
3248 #define RSHW_CID(cte1,ptr2,y2,tmp3)\
3249 ldy #y2 ;\
3250 lda ptr2,y ;\
3251 tax ;\
3252 lda #LOW(cte1) ;\
3253 sta tmp ;\
3254 lda #HIGH(cte1)+1 ;\
3255 RSHW ;\
3256 stx tmp3 ;\
3257 sta tmp3+1 ;\
3258
3259 #define RSHW_IDD(ptr1,y1,tmp2,tmp3)\
3260 ldy #y1 ;\
3261 lda ptr1,y ;\
3262 sta tmp ;\
3263 iny ;\
3264 lda ptr1,y ;\
3265 ldx tmp2 ;\
3266 RSHW ;\
3267 stx tmp3 ;\
3268 sta tmp3+1 ;\
3269
3270 #define RSHW_ICD(ptr1,y1,cte2,tmp3)\
3271 ldy #y1 ;\
3272 lda ptr1,y ;\
3273 sta tmp ;\
3274 iny ;\
3275 lda ptr1,y ;\
3276 ldx #cte2 ;\
3277 RSHW ;\
3278 stx tmp3 ;\
3279 sta tmp3+1 ;\
3280
3281 #define RSHW_IID(ptr1,y1,ptr2,y2,tmp3)\
3282 ldy #y2 ;\
3283 lda ptr2,y ;\
3284 tax ;\
3285 ldy #y1 ;\
3286 lda ptr1,y ;\
3287 sta tmp ;\
3288 iny ;\
3289 lda ptr1,y ;\
3290 RSHW ;\
3291 stx tmp3 ;\
3292 sta tmp3+1 ;\
3293
3294 #define RSHW_DDI(tmp1,tmp2,ptr3,y3)\
3295 lda tmp1 ;\
3296 sta tmp ;\
3297 lda tmp1+1 ;\
3298 ldx tmp2 ;\
3299 RSHW ;\
3300 ldy #y3+1 ;\
3301 sta ptr3,y ;\
3302 dey ;\
3303 txa ;\
3304 sta ptr3,y ;\
3305
3306 #define RSHW_DCI(tmp1,cte2,ptr3,y3)\
3307 lda tmp1 ;\
3308 sta tmp ;\
3309 lda tmp1+1 ;\
3310 ldx #cte2 ;\
3311 RSHW ;\
3312 ldy #y3+1 ;\
3313 sta ptr3,y ;\
3314 dey ;\
3315 txa ;\
3316 sta ptr3,y ;\
3317
3318 #define RSHW_DII(tmp1,ptr2,y2,ptr3,y3)\
3319 ldy #y2 ;\
3320 lda ptr2,y ;\
3321 tax ;\
3322 lda tmp1 ;\
3323 sta tmp ;\
3324 lda tmp1+1 ;\
3325 RSHW ;\
3326 ldy #y3+1 ;\
3327 sta ptr3,y ;\
3328 dey ;\
3329 txa ;\
3330 sta ptr3,y ;\
3331
3332 #define RSHW_CDI(cte1,tmp2,ptr3,y3)\
3333 lda #LOW(cte1) ;\
3334 sta tmp ;\
3335 lda #HIGH(cte1) ;\
3336 ldx tmp2 ;\
3337 RSHW ;\
3338 ldy #y3+1 ;\
3339 sta ptr3,y ;\
3340 dey ;\
3341 txa ;\
3342 sta ptr3,y ;\
3343
3344 #define RSHW_CII(cte1,ptr2,y2,ptr3,y3)\
3345 ldy #y2 ;\
3346 lda ptr2,y ;\
3347 tax ;\
3348 lda #LOW(cte1) ;\
3349 sta tmp ;\
3350 lda #HIGH(cte1)+1 ;\
3351 RSHW ;\
3352 ldy #y3+1 ;\
3353 sta ptr3,y ;\
3354 dey ;\
3355 txa ;\
3356 sta ptr3,y ;\
3357
3358 #define RSHW_IDI(ptr1,y1,tmp2,ptr3,y3)\
3359 ldy #y1 ;\
3360 lda ptr1,y ;\
3361 sta tmp ;\
3362 iny ;\
3363 lda ptr1,y ;\
3364 ldx tmp2 ;\
3365 RSHW ;\
3366 ldy #y3+1 ;\
3367 sta ptr3,y ;\
3368 dey ;\
3369 txa ;\
3370 sta ptr3,y ;\
3371
3372 #define RSHW_ICI(ptr1,y1,cte2,ptr3,y3)\
3373 ldy #y1 ;\
3374 lda ptr1,y ;\
3375 sta tmp ;\
3376 iny ;\
3377 lda ptr1,y ;\
3378 ldx #cte2 ;\
3379 RSHW ;\
3380 ldy #y3+1 ;\
3381 sta ptr3,y ;\
3382 dey ;\
3383 txa ;\
3384 sta ptr3,y ;\
3385
3386 #define RSHW_III(ptr1,y1,ptr2,y2,ptr3,y3)\
3387 ldy #y2 ;\
3388 lda ptr2,y ;\
3389 tax ;\
3390 ldy #y1 ;\
3391 lda ptr1,y ;\
3392 sta tmp ;\
3393 iny ;\
3394 lda ptr1,y ;\
3395 RSHW ;\
3396 ldy #y3+1 ;\
3397 sta ptr3,y ;\
3398 dey ;\
3399 txa ;\
3400 sta ptr3,y ;\
3401
3402 #define ASGNB_CC(cte1,var2)\
3403 lda #LOW(cte1) ;\
3404 sta var2 ;\
3405
3406 #define ASGNB_CZ(cte1,ptr2)\
3407 ldy #0 ;\
3408 lda #LOW(cte1) ;\
3409 sta (ptr2),y ;\
3410
3411 #define ASGNB_CD(cte1,var2)\
3412 lda var2 ;\
3413 sta tmp ;\
3414 lda var2+1 ;\
3415 sta tmp+1 ;\
3416 ldy #0 ;\
3417 lda #LOW(cte1) ;\
3418 sta (tmp),y ;\
3419
3420 #define ASGNB_CA(cte1,ptr2,y2)\
3421 ldy #y2 ;\
3422 lda #LOW(cte1) ;\
3423 sta ptr2,y ;\
3424
3425 #define ASGNB_CI(cte1,ptr2,y2)\
3426 ldy #y2 ;\
3427 lda ptr2,y ;\
3428 sta tmp ;\
3429 iny ;\
3430 lda ptr2,y ;\
3431 sta tmp+1 ;\
3432 lda #LOW(cte1) ;\
3433 ldy #0 ;\
3434 sta (tmp),y ;\
3435
3436 #define ASGNB_DC(tmp1,var2)\
3437 lda tmp1 ;\
3438 sta var2 ;\
3439
3440 #define ASGNB_DZ(tmp1,ptr2)\
3441 ldy #0 ;\
3442 lda tmp1 ;\
3443 sta (ptr2),y ;\
3444
3445 #define ASGNB_DD(tmp1,var2)\
3446 lda var2 ;\
3447 sta tmp ;\
3448 lda var2+1 ;\
3449 sta tmp+1 ;\
3450 ldy #0 ;\
3451 lda tmp1 ;\
3452 sta (tmp),y ;\
3453
3454 #define ASGNB_DA(tmp1,ptr2,y2)\
3455 ldy #y2 ;\
3456 lda tmp1 ;\
3457 sta ptr2,y ;\
3458
3459 #define ASGNB_DI(tmp1,ptr2,y2)\
3460 ldy #y2 ;\
3461 lda ptr2,y ;\
3462 sta tmp ;\
3463 iny ;\
3464 lda ptr2,y ;\
3465 sta tmp+1 ;\
3466 ldy #0 ;\
3467 lda tmp1 ;\
3468 sta (tmp),y ;\
3469
3470 #define ASGNB_IC(ptr1,y1,var2)\
3471 ldy #y1 ;\
3472 lda ptr1,y ;\
3473 sta var2 ;\
3474
3475 #define ASGNB_IZ(ptr1,y1,ptr2)\
3476 ldy #y1 ;\
3477 lda ptr1,y ;\
3478 ldy #0 ;\
3479 sta (ptr2),y ;\
3480
3481 #define ASGNB_ID(ptr1,y1,var2)\
3482 lda var2 ;\
3483 sta tmp ;\
3484 lda var2+1 ;\
3485 sta tmp+1 ;\
3486 ldy #y1 ;\
3487 lda ptr1,y ;\
3488 ldy #0 ;\
3489 sta (tmp),y ;\
3490
3491 #define ASGNB_IA(ptr1,y1,ptr2,y2)\
3492 ldy #y1 ;\
3493 lda ptr1,y ;\
3494 ldy #y2 ;\
3495 sta ptr2,y ;\
3496
3497 #define ASGNB_II(ptr1,y1,ptr2,y2)\
3498 ldy #y2 ;\
3499 lda ptr2,y ;\
3500 sta tmp ;\
3501 iny ;\
3502 lda ptr2,y ;\
3503 sta tmp+1 ;\
3504 ldy #y1 ;\
3505 lda ptr1,y ;\
3506 ldy #0 ;\
3507 sta (tmp),y ;\
3508
3509 #define ASGNW_CC(cte1,var2)\
3510 lda #LOW(cte1) ;\
3511 sta var2 ;\
3512 lda #HIGH(cte1) ;\
3513 sta var2+1 ;\
3514
3515 #define ASGNW_CZ(cte1,ptr2)\
3516 ldy #0 ;\
3517 lda #LOW(cte1) ;\
3518 sta (ptr2),y ;\
3519 iny ;\
3520 lda #HIGH(cte1) ;\
3521 sta (ptr2),y ;\
3522
3523 #define ASGNW_CD(cte1,var2)\
3524 lda var2 ;\
3525 sta tmp ;\
3526 lda var2+1 ;\
3527 sta tmp+1 ;\
3528 ldy #0 ;\
3529 lda #LOW(cte1) ;\
3530 sta (tmp),y ;\
3531 iny ;\
3532 lda #HIGH(cte1) ;\
3533 sta (tmp),y ;\
3534
3535 #define ASGNW_CA(cte1,ptr2,y2)\
3536 ldy #y2 ;\
3537 lda #LOW(cte1) ;\
3538 sta ptr2,y ;\
3539 iny ;\
3540 lda #HIGH(cte1) ;\
3541 sta ptr2,y ;\
3542
3543 #define ASGNW_CI(cte1,ptr2,y2)\
3544 ldy #y2 ;\
3545 lda ptr2,y ;\
3546 sta tmp ;\
3547 iny ;\
3548 lda ptr2,y ;\
3549 sta tmp+1 ;\
3550 ldy #0 ;\
3551 lda #LOW(cte1) ;\
3552 sta (tmp),y ;\
3553 iny ;\
3554 lda #HIGH(cte1) ;\
3555 sta (tmp),y ;\
3556
3557 #define ASGNW_DC(tmp1,var2)\
3558 lda tmp1 ;\
3559 sta var2 ;\
3560 lda tmp1+1 ;\
3561 sta var2+1 ;\
3562
3563 #define ASGNW_DZ(tmp1,ptr2)\
3564 ldy #0 ;\
3565 lda tmp1 ;\
3566 sta (ptr2),y ;\
3567 iny ;\
3568 lda tmp1+1 ;\
3569 sta (ptr2),y ;\
3570
3571 #define ASGNW_DD(tmp1,var2)\
3572 lda var2 ;\
3573 sta tmp ;\
3574 lda var2+1 ;\
3575 sta tmp+1 ;\
3576 ldy #0 ;\
3577 lda tmp1 ;\
3578 sta (tmp),y ;\
3579 iny ;\
3580 lda tmp1+1 ;\
3581 sta (tmp),y ;\
3582
3583 #define ASGNW_DA(tmp1,ptr2,y2)\
3584 ldy #y2 ;\
3585 lda tmp1 ;\
3586 sta ptr2,y ;\
3587 iny ;\
3588 lda tmp1+1 ;\
3589 sta ptr2,y ;\
3590
3591 #define ASGNW_DI(tmp1,ptr2,y2)\
3592 ldy #y2 ;\
3593 lda ptr2,y ;\
3594 sta tmp ;\
3595 iny ;\
3596 lda ptr2,y ;\
3597 sta tmp+1 ;\
3598 ldy #0 ;\
3599 lda tmp1 ;\
3600 sta (tmp),y ;\
3601 iny ;\
3602 lda tmp1+1 ;\
3603 sta (tmp),y ;\
3604
3605 #define ASGNW_IC(ptr1,y1,var2)\
3606 ldy #y1 ;\
3607 lda ptr1,y ;\
3608 sta var2 ;\
3609 iny ;\
3610 lda ptr1,y ;\
3611 sta var2+1 ;\
3612
3613 #define ASGNW_IZ(ptr1,y1,ptr2)\
3614 ldy #y1 ;\
3615 lda ptr1,y ;\
3616 ldy #0 ;\
3617 sta (ptr2),y ;\
3618 ldy #y1+1 ;\
3619 lda ptr1,y ;\
3620 ldy #1 ;\
3621 sta (ptr2),y ;\
3622
3623 #define ASGNW_ID(ptr1,y1,var2)\
3624 lda var2 ;\
3625 sta tmp ;\
3626 lda var2+1 ;\
3627 sta tmp+1 ;\
3628 ldy #y1 ;\
3629 lda ptr1,y ;\
3630 ldy #0 ;\
3631 sta (tmp),y ;\
3632 ldy #y1+1 ;\
3633 lda ptr1,y ;\
3634 ldy #1 ;\
3635 sta (tmp),y ;\
3636
3637 #define ASGNW_IA(ptr1,y1,ptr2,y2)\
3638 ldy #y1 ;\
3639 lda ptr1,y ;\
3640 ldy #y2 ;\
3641 sta ptr2,y ;\
3642 ldy #y1+1 ;\
3643 lda ptr1,y ;\
3644 ldy #y2+1 ;\
3645 sta ptr2,y ;\
3646
3647 #define ASGNW_II(ptr1,y1,ptr2,y2)\
3648 ldy #y2 ;\
3649 lda ptr2,y ;\
3650 sta tmp ;\
3651 iny ;\
3652 lda ptr2,y ;\
3653 sta tmp+1 ;\
3654 ldy #y1 ;\
3655 lda ptr1,y ;\
3656 ldy #0 ;\
3657 sta (tmp),y ;\
3658 ldy #y1+1 ;\
3659 lda ptr1,y ;\
3660 ldy #1 ;\
3661 sta (tmp),y ;\
3662
3663 #define EQ0W_D(tmp,label)\
3664 lda tmp ;\
3665 ora tmp+1 ;\
3666 bne *+5 ;\
3667 jmp label ;\
3668
3669 #define EQ0W_I(ptr,y2,label)\
3670 ldy #y2 ;\
3671 lda ptr,y ;\
3672 iny ;\
3673 ora ptr,y ;\
3674 bne *+5 ;\
3675 jmp label ;\
3676
3677 #define EQW_DC(tmp2,cte1,label)\
3678 lda #LOW(cte1) ;\
3679 eor tmp2 ;\
3680 sta tmp ;\
3681 lda #HIGH(cte1) ;\
3682 eor tmp2+1 ;\
3683 ora tmp ;\
3684 bne *+5 ;\
3685 jmp label ;\
3686
3687 #define EQW_DA(tmp2,ptr1,y1,label)\
3688 clc ;\
3689 lda 0+ptr1 ;\
3690 adc #y1 ;\
3691 eor tmp2 ;\
3692 sta tmp ;\
3693 lda 1+ptr1 ;\
3694 adc #0 ;\
3695 eor tmp2+1 ;\
3696 ora tmp ;\
3697 bne *+5 ;\
3698 jmp label ;\
3699
3700 #define EQW_IC(ptr2,y2,cte1,label)\
3701 lda #LOW(cte1) ;\
3702 ldy #y2 ;\
3703 cmp ptr2,y ;\
3704 bne *+12 ;\
3705 iny ;\
3706 lda #HIGH(cte1) ;\
3707 cmp ptr2,y ;\
3708 bne *+5 ;\
3709 jmp label ;\
3710
3711 #define EQW_IA(ptr2,y2,ptr1,y1,label)\
3712 clc ;\
3713 lda 0+ptr1 ;\
3714 adc #y1 ;\
3715 ldy #y2 ;\
3716 eor ptr2,y ;\
3717 sta tmp ;\
3718 iny ;\
3719 lda 1+ptr1 ;\
3720 adc #0 ;\
3721 eor ptr2,y ;\
3722 ora tmp ;\
3723 bne *+5 ;\
3724 jmp label ;\
3725
3726 #define EQW_DD(tmp1,tmp2,label)\
3727 lda tmp1 ;\
3728 eor tmp2 ;\
3729 sta tmp ;\
3730 lda tmp1+1 ;\
3731 eor tmp2+1 ;\
3732 ora tmp ;\
3733 bne *+5 ;\
3734 jmp label ;\
3735
3736 #define EQW_DI(tmp1,ptr2,y2,label)\
3737 lda tmp1 ;\
3738 ldy #y2 ;\
3739 ora ptr2,y ;\
3740 sta tmp ;\
3741 iny ;\
3742 lda tmp1+1 ;\
3743 eor ptr2,y ;\
3744 ora tmp ;\
3745 bne *+5 ;\
3746 jmp label ;\
3747
3748 #define EQW_ID(ptr1,y1,tmp2,label)\
3749 ldy #y1 ;\
3750 lda ptr1,y ;\
3751 eor tmp2 ;\
3752 sta tmp ;\
3753 iny ;\
3754 lda ptr1,y ;\
3755 eor tmp2+1 ;\
3756 ora tmp ;\
3757 bne *+5 ;\
3758 jmp label ;\
3759
3760 #define EQW_II(ptr1,y1,ptr2,y2,label)\
3761 ldy #y1 ;\
3762 lda ptr1,y ;\
3763 ldy #y2 ;\
3764 cmp ptr2,y ;\
3765 bne *+15 ;\
3766 ldy #y1+1 ;\
3767 lda ptr1,y ;\
3768 ldy #y2+1 ;\
3769 cmp ptr2,y ;\
3770 bne *+5 ;\
3771 jmp label ;\
3772
3773 #define NE0W_D(tmp,label)\
3774 lda tmp ;\
3775 ora tmp+1 ;\
3776 beq *+5 ;\
3777 jmp label ;\
3778
3779 #define NE0W_I(ptr,y2,label)\
3780 ldy #y2 ;\
3781 lda ptr,y ;\
3782 iny ;\
3783 ora ptr,y ;\
3784 beq *+5 ;\
3785 jmp label ;\
3786
3787 #define NEW_DC(tmp2,cte1,label)\
3788 lda #LOW(cte1) ;\
3789 eor tmp2 ;\
3790 sta tmp ;\
3791 lda #HIGH(cte1) ;\
3792 eor tmp2+1 ;\
3793 ora tmp ;\
3794 beq *+5 ;\
3795 jmp label ;\
3796
3797 #define NEW_DA(tmp2,ptr1,y1,label)\
3798 clc ;\
3799 lda 0+ptr1 ;\
3800 adc #y1 ;\
3801 eor tmp2 ;\
3802 sta tmp ;\
3803 lda 1+ptr1 ;\
3804 adc #0 ;\
3805 eor tmp2+1 ;\
3806 ora tmp ;\
3807 beq *+5 ;\
3808 jmp label ;\
3809
3810 #define NEW_IC(ptr2,y2,cte1,label)\
3811 lda #LOW(cte1) ;\
3812 ldy #y2 ;\
3813 cmp ptr2,y ;\
3814 beq *+5 ;\
3815 jmp label ;\
3816 iny ;\
3817 lda #HIGH(cte1) ;\
3818 cmp ptr2,y ;\
3819 beq *+5 ;\
3820 jmp label ;\
3821
3822 #define NEW_IA(ptr2,y2,ptr1,y1,label)\
3823 clc ;\
3824 lda 0+ptr1 ;\
3825 adc #y1 ;\
3826 ldy #y2 ;\
3827 eor ptr2,y ;\
3828 sta tmp ;\
3829 iny ;\
3830 lda 1+ptr1 ;\
3831 adc #0 ;\
3832 eor ptr2,y ;\
3833 ora tmp ;\
3834 beq *+5 ;\
3835 jmp label ;\
3836
3837 #define NEW_DD(tmp1,tmp2,label)\
3838 lda tmp1 ;\
3839 eor tmp2 ;\
3840 sta tmp ;\
3841 lda tmp1+1 ;\
3842 eor tmp2+1 ;\
3843 ora tmp ;\
3844 beq *+5 ;\
3845 jmp label ;\
3846
3847 #define NEW_DI(tmp1,ptr2,y2,label)\
3848 lda tmp1 ;\
3849 ldy #y2 ;\
3850 eor ptr2,y ;\
3851 sta tmp ;\
3852 iny ;\
3853 lda tmp1+1 ;\
3854 eor ptr2,y ;\
3855 ora tmp ;\
3856 beq *+5 ;\
3857 jmp label ;\
3858
3859 #define NEW_ID(ptr1,y1,tmp2,label)\
3860 ldy #y1 ;\
3861 lda ptr1,y ;\
3862 eor tmp2 ;\
3863 sta tmp ;\
3864 iny ;\
3865 lda ptr1,y ;\
3866 eor tmp2+1 ;\
3867 ora tmp ;\
3868 beq *+5 ;\
3869 jmp label ;\
3870
3871 #define NEW_II(ptr1,y1,ptr2,y2,label)\
3872 ldy #y1 ;\
3873 lda ptr1,y ;\
3874 ldy #y2 ;\
3875 cmp ptr2,y ;\
3876 beq *+5 ;\
3877 jmp label ;\
3878 ldy #y1+1 ;\
3879 lda ptr1,y ;\
3880 ldy #y2+1 ;\
3881 cmp ptr2,y ;\
3882 beq *+5 ;\
3883 jmp label ;\
3884
3885 #define GEI(label)\
3886 bvc *+4 ;\
3887 eor #$80 ;\
3888 bmi *+5 ;\
3889 jmp label ;\
3890
3891 #define GEU(label)\
3892 bcc *+5 ;\
3893 jmp label ;\
3894
3895 #define GEI_DC(tmp1,cte2,label)\
3896 lda tmp1 ;\
3897 cmp #LOW(cte2) ;\
3898 lda tmp1+1 ;\
3899 sbc #HIGH(cte2) ;\
3900 GEI(label) ;\
3901
3902 #define GEI_DD(tmp1,tmp2,label)\
3903 lda tmp1 ;\
3904 cmp tmp2 ;\
3905 lda tmp1+1 ;\
3906 sbc tmp2+1 ;\
3907 GEI(label) ;\
3908
3909 #define GEI_DI(tmp1,ptr2,y2,label)\
3910 lda tmp1 ;\
3911 ldy #y2 ;\
3912 cmp ptr2,y ;\
3913 iny ;\
3914 lda tmp1+1 ;\
3915 sbc ptr2,y ;\
3916 GEI(label) ;\
3917
3918 #define GEI_IC(ptr1,y1,cte2,label)\
3919 ldy #y1 ;\
3920 lda ptr1,y ;\
3921 cmp #LOW(cte2) ;\
3922 iny ;\
3923 lda ptr1,y ;\
3924 sbc #HIGH(cte2) ;\
3925 GEI(label) ;\
3926
3927 #define GEI_ID(ptr1,y1,tmp2,label)\
3928 ldy #y1 ;\
3929 lda ptr1,y ;\
3930 cmp tmp2 ;\
3931 iny ;\
3932 lda ptr1,y ;\
3933 sbc tmp2+1 ;\
3934 GEI(label) ;\
3935
3936 #define GEI_II(ptr1,y1,ptr2,y2,label)\
3937 ldy #y1 ;\
3938 lda ptr1,y ;\
3939 ldy #y2 ;\
3940 cmp ptr2,y ;\
3941 ldy #y1+1 ;\
3942 lda ptr1,y ;\
3943 ldy #y2+1 ;\
3944 sbc ptr2,y ;\
3945 GEI(label) ;\
3946
3947 #define GEI_CD(cte1,tmp2,label)\
3948 lda #LOW(cte1) ;\
3949 cmp tmp2 ;\
3950 lda #HIGH(cte1) ;\
3951 sbc tmp2+1 ;\
3952 GEI(label) ;\
3953
3954 #define GEI_CI(cte1,ptr2,y2,label)\
3955 lda #LOW(cte1) ;\
3956 ldy #y2 ;\
3957 cmp ptr2,y ;\
3958 iny ;\
3959 lda #HIGH(cte1) ;\
3960 sbc ptr2,y ;\
3961 GEI(label) ;\
3962
3963 #define GEU_DC(tmp1,cte2,label)\
3964 lda tmp1 ;\
3965 cmp #LOW(cte2) ;\
3966 lda tmp1+1 ;\
3967 sbc #HIGH(cte2) ;\
3968 GEU(label) ;\
3969
3970 #define GEU_DD(tmp1,tmp2,label)\
3971 lda tmp1 ;\
3972 cmp tmp2 ;\
3973 lda tmp1+1 ;\
3974 sbc tmp2+1 ;\
3975 GEU(label) ;\
3976
3977 #define GEU_DI(tmp1,ptr2,y2,label)\
3978 lda tmp1 ;\
3979 ldy #y2 ;\
3980 cmp ptr2,y ;\
3981 iny ;\
3982 lda tmp1+1 ;\
3983 sbc ptr2,y ;\
3984 GEU(label) ;\
3985
3986 #define GEU_IC(ptr1,y1,cte2,label)\
3987 ldy #y1 ;\
3988 lda ptr1,y ;\
3989 cmp #LOW(cte2) ;\
3990 iny ;\
3991 lda ptr1,y ;\
3992 sbc #HIGH(cte2) ;\
3993 GEU(label) ;\
3994
3995 #define GEU_ID(ptr1,y1,tmp2,label)\
3996 ldy #y1 ;\
3997 lda ptr1,y ;\
3998 cmp tmp2 ;\
3999 iny ;\
4000 lda ptr1,y ;\
4001 sbc tmp2+1 ;\
4002 GEU(label) ;\
4003
4004 #define GEU_II(ptr1,y1,ptr2,y2,label)\
4005 ldy #y1 ;\
4006 lda ptr1,y ;\
4007 ldy #y2 ;\
4008 cmp ptr2,y ;\
4009 ldy #y1+1 ;\
4010 lda ptr1,y ;\
4011 ldy #y2+1 ;\
4012 sbc ptr2,y ;\
4013 GEU(label) ;\
4014
4015 #define GEU_CD(cte1,tmp2,label)\
4016 lda #LOW(cte1) ;\
4017 cmp tmp2 ;\
4018 lda #HIGH(cte1) ;\
4019 sbc tmp2+1 ;\
4020 GEU(label) ;\
4021
4022 #define GEU_CI(cte1,ptr2,y2,label)\
4023 lda #LOW(cte1) ;\
4024 ldy #y2 ;\
4025 cmp ptr2,y ;\
4026 iny ;\
4027 lda #HIGH(cte1) ;\
4028 sbc ptr2,y ;\
4029 GEU(label) ;\
4030
4031 #define LTI(label)\
4032 bvc *+4 ;\
4033 eor #$80 ;\
4034 bpl *+5 ;\
4035 jmp label ;\
4036
4037 #define LTU(label)\
4038 bcs *+5 ;\
4039 jmp label ;\
4040
4041 #define LTI_DC(tmp1,cte2,label)\
4042 lda tmp1 ;\
4043 cmp #LOW(cte2) ;\
4044 lda tmp1+1 ;\
4045 sbc #HIGH(cte2) ;\
4046 LTI(label) ;\
4047
4048 #define LTI_DD(tmp1,tmp2,label)\
4049 lda tmp1 ;\
4050 cmp tmp2 ;\
4051 lda tmp1+1 ;\
4052 sbc tmp2+1 ;\
4053 LTI(label) ;\
4054
4055 #define LTI_DI(tmp1,ptr2,y2,label)\
4056 lda tmp1 ;\
4057 ldy #y2 ;\
4058 cmp ptr2,y ;\
4059 iny ;\
4060 lda tmp1+1 ;\
4061 sbc ptr2,y ;\
4062 LTI(label) ;\
4063
4064 #define LTI_IC(ptr1,y1,cte2,label)\
4065 ldy #y1 ;\
4066 lda ptr1,y ;\
4067 cmp #LOW(cte2) ;\
4068 iny ;\
4069 lda ptr1,y ;\
4070 sbc #HIGH(cte2) ;\
4071 LTI(label) ;\
4072
4073 #define LTI_ID(ptr1,y1,tmp2,label)\
4074 ldy #y1 ;\
4075 lda ptr1,y ;\
4076 cmp tmp2 ;\
4077 iny ;\
4078 lda ptr1,y ;\
4079 sbc tmp2+1 ;\
4080 LTI(label) ;\
4081
4082 #define LTI_II(ptr1,y1,ptr2,y2,label)\
4083 ldy #y1 ;\
4084 lda ptr1,y ;\
4085 ldy #y2 ;\
4086 cmp ptr2,y ;\
4087 ldy #y1+1 ;\
4088 lda ptr1,y ;\
4089 ldy #y2+1 ;\
4090 sbc ptr2,y ;\
4091 LTI(label) ;\
4092
4093 #define LTI_CD(cte1,tmp2,label)\
4094 lda #LOW(cte1) ;\
4095 cmp tmp2 ;\
4096 lda #HIGH(cte1) ;\
4097 sbc tmp2+1 ;\
4098 LTI(label) ;\
4099
4100 #define LTI_CI(cte1,ptr2,y2,label)\
4101 lda #LOW(cte1) ;\
4102 ldy #y2 ;\
4103 cmp ptr2,y ;\
4104 iny ;\
4105 lda #HIGH(cte1) ;\
4106 sbc ptr2,y ;\
4107 LTI(label) ;\
4108
4109 #define LTU_DC(tmp1,cte2,label)\
4110 lda tmp1 ;\
4111 cmp #LOW(cte2) ;\
4112 lda tmp1+1 ;\
4113 sbc #HIGH(cte2) ;\
4114 LTU(label) ;\
4115
4116 #define LTU_DD(tmp1,tmp2,label)\
4117 lda tmp1 ;\
4118 cmp tmp2 ;\
4119 lda tmp1+1 ;\
4120 sbc tmp2+1 ;\
4121 LTU(label) ;\
4122
4123 #define LTU_DI(tmp1,ptr2,y2,label)\
4124 lda tmp1 ;\
4125 ldy #y2 ;\
4126 cmp ptr2,y ;\
4127 iny ;\
4128 lda tmp1+1 ;\
4129 sbc ptr2,y ;\
4130 LTU(label) ;\
4131
4132 #define LTU_IC(ptr1,y1,cte2,label)\
4133 ldy #y1 ;\
4134 lda ptr1,y ;\
4135 cmp #LOW(cte2) ;\
4136 iny ;\
4137 lda ptr1,y ;\
4138 sbc #HIGH(cte2) ;\
4139 LTU(label) ;\
4140
4141 #define LTU_ID(ptr1,y1,tmp2,label)\
4142 ldy #y1 ;\
4143 lda ptr1,y ;\
4144 cmp tmp2 ;\
4145 iny ;\
4146 lda ptr1,y ;\
4147 sbc tmp2+1 ;\
4148 LTU(label) ;\
4149
4150 #define LTU_II(ptr1,y1,ptr2,y2,label)\
4151 ldy #y1 ;\
4152 lda ptr1,y ;\
4153 ldy #y2 ;\
4154 cmp ptr2,y ;\
4155 ldy #y1+1 ;\
4156 lda ptr1,y ;\
4157 ldy #y2+1 ;\
4158 sbc ptr2,y ;\
4159 LTU(label) ;\
4160
4161 #define LTU_CD(cte1,tmp2,label)\
4162 lda #LOW(cte1) ;\
4163 cmp tmp2 ;\
4164 lda #HIGH(cte1) ;\
4165 sbc tmp2+1 ;\
4166 LTU(label) ;\
4167
4168 #define LTU_CI(cte1,ptr2,y2,label)\
4169 lda #LOW(cte1) ;\
4170 ldy #y2 ;\
4171 cmp ptr2,y ;\
4172 iny ;\
4173 lda #HIGH(cte1) ;\
4174 sbc ptr2,y ;\
4175 LTU(label) ;\
4176
4177 #define GTI_DC(tmp1,cte2,label)\
4178 LTI_CD(cte2,tmp1,label) ;\
4179
4180 #define GTI_DD(tmp1,tmp2,label)\
4181 LTI_DD(tmp2,tmp1,label) ;\
4182
4183 #define GTI_DI(tmp1,ptr2,y2,label)\
4184 LTI_ID(tmp2,y2,tmp1,label) ;\
4185
4186 #define GTI_IC(ptr1,y1,cte2,label)\
4187 LTI_CI(cte2,ptr1,y1,label) ;\
4188
4189 #define GTI_ID(ptr1,y1,tmp2,label)\
4190 LTI_DI(tmp2,ptr1,y1,label) ;\
4191
4192 #define GTI_II(ptr1,y1,ptr2,y2,label)\
4193 LTI_II(ptr2,y2,ptr1,y1,label) ;\
4194
4195 #define GTI_CD(cte1,tmp2,label)\
4196 LTI_DC(tmp2,cte1,label) ;\
4197
4198 #define GTI_CI(cte1,ptr2,y2,label)\
4199 LTI_IC(ptr2,y2,cte1,label) ;\
4200
4201 #define LEI_DC(tmp1,cte2,label)\
4202 GEI_CD(cte2,tmp1,label) ;\
4203
4204 #define LEI_DD(tmp1,tmp2,label)\
4205 GEI_DD(tmp2,tmp1,label) ;\
4206
4207 #define LEI_DI(tmp1,ptr2,y2,label)\
4208 GEI_ID(tmp2,y2,tmp1,label) ;\
4209
4210 #define LEI_IC(ptr1,y1,cte2,label)\
4211 GEI_CI(cte2,ptr1,y1,label) ;\
4212
4213 #define LEI_ID(ptr1,y1,tmp2,label)\
4214 GEI_DI(tmp2,ptr1,y1,label) ;\
4215
4216 #define LEI_II(ptr1,y1,ptr2,y2,label)\
4217 GEI_II(ptr2,y2,ptr1,y1,label) ;\
4218
4219 #define LEI_CD(cte1,tmp2,label)\
4220 GEI_DC(tmp2,cte1,label) ;\
4221
4222 #define LEI_CI(cte1,ptr2,y2,label)\
4223 GEI_IC(ptr2,y2,cte1,label) ;\
4224
4225 #define GTU_DC(tmp1,cte2,label)\
4226 LTU_CD(cte2,tmp1,label) ;\
4227
4228 #define GTU_DD(tmp1,tmp2,label)\
4229 LTU_DD(tmp2,tmp1,label) ;\
4230
4231 #define GTU_DI(tmp1,ptr2,y2,label)\
4232 LTU_ID(tmp2,y2,tmp1,label) ;\
4233
4234 #define GTU_IC(ptr1,y1,cte2,label)\
4235 LTU_CI(cte2,ptr1,y1,label) ;\
4236
4237 #define GTU_ID(ptr1,y1,tmp2,label)\
4238 LTU_DI(tmp2,ptr1,y1,label) ;\
4239
4240 #define GTU_II(ptr1,y1,ptr2,y2,label)\
4241 LTU_II(ptr2,y2,ptr1,y1,label) ;\
4242
4243 #define GTU_CD(cte1,tmp2,label)\
4244 LTU_DC(tmp2,cte1,label) ;\
4245
4246 #define GTU_CI(cte1,ptr2,y2,label)\
4247 LTU_IC(ptr2,y2,cte1,label) ;\
4248
4249 #define LEU_DC(tmp1,cte2,label)\
4250 GEU_CD(cte2,tmp1,label) ;\
4251
4252 #define LEU_DD(tmp1,tmp2,label)\
4253 GEU_DD(tmp2,tmp1,label) ;\
4254
4255 #define LEU_DI(tmp1,ptr2,y2,label)\
4256 GEU_ID(tmp2,y2,tmp1,label) ;\
4257
4258 #define LEU_IC(ptr1,y1,cte2,label)\
4259 GEU_CI(cte2,ptr1,y1,label) ;\
4260
4261 #define LEU_ID(ptr1,y1,tmp2,label)\
4262 GEU_DI(tmp2,ptr1,y1,label) ;\
4263
4264 #define LEU_II(ptr1,y1,ptr2,y2,label)\
4265 GEU_II(ptr2,y2,ptr1,y1,label) ;\
4266
4267 #define LEU_CD(cte1,tmp2,label)\
4268 GEU_DC(tmp2,cte1,label) ;\
4269
4270 #define LEU_CI(cte1,ptr2,y2,label)\
4271 GEU_IC(ptr2,y2,cte1,label) ;\
4272
4273 #define ARGW_C(cte,ptr,y2)\
4274 lda #LOW(cte) ;\
4275 ldy #y2 ;\
4276 sta ptr,y ;\
4277 iny ;\
4278 lda #HIGH(cte) ;\
4279 sta ptr,y ;\
4280
4281 #define ARGW_D(tmp,ptr,y2)\
4282 lda tmp ;\
4283 ldy #y2 ;\
4284 sta ptr,y ;\
4285 iny ;\
4286 lda tmp+1 ;\
4287 sta ptr,y ;\
4288
4289 #define ARGW_A(ptr1,y1,ptr,y2)\
4290 clc ;\
4291 lda 0+ptr1 ;\
4292 adc #y1 ;\
4293 ldy #y2 ;\
4294 sta ptr,y ;\
4295 iny ;\
4296 lda 1+ptr1 ;\
4297 adc #0 ;\
4298 sta ptr,y ;\
4299
4300 #define ARGW_I(ptr1,y1,ptr,y2)\
4301 ldy #y1 ;\
4302 lda ptr1,y ;\
4303 ldy #y2 ;\
4304 sta ptr,y ;\
4305 ldy #y1+1 ;\
4306 lda ptr1,y ;\
4307 ldy #y2+1 ;\
4308 sta ptr,y ;\
4309
4310 #define CALLV_C(adr,size)\
4311 ldy #size ;\
4312 jsr adr ;\
4313
4314 #define CALLV_D(tmp,size)\
4315 lda tmp ;\
4316 sta *+11 ;\
4317 lda tmp+1 ;\
4318 sta *+7 ;\
4319 ldy #size ;\
4320 jsr 0000 ;\
4321
4322 #define CALLV_I(ptr,y2,size)\
4323 ldy #y2 ;\
4324 lda ptr,y ;\
4325 sta jsrvect+1 ;\
4326 iny ;\
4327 lda ptr,y ;\
4328 sta jsrvect+2 ;\
4329 ldy #size ;\
4330 jsr jsrvect ;\
4331
4332 #define CALLW_CD(adr,size,tmp)\
4333 ldy #size ;\
4334 jsr adr ;\
4335 stx tmp ;\
4336 sta tmp+1 ;\
4337
4338 #define CALLW_DD(tmp1,size,tmp)\
4339 lda tmp1 ;\
4340 sta *+11 ;\
4341 lda tmp1+1 ;\
4342 sta *+7 ;\
4343 ldy #size ;\
4344 jsr 0000 ;\
4345 stx tmp ;\
4346 sta tmp+1 ;\
4347
4348 #define CALLW_ID(ptr,y2,size,tmp)\
4349 ldy #y2 ;\
4350 lda ptr,y ;\
4351 sta jsrvect+1 ;\
4352 iny ;\
4353 lda ptr,y ;\
4354 sta jsrvect+2 ;\
4355 ldy #size ;\
4356 jsr jsrvect ;\
4357 stx tmp ;\
4358 sta tmp+1 ;\
4359
4360 #define CALLW_CI(adr,size,ptr,y2)\
4361 ldy #size ;\
4362 jsr adr ;\
4363 ldy #y2+1 ;\
4364 sta ptr,y ;\
4365 dey ;\
4366 txa ;\
4367 sta ptr,y ;\
4368
4369 #define CALLW_II(ptr,y0,size,ptr2,y2)\
4370 ldy #y0 ;\
4371 lda ptr,y ;\
4372 sta jsrvect+1 ;\
4373 iny ;\
4374 lda ptr,y ;\
4375 sta jsrvect+2 ;\
4376 ldy #size ;\
4377 jsr jsrvect ;\
4378 ldy #y2+1 ;\
4379 sta ptr2,y ;\
4380 dey ;\
4381 txa ;\
4382 sta ptr2,y ;\
4383
4384
4385 #define JUMP_C(label)\
4386 jmp label ;\
4387
4388 #define JUMP_D(tmp)\
4389 lda tmp ;\
4390 sta *+9 ;\
4391 lda tmp+1 ;\
4392 sta *+5 ;\
4393 jmp 0000 ;\
4394
4395 #define JUMP_I(ptr1,y1)\
4396 ldy #y1 ;\
4397 lda ptr1,y ;\
4398 sta *+10 ;\
4399 iny
4400 lda ptr1,y ;\
4401 sta *+5 ;\
4402 jmp 0000 ;\

  ViewVC Help
Powered by ViewVC 1.1.26