Classic Computer Magazine Archive PROGRAM LISTING: 85-12/EPROG.M65


10 ;EPROG
20 ;BY LARRY A. WOODGEARD
30 ;(c) 1985, ANTIC PUBLISHING
40 ;DEFAULT 2764
50       *=  $6000
60 ADDRL =   $CE
70 ADDRH =   $CF
80 CLK   =   $10
90 RW1   =   $20
0100 RW2 =   $40
0110 EN  =   $80
0120 PORTA = $D300
0130 PACTL = $D302
0140 DSUM =  $CD
0150 ;EPROM=$6123 FOR 2764
0160 ;EPROM=$612B FOR 2732
0170 ;EPROM=$6133 FOR 2716
0180 EPROM = $6123
0190 GBUF =  $6360
0200 GBUFL = $60
0210 GBUFH = $63
0220 VADDRL = $CE
0230 VADDRH = $CF
0240 IOCB2 = $20
0250 ICCOM = $0342
0260 ICBAL = $0344
0270 ICBAH = $0345
0280 ICBLL = $0348
0290 ICBLH = $0349
0300 ICAX1 = $034A
0310 ICAX2 = $034B
0320 CIOV =  $E456
0330 ADTEXL = $CB
0340 ADTEXH = $CC
0350     JMP EPTYPE
0360 READR
0370 ;READ ROUTINE
0380     LDA #$00
0390     STA ADDRL
0400     LDA #$70
0410     STA ADDRH
0420 READ LDX #$7F
0430     JSR PORTMODE
0440     JSR ADDROUT
0450     LDX #$70
0460     JSR PORTMODE
0470     LDA #RW1
0480     JSR CLKOUT
0490     LDA #$0F
0500     AND PORTA
0510     STA DSUM
0520     LDA #RW1+RW2
0530     JSR CLKOUT
0540     LDA #$0F
0550     AND PORTA
0560     CLC 
0570     ASL A
0580     ASL A
0590     ASL A
0600     ASL A
0610     CLC 
0620     ADC DSUM
0630     LDY #$00
0640     STA (ADDRL),Y
0650     INC ADDRL
0660     BNE READ
0670     INC ADDRH
0680     LDA ADDRH
0690     CMP #$90
0700     BNE READ
0710     LDX #$00
0720     JSR PORTMODE
0730     BRK 
0740 ;ADDROUT SUBROUTINE
0750 ADDROUT
0760     LDA #$F0
0770     AND ADDRH
0780     JSR DIV16
0790     SEC 
0800     SBC #$07
0810     JSR CLKOUT
0820     LDA #$0F
0830     AND ADDRH
0840     JSR CLKOUT
0850     LDA #$F0
0860     AND ADDRL
0870     JSR DIV16
0880     JSR CLKOUT
0890     LDA #$0F
0900     AND ADDRL
0910     JSR CLKOUT
0920     RTS 
0930 ;CLOCK REGISTERS SUBROUTINE
0940 CLKOUT
0950     ORA #$00
0960     STA PORTA
0970     LDX #$10
0980 DELAY1 DEX 
0990     BNE DELAY1
1000     ORA #CLK
1010     STA PORTA
1020     LDX #$10
1030 DELAY2 DEX 
1040     BNE DELAY2
1050     AND #$EF
1060     RTS 
1070 ;PORT DIRECTION SUBROUTINE
1080 PORTMODE
1090     LDA #$38
1100     STA PACTL
1110     STX PORTA
1120     LDA #$3C
1130     STA PACTL
1140     RTS 
1150 ;DIVIDE BY 16 SUBROUTINE
1160 DIV16
1170     CLC 
1180     LSR A
1190     LSR A
1200     LSR A
1210     LSR A
1220     CLC 
1230     RTS 
1240 PROGRAMR
1250 ;PROGRAM ROUTINE
1260     LDA #$00
1270     STA ADDRL
1280     LDA #$70
1290     STA ADDRH
1300     LDX #$FF
1310     JSR PORTMODE
1320     LDA #$00
1330     STA PORTA
1340     JSR SWPROG
1350 PROGRAM
1360     LDY #$00
1370     LDA (ADDRL),Y
1380     AND #$F0
1390     JSR DIV16
1400     JSR CLKOUT
1410     LDY #$00
1420     LDA (ADDRL),Y
1430     AND #$0F
1440     JSR CLKOUT
1450     JSR ADDROUT
1460     LDA #EN
1470     STA PORTA
1480     JSR DELAY
1490     LDA #$00
1500     STA PORTA
1510     INC ADDRL
1520     BNE PROGRAM
1530     INC ADDRH
1540     LDA ADDRH
1550     CMP #$90
1560     BNE PROGRAM
1570     JSR PROGEND
1580     LDX #$00
1590     JSR PORTMODE
1600     BRK 
1610 DELAY
1620     LDX #$00
1630 START LDY #$01
1640 DELAY3 DEY 
1650     BNE DELAY3
1660     DEX 
1670     BNE START
1680     RTS 
1690 CKEY
1700     LDA #TEXT6&255
1710     STA ADTEXL
1720     LDA #TEXT6/256
1730     STA ADTEXH
1740     JSR PRINTSCR
1750 CH  LDA $D01F
1760     CMP #$06
1770     BNE CH
1780     RTS 
1790 ;EPROM VARIABLES
1800 EPVAR LDA #$60
1810     STA VADDRH
1820     LDY #$00
1830     LDX #$00
1840 VLOOP LDA VADDR,X
1850     STA VADDRL
1860     LDA EPROM,X
1870     STA (VADDRL),Y
1880     INX 
1890     CPX #$08
1900     BNE VLOOP
1910     RTS 
1920 EP64 .BYTE $70,$07,$00,$70,$00,$80,$00,$01
1930 EP32 .BYTE $80,$08,$00,$80,$00,$80,$00,$28
1940 EP16 .BYTE $88,$08,$80,$88,$80,$00,$80,$28
1950 VADDR .BYTE $08,$55,$73,$A3,$AC,$CC,$D4,$F0
1960 OPENSCR
1970     LDX #IOCB2
1980     LDA #$03    OPEN CMD
1990     STA ICCOM,X
2000     LDA #DEVNAM&255
2010     STA ICBAL,X
2020     LDA #DEVNAM/256
2030     STA ICBAH,X
2040     LDA #$0C    WRITE CMD
2050     STA ICAX1,X
2060     LDA #$00
2070     STA ICAX2,X
2080     JSR CIOV
2090     RTS 
2100 PRINTSCR
2110     LDX #IOCB2
2120     LDA #$0B    PUT CHARACTER
2130     STA ICCOM,X
2140     LDA ADTEXL
2150     STA ICBAL,X
2160     LDA ADTEXH
2170     STA ICBAH,X
2180     LDY #$00    DETERMINE LENGTH
2190 TY  LDA (ADTEXL),Y
2200     CMP #$7C
2210     BEQ PRINT
2220     INY 
2230     JMP TY
2240 PRINT
2250     TYA 
2260     STA ICBLL,X
2270     LDA #$00
2280     STA ICBLH,X
2290     JSR CIOV
2300     RTS 
2310 DEVNAM .BYTE "E:",$9B
2320 CLOSE
2330     LDX #IOCB2
2340     LDA #$0C
2350     STA ICCOM,X
2360     JSR CIOV
2370     RTS 
2380 GETCHAR
2390     LDX #IOCB2  GET CHARACTER
2400     LDA #$07    GET CMD
2410     STA ICCOM,X
2420     LDA #$00
2430     STA ICBLH,X LENGTH OF INPUT
2440     LDA #$02
2450     STA ICBLL,X
2460     LDA #GBUFH
2470     STA ICBAH,X DATA BUFFER LOC.
2480     LDA #GBUFL
2490     STA ICBAL,X
2500     JSR CIOV
2510     RTS 
2520 EPTYPE
2530     LDA #TEXT&255
2540     STA ADTEXL
2550     LDA #TEXT/256
2560     STA ADTEXH
2570     JSR OPENSCR
2580     JSR PRINTSCR
2590     JSR GETCHAR
2600     LDA GBUF
2610     CMP #$31
2620     BEQ EPROM1
2630     CMP #$32
2640     BEQ EPROM2
2650     JMP EPROM3
2660 MODE
2670     JSR EPVAR
2680     LDA #TEXT1&255
2690     STA ADTEXL
2700     LDA #TEXT1/256
2710     STA ADTEXH
2720     JSR PRINTSCR
2730     JSR GETCHAR
2740     LDA GBUF
2750     CMP #$31
2760     BEQ SWRD
2770     JMP PROGRAMR
2780 EPROM1
2790     LDA #$33
2800     STA $6119
2810     JMP MODE
2820 EPROM2
2830     LDA #$2B
2840     STA $6119
2850     JMP MODE
2860 EPROM3
2870     LDA #$23
2880     STA $6119
2890     JMP MODE
2900 SWRD
2910     LDA #TEXT2&255
2920     STA ADTEXL
2930     LDA #TEXT2/256
2940     STA ADTEXH
2950     JSR PRINTSCR
2960     JSR CKEY
2970     JSR WAIT
2980     JSR CLOSE
2990     JMP READR
3000 SWPROG
3010     LDA $6119
3020     CMP #$33
3030     BEQ SW1
3040     CMP #$2B
3050     BEQ SW2
3060     JMP SW3
3070 SW1
3080     LDA #TEXT3&255
3090     STA ADTEXL
3100     LDA #TEXT3/256
3110     STA ADTEXH
3120     JSR PRINTSCR
3130     JSR CKEY
3140     JSR WAIT
3150     RTS 
3160 SW2
3170     LDA #TEXT4&255
3180     STA ADTEXL
3190     LDA #TEXT4/256
3200     STA ADTEXH
3210     JSR PRINTSCR
3220     JSR CKEY
3230     JSR WAIT
3240     RTS 
3250 SW3
3260     LDA #TEXT5&255
3270     STA ADTEXL
3280     LDA #TEXT5/256
3290     STA ADTEXH
3300     JSR PRINTSCR
3310     JSR CKEY
3320     JSR WAIT
3330     RTS 
3340 PROGEND
3350     LDA #TEXT2&255
3360     STA ADTEXL
3370     LDA #TEXT2/256
3380     STA ADTEXH
3390     JSR PRINTSCR
3400     JSR CKEY
3410     JSR CLOSE
3420     RTS 
3430 WAIT
3440     LDA #TEXT7&255
3450     STA ADTEXL
3460     LDA #TEXT7/256
3470     STA ADTEXH
3480     JSR PRINTSCR
3490     RTS 
3500 TEXT .BYTE "(1) 2716",$9B,"(2) 2732",$9B,"(3) 2764",$9B,"SELECT A NUMBER ",$7C
3510 TEXT1 .BYTE $9B,"(1) READ",$9B,"(2) PROGRAM",$9B,"SELECT A NUMBER ",$7C
3520 TEXT2 .BYTE $9B,"SET ALL SWITCHES DOWN",$9B,$7C
3530 TEXT3 .BYTE $9B,"SET SWITCH 3 UP",$9B,$7C
3540 TEXT4 .BYTE $9B,"SET SWITCH 2 UP",$9B,$7C
3550 TEXT5 .BYTE $9B,"SET SWITCH 1,4,5 UP",$9B,$7C
3560 TEXT6 .BYTE $9B,"PRESS ���� TO CONTINUE",$9B,$7C
3570 TEXT7 .BYTE $9B,"ONE MOMENT PLEASE...",$9B,$7C

Back to previous page