Atari originally licensed the 6502-assembler code for Microsoft BASIC. This came in two versions, one that was about 7900 bytes that used a 32-bit (6-digit) floating point number format, and another that was closer to 9000 that included an expanded floating point format with a 40-bit (9-digit) numbers. The vast majority of 8-bit machines used the larger 9k/40-bit version, and then further expanded it with additional functions for basic input/output. For instance, the BASIC, character set and I/O in the early PET machines was supplied in a total of 16k of ROM.
When the project was still a games console, Atari had selected an 8k cartridge format because that was an easy size to supply in a single ROM. When the project moved to a computer, a BASIC interpreter was required and Atari naturally licensed MS's code. Atari programmers started with the smaller 8k version and struggled to cut it down enough to fit in the pre-selected 8k cartridge format. That was hard enough of its own, but they really wanted to add additional instructions to take advantage of the Atari's graphics and sound. Eventually, sometime in the summer of 1978, they gave up and went looking for a 3rd party to do it for them.
Atari approached Shepardson Microsystems Inc, or SMI for short, who had written a number of 6502-based products and a series of BASICs for other machines. They proposed a simplified syntax and the cutting of a number of rarely-used features, leaving more room for new commands for graphics and sound. Even then, the result required about 10k, so to cross the remaining gap to 8k, some of the core libraries were moved out of the language and into the operating system ROMs. This had the side-effect of allowing any other language on the Atari to use these routines as well.
By the time SMI was hired, Atari was in something of a rush to get a working BASIC. They were planning to show the machines in January 1979, using the working MS version, but then sell the machines later that year with the SMI version instead. The original contract required SMI to make its final delivery in April 1979, but it contained bonus clauses if they finished early. They did: a working version was delivered in October 1978, so Atari to that to CES instead. To SMI's surprise, they learned that Atari had begun burning that version to ROM for sale, even though it had several known bugs. SMI offered an updated version with various fixes, but Atari didn't bother using it, and instead shipped the buggy version for several years.
In order to fit the code into a 8k ROM, two major pieces of code were moved out of the BASIC into the OS ROM. The first was a set of graphics routines to set up the screen, draw lines, and similar tasks. The second was the floating point math system, based on a new implementation of the 6-byte binary-coded-decimal (BCD) format. Both libraries were notoriously slow. Generally, Atari BASIC was among the slowest BASICs of its era, both due to the OS code and two problems involving loops.
The performance issues led to a profusion of 3rd party BASICs, some of which continue to be developed to this day. By replacing the math libraries and fixing these two loop issues, speed improves on the order of 3 to 5 times in most programs, and this is a common feature of 3rd party BASICs like Turbo-BASIC XL and Altirra Basic. For even higher performance, FastBasic uses a p-code system that can be quickly interpreted.
Most BASICs of the era had the concept of "immediate mode" and "program mode", and some commands could only be used in one mode or the other. A good example in MS BASIC is the LIST command, which could only be used in immediate mode, at the "command line". Atari BASIC removed this limitation, one could write a program consisting of 10 LIST.
Additionally, most BASICs had commands that read input or produced output, for example, the INPUT can be thought of as the opposite of PRINT. Atari BASIC was orthogonal in that every such command had a partner. For instance, LIST produces output, so the new command ENTER reversed this, reading a program listing from a device. This opened up a number of possible overlay techniques that other BASICs lacked.
The most noticeable difference between Atari BASIC and MS-derived versions is the string handling. Atari BASIC used a greatly simplified system of character-arrays instead of the dynamic strings in MS. This meant that all strings had to be predefined using DIM, and their length could not be changed during run-time. There are a number of advantages to this approach, notably speed and lower memory usage, but this means conversion of standard programs from MS listings may be difficult.
Most 3rd party BASICs for the Atari added many of these features, and more.
To create one 16 KiB-ROM out of 2 8 KiB ROMs, use the following method:
Windows:
Go to the CMD shell and there to the directory, where the 2 files are, which should be combined, then type:
copy /b monkey.rom+basic.rom allinone16k.rom
and the resulting rom file can be found in the same directory.
Unix/Mac:
Start application shell/Terminal and then type cd and a blank. Drag the folder, in which the 2 files are, directly behind the blank. Check with typing ls -a, whether the 2 files can be seen. Then type:
cat monkey.rom basic.rom > allinone16k.rom
and the resulting rom file can be found in the same directory.
Command | Abbreviation |
---|
BYE | B. |
---|---|
CLOAD | CLOA. |
CLOSE | CL. |
COLOR | C. |
CONT | CON. |
CSAVE | CS. |
DATA | D. |
DEG | DE. |
DIM | DI. |
DOS | DO. |
DRAWTO | DR. |
ENTER | E. |
FOR | F. |
GET | GE. |
GOTO | G. |
GOSUB | GOS. |
GRAPHICS | GR. |
INPUT | I. |
LET | LE. |
LIST | L. |
LOAD | LO. |
LOCATE | LOC. |
LPRINT | LP. |
NEXT | N. |
NOTE | NO. |
OPEN | O. |
PLOT | PL. |
POINT | P. |
POKE | POK. |
POSITION | POS. |
PR. | |
PUT | PU. |
RAD | RA. |
READ | REA. |
REM | . |
RESTORE | RES. |
RETURN | RET. |
RUN | RU. |
SAVE | S. |
SETCOLOR | SE. |
SOUND | SO. |
STATUS | ST. |
STOP | STO. |
TRAP | T. |
XIO | X. |