One of the utilities missing on the Larken DOS is a Rename feature that would allow the user to change the name assigned to any program. The thought first occurred to me when I wanted to change titles of programs on the LDOS Master Disk which have a mixture of upper and lower case letters. Examples are Remdos, Copy2D, and TapeCP. Once you get used to having the names all in lower case letters, it is much easier to type in the load instructions. So with that thought I proceeded to write a short BASIC program which I present below.
The on-screen prompts will lead you through the routine but here are a few notes by way of explanation.
First: Note that you must remove the write-protect sticker from any disk before you use this program.
The program loads the directory (track 0) into the buffer, asks for the name change information and changes the name in that track. The ‘from’ name is stored in array y$ and the actual names in the directory are stored in array x$ at line 45 one by one until x$ and y$ match. The ‘to’ name is then input as array z$ and action moves to line 100 where the contents of array z$ is poked into the buffer and then saved onto the track at line 110.
Line 150 advances the search through the addresses and locates the end of name marker 253.
The job is only half done, for although the name on the directory track has been changed, it is still necessary to change the names on all the affected tracks for that program. So the next stage is to determine the track numbers from the directory. This is accomplished starting at line 170. Variable ‘k’ is our datum point for peeking addresses on track 0 and has now advanced to the address just after the end of name marker. This will contain the first track number. This number, minus the 128, is stored at the first location in array ‘a’. Note variable t=1 from line 15. Variable ‘t’ is incremented and the search goes on until peek (k+1)=249 or end of file marker. Action then proceeds to line 200. Now all the relevant tracks are stored in array ‘a’ and the remaining unused dimensions are all zeros.
At line 200 ‘t’ (for track #) is reset at 1 and location 61441 (current track #) is poked with the contents of array a(1) which is the first track number for that program. Line 210 sets the disk head on track 1, loads the track into the buffer and enables the interrupts. Line 220 pokes the new name into correct locations and then line 255 starts up the disk drive and saves the buffer to the current track.
Line 230 runs through this routine until it meets with a zero in array ‘a’, whereupon the program advances to line 510 to signal that the program has been renamed from … to …”
Here’s the program:
1 REM RENAME Bob Mitchell
2
3 REM Remove Protect Tabs While using Rename.
4
5 CLS : PRINT "Rename a disk program Insert disk"
7 PRINT "ready?": PAUSE 0
10 DIM x$(9): DIM y$(9): DIM z$(9): DIM a(79)
15 LET t=1
20 POKE 61000,251: POKE 61001,201
25 LET ei=61000: LET settrack=63968: LET loadtrack=61190
26 PRINT #1;"enter ""exit"" when directory"'"appears."
27 OUT 84,64: RANDOMIZE USR 63488: REM dire
30 INPUT "change name from "; LINE y$
40 FOR i=61600 TO 63440
45 IF PEEK i=255 THEN LET k=i+1: FOR j=1 TO 9: LET x$(j)=CHR$ PEEK (i+j): NEXT j: IF x$=y$ THEN INPUT "change name to "; LINE z$: GO TO 100
50 NEXT i
100 FOR i=1 TO 9: POKE k,CODE z$(i): LET k=k+1: NEXT i
110 OUT 84,72: PAUSE 40: RANDOMIZE USR 64915
150 IF PEEK k<>253 THEN LET k=k+1: GO TO 150
155 GO TO 170
160 IF PEEK (k+1)=249 OR t>79 THEN GO TO 200
170 LET k=k+1: IF PEEK k>128 AND PEEK k<208 THEN LET a(t)=PEEK k: LET a(t)=a(t)-128
180 LET t=t+1: GO TO 160
200 LET t=1
205 POKE 61441,a(t)
210 RANDOMIZE USR settrack: RANDOMIZE USR loadtrack: RANDOMIZE USR ei
220 FOR l=1 TO 9: POKE 61505+l,CODE z$(l): NEXT l
225 OUT 84,72: PAUSE 40: RANDOMIZE USR 64915
230 LET t=t+1: IF a(t)<>0 THEN GO TO 205
500
510 CLS : PRINT PAPER 2; INK 7;"Program has been renamed "'"from ";y$;" to ";z$
520 STOP
600 CLEAR 61000: OUT 84,64: RANDOMIZE USR 63488: REM save "rename.B1"
603 CLS : GO TO 1
Media
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.