Classic Computer Magazine Archive COMPUTE! ISSUE 56 / JANUARY 1985 / PAGE 10

Atari BASIC AUTORUN

How can I automatically run a BASIC program?

David Lanese

The Atari Disk Operating System (DOS 2.0 and 3.0) has a feature that lets you automatically load and run a machine language program from disk when­ever the computer is turned on. This feature can be adapted to run a program written in BASIC.

Here's a short BASIC loader for a machine lan­guage program which tells the system on powerup to run a BASIC program named AUTORUN.BAS from disk:

CE 10 OPEN # 4, 8, 0, "Dl : AUTORUN . SYS"
BA 20 FOR 1 = 1 TO 94
MA 30 READ A
CB 40 PUT # 4, A
ON 50 NEXT I
DD 60 CLOSE # 4
DO 70 END
AB 80 DATA 255, 255, 0, 6, 81, 6, 216, 24, 173, 48, 2, 105, 4, 133, 204, 173, 49, 2, 105, 0, 133, 205, 24, 160, 0, 177, 204, 105, 162, 133, 212
00 90 DATA 160, 1, 177, 204, 105, 0, 133, 213, 160, 32, 185, 49, 6, 145, 212, 136, 208, 248, 169, 13, 141, 74, 3, 96, 0, 48, 47, 43, 37, 0, 24
NI 100 DATA 20, 18, 12, 17, 18, 26, 50, 53, 46, 0, 2, 36, 17, 26, 33, 53, 52, 47, 50, 53, 46, 14, 34, 33, 51, 2, 2 26, 2, 227, 2, 0, 6

This program, written by Michael E. Hepner, originally appeared in the January 1984 issue of COMPUTE!. It creates a machine language program on your disk with the filename AUTORUN.SYS. When the computer is turned on, the operating system loads DOS from disk, then runs AUTORUN.SYS if it finds such a program on the disk.

To automatically load and run your BASIC pro­gram, store it on the same disk with the filename AUTORUN.BAS. Of course, only one program per disk can be automatically run using this method.

Another approach using the program above would be to enter the Atari version of "Super Directory" (COMPUTE!, April 1984) and save it as AUTORUN.BAS on each disk. Then every time you turn on your computer, the boot process ends with Super Directory running and a directory of that disk displayed on your screen. Or you could have the program AUTORUN.BAS chain to any other program you desire.