The READY prompt
Atari BASIC made the 400, 800, XL, and XE computers programmable with numbered lines,
immediate commands, and built-in graphics and sound. It is an interpreted language:
you enter a listing, type RUN, and can stop to inspect or change it.
Strings must be dimensioned before use, and its syntax differs from Microsoft BASIC.
Atari BASIC revisions A, B, and C
- Revision A: the original 400/800 cartridge release. It established the language but retained bugs, including problems with editing and memory management.
- Revision B: built into many 600XL and 800XL computers. It corrected earlier faults but introduced a program-growth bug associated with saving and reloading programs.
- Revision C: the later corrected release, built into XE machines and later XL production, and also available on cartridge. It fixed the notorious Revision B growth problem. These revisions repair the same language; they are not separate expanded BASIC dialects.
With an original Atari BASIC ROM active, enter this at READY. A result of 162 identifies A, 96 identifies B, and 234 identifies C. This byte check is not a general version test for replacement BASICs.
PRINT PEEK(43234)
Revision A
162 READY
Revision B
96 READY
Revision C
234 READY
Only one of these values appears on your Atari, followed by READY. The three screens show the possible results for original Atari BASIC ROMs.
Reference: Mapping the Atari — XL/XE memory map.
Example: a little Atari sound
Enter these numbered lines in Atari BASIC, then type RUN. The screen
turns blue with light text, and POKEY plays a short sequence. The final line silences
channel 0. The delay loop is approximate and will vary with the BASIC implementation.
10 GRAPHICS 0
20 SETCOLOR 2,9,4
30 SETCOLOR 1,0,14
40 PRINT "HELLO FROM YOUR ATARI"
50 FOR N=1 TO 4
60 SOUND 0,180-N*25,10,8
70 FOR T=1 TO 150:NEXT T
80 NEXT N
90 SOUND 0,0,0,0
HELLO FROM YOUR ATARI READY
You hear four successive tones rising in pitch, then silence. The sound values are 155, 130, 105, and 80; smaller values give higher pitches. READY appears when the program finishes. The delay depends on the BASIC implementation.
Reference: Atari BASIC: A Self-Teaching Guide.
BASIC XL
OSS BASIC XL expands the familiar Atari language with tools such as automatic line numbering, renumbering, structured control statements, and string arrays. Its FAST facility reduces repeated searches for branch and loop destinations. It runs on the eight-bit Atari family; the XL name does not mean it is restricted to XL computers.
This example uses a BASIC XL string array. Enter it with the BASIC XL cartridge active, then RUN. The first dimension selects the number of strings; the second sets their maximum length.
10 DIM MACHINE$(3,12)
20 MACHINE$(1)="ATARI 800"
30 MACHINE$(2)="ATARI 800XL"
40 MACHINE$(3)="ATARI 130XE"
50 FOR I=1 TO 3
60 PRINT MACHINE$(I)
70 NEXT I
ATARI 800 ATARI 800XL ATARI 130XE
The loop prints the three strings in order. This preview shows the program’s output only; the interpreter returns to its prompt afterward. The blue screen assumes the usual text-display colors.
Reference: OSS BASIC XL manuals.
BASIC XE
BASIC XE develops the OSS language further for XL/XE computers, with faster arithmetic and additional commands. The extension disk supplies part of its functionality; a 130XE can also use its extra RAM through extended mode. It is a separate product from BASIC XL, not Atari BASIC Revision C.
The BASIC XL string-array listing above also illustrates BASIC XE syntax. Here is a separate arithmetic example that uses only the shared core commands and does not require extended memory. Run it under BASIC XE to print a small table of squares.
10 GRAPHICS 0
20 PRINT "BASIC XE ON THE ATARI"
30 FOR N=1 TO 8
40 PRINT N,N*N
50 NEXT N
BASIC XE ON THE ATARI 1 1 2 4 3 9 4 16 5 25 6 36 7 49 8 64
The left column runs from 1 to 8; the right column contains each number squared. Comma-separated PRINT values occupy separate print zones. Spacing is illustrative; the interpreter returns to its prompt when the loop finishes.
Reference: OSS BASIC XE manual collection.
Altirra BASIC
Avery Lee’s Altirra BASIC is a modern reimplementation of Atari BASIC, designed for compatibility and improved performance. It is included with the Altirra emulator, and versions are available for Atari hardware. It is its own implementation, not a fourth official Atari ROM revision. Programs that depend on undocumented ROM internals may need the original Atari BASIC.
The sound example above also uses commands supported by Altirra BASIC. For a quiet graphics experiment, enter this listing and RUN. It draws a rectangle in graphics mode 7, then waits until you press BREAK.
10 GRAPHICS 7
20 COLOR 1
30 PLOT 20,20
40 DRAWTO 130,20
50 DRAWTO 130,60
60 DRAWTO 20,60
70 DRAWTO 20,20
80 GOTO 80
With the default graphics palette, COLOR 1 draws orange. GRAPHICS 7 leaves a four-line text window below the drawing; the loop runs until BREAK. This preview shows that window cleared. Atari graphics color reference.
Reference: Altirra BASIC Reference Manual (PDF).