Bob’s Notebook: Another Disk Rename Routine

See all articles from Sinc-Link v7 n6
Author(s): Bob Mitchell
Publication: Sinc-Link
Pub Details: Sinc-Link v7 n6 (Volume 7, Issue 6)
Date: November/December 1989
Pages: 3-4

ANOTHER DISK RENAME ROUTINE

In the last issue of Sinc-Link, you probably saw a way of renaming a Larken disk using the utility “Disk Doctor” which appears on the club’s Omnibus disk. Here is my pet version for doing this chore; this appeared first as a utility for the old original LDOS system and I have since adapted it to the LKDOS systems with which most club members are by now very familiar.

Type in the listing and check it carefully. SAVE it by a <GO TO 480>.

This program provides a quick ‘n’ easy way to give a disk a new name and what is more the name can be quite long, up to around 500 bytes. If you are going to give a disk a complex name, you can set it up by using the word processor Mscript. See the notes below for more details.

Here is the listing and there are some explanatory notes at the end.

100 CLEAR : BORDER 7: PAPER 7: INK 9: CLS
110 CLEAR 43400: RANDOMIZE USR 100: OPEN #4,"dd"
120 RESTORE 400: FOR i=0 TO 119: READ val: POKE 44000+i,val: NEXT i
140 LET trac=43900: LET settrk=44000: LET load=44006: LET save=44009
150 INPUT "drive? (0-3) ";dr
160 PRINT #4: GO TO dr
170 CLS : POKE trac,0: RANDOMIZE USR settrk: RANDOMIZE USR load
180 PRINT : PRINT " "; FLASH 1;" Enter Disk Name"
190 PRINT "Press STOP (SS 'A') to end name ENTER for new line": PRINT
200 PRINT "Disk Name : ";
210 LET m=54500
220 LET a$=INKEY$: IF INKEY$="" THEN GO TO 220
230 IF CODE a$=0 THEN GO TO 220
240 BEEP .02,1
250 IF CODE a$=12 THEN PRINT CHR$ 8;CHR$ 32;CHR$ 8;: LET m=m-1: GO TO 300
260 IF CODE a$=226 THEN POKE m,0: GO TO 320
270 POKE m,CODE a$
280 PRINT PAPER 6;a$;
290 LET m=m+1
300 IF INKEY$<>"" THEN GO TO 300
310 GO TO 220
320 POKE m,0: BEEP .1,20: BEEP .1,20
324 REM GO TO 325 after BREAKing to load Mscript Name
325 GO SUB 370: INPUT "Ok to save to catalog (y) ?"; LINE a$: IF a$="y" OR a$="Y" THEN RANDOMIZE USR settrk: RANDOMIZE USR save
330 INPUT "1=more 0=menu ";mm
340 IF mm THEN GO TO 150
350 IF NOT mm THEN PRINT #4: GO TO 4: PRINT #4: NEW
360
370 BEEP .05,10: BEEP .05,10: INPUT " Disk must have write protect removed OK? "; LINE a$: RETURN
380 STOP
400 DATA 195,249,171,195,7,172,195,27
401 DATA 172,195,56,172,195,75,172,243
402 DATA 205,98,0,201,58,100,0,251
403 DATA 201,205,239,171,58,124,171,50
404 DATA 29,32,205,126,0,24,237,205
405 DATA 239,171,58,124,171,50,29,32
406 DATA 205,129,0,58,29,32,50,124
407 DATA 171,24,217,205,239,171,175,50
408 DATA 32,32,205,123,0,58,32,32
409 DATA 79,6,0,33,112,32,17,80
410 DATA 195,1,0,20,237,176,24,188
411 DATA 205,239,171,33,80,195,17,112
412 DATA 32,1,0,20,237,176,205,120
413 DATA 0,24,169,205,239,171,42,144
414 DATA 171,78,35,70,24,158,0,0
480 CLEAR : PRINT #4: SAVE "diskna.B1" LINE 100

Notes:

Line 120: Pokes into memory, starting at address 44000, the 120 byte machine code routine which loads the directory (catalog) to a buffer area for editing and then saves it back to disk when editing is done. The code is at lines 400-414. This poking will take a few seconds.

Line 150: Prompts for drive number.

Line 170: Pokes the track number zero (ie, the directory track) into address <trac> (43900). Calls the routine at <settrk> (44000) which puts the disk drive head on the indicated track. Calls the load routine at <load> (44006).

Line 180: Prompts for Disk Name. There is room for up to 20 characters on the first line; after that full 32-character lines may be entered. Use ENTER to start a new line at any time. If you are entering CAPITAL letters, do not hold the CAP SHIFT down while pressing the space bar. If you do, you’ll get an ERROR message <L BREAK into program>. You could try CONTINUE then ENTER to resume; but I find it best to start over. The characters will be displayed on screen on yellow PAPER and you may back up using the DELETE key. As I indicated at the start, you could enter a complex name by designing it earlier using Mscript and then when you get to this point, BREAK into BASIC and load the Mscript file into address 54500. Use <PRINT #4: LOAD “name.CT” CODE 54500>; then <GO TO 325> will save the buffer to disk. Try it! It’s a great way to fancy up your disk names.

Line 250: Does the backing up as you use the DELETE key. Notice that the variable <m> which is an address counter or marker is decreased by one for each DELETE key press.

Line 260: Responds to the use of the STOP key (Symbol Shift and <A>); pokes a zero into the next byte to act as an end-of-name marker (ie <m> mentioned in Line 250).

Line 325: You are reminded to remove the write protect sticker from the disk and then prompted to press <y> to start the save. Code routines at <settrk> (44000) and <save> (44009) are called and the edited directory is transferred from the buffer to the disk drive.

Line 330: You have a chance to do more or quit to menu.

Line 350: This is written to load the Ramdisk Autostart; if you want it to do something else, you must change this line.

Line 480: Here’s the place to save the program.

Finally, here is a small sample of a fancy disk name using the technique described above. Start with a line feed to skip the 20 character first line.

******************************
**    WXYZ  SOFTWARE 1989   **
**    WORKSPACE NUMBER  4   **
******************************

Bob Mitchell Willowdale Ontario 890919

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