A disk backup/maintenance program for Disk Extended Basic

Color BASIC, Extended Color BASIC, CoCo 3 BASIC, and Disk Extended Color BASIC call all be discussed here.

A disk backup/maintenance program for Disk Extended Basic

Postby BillO » Sun Mar 11, 2018 4:46 pm

I used to work on DEC pdp11 computers running the RSTS/E operating system back in the day (I really miss those days :cry: ). One of the coolest utilities in RSTS/E arsenal was called PIP (Peripheral Interchange Program) and could do just about any task you can imagine doing between any two peripherals you had access to. Two of the most used functions were to backup and defragment disks. I wrote this little program to do the same for my COCO 2 back when the COCO 2 was the latest and greatest. I still use it today. I have it in mind to add a formatting function too, but have yet to get around to it :roll:. It works great with DriveWire floppy volumes too.

Code: Select all
10 PCLEAR1:CLEAR 8192:LAST=0:DR$="N"
20 DIM NAM$(71), EXT$(71), A$(20), B$(20)
30 CLS:PRINT "PIP BACKUP PROGRAM":PRINT:PRINT
40 PRINT "(D)IRECTORY"
50 PRINT "(F)ILE BY FILE COPY"
60 PRINT "(R)EFRESH AND DEFRAGMENT"
70 PRINT "(T)RACK BY TRACK COPY"
80 PRINT "E(X)IT"
90 PRINT:PRINT:INPUT "CHOICE";FLAG$
100 IF FLAG$="F" THEN GOSUB 160:GOSUB 170:GOSUB 180:GOSUB 290
110 IF FLAG$="D" THEN GOSUB 160:GOSUB 180:GOSUB 290
120 IF FLAG$="T" THEN GOSUB 160:GOSUB 170:GOSUB 410
130 IF FLAG$="R" THEN GOSUB 530
140 IF FLAG$="X" THEN CLS:END
150 INPUT "PRESS RETURN TO CONTINUE";DUM$:GOTO 10
160 INPUT "SOURCE DRIVE #";DI$:DI=VAL(DI$):RETURN
170 INPUT "TARGET DRIVE #";DO$:DO=VAL(DO$):RETURN
180 FOR SE=3 TO 11
190 DSKI$ DI,17,SE,A$,B$
200 C$=A$+LEFT$(B$,127)
210 FOR N=0 TO 7
220 FLD=N*32+1
230 NAM$(J)=MID$(C$,FLD,8)
240 EXT$(J)=MID$(C$,FLD+8,3)
250 IF ASC(NAM$(J))<>255 AND ASC(NAM$(J))<>0 THEN J=J+1
260 NEXT N
270 NEXT SE
280 LA=J-1:RETURN
290 FOR J=0 TO LA
300 FILE$=NAM$(J)+"."+EXT$(J)
310 IN$=FILE$+":"+DI$
320 OUT$=FILE$+":"+DO$
330 IF FLAG$="F" OR FLAG$="R" THEN GOSUB 370
340 IF FLAG$="D" THEN PRINT FILE$;"    ";
350 NEXT J
360 PRINT:RETURN
370 PRINT "COPYING ->";IN$
380 PRINT "     TO ->";OUT$
390 COPY IN$ TO OUT$
400 RETURN
410 FOR TR=0 TO 34
420 FOR SE=1 TO 18:J=SE-1
430 DSKI$ DI,TR,SE,A$,B$
440 A$(J)=A$:B$(J)=B$
450 NEXT SE
460 PRINT ".";
470 FOR SE=1 TO 18:J=SE-1
480 DSKO$ DO,TR,SE,A$(J),B$(J)
490 NEXT SE
500 NEXT TR
510 PRINT
520 RETURN
530 PRINT:PRINT "PLACE THE DISK TO BE REFRESHED"
540 PRINT "INTO THE SOURCE DRIVE AND PLACE"
550 PRINT "A FRESHLY FORMMATED DISK INTO"
560 PRINT "THE TARGET DRIVE.":PRINT
570 INPUT "PRESS ENTER TO CONTINUE";DUM$:PRINT
580 GOSUB 160:GOSUB 170:GOSUB 180:GOSUB 290
590 TEMP=DI:DI=DO:DO=TEMP
600 TEMP$=D1$:D1$=DO$:DO$=TEMP$
610 GOSUB 410
620 RETURN
User avatar
BillO
 
Posts: 11
Joined: Wed Mar 07, 2018 9:19 am
Location: The deep woods of Central Ontario

Return to CoCo BASIC

Who is online

Users browsing this forum: No registered users and 0 guests

cron