1000 ;
1010 ; SET / TEST V1.2
1020 ;
1030 ;
1040 ; SET : C SET
1050 ; TEST : C RESET
1060 ;
1070 ;
1080 ORG 20000
1090 ;
1100 TMP1 EQU 20
1110 TMP2 EQU 151
1120 TMP3 EQU 252
1130 FREE EQU 704
1140 X EQU TMP1
1150 Y EQU TMP2
1160 BMAP EQU $2000
1170 OFFX EQU FREE
1180 OFFY EQU FREE+2
1190 ADR EQU TMP3
1200 ;
1210 ;
1220 JSR $AEFD
1230 JSR $B7EB
1240 STX Y
1250 ;
1260 SET SEC
1270 BCS PRG
1280 TEST CLC
1290 PRG PHP
1300 LDA Y
1310 CMP #200
1320 BCS ERR
1330 LDA X+1
1340 CMP #>320
1350 BCS ERR
1360 LDA X
1370 CMP #<320
1380 BCC SET1
1390 ERR PLP
1400 CLC
1410 RTS
1420 ;
1430 SET1 LDA Y
1440 LSR
1450 LSR
1460 LSR
1470 ASL ; DURCH 8 MAL 2
1480 TAY
1490 ;
1500 LDA MULTTAB,Y
1510 STA OFFY
1520 LDA MULTTAB+1,Y
1530 STA OFFY+1
1540 LDA Y
1550 AND #7
1560 CLC
1570 ADC OFFY
1580 STA OFFY
1590 ;
1600 LDA X
1610 AND #%11111000
1620 STA OFFX
1630 CLC
1640 LDA #<BMAP
1650 ADC OFFY
1660 STA ADR
1670 LDA #>BMAP
1680 ADC OFFY+1
1690 STA ADR+1
1700 CLC
1710 LDA ADR
1720 ADC OFFX
1730 STA ADR
1740 LDA ADR+1
1750 ADC X+1
1760 STA ADR+1
1770 ;
1780 LDA X
1790 AND #7
1800 EOR #7
1810 TAY
1820 LDA ZWEIHOCH,Y
1830 LDY #0
1840 PLP
1850 BCC SET2
1860 ORA (ADR),Y
1870 STA (ADR),Y
1880 CLC
1890 RTS
1900 SET2 AND (ADR),Y
1910 CLC
1920 RTS
1930 ;
1940 ;
1950 ZWEIHOCH DFB 1,2,4,8,16,32,64,128
1960 MULTTAB DFB 0,00,64,01,128,02,196,03
1970 DFB 0,05,64,06,128,07,196,08
1980 DFB 0,10,64,11,128,12,196,13
1990 DFB 0,15,64,16,128,17,196,18
2000 DFB 0,20,64,21,128,22,196,23
2010 DFB 0,25,64,26,128,27,196,28
READY.