Classic Computer Magazine Archive COMPUTE! ISSUE 86 / JULY 1987 / PAGE 103

Autoload: A Streamlined 130XE RAMdisk Loader

Mark Slagell

Here's a utility that no Atari 130XE owner can afford to be without. Only seven lines long, this tiny program copies up to ten BASIC programs from disk to the RAMdisk. Atari DOS 2.5 is required.

When you boot up an Atari 130XE using Atari DOS 2.5, a RAMdisk is automatically established in the computer's second 64K bank of memory—an area that few programs use. This electronic "drive," designated D8:, can be used to save and load programs in the same manner as the more familiar mechanical drive. The advantage of the RAMdisk is that data can be loaded or saved much faster. The disadvantage is that all information in the RAMdisk is lost when the computer is turned off.

One of the most common uses for the RAMdisk is to hold frequently used programs for faster access. "Autoload" simplifies the use of the RAMdisk by automatically copying as many as ten BASIC programs to the 130XE's RAMdisk when you boot the computer. That task has been accomplished before, but this program does it with only seven lines of code. You can watch the program at work, and it also offers an instructive and unusual demonstration of Atari's forced read mode.

In order to squeeze the program into only eight lines, we'll be pushing to the limit Atari's 120-character restriction on the length of a logical line. Before you start to enter the program, type POKE 82,0 and press RETURN to get wider-than-normal screen margins. Note, too, that the listing includes several abbreviations. The abbreviations are present to save crucial space, so type each line exactly as it's listed, including the abbreviations.

Line 12 of Autoload contains a list of the programs you want to copy to the RAMdisk at boot time. The names in the listing are merely examples; replace them with filenames of your own. Every name must be exactly 12 characters long, so add blank spaces as needed to the end of any shorter filenames—except for the very last name, which doesn't require extra spaces. Other than in line 12, you should not type extra spaces anywhere in the program.

When you are finished typing in Autoload, be sure to save a copy before you run it. This is important because the program erases itself when it runs. Save the program with the filename AUTOLOAD. You should save the program on a boot disk—one that you use to start the computer. If you use more than one boot disk, you should save a copy of Autoload on all boot disks for which you wish to use the autoloading feature. To set up the RAMdisk, your working boot disks must also have a copy of the RAMDISK.COM file from the DOS 2.5 master disk.

Now, remove your working boot disk and place a copy of the DOS master disk in the drive. Type DOS and press RETURN to bring up the DOS command menu; then use option L to call up the SETUP.COM utility from the DOS disk. Remove the master disk from the drive and replace it with the boot disk containing Autoload. Follow the prompts of SETUP.COM to create an AUTORUN.SYS file that points to the AUTOLOAD program. Finally, copy to the same disk the programs you wish to load into the RAMdisk when the computer boots. At this stage, the program is ready to use. Whenever you start the computer with this boot disk in the drive, Autoload will automatically be executed to transfer the specified programs into the RAMdisk.

How It Works

Autoload works in an interesting way. The program itself actually runs, in the technical sense, only for a fraction of a second: It merely writes some instructions to the screen and erases itself. The instructions form a sequence of commands which are, in effect, carried out in direct mode, just as if an invisible hand were pressing RETURN over each line. Atari literature calls this technique forced read mode; it is also called the dynamic keyboard technique on other systems.

In a sense, this set of commands on the screen is a miniature program. Each command is performed in order, just as in an ordinary BASIC program. However, the command lines don't begin with line numbers. You also can branch around in a program of this type—not with GOTO, but with a POSITION command which places the cursor over the command you want to execute next.

This series of instructions contains LOAD commands, each of which performs a NEW. But since NEW doesn't erase the screen, our set of instructions can be performed in its entirety. Variables are erased after each LOAD, however, so it is necessary to redefine them after each program loads. When all files have been copied into the RAMdisk, the screen clears and execution stops. If desired, you can automatically run the last program in the chain. Simply add the characters :RUN before the quotation mark in line 4 and make sure that the program you want to run is the last one listed in line 12.


For instructions on entering this program, please refer to "COMPUTE!'s Guide to Typing In Programs" elsewhere in this issue.

OC 2 	POKE 82, 0 : GRAPHICS 0
KD 4 	POSITION 0, 2 : ? "POKE752, 1 : S = 40840 : IFPEEK (S) = 0 THEN POKE 842, 12 : GR.0"
AA 6 	POSITION 0, 6 : ? "POS.0, 2 1 : J = 40448 : FOR I = 40568 TO 40579 : POKEI, PEEK(S) : POKE J, PEEK(S) : J = J + 1 : ?CH R$(254); : NEXT I : POS.0, 9"
BC 8 	POSITION 0, 11 : ? "LOAD"; CHR$(34);"D1 : " : POSITION 0, 14 : ? "SAVE";CHR$(34); "D8 : " : POSITION 0, 17
FD 10 ? "POSITION 0, 0" : POSITION 0, 21
PN 14 POSITION 0, 0 : POKE 842, 13