LKDOS #1. <RANDOMIZE USR 100: PRINT “fred.A$”> will print the “fred” disk file directly to screen for your viewing. If “fred” is a dimensioned Character array all elements of the text array will print to screen. This is a good feature to use as a pull-down menu choice, as it lets one use the disk files for reference while creating a document.
LKDOS #2: Those using the LKDOS Cartridge with Oliger or Aerco Controller boards are missing the NMI button. But most NMI’s can be imulated by programming. <RANDOMIZE USR 100: NEW> will auto load from whichever disk you may have as the active disk.
LKDOS #3: SAVE an AUTO LOAD PROGRAM: An auto load program can be of any size from small to large. The objective should be to use as little disk space for the program as is practical.
To conserve disk space RAM TOP is lowered to “near the top of the vars file”. I like a reserve of 400 bytes above. But WHERE IS the top of the vars file? It is necessary to “find where” and do pokes for each AUTO LOAD program that one wants to save. Or is it?
In the following utility lines 10 and 1000 can be a standard for all AUTO LOAD program SAVES. You can save this little program to disk and re-load it each time you need the utility. Actually it is best to MERGE it to your auto load program. When ready to do your SAVE, type <GO TO 1000> and when the tune plays touch the “d” key.
Line 1 restores RAM TOP to its normal place (65367) before your own auto load program operates.
“Sandwich” your Auto Load program lines between line 1 and line 1000 of this-un..
10 POKE 23731,255: POKE 23730, 87
20 BORDER 0: PAPER 0: INK 7: CLS: STOP: REM * set attributes. Remove Stop to let your program operate.
999 STOP: REM * to prevent next line from operating except by GO TO to SAVE.
1000 Let a=PEEK 23641+256*PEEK 23642+400: LET b=INT (a/256): LET c=a-b*256: POKE 23731,b: POKE 23730,c: RANDOMIZE USR 102: GO TO 10
To SAVE as an Auto Run program, type GO TO 1000. When the music stops, touch “d”.
When the program SAVES, it will have only 400 bytes of FREE. (Minimum Disk Space)
Upon Auto Load, line 10 will reset RAM TOP to 65367. If the program has a variable file it will be preserved. BJ
LKDOS #3A: What to Include in a Auto Run Program?
Well, I would think that it would be very nice to Initialize LKDOS and the Printer Driver in the Auto Load program. Then you wouldn’t need to spend FREE RAM in your operating program to do these functions.
Update Magazine gives you a neat utility called “Init.B6” that does these two jobs. Key it in as part of your Auto Run program between lines 10 and 1000. Then when your auto load program boots in the main program you are all set up to go with a Printing capability.
Some of Bob Mitchell‘s programs set up files in the RAM DISK for a program to use. Why not do that in your Auto Run program. Then you dont have to spend FREE Memory in the operating program for that purpose.
Once LKDOS and the Printer driver is set up, and RAM DISK loaded, the Auto Load program can present a MENU to load any other BASIC or CODE program in disk. Lets go through such a shennanagin. Now you’re gonna have to use some imagination to follow through:
10 (Set Ram Top)
20 (Initialize LKDOS, plus prompts for type of interface, and other Printer Driver needs: SET PRINTER DRIVER.
30 RANDOMIZE USR 100 LOAD "menu.C1"SCREEN$
We will assume that the menu has several choices for your own needs. We will assume that item 4 is to Load a basic program named "fred.b4" and this is your choice.
40 PAUSE 0:LET z=CODE INKEY$-48 assigns number key touched to var z
50 IF z=4 then RANDOMIZE USR 100:LOAD "fred.B4"
60 Other lines having IF THEN programming for other menu electives.
999 STOP
1000 same programming as given in previous listing to AUTO SAVE this Auto Run program.
OR- lets use another example for line #30.
30 CLS: RANDOMIZE USR 100: CAT ".B↑",: INPUT "Key in Whole BASIC program name to load";m$: RANDOMIZE USR 100: LOAD m$
In this example line 30, The disk catalog is gotten and a prompt allows you to select a Basic Program to load. Then the program is loaded. NOTE the wild card “↑” used to restrict the catalog to “Just Basic Program Titles”. The wild card is great to present a catalog trimmed of non-appropriate files. Such abbreviated catalogs are useful as MENUS. BJ.