C64 Software  <  SCA: The C64 Software Collection / LINE V1.0

  Run
1000              ORG 49152
1010              ;
1020 XL           EQU 20
1030 XH           EQU 21
1040 Y1           EQU 87
1050 XL2          EQU 88
1060 XH2          EQU 89
1070 T0           EQU 90
1080 T1           EQU 91
1090 T2           EQU 92
1100 T3           EQU 93
1110 T4           EQU 94
1120 T5           EQU 95
1130 T6           EQU 96
1140 T7           EQU 97
1150 T8           EQU 98
1160 MAPMSB       EQU 252
1170 MAPPTR       EQU 253
1180 Y2           EQU 255
1190              ;
1200              ;
1210              ;
1220              ;
1230 LINEEINSPR   LDA #0
1240              STA XL
1250              LDA #0
1260              STA XH
1270              LDA #0
1280              STA Y1
1290              LDA #0
1300              STA XL2
1310              LDA #0
1320              STA XH2
1330              LDA #0
1340              STA Y2
1350              ;
1360              ;
1370 LINE         LDY #1
1380              STY T8
1390              STY T5
1400              STY T3
1410              DEY
1420              STY T4
1430              STY T7
1440              STY T6
1450              DEY
1460              LDA XH2
1470              CMP XH
1480              BCC D1
1490              BNE D2
1500              LDA XL2
1510              CMP XL
1520              BCS D2
1530 D1           SEC
1540              LDA XL
1550              SBC XL2
1560              STA T1
1570              LDA XH
1580              SBC XH2
1590              STA T2
1600              STY T8
1610              JMP L1
1620 D2           SEC
1630              LDA XL2
1640              SBC XL
1650              STA T1
1660              LDA XH2
1670              SBC XH
1680              STA T2
1690 L1           LDA Y2
1700              CMP Y1
1710              BCS D3
1720              SEC
1730              LDA Y1
1740              SBC Y2
1750              STA T0
1760              STY T5
1770              JMP L2
1780 D3           SBC Y1
1790              STA T0
1800 L2           LDA T2
1810              BNE D4
1820              LDA T1
1830              CMP T0
1840              BCS D4
1850              LDX T0
1860              STA T0
1870              STX T1
1880              LDA T8
1890              STA T6
1900              LDA T5
1910              STA T7
1920              INY
1930              STY T8
1940              STY T5
1950 D4           LDA T2
1960              LSR
1970              STA XH2
1980              LDA T1
1990              ROR
2000              STA XL2
2010              JMP D11
2020 L3           LDA T8
2030              BMI D5
2040              CLC
2050              ADC XL
2060              STA XL
2070              BCC D6
2080              INC XH
2090              BNE D6
2100 D5           CLC
2110              ADC XL
2120              STA XL
2130              BCS D6
2140              DEC XH
2150 D6           CLC
2160              LDA Y1
2170              ADC T7
2180              STA Y1
2190              CLC
2200              LDA XL2
2210              ADC T0
2220              STA XL2
2230              LDA XH2
2240              ADC #0
2250              STA XH2
2260              INC T3
2270              BNE D7
2280              INC T4
2290 D7           LDA XH2
2300              CMP T2
2310              BCC D11
2320              BNE D8
2330              LDA T1
2340              CMP XL2
2350              BCS D11
2360 D8           SEC
2370              LDA XL2
2380              SBC T1
2390              STA XL2
2400              LDA XH2
2410              SBC T2
2420              STA XH2
2430              LDA T6
2440              BMI D9
2450              CLC
2460              ADC XL
2470              STA XL
2480              BCC D10
2490              INC XH
2500              BNE D10
2510 D9           CLC
2520              ADC XL
2530              STA XL
2540              BCS D10
2550              DEC XH
2560 D10          CLC
2570              LDA Y1
2580              ADC T5
2590              STA Y1
2600 D11          LDX Y1
2610              JSR SET
2620              LDA T4
2630              CMP T2
2640              BCC D12
2650              LDA T1
2660              CMP T3
2670              BCS D12
2680              RTS
2690 D12          JMP L3
2700              ;
2710              ;
2720 SET          TXA   ;YCORD IN X
2730              LSR   ;XCORD IN XL/XH
2740              LSR
2750              AND #254
2760              TAY
2770              LDA TAB,Y
2780              STA MAPPTR
2790              LDA TAB+1,Y
2800              STA MAPPTR+1
2810              TXA
2820              AND #7
2830              CLC
2840              ADC MAPPTR
2850              STA MAPPTR
2860              LDA XL
2870              AND #248
2880              ADC MAPPTR
2890              LDA MAPPTR+1
2900              ADC MAPMSB
2910              ADC XH
2920              STA MAPPTR+1
2930              LDA XL
2940              AND #7
2950              EOR #7
2960              TAX
2970              LDA ZWEIHOCH,X
2980              LDY #0
2990              ORA (MAPPTR),Y
3000              STA (MAPPTR),Y
3010              RTS
3020              ;
3030              ;
3040 TAB          DFB   0, 0, 64,1
3050              DFB 128, 2,192,3
3060              DFB   0, 5, 64,6
3070              DFB 128, 7,192,8
3080              DFB   0,10, 64,11
3090              DFB 128,12,192,13
3100              DFB   0,15, 64,16
3110              DFB 128,17,192,18
3120              DFB   0,20, 64,21
3130              DFB 128,22,192,23
3140              DFB   0,25, 64,26
3150              DFB 128,27,192,28
3160              DFB  0,30
3170 ZWEIHOCH     DFB  1,2,4,8,16,32,64,128
READY.