The Ultimate Autostart

Author(s): Bob Swoger
Publication: Update Magazine
Pub Details: Update January 1994
Date: January 1994
Pages: 6-7

[Reprinted from the July 1993 issue: the first part of More INPUT on AUTOSTART and other Larken Thoughts.]

In the January 1993 Update! Magazine page 20, Peter Hyman gave a good clue to writing a better AUTOSTART program for the LarKen disk system. Like Peter, I have seen AUTOSTARTs that use two tracks. They are usually made from another program on the disk, sometimes called Menu.B1. Menu.B1 is provided to allow changes to the AUTOSTART program and is, therefore, identical to it. Three tracks on the disk now contain the same program!

AUTOSTART programs instruct the computer what to do when the machine is turned ON with the ENTER key held down or when the RAND USR 100: NEW sequence is typed in on either the TS2068 or SPECTRUM systems. Here are a few simple rules:

RULE 1 The ULTIMATE AUTOSTART should do little more than reset RAMTOP, call another program from the disk (LOAD the program and RUN it) and save itself to that disk.

RULE 2 The ULTIMATE AUTOSTART should be 5089 bytes long. Using the CHAMBERS UTILITIES disk, you will find that an AUTOSTART made in both the TS2068 mode and the SPECTRUM mode will always start at address 22490 and contain 5089 bytes.

RULE 3 The ULTIMATE CLEAR number for both TS2068 and SPECTRUM is 27577. One need not execute the PRINT 65536-FREE misprinted in the UPDATE! article to find the lowest point to move RAMTOP, just use 27577 instead. The area saved will always be one track long, 5090-1 bytes.

Since many menu programs are too long to fit on a single track as an AUTOSTART SAVE in the TS2068 mode, (SPECTRUM gives us 2955 bytes more) I submit the following subprogram that could be included in any menu program to create AUTOSTART. Since this is the AUTOSTART program included within the lines of the LogiCall program, it is numbered accordingly:

  49 LET H=CODE "d": LET Z=PEEK(PI+PI)=CODE "1"
110 GO TO VAL "460-(30*Z)"
400 CLEAR VAL "65367"
410 REM RANDOMIZE USR CODE "d": OPEN # VAL "4","dd"
420 RANDOMIZE USR CODE "d": LOAD "L.B1"
430 DELETE RND,VAL "399"
440 DELETE VAL "461",VAL"9999"
450 DELETE VAL "421",VAL"459"
460 CLEAR VAL "27577": RANDOMIZE USR CODE "f": GO TO VAL "400"

In line 49, H is assigned the value 100 to save RAM space when subsequent needs for the value 100 are needed. The heavy use of VAL and CODE is to save RAM space and will be explained later in this article.

LET Z = PEEK (PI+PI) = CODE “1” reduces down to LET Z = (PEEK 6 = 49) assigning Z the value 1 if the software finds itself running on the TS2068 and 0 if running on the SPECTRUM. EXPLANATION: If the TS2068 ROM is operating the system, byte 6 hold the value 49. The SPECTRUM ROM holds 203. Therefore, if the TS2068 ROM is operating, the boolean operator (PEEK 6=49) will be true and Z will equal 1. If the SPECTRUM ROM is operating, the boolean operator (PEEK 6=49) will be false and Z will equal 0.

Line 110 bypasses lines 430 to 450 in the Spec’y mode thus avoiding a crash since the SPECTRUM does not have a delete command.

Line 400 sets RAM TOP to a place compatible to fonts and other favorite machine code. You may choose any other number you like up to 65535.

Line 410 is included in case one MUST open stream/channel 4. Since opening stream/channel 4 conflicts with ZEBRA Talkers and eats up precious RAM space, it is REMarked out. Opening stream/channel 4 really has no added programming value in most cases. Just edit REM out if you need to open stream/channel 4.

Line 420 calls the start-up program.

Lines 430 to 450 delete all un-needed lines on the TS2068 from the program which contained this AUTOSTART sub-program thus keeping the required space to one track. This is not required on the SPECTRUM because: 1) not having a DELETE command in its vocabulary it can’t delete lines! and 2) SPECTRUM gives us 2955 more bytes of program space on an AUTOSTART save.

Finally, line 460 sets RAM TOP to the ULTIMATE value which will save exactly 5089 bytes, exactly the size of one LarKen track, the AUTOSTART save routine is called, and 400 is given to the AUTOSTART header as the line to auto RUN once this program is loaded.

To use this sub-program, simply merge it into your favorite menu program using the appropriate re-numbering of the statements and cause some keyboard action to send it to the beginning statement of this sub-program. If you use it as a stand alone program, the DELETE statements can probably be removed. When the sub-program is executed, the NMI tone will sound and you will either have to press the ‘D’ key to continue the save to disk or the ‘A’ key to interrupt the program to change ‘L.B1’ to ‘Menu.B1’ in line 420 if you want to call Menu.B1 instead of LogiCall when you boot the disk. Next type GOTO 460 <ENTER> and ‘D’ after the tone to save the modified AUTOSTART.

My concern, however, is that you have not yet discovered LogiCall! Many folks who now use LogiCall have discovered that without it on every disk, LKDOS is a ‘NAKED’ system which requires you to do a lot of typing (i.e. RAND USR 100: GOTO 1: RAND USR 100: LOAD “filenm.B1” as an example of LOADing “filenm.B1” on drive 1). LogiCall creates the ULTIMATE AUTOSTART for you simply by pressing the ‘A’ key <ENTER> and ‘D’ at the ‘Program?’ prompt. Get and use LogiCall!

Because the AUTOSTART programs others have written often use two tracks, I have usually been able to find room on even a full disk to add LogiCall (L.B1) by using LogiCall’s embedded AUTOSTART program to call the other person’s Menu.B1 program on boot-up and the disk still works the way it did before I added LogiCall!

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