Larken Disk Copy Utility

See all articles from Sinc-Link v6 n3
Author(s): George Chambers
Publication: Sinc-Link
Pub Details: Sinc-Link v6 n3 (Volume 6, Issue 3)
Date: May/June 1988
Pages: 11

The listing is a program which will copy a disk on the Larken system using either one or two drives.It has been designed to work with the current Larken 4ystem which saves 5090 bytes per track. With some minor modifications it could also be used on the Larken system which saves 1960 bytes per track. It makes use of the Larken M/C “Move .C1” utility.

With other modifications it could probably work with the Larken cartridges designed for the Oliger, and Aerco Disk systems.

This utility is a little different than Larken’s disk copy routine, “Move.B1”. While using elements of the Larken utility, it has several significant differences. Firstly, it copies on a program basis rather than on a track by track basis. What this means is that the second disk is not a “chinese copy” of the master disk. Where the original disk might very well have a program spread over several non-adjacent tracks, on the copy the program will be stored on contiguous tracks. Usually this is considered advantageous. It also means that only active programs/ tracks are in fact copied. Tracks not in use are not copied.

Secondly, it offers the option of an automatic copy of all programs on the disk, or the copying of selected programs only.

The program starts off by asking for the Originating and Destination drive No.’s. If the originating and destination drives are the same, i.e. single-drive option, the program will ask you to swap disks during the copying process. Otherwise it will proceed to copy autimatically.

The program then loads the directory track, and searches it for program names on the disk. It stores these in an array, using them during the copy process.

During the copying process the program shows onscreen the name of the program is being copied, and also a record of the number of programs on the disk, and the number currently copied or skipped.

Lines 210-240 contain a disk operating routine used to load the directory buffer into memory in the initial stage of program operation. This M/C routine was covered in the Jan/Feb ’88 issue of our newsletter.

 100 REM  Disk Copy Prgm (v1.22) for the LARKEN system
110 REM By G. Chambers 14 Richome Court Scarborough, Ont. CANADA M1K 2Y1
120 REM Use to copy a disk with a 1- or 2-drive system
130 REM Data statements contain Drive Control Code.
140 REM For use with the DSK400 system of 5090 bytes/track using a DD drive i.e.80 tracks
150 RANDOMIZE USR 100: OPEN #4,"dd"
170 RESTORE VAL "210"
180 FOR n=VAL "63000" TO VAL "63047"
190 READ a: POKE n,a
200 NEXT n
210 DATA 195,43,246,0,0,0,0,0,0,243,205,98,0,201,58
220 DATA 100,0,251,201,205,33,246,58,176,92,50,29,32,205,126
230 DATA 0,205,123,0,33,112,32,17,156,224,1,0,20,237,176
240 DATA 195,38,246
280 LET trac=VAL "23728": LET loadbuf=VAL "63000"
290 LET name=VAL "57688"
300 BORDER PI/PI: PAPER PI/PI: CLS
310 GO SUB VAL "800"
320 PRINT AT VAL "2",VAL "7"; INK VAL "2"; PAPER VAL "6";"LARKEN DISK UTILITY"; PAPER PI/PI;,,TAB VAL "3"; PAPER VAL "6";"Disk Copying-1 or 2 Drives"; PAPER VAL "1",,TAB VAL "7"; PAPER VAL "6";"By George Chambers"
330 INK VAL "3": PLOT NOT PI,VAL "108": DRAW NOT PI,VAL "62": DRAW VAL "255",NOT PI: DRAW NOT PI,VAL "-62": DRAW VAL "-255",NOT PI
340 INK VAL "6": PLOT VAL "8",VAL "114": DRAW NOT PI,VAL "50": DRAW VAL "238",NOT PI: DRAW NOT PI,VAL "-50": DRAW VAL "-238",NOT PI: INK VAL "7"
350 PRINT '''"Install the disk to be copied"''" in the originating Drive"'"... then Press a key"': PAUSE NOT PI
352 INPUT "Enter the Orig. Drive No.(0-4)";Odrv
353 PRINT #4: GO TO Odrv
354 INPUT "Enter the Dest. Drive No.(0-4)";Ddrv
355 POKE VAL "23658",VAL "8": LET r$="N": INPUT "Select files to save? Y/N";r$
360 REM Picking pgm names from buffer(Track 0)
370 POKE trac,NOT PI: RANDOMIZE USR loadbuf
380 PRINT AT VAL "10",NOT PI;c$'c$'c$;TAB VAL "9";"Files on Disk"
390 FOR n= PI/PI TO VAL "90"
400 LET e=n
410 IF PEEK (name+3)=NOT PI THEN LET e=n-1: LET n=VAL "90": GO TO VAL "480"
420 IF PEEK (name+PI/PI)=VAL "254" THEN LET name=name+VAL "34": GO TO VAL "410"
430 FOR m=PI/PI TO VAL "9"
440 LET d$(n,m)=CHR$ PEEK (name+m)
450 NEXT m
460 LET name=name+VAL "34"
470 PRINT AT VAL "15",VAL "11";d$(n)
480 NEXT n
490 PAUSE VAL "30": PRINT AT VAL "14",NOT PI;c$;C$''TAB VAL "14";e;" files on disk"
500 DIM f$(VAL "9")
520 PRINT AT VAL "13",VAL "7";"File being copied"
530 FOR n=PI/PI TO e
535 PRINT AT VAL "16",NOT PI;C$
540 LET f$=d$(n)
545 IF r$(1)<>"N" THEN PRINT AT VAL "21",NOT PI;c$;AT VAL "21",VAL "3";"Copy """;f$;""" Y/N?"
546 LET s$="Y": IF r$<>"N" THEN INPUT TAB VAL "23";s$
547 IF s$(1)="N" THEN GO TO 680
550 GO SUB OrgDrv
555 PRINT AT VAL "21",NOT PI;C$
560 FOR a=PI/PI TO VAL "9": POKE Onam+a,CODE f$(a): POKE Dnam+a,CODE f$(a): NEXT a
570 PRINT AT VAL "15",VAL "11";f$
580 PRINT #4: GO TO Odrv: LET rt=USR indir: IF rt<>0 THEN GO TO rt
590: LET rt=USR Ld1: IF rt<>NOT PI THEN GO TO rt
600 LET Tlen=PEEK VAL "34002": LET pass=PI/PI: IF Tlen>(PEEK Nbcs)-1 THEN LET Pass=VAL "2"
610 GO SUB DesDrv
620 LET rt=USR Svnam: IF rt<>NOT PI THEN GO TO rt
630 LET rt=USR Svdata: IF rt<>NOT PI THEN GO TO rt
640 IF pass=PI/PI THEN GO TO VAL "670"
650 GO SUB OrgDrv: LET rt=USR Ld2: IF rt<>NOT PI THEN GO TO rt
660 GO SUB DesDrv: LET rt=USR Svdata: IF rt<>NOT PI THEN GO TO rt
670 LET rt=USR Svend: IF rt<>NOT PI THEN GO TO rt
680 PRINT AT VAL "18",VAL "14";n;" copied/skipped"
690 BEEP VAL ".1",VAL "10": BEEP VAL ".1",VAL "10"
700 NEXT n
705 PRINT #4: GO TO 0
710 FOR n=VAL "10" TO VAL "21": PRINT AT n,NOT PI;c$: NEXT n
720 PRINT AT VAL "15",VAL "6";"Disk copy completed"''"Press a key to copy another disk"
730 PAUSE NOT PI: GO TO VAL "280"
790 STOP
800 LET Mem=VAL "34800": LET Owka=VAL "34700": LET Dwka=VAL "34750": LET Onam=VAL "34599": LET Dnam=VAL "34649"
810 LET indir=VAL "32000": LET Ld1=VAL "32003": LET Ld2=VAL "32006": LET Svnam=VAL "32009": LET Svdata=VAL "32012": LET Svend=VAL "32015": LET Renam=VAL "32018"
820 LET OrgDrv=VAL "870": LET DesDrv=VAL "890": LET Nbcs=VAL "34003": LET Bsize=VAL "34004"
830 REM DDen Bsize=5120 Nbcs=7 SDen Bsize=2050 Nbcs=14
840 POKE Nbcs,VAL "7": PRINT #4: POKE Bsize,VAL "5120"
850 DIM d$(VAL "90",VAL "9"): LET c$=" "
860 RETURN
870 IF Odrv<>Ddrv THEN PRINT #4: GO TO Odrv: RETURN
880 INPUT "Insert Source Disk-Press ENTER"; LINE a$: RETURN
890 IF Odrv<>Ddrv THEN PRINT #4: GO TO Ddrv: RETURN
900 INPUT "Insert Dest'n Disk-Press ENTER"; LINE a$: RETURN
910 STOP
9900 REM ** Save to Disk **
9910 PRINT #4: SAVE "copy12.B1" LINE VAL "9990"
9920 PRINT #4: SAVE "Move .C1"CODE VAL "32000",VAL "1000": RUN
9930 STOP
9990 CLEAR VAL "31999": RANDOMIZE USR 100: LOAD "Move .C1"CODE VAL "32000": RUN

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.