2068 Larken Disk Menu Maker

See all articles from Sinc-Link v9 n2
Author(s): Larry Crawford
Publication: Sinc-Link
Pub Details: Sinc-Link v9 n2 (Volume 9, Issue 2)
Date: March/April 1991
Pages: 20-21

A couple of years ago, George Chambers put together a super program which permitted files on a Larken disk to be loaded with a single keystroke. My kind of utility. I modified it somewhat. With George’s permission, here it is.

There are a couple of techniques used which could be useful in other applications, so read on.

The listed program will create an AUTOSTART disk menu on a designated disk. The entry point is line 8888. At this point you are prompted to enter the number of the drive to be processed (dd).

FINDING THE ACTIVE DRIVE

The Larken system stores the active drive number at location 8195 in the LKDOS RAM. To find this number it is necessary to Larken POKE 8200 with 8195. <LET s=USR 110> assigns to s the value stored at that location. This is really a flag with the appropriate bit set. Variable s will have a value of 2, 4, 8, or 16 depending upon which drive is active. The Boolean calculation, <LET sd=INT (s/4-(s>8))>, converts the value of s to an actual drive number. Drive 4, the RAMDISK, has a code of 128 and is not looked after here. However, it would not be used frequently and can be dealt with manually.

In another application, this source drive number could be poked into a safe RAM location (e.g. 26687) for use later on. In this program there is no need to keep the drive number.

ADDING TASWIDE

By using the Taswide utility, it is possible to read a Tasword file directly from the disk without having to load it into Tasword. This is a very useful feature for help files and lengthy descriptions of programs on the disk.

Assuming that is resident, the code “taswi.Cx” is loaded from the source drive and saved to the destination drive.

IF YOU DON’T HAVE TASWIDE

Omit all of line 8888 except for the destination drive input. Also omit lines 3 and 92 and the subroutine 5000 to 5030.

GETTING RID OF UNNECESSARY LINES

Line 8889 deletes line 8888 and itself since they are not needed by the menu program.

AUTOSTART SAVE

Control passes to line 9999, the SAVE line. The variables are cleared out and RAMTOP is poked with 256 bytes more than the value stored in ELIN. The two PEEKS and POKES do this.

Setting RAMTOP this way for the AUTOSTART SAVE allows you to add to the menu without having to worry about exceeding the current value of RAMTOP.

You are prompted to press the <D> key for the save and USR 102 is called to do the job. Control now goes to line 8000.

FINDING THE DISK NAME

In line 8000, thirty-two bytes are poked into the unused area of RAM starting at 24311 (it runs to 24560).

Here is the dissassembly:

DI
CALL 0062 (98 dec) :turn on LKDOS
XOR A :a=0
LD (201D),A (8221 dec) :current track #
LD (2020),a (8224 dec) :error number=0
CALL 007E (126 dec) :turn on track 0
CALL 007B (123 dec) :ld bufr frm dsk
LD HL,3204 (12804 dec) :loc of dsk name
LD DE,6824 (26660 dec) :loc for name
LD BC,0010 (16 dec) :length of name
LDIR :move name
LD A (0064) (100 dec) :turn off LKDOS
EI
RET

The USR call to 24311 moves the first 16 characters of the disk name to another unused area of RAM starting at 26660 (it runs to 26687). The program is then RUN.

DATA STATEMENTS

Lines 100 to 1000 are reserved for DATA statements. Each statement must contain two strings of data. The first is a description of the program as it will appear on the screen in the disk menu. The second one is the exact program name as it appears in the disk catalog.

OPERATION

Lines 10 and 11 recover the disk name from its storage area in RAM and assigns it to x$.

Line 20 reads the data lines starting at 100 and prints an identifying letter and the first data statement to the screen via subroutine 7000. The process continues until it hits the dummy statement at 1001.

Lines 50 to 90 prompt you to press a letter key within range and then a loop reads the data lines until the selected one is reached.

Line 91 assigns to t$ the extension symbols of the file name. The file is then LOADed as the appropriate type by line 92, 94, or 98 depending on the contents of t$.

After the program is typed in, SAVE it as “dmm.B1” LINE 8888.

USING THE DISK MENU MAKER

Load “dmm.B1”. Place a disk in the destination drive. This disk can be blank or have programs on it but there must be at least 2 free blocks available for the AUTOSTART and another one for Taswide if you are using it.

You will be prompted to enter the number of the destination drive. Once this is entered, “taswi.Cx” will be loaded from the source drive and saved to the destination drive (if applicable).

The tune will play and you will be prompted to press the <D> key. The “blank” disk menu program will now be saved as an AUTOSTART on the disk in the destination drive.

USING THE DISK MENU

After booting the AUTOSTART on the disk in the active drive, <BREAK> in after the menu screen appears. Add the appropriate DATA lines starting at line 100.

A typical line will look like this: <100 DATA “RABBIT’S REVENGE”,”rr.B1″>, the first statement being the description which will appear in the menu and the second the exact name of the file to be loaded.

Then <GO TO 9999> to resave the amended menu as an AUTOSTART.

Whenever a program is added to the disk, repeat this procedure.

The whole process is relatively painless and very useful. I recommend it highly.

LDC

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