Larken Disk Copier Utility

See all articles from Sinc-Link v4 n4
Author(s): George Chambers
Publication: Sinc-Link
Pub Details: Sinc-Link v4 n4 (Volume 4, Issue 4)
Date: August/September 1986
Pages: 4-5

Although the LARKEN DD system has a 2-drive option many users will doubtless make do with a single drive. This utility listed here is designed to facilitate the use of the COPY function of the LARKEN DOS when using a single drive.

Essentially the program makes use of the Directory on track 0 of the disk to list each program on the disk in turn, to ask if you wish to copy it, and then do so; requiring only that you switch disks when prompted. No entering of COPY commands is required.

Some features of this program are worth mentioning, since they could provide ideas for use in other LARKEN DD applications.

-The program is saved within the listing at line 9900, thus it starts automatically, and displays instructions contained in lines 9910 to 9980. Because this utility must fit under the LDOS located at address 28000, these lines are deleted before loading LDOS28 at line 10. Also, to save space the program makes extensive use of the VAL function.

-The POKE in line 25 is used to cause the LDOS28 to return to the BASIC program after executing a COPY command at line 140, rather than returning with a LDOS cursor as it would normally do.

-The POKE at line 145 is designed to foil the “scroll?” function, which would otherwise appear periodically as the screen scrolled upwards.

-The FOR/NEXT routine in lines 30-50 is used to scan the Directory which has been placed there by line 20. Line 40 is used to identify the start of a program name. The 255 marks a program name slot in the directory. If a name slot contains no program name, or if a program has been deleted from the disk, the address following the “255” will contain a value “254”. If the FOR/NEXT loop detects a value of “255” in an address, and other than a “254” in the next address it correctly assumes that a valid program name is coming up, and does a GOSUB to line 100.

-The FOR/NEXT loop in lines 100-130 picks the program name out of the Directory and places it into the a$ used in line 140.

-Because of the presence of the Directory in the 61000 region of memory the size of the program that can be copied with this routine is 16 tracks, or about 31360 bytes. Lines 132/135 take care of this by displaying an appropriate message, and moving on to the next program.

-After the last program on the Directory has been handled the utility will appear to have hung up. This is not so. The search for a program name is continuing; however because this utility is in BASIC it takes a while to search the balance of the Directory until it finds a value “250”, indicating the end of the Directory has been reached (see line 45).

   1 REM   DISK COPIER UTILITY
2 REM
3 REM by George Chambers
4 REM May 1986
6 REM
7 REM
10 CLEAR VAL "27999": OUT VAL "84",VAL "64": RANDOMIZE USR VAL "63488": REM load "LDOS28.C5"
15 PRINT AT VAL "8",NOT PI;"Insert disk to be copied and",,"press any key": PAUSE 0: CLS
20 PRINT USR VAL "63488": REM dire
25 CLS : POKE VAL "30700",NOT PI
30 FOR n=VAL "61608" TO VAL "63440"
40 IF PEEK n=VAL "255" AND PEEK (n+PI/PI) VAL "254" THEN GO SUB VAL "100"
45 IF PEEK n=VAL "250" THEN PRINT '"End of Disk Directory": STOP
50 NEXT n
100 LET a$=" "
105 LET z=NOT PI
110 FOR y=PI/PI TO (VAL "9")
113 IF PEEK (n+PI/PI)=VAL "46" THEN LET z=PI/PI
115 IF PEEK (n+PI/PI)=VAL "32" AND z=PI/PI THEN LET a$(y)="""": LET y=VAL "9": GO TO VAL "130"
120 LET a$(y)=CHR$ PEEK (n+PI/PI): PRINT INK PI/PI;CHR$ PEEK (n+PI/PI); INK NOT PI;
125 LET n=n+PI/PI
130 NEXT y
132 LET z=NOT PI: FOR q=(n+PI/PI) TO (n+VAL "16"): IF PEEK q=VAL "249" THEN LET z=PI/PI: LET q=(n+VAL "16")
133 NEXT q
135 IF z=NOT PI THEN PRINT " This program too long to copy": RETURN
137 PRINT " Copy? (y/n)": PAUSE NOT PI: IF INKEY$="n" THEN RETURN
140 RANDOMIZE USR VAL "28000": REM copy a$
145 POKE VAL "23692",VAL "255"
150 PRINT "Insert original"'"Ready ?": PAUSE NOT PI: RETURN
9900 RANDOMIZE USR VAL "63488": REM save "copy.B1"
9910 CLS : LIST VAL "9920": PAUSE NOT PI: DELETE VAL "9920",VAL "9980": RUN
9920 REM DISK COPIER
9930 REM Use this copier to copy programs using one drive.
9940 REM When a DOS prompt appears after Directory, enter the command "exit"
9950 REM Switch disks on prompt
9960 REM When a program is found that is larger than 14 blocks it will not be copied. You will be notified; the copier will move to the next program.
9970 REM There will be a delay as the copier searches for the end-of-directory marker.
9980 REM Press any key to start

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