Atari BASIC#
Background#
Atari BASIC is the "standard" BASIC dialect for the 8-bit series. It was originally sold separately as a (relatively expensive) 8k ROM cartridge. Starting with the 600XL/800XL, the ROMs were included inside the machine. There are three versions, the original version, retroactively known as Revision A, and the updated Revision B and C which fixed various bugs.
Atari originally licensed the 6502-assembler code for Microsoft BASIC. This came in two versions, one that was about 7900 bytes that used a 6-byte floating point number format, and another that was closer to 9000 that included an expanded floating point format with 9-byte numbers. The vast majority of 8-bit machines used the larger 9k version, and then further expanded it with additional functions for basic input/output. For instance, the BASIC and I/O in the early PET machines was supplied in a total of 12k of ROM.
Atari had selected an 8k cartridge format because that was an easy size to supply in a single ROM. So the Atari programmers started with the smaller 8k version of the MS code and struggled to cut it down enough to fit in a cart. 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, some time in the summer of 1978, they gave up and went looking for a 3rd party to do it for them.
Shepardson Microsystems Inc, or SMI for short, won the contract. 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 years.
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. 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.
Atari BASIC - Computing Language box
Design notes#
Atari BASIC has some key differences with the more common MS-derived BASICs found on most contemporary machines. This included the 6-byte vs. 9-byte math, but also included numerous syntax changes as well. Generally, one can describe Atari BASIC's design philosophy as "modeless" and "orthogonal".
Most BASICs of the era had the concept of "immediate mode" and "program mode", and some commands could only be used in one more 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 containing 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 noticable 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, but memory handling is more difficult and conversion of standard programs from MS listings is more difficult.
What's missing#
In addition to differences like string handling, Atari BASIC also lacked some of the less-used features found in MS BASIC. Among these are...
- TAB and SPC, for formatting output
- PRINT USING, which formatted output
- INPUT "prompt", A$, which printed the prompt and placed the cursor at the end
- DEF FN, which defines mathematical functions
Most 3rd party BASICs add many of these features, and more.
What's new#
To allow BASIC programmers access to the advanced features of the system, Atari BASIC added commands for defining the GRAPHICS, changing COLORs, MOVEing and drawing a LINETO, playing SOUND, and others.
Source Code#
The Atari BASIC Source Book - Bill Wilkinson, Kathleen O'Brien and Paul Laughton![](/wiki/images/out.png)
; size: 76.8 MB ; 316 pages
ROM-Images#
Atari Basic Cartridge - brown - Revison A
Atari Basic Cartridge - silver - Revison C ; Revision B was soldered in the machines only and therefore not available as a stand-alone cartridge
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.
CAR-Images#
Manuals#
- Atari Basic Reference Manual Rev. A
; size: 77.7 MB ; 122 pages
- Atari Basic Reference Manual Rev. C
; size: 47.9 MB ; 134 pages
- Atari BASIC - Bob_Albrecht, LeRoy Finkel and Jerald R. Brown (1979)
; size: 80.9 MB ; OCR ; 348 pages
- Atari_Basic-Richard_Haskell (1983)
; size: 74.7 MB ; OCR ; 196 pages
- Atari BASIC-XL Edition - Bob_Albrecht, LeRoy Finkel and Jerald R. Brown (1985)
; size: 86.5 MB ; OCR ; 404 pages
- ATARI BASIC-Handbuch für Selbststudium und Praxis-BOB ALBRECHT, Le Roy Finkel, JERALD BROWN
; Größe: 44,8 MB ; OCR ; 214 Doppelseiten
- ATARI Basic Leitfaden
; Größe: 5,2 MB ; 11 Seiten
- Atari BASIC - Quick Reference Guide - Gilbert Held
; size: 10.4 MB ; 8 pages
- Atari Basic Referenz-Karten
; Größe: 3,1 MB ; OCR ; 271 Seiten
- Atari BASIC Source Book (2006)
; size: 10.4 MB ; OCR ; 80 pages ; converted 2006 by Andreas Bertelmann for ABBUC ; thank you Andreas
- Monkey_Wrench_-_Manual.pdf
; size: 67.5 MB ; thanks to serious computerist
, we really appreciate! :-)
- Monkey_Wrench_II_-_Manual.pdf
; size: 2.5 MB ; thanks to serious computerist
, we really appreciate! :-)
- The major differences between the Monkey Wrench II and Monkey Wrench II-XL cartridges
; thanks to serious computerist
, we really appreciate! :-)
Atari Basic Keywords#
An incredible good site for all
Atari BASIC keywords![](/wiki/images/out.png)
; thank you ABBUC, greatly appreciated! :-)
Atari Basic Keywords
Atari Basic Error Codes#
2 - INSUFFICIENT MEMORY
3 - BAD VALUE
4 - TOO MANY VARIABLES
5 - STRING LENGHT ERROR
6 - OUT OF DATA
7 - BAD LINE NUMBER
8 - INPUT ERROR
9 - DIMENSION ERROR
10 - STACK OVERFLOW
11 - OVERFLOW/UNDERFLOW
12 - LINE NOT FOUND
13 - NO MATCHING FOR
14 - LINE TOO LONG
15 - GOSUB/FOR DELETED
16 - RETURN ERROR
17 - SYNTAX ERROR
18 - INVALID CHARACTER
19 - PROGRAM TOO LONG
20 - BAD DEVICE NUMBER
21 - LOAD FILE ERROR
Atari Basic Course: An Invitation to Programming 1-3#
Atari Basic Kurs (deutsch): Teil 1 und 2 sind vorhanden, Status von Teil 3 ist unklar#
Pictures#
Atari Basic Reference Manual Rev. A![](/wiki/images/out.png)
; size: 77.7 MB ; 122 pages
Atari Basic Reference Manual Rev. C![](/wiki/images/out.png)
; size: 47.9 MB ; 134 pages
Atari BASIC - Bob_Albrecht, LeRoy Finkel and Jerald R. Brown (1979)![](/wiki/images/out.png)
; size: 80.9 MB ; OCR ; 348 pages
Atari_Basic-Richard_Haskell.jpg (1983)![](/wiki/images/out.png)
; size: 74.7 MB ; OCR ; 196 pages
Atari BASIC-XL Edition - Bob_Albrecht, LeRoy Finkel and Jerald R. Brown (1985)![](/wiki/images/out.png)
; size: 86.5 MB ; OCR ; 404 pages
ATARI BASIC-Handbuch für Selbststudium und Praxis-BOB ALBRECHT, Le Roy Finkel, JERALD BROWN![](/wiki/images/out.png)
; Größe: 44,8 MB ; OCR ; 214 Doppelseiten
ATARI Basic Leitfaden![(info)](/wiki/images/attachment_small.png)
; Größe: 5,2 MB ; 11 Seiten
Atari BASIC - Quick Reference Guide - Gilbert Held![(info)](/wiki/images/attachment_small.png)
; size: 10.4 MB ; 8 pages
Atari Basic Referenz-Karten![(info)](/wiki/images/attachment_small.png)
; Größe: 3,1 MB ; OCR ; 271 Seiten