Classic Computer Magazine Archive ANTIC VOL. 8, NO. 1 / MAY 1989

Type-in Software

Atari BASIC Enhancements

Library of high-powered routines

By Paul Alhart

Atari BASIC enhancements is a collection of very useful routines that can be used from BASIC--without touching your program in memory. Thses short BASIC programs will work on 8-bit Ataris with at least 32K memory and disk drive.

There I was sitting at my Atari at 3 a.m. trying to save my just-completed masterpiece. I kept getting an ERROR 162 (whatever that means) no matter how many times I tried. I had left my BASIC Reference Manual at a friend's house, so I couldn't even look it up.

As my fingers danced across the keyboard typing the word DOS, I got a bad feeling, and stopped. What if there was no MEM.SAV on this disk? All my work would be lost. Now what? I grabbed for a fresh disk, only to find that I had none that were formatted. No formatted disks, ERROR 162, and not able to go to DOS. What to do?

ENTER (pun intended) my Atari BASIC Enhancements.

With these BASIC Enhancements I could look up that error code, delete unnecessary files, and more. All without leaving BASIC, and more important, without affecting one line of my precious program.

Now the world was assured of another great 8-bit program and I was able to get some sleep.


Atari BASIC Enhancements is a collection of useful routines that help you get the most from Atari BASIC.

Unlike a BASIC wedge or other Extended BASICs, the enhancements will work with any 8-bit Atari and Atari BASIC Rev. A, B, C or compatible BASICs.

Each enhancement file consists of a collection of BASIC statements which have no line numbers. Since there are no line numbers, the BASIC statements are executed immediately.

For example, the LOCK Enhancement will lock a given disk file. Here's what the LOCK Enhancement file looks like:

CLOSE #1:CLR :DIM Z$(18):? "Which File to LOCK?"
? " Ex. D2:DATA.EXE":INPUT #16,Z$:? "Locking ";Z$:XIO 35,#1,0,0,Z$

You could just as well have typed these lines in immediate mode, but keeping these commands in a single file is much more convenient.

The Enhancements use no program memory and don't touch Page 6. Any program in memory is untouched and can be LISTed or RUN as soon as the BASIC "READY" prompt is restored.

Written for Atari DOS 2 users, most of the Enhancements should also work with any compatible DOS. Known exceptions are noted in each Enhancement's description. But the routines automatically test for compatibility before they begin, just in case.


Type in listing 1, ENHANCE.BAS, check it with TYPO II and SAVE a copy to disk. Have a second disk ready freshly formatted with DOS 2 and with the file DOS.SYS on it. When you RUN "D:ENHANCE.BAS", the program will bring up a menu.

You can choose which enhancements you want written to the disk each as a separate file. Antic Disk owners will find all the enhancements already on this month's disk.

The BASIC Enhancements on this disk are all ENTERed from BASIC in the Immediate Mode by typing ENTER "D:FILENAME" and then following the screen prompts.

Copy any or all of them to your work disk or RAMdisk, to eliminate disk swapping. The Enhancements will run faster from a RAMdisk. Drives 1--8 are supported. For proper operation, do not rename the Enhancements "HEX," "DEC," or "ERROR." Following are descriptions of each Enhancement.


BINLOAD: DOS 2 equivalent "L" Binary LOAD. Load and Run any machine language program that can be run with BASIC installed. NOTE: For use only with DOS 2 or DOS 2.5

DEC: DOS 2 equivalent--None. Decimal to Hexadecimal conversion.
HEX: DOS 2 equivalent--Non Hexadecimal to Decimal Conversion. The decimal and hexadecimal files work together. Both are written to your disk at the same time. DELETE: DOS 2 equivalent "D" Deletes a FILE.
DIR: DOS 2 equivalent "A" Disk Directory. This Enhancement will always end with an ERROR 136. This is normal and may be disregarded. NOTE: when using DOS 2.5, filenames shown in use sectors above 720 and are not available to DOS 2.
DRIVES: DOS 2 equivalent--None. Examine/Set which Disk Drives DOS will support. NOTE: Modifies DOS.SYS.
ERROR: DOS 2 equivalent--None. Gives an English translation of Error Codes.
ERROR.164: DOS 2 equivalent--None. Enable/Disable ERROR 164 handling by DOS. NOTE: Modifies DOS.SYS. Not Compatible with DOS 2.5
LOCK: DOS 2 equivalent "F" Lock File.
OPENFILE: DOS 2 equivalent--None. Examine/Set number of File Buffers. (Number of Files that can be OPENed at the same time). NOTE: Modifies DOS.SYS.
RENAME: DOS 2 equivalent "E" Rename File.
UNLOCK: DOS 2 equivalent "G" Unlock File.
WRITEDOS: DOS 2 equivalent "H" Write DOS Files. NOTE: Only DOS.SYS is written. Use whenever DOS has been modified and you want to make the changes permanent.

ANTIC ED: If you want to make a MEM.SAV without going to DOS, the command to do it is: OPEN #1, 8, 0,"D:MEM.SAV":CLOSE #1

Paul Alhart of Lompoc, California is an Electronics Technician in the aerospace industry, and an active member of his local users group, the Atari Federation. His Tech Tip Default Writer Plus appeared in the July 1988 issue of Antic.

DEC Download

DELETE Download

DIR Download

DRIVES Download

ERROR Download

ERROR.164 Download

HEX Download

LOCK Download


RENAME Download

UNLOCK Download