Compucolor.org – Virtual Media

Listing of file='FDSPRT.BAS;01' on disk='vmedia/chip_22-sector.ccvf'

0 CLEAR 1000:REM PRINT TEXT FILES/ASSEMBLER PROGRAMS
1 PLOT 12:PRINT TAB( 4);
2 PRINT "C O M P U W O R L D   P R I N T I N G   P R O G R A M"
3 PRINT :PRINT TAB( 5);
4 PRINT "LIST ASSEMBLER PROGRAM(S) ON PRINTER  V1.0-4/1/79"
5 PRINT :INPUT "ENTER DEVICE NUMBER IF NOT DRIVE 0  ";M$
6 D$= "DEV CD0:"
7 IF M$= "1"THEN D$= "DEV CD1:"
8 PLOT 27,4:PRINT D$:PRINT "DIR":PLOT 27,27
9 POKE 33289,130
12 PRINT :PRINT :
14 INPUT "TURN ON THE PRINTER- THEN PRESS ENTER ";M$
15 PRINT :PRINT
16 INPUT "ENTER PRINT, VIEW, OR END  ";M$
17 PRINT :PRINT
20 IF LEFT$ (M$,1)= "E"GOTO 60000
30 IF LEFT$ (M$,1)= "V"THEN SC$= "Y":GOTO 40
35 SC$= ""
40 PRINT
100 INPUT "ENTER STARTING BLOCK NUMBER (SBLK) ->";M$
104 IF M$= "0"GOTO 110
105 L= LEN (M$)
107 IF L> 3THEN PRINT "TOO HIGH- RETRY":PLOT 28,28:GOTO 100
110 PRINT
120 INPUT "ENTER NUMBER OF BLOCKS (SIZE) ->";H$
130 L= LEN (H$)
140 IF L> 3THEN PRINT "TOO LONG- RETRY":PLOT 28,28:GOTO 120
142 IF H$= "0"THEN PRINT "ENTRY REQUIRED:":PLOT 28,28:GOTO 120
145 HX$= H$:GOSUB 2000:DL= NN
160 IF SC$= "Y"GOTO 180
170 GOSUB 5000:PLOT 2,30:GOSUB 6000:REM NORMAL,12 CHAR/IN.PRINT
180 T$= "     "
190 FOR A= 1TO DL
191 PP$= "READ "+ M$+ " 7000-70FF"
192 GOSUB 6000:PLOT 12,3,0,10
193 PRINT "SECTOR = ";M$;""
195 PLOT 27,4:PRINT PP$:PLOT 27,27
196 PLOT 3,0,10
198 GOSUB 5000
200 FOR I= 0TO 127
210 N= 28672+ I
220 B= PEEK (N)
225 B$= CHR$ (B)
228 IF B$> CHR$ (31)AND B$< CHR$ (97)THEN S$= S$+ B$:GOTO 400
230 IF B$= CHR$ (13)THEN PRINT S$:S$= "":GOTO 400
232 IF B$= CHR$ (9)THEN GOSUB 500:GOTO 400
400 NEXT
402 HX$= M$:GOSUB 2000:NN= NN+ 1:GOSUB 1000:M$= HX$
405 NEXT
408 GOSUB 6000
409 PLOT 27,11
410 GOTO 1
500 REM TABS
505 L= LEN (S$)
507 IF L= > 37THEN S$= S$+ T$:RETURN
510 IF L= > 29THEN GOSUB 550:RETURN
515 IF L= > 23THEN GOSUB 600:RETURN
520 IF L= > 13THEN GOSUB 700:RETURN
525 IF L= > 7THEN GOSUB 800:RETURN
530 IF L= > 1THEN GOSUB 900:RETURN
535 S$= "       ":RETURN :REM 7 SPACES
550 REM TABS TO 37
555 FOR Z= 1TO 10:S$= S$+ " ":IF LEN (S$)> 36THEN Z= 10
560 NEXT :RETURN
600 REM TABS TO 29
605 FOR Z= 1TO 10:S$= S$+ " ":IF LEN (S$)> 28THEN Z= 10
610 NEXT :RETURN
700 REM TABS TO 23
705 FOR Z= 1TO 10:S$= S$+ " ":IF LEN (S$)> 22THEN Z= 10
710 NEXT :RETURN
800 REM TABS TO 13
805 FOR Z= 1TO 10:S$= S$+ " ":IF LEN (S$)> 12THEN Z= 10
810 NEXT :RETURN
900 REM TABS TO 7
905 FOR Z= 1TO 10:S$= S$+ " ":IF LEN (S$)> 6THEN Z= 10
910 NEXT :RETURN
1000 REM DEC TO HEX
1005 N1= 0:N2= 0:N3= 0:M1$= "":M2$= "":M3$= ""
1006 HX$= ""
1010 IF NN= > 256THEN GOSUB 1500:GOTO 1010
1020 IF NN= > 16THEN GOSUB 1600:GOTO 1020
1030 IF NN= > 1THEN GOSUB 1700:GOTO 1030
1050 NN= N1:GOSUB 1800:M1$= XX$
1060 NN= N2:GOSUB 1800:M2$= XX$
1070 NN= N3:GOSUB 1800:M3$= XX$
1072 M1$= RIGHT$ (M1$,1)
1074 M2$= RIGHT$ (M2$,1)
1076 M3$= RIGHT$ (M3$,1)
1080 HX$= M1$+ M2$+ M3$
1100 RETURN
1500 N1= N1+ 1:NN= NN- 256:RETURN
1600 N2= N2+ 1:NN= NN- 16:RETURN
1700 N3= N3+ 1:NN= NN- 1:RETURN
1800 IF NN= 10THEN XX$= "A":RETURN
1810 IF NN= 11THEN XX$= "B":RETURN
1820 IF NN= 12THEN XX$= "C":RETURN
1830 IF NN= 13THEN XX$= "D":RETURN
1840 IF NN= 14THEN XX$= "E":RETURN
1850 IF NN= 15THEN XX$= "F":RETURN
1860 IF NN< 10THEN XX$= STR$ (NN):RETURN
2000 REM HEX TO DEC
2005 NN= 0
2010 L= LEN (HX$)
2020 IF L< 3GOTO 2090
2030 L$= LEFT$ (HX$,1)
2040 IF L$< "A"THEN NN= (VAL (L$)* 256):GOTO 3020
2050 F= 256:GOSUB 4100:GOTO 3020
2090 IF L< 2GOTO 4000
3000 L$= LEFT$ (HX$,1)
3001 IF L$< "A"THEN NN= NN+ (VAL (L$)* 16):GOTO 4000
3010 F= 16:GOSUB 4100:GOTO 4000
3020 L$= MID$ (HX$,2,1):GOTO 3001
4000 L$= RIGHT$ (HX$,1)
4010 IF L$< "A"THEN NN= NN+ VAL (L$):GOTO 4030
4020 F= 1:GOSUB 4100
4030 RETURN
4100 REM HEX OVRFLOW
4200 IF L$= "A"THEN NN= NN+ (F* 10)
4210 IF L$= "B"THEN NN= NN+ (F* 11)
4220 IF L$= "C"THEN NN= NN+ (F* 12)
4230 IF L$= "D"THEN NN= NN+ (F* 13)
4240 IF L$= "E"THEN NN= NN+ (F* 14)
4250 IF L$= "F"THEN NN= NN+ (F* 15)
4260 RETURN
5000 REM SET OUTPUT TO PRINTER
5010 IF SC$= "Y"THEN RETURN
5020 IF BR$= "300"THEN PLOT 14,27,18,3,15,27,13:RETURN
5030 IF BR$= "1200"THEN PLOT 14,27,18,4,27,13:RETURN
5040 INPUT "ENTER BAUD RATE (300 OR 1200) ";BR$
5050 IF BR$= "300"OR BR$= "1200"GOTO 5020
5060 PLOT 28,11:GOTO 5040
6000 REM SET OUTPUT TO CRT
6050 PLOT 12:REM FORM FEED
6100 POKE 33265,0
6200 RETURN
60000 REM END
60010 INPUT "TURN OFF THE PRINTER - THEN PRESS ENTER";M$
60020 PRINT ""
60025 LOAD "MENU":RUN
60030 END