Atari BASIC



         


Atari BASIC was a ROM resident BASIC interpreter for the Atari 8-bit family of 6502-based home computers. The interpreter was originally published on an 8 KB cartridge; on later XL and XE model computers it was built in, and would load by default when the machines were booted w/o other cartridges in place.

[Top]

Background

The machines that would become the 8-bit family had originally been developed as a 2nd generation games console intended to replace the Atari 2600. However, during development the home computer market "took off", and management realized they could sell the machine at a considerably higher price point if it were re-purposed for that market. This left them with the need for a BASIC system, at that time considered an absolute requirement for all home computers.

Atari's first attempt to produce a BASIC followed the lines of most other companies; they puchased a license to the already-standard Microsoft 8K BASIC. This turned out to be more difficult than expected; the 8K code expanded to over 11K when ported from the Intel 8080's instruction set to the Atari's less-dense 6502 instruction set. With the release of the machines not far off they decided to hire outside help, and found Sheperdson Microsystems, Inc. (SMI) fit the bill. Sheperdson had written a number of programs for the 6502-based Apple II, and were in the midst of finishing a new BASIC for the CP/M world. Sheperdson, however, appears to have suffered from NIH (or perhaps simply hubris), and instead proposed an entirely new design.

[Top]

Description

[Top]

Origin and bugs

The result was a rather different version of BASIC, originally called Sheperdson BASIC but later simply Atari BASIC. Unlike the MS BASIC which followed DEC conventions, the new BASIC was patterned on Data General's BASIC and had a number of obvious differences. Development proceeded quickly and an 8K cartridge was available just before release of the machines. A serious bug was found in the code and fixed just before printing, but the Atari team in charge of the release didn't bother to upgrade to this version, and printed the cartridges with a buggy version. Two more releases followed over the span of the 8-bit lifetime, Version B fixing the bug but introducing a much more serious one, and Version C which finally eliminated both after several years of being in the market.

[Top]

String handling

Atari BASIC differs from Microsoft-style BASICs primarily in the way it handles strings — it actually doesn't have any. Instead it used the Data General-like system of using character arrays, similar to the way the C programming language constructs strings. While this is in theory much faster than MS's solution, it was also much harder to port BASIC programs to the machine. Worse yet, character arrays in Atari BASIC were single-dimensional only, meaning that if a program used string arrays it essentially had to be completely redesigned for the Atari.

On the upside they were easy to work with, using "slicing" commands. A$ referred to the entire string, whereas A$(4,6) "sliced" out the three characters, 4, 5 and 6. In general this was a more elegant solution than MS BASIC's LEFT$, MID$, and RIGHT$ solution. Another difference was that the Atari strings, like C arrays, were 0-indexed while MS strings were 1-indexed. This may be seen as a somewhat dual edged sword: "Real Programmers" enumerate arrays from zero, but BASIC programmers wanting to convert MS BASIC programs to the Atari had to strive to avoid "Obi wan errors" when dealing with text strings.

[Top]

Sound and graphics

Other features of Atari BASIC, in comparison to the BASICs of some competing machines at the time, were its built-in support of simple sound effects and high-resolution graphics as well as periheral units like joysticks, paddles, and floppy disk drives. Other home computer users were often left with cryptic POKE's for doing such programming.

[Top]

Program editing

Most Atari BASIC statements may be abbreviated when entered. The language used a clever system for this, which did not require a second set of abbreviated tokens (keywords) as did most other languages. Instead they sorted the token list such that the most popular command for any particular letter was at the top of the list, and when searching for a token they stopped at the first one that matched. The user could then enter keywords abbreviated with a period, for instance P. would expand to PRINT, whereas PL. would expand to PLOT. After entry the token would be expanded to its "full" form.

[Top]

Performance

Atari BASIC was very slow, being outperformed by most other BASICs of the era. This was particularly galling given that the machine it ran on was the fastest of the home computers. It also didn't support integer variables or the rich MS input/output system. All of these problems were fixable, but it appears Atari was still a videogame company at heart, and none of the three versions addressed any of these issues. Atari also packaged cartridge and diskette-based versions of MS BASIC, Atari Microsoft BASIC, but those saw little use.

[Top]

See also

[Top]




  View Live Article   This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License