Atari BASIC

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

Missing image
AtariBasicExample.png
A rudimentary Atari BASIC program ready to run
Contents

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. During development in the late 1970s 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 intending to convert it to run on the new machine. 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, and the system had been built to support only 8k of ROM. With the release of the machines not far off they decided to hire outside help.

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, and proposed an entirely new design instead of completing the port Atari had started.

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.

Description

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, arrays in ATARI BASIC were single-dimensional only, meaning that if a program used arrays of strings 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.

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 such programming. Interestingly the BASIC did not give direct access to one of the most useful graphics modes the machine supported, which left users wondering why commercial software always looked so much better than their efforts in BASIC. It was some time before this issue became generally known, and solutions for BASIC programms became common in the early 1980s.

Program editing

Missing image
AtariBasicError.png
What happens when a line containing a syntax error is entered

When not running a program, Atari BASIC is in intermediate mode, where lines can be entered (with a line-number) or immediate commands can be entered (without a line-number) that are executed immediately. If the user enters a line containing a syntax error, then the interpreter re-prints the line with the string "ERROR-   " at the start (or after the line-number if the syntax error is entered on a line) and the first character of the token following the erroneous token is displayed with the foreground and background colours swapped.

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. Like most microcomputer BASICs, programs were stored in a tokenized (semi-compiled) form, and since the short-form was not an actual separate token, when the program was later LISTed the short forms would be expanded its "full" form.

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. Most of these problems stemmed from two particularily poorly implemented bits of code, one for handling loops like the FOR...NEXT that required the system to re-scan the entire program to find the starting point once again every time through the loop, and a particularily poor implementation of the multiply code that was used throughout the math libraries. Several commercial and shareware BASICs were available on the platform that addressed these issues, resulting in performance that was often 10 or more times faster than the Atari version.

Atari BASIC also didn't support integer variables or the rich MS input/output/record 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 packaged a diskette-based version of MS BASIC, Atari Microsoft BASIC, and later managed to fit it onto a cartridge as well, but those saw little use.

See also

References

  • Wilkinson, Bill. Inside Atari DOS. COMPUTE! Books (1982). ISBN 0-942386-02-7. [1] (http://www.atariarchives.org/iad/introduction.php)

External links

pl:Atari BASIC

Navigation

  • Art and Cultures
    • Art (https://academickids.com/encyclopedia/index.php/Art)
    • Architecture (https://academickids.com/encyclopedia/index.php/Architecture)
    • Cultures (https://www.academickids.com/encyclopedia/index.php/Cultures)
    • Music (https://www.academickids.com/encyclopedia/index.php/Music)
    • Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
  • Biographies (http://www.academickids.com/encyclopedia/index.php/Biographies)
  • Clipart (http://www.academickids.com/encyclopedia/index.php/Clipart)
  • Geography (http://www.academickids.com/encyclopedia/index.php/Geography)
    • Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
    • Maps (http://www.academickids.com/encyclopedia/index.php/Maps)
    • Flags (http://www.academickids.com/encyclopedia/index.php/Flags)
    • Continents (http://www.academickids.com/encyclopedia/index.php/Continents)
  • History (http://www.academickids.com/encyclopedia/index.php/History)
    • Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
    • Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
    • Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
    • Prehistory (http://www.academickids.com/encyclopedia/index.php/Prehistory)
    • Renaissance (http://www.academickids.com/encyclopedia/index.php/Renaissance)
    • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
    • United States (http://www.academickids.com/encyclopedia/index.php/United_States)
    • Wars (http://www.academickids.com/encyclopedia/index.php/Wars)
    • World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
  • Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
  • Mathematics (http://www.academickids.com/encyclopedia/index.php/Mathematics)
  • Reference (http://www.academickids.com/encyclopedia/index.php/Reference)
  • Science (http://www.academickids.com/encyclopedia/index.php/Science)
    • Animals (http://www.academickids.com/encyclopedia/index.php/Animals)
    • Aviation (http://www.academickids.com/encyclopedia/index.php/Aviation)
    • Dinosaurs (http://www.academickids.com/encyclopedia/index.php/Dinosaurs)
    • Earth (http://www.academickids.com/encyclopedia/index.php/Earth)
    • Inventions (http://www.academickids.com/encyclopedia/index.php/Inventions)
    • Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
    • Plants (http://www.academickids.com/encyclopedia/index.php/Plants)
    • Scientists (http://www.academickids.com/encyclopedia/index.php/Scientists)
  • Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
    • Anthropology (http://www.academickids.com/encyclopedia/index.php/Anthropology)
    • Economics (http://www.academickids.com/encyclopedia/index.php/Economics)
    • Government (http://www.academickids.com/encyclopedia/index.php/Government)
    • Religion (http://www.academickids.com/encyclopedia/index.php/Religion)
    • Holidays (http://www.academickids.com/encyclopedia/index.php/Holidays)
  • Space and Astronomy
    • Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)
    • Planets (http://www.academickids.com/encyclopedia/index.php/Planets)
  • Sports (http://www.academickids.com/encyclopedia/index.php/Sports)
  • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
  • Weather (http://www.academickids.com/encyclopedia/index.php/Weather)
  • US States (http://www.academickids.com/encyclopedia/index.php/US_States)

Information

  • Home Page (http://academickids.com/encyclopedia/index.php)
  • Contact Us (http://www.academickids.com/encyclopedia/index.php/Contactus)

  • Clip Art (http://classroomclipart.com)
Toolbox
Personal tools