A program ready to run
|Original author(s)||Paul Laughton|
Revision C / 1983
|Platform||Atari 8-bit family|
|License||Commercial proprietary software|
Atari BASIC is an interpreter for the BASIC programming language that shipped with the Atari 8-bit family of 6502-based home computers. Unlike many 8-bit BASICs, Atari BASIC is not a derivative of Microsoft BASIC, and differs in significant ways. It includes keywords for Atari-specific features and lacks support for string arrays, for example.
The language was originally an 8 KB ROM cartridge for the first machines in the 8-bit series, the 400, 800 and 1200XL. Starting with the 600XL and 800XL, BASIC was built-in to the machines, but can be disabled by holding down the
OPTION key while booting. The XEGS disables BASIC if powered without the keyboard attached.
- 1 History
- 2 Description
- 3 Advanced techniques
- 4 Performance
- 5 Differences from Microsoft BASIC
- 6 Keywords
- 7 See also
- 8 Notes
- 9 References
- 10 External links
The machines that would become the Atari 8-bit family had originally been developed as second-generation video game consoles intended to replace the Atari 2600. Ray Kassar, the new president of Atari, decided to challenge Apple Computer by building a home computer instead. This meant the designs, among other changes, needed to support the BASIC programming language, then the standard language for home computers.
In 1978, Atari purchased the source code to the MOS 6502 version of Microsoft 8K BASIC. The original 8K BASIC referred to its memory footprint when compiled on the Intel 8080's instruction set. The lower code density of the 6502 expanded the code to about 9 kB. This was slightly larger than the natural 8 kB size of the Atari's ROM cartridges.
Atari felt that they also needed to expand the language to add better support for the specific hardware features of their computers, similar to what Apple had done with their Applesoft BASIC. This increased the size from 9 kB to around 11 kB. Paring down the code from 11 to 8 kB to fit in a ROM turned out to be a significant problem. Adding to the problem was the fact that the 6502 code supplied by Microsoft was undocumented.
Six months later they were almost ready with a shippable version of the interpreter. However, Atari was facing a January 1979 deadline with the Consumer Electronics Show (CES) where the machines would be demonstrated. They decided to ask for help to get a version of BASIC ready in time for the show.
In September 1978, Shepardson Microsystems won the bid on completing BASIC. Shepardson had written a number of programs for the Apple II family, which used the same 6502 processor, and were in the middle of finishing a new BASIC for the Cromemco S-100 bus machines (Cromemco 32K Structured BASIC).
Shepardson examined the existing work and decided it was too difficult to continue cutting it down to size; instead, they recommended developing a completely new version, originally 10k in size. To make it fit on an 8k ROM, some of the common routines would be moved to the operating system ROMs. Atari accepted the proposal, and when the specifications were finalized in October 1978, Paul Laughton and Kathleen O'Brien began work on the new language.
The contract specified a delivery date on or before 6 April 1979 and this also included a File Manager System (later known as DOS 1.0). Atari's plans were to take an early 8K version of Microsoft BASIC to the 1979 CES and then switch to the new Atari BASIC for production. Development proceeded quickly, helped by a bonus clause in the contract, and an 8K cartridge was available just before the release of the machines. Atari took that version to CES instead of the MS version. Atari Microsoft BASIC later became available as a separate product.
The version Shepardson gave to Atari for the CES demo was not supposed to be the final version. Between the time they delivered the demo and the final delivery a few weeks later, Shepardson found several bugs in the code and had developed fixes for them. However, unknown to Shepardson, Atari had already sent the CES version to manufacturing.
This version was later known as Revision A. Among several problems, this version contains a major bug in a subroutine that copies memory; deleting lines of code that were exactly 256 bytes long causes a lockup. This was sometimes known as the "two-line lockup" because it did not trigger until the next line of code or command was entered. It was notorious as it was one of a very few problems that could not be fixed by pressing the Reset key.
Revision B attempted to fix all of the major bugs in Revision A, and was released in 1983 as a built-in ROM in the 600XL and 800XL models. While fixing the memory copying bug, the programmer noticed the same pattern of code in the section for inserting lines, and applied the same fix. This "fix" instead introduced the original bug into this code. Inserting new lines is much more common than deleting old ones, so the change dramatically increased the number of crashes. Another major problem in Revision B was a bug that added 16 bytes to the memory of the program every time it was
LOADed, eventually causing the machine to run out of memory even on the smallest programs. Mapping the Atari described them as "awesome bugs", and advised Revision B owners "Don't fool around; get the new ROM, which is available on cartridge" from Atari. The book provided a type-in program to patch Revision B to Revision C for those without the cartridge.
Revision C finally eliminated the memory leaks in Revision B. This version was built-in on later versions of the 800XLs, all XE computers, and the XEGS. Revision C was also available in a cartridge production run.
The version can be determined by typing
PRINT PEEK(43234) at the READY prompt. The result is
162 for Revision A,
96 for Revision B, and
234 for Revision C.
Atari BASIC uses a line editor, like most home computer BASICs. Unlike most BASICs, Atari BASIC scans the just-entered program line and reports errors immediately. If an error is found, the editor re-displays the line, highlighting the text near the error in inverse video. Errors are displayed as numeric codes, with the descriptions printed in the manual.
Program lines can be entered by starting with a line number, which will insert a new line or amend an existing one. Lines without a line number are executed immediately. When the programmer types
RUN the program executes from the lowest line number. Atari BASIC allows all commands to be executed in both modes. For instance, the
LIST command can be used inside a program.
The LIST statement can be used to display either the entire BASIC program or a section of program lines by specifying the starting and ending line separated with a comma.
LIST "P:" is used to output a program listing to the printer.
Program lines ("logical lines") can be up to three screen lines ("physical lines") of 40 characters, so 120 characters total. The cursor can be moved freely in these lines, unlike in other BASICs where the cursor can only be moved left or right in the editor. The OS handles tracking whether a physical line flowed to the next on the same logical line, so moving the cursor up and down could move within logical lines or between them, automatically.
Pressing ↵ Enter sends the tokenizer the (logical) line on which the cursor sits. So, in the example pictured above (with
PRUNT), all the author needs to do to fix the error is move the cursor over the
U, type I (the editor only has an overwrite mode) and hit ↵ Enter. This is a common editing technique for, say, renumbering lines. Atari BASIC has no built-in renumbering command, but one can quickly learn to overwrite the numbers on a set of lines then just hit ↵ Enter repeatedly to put them back into the program.
Atari BASIC uses a token structure to handle lexical processing for better performance and reduced memory size. In contrast to MS-derived BASICs, which perform this tokenization on a line-by-line basis while the program runs, in Atari BASIC this occurs when the user hits Return. The immediate syntax checking described in the "Program editing" section is a side effect of converting each line into a tokenized form before it is stored. Shepardson referred to this early-tokenizing concept as a "pre-compiling interpreter".
The tokenizer converts lines using a small buffer in memory, and the program is stored as a parse tree.[a] The token output buffer (addressed by a pointer at LOMEM – 80, 8116) is 256 bytes, and any tokenized statement larger than the buffer generates an error (14 – line too long). The output from the tokenizer is then moved into more permanent storage in various locations in memory. A set of pointers (addresses) indicates these locations: variables are stored in the variable name table (pointed to at VNTP – 82, 8316) and the values are stored in the variable value table (pointed to at VVTP – 86, 8716). By indirecting the variable names in this way, a reference to a variable needs only two bytes to address its entry into the appropriate table. Strings have their own area (pointed to at STARP – 8C, 8D16) as does the runtime stack (pointed to at RUNSTK – 8E, 8F16) used to store the line numbers of looping statements (
FOR...NEXT) and subroutines (
GOSUB...RETURN). Finally, the end of BASIC memory usage is indicated by an address stored at MEMTOP – 90, 9116) pointer.
Atari BASIC uses a unique way to recognize abbreviated reserved words. Any keyword can be abbreviated using a period at any point in writing it. So
L. is expanded to
LIST, as is
LI.. To expand an abbreviation, the tokenizer searches through its list of reserved words to find the first that matches the portion supplied. More commonly used commands occur first in the list of reserved words, with
REM at the beginning (it can be typed as
.). When the program is later
LISTed it will always write out the full words with three exceptions:
GOTO has a synonym,
GO TO; and
LET has a synonym which is the empty string (so
10 LET A = 10 and
10 A = 10 mean the same thing). These are separate tokens, and so will remain as such in the program listing.
In the keywords for communicating with peripherals (see the Input/Output section, below) such as
OPEN # and
PRINT #, the "
#" is actually part of the tokenized keyword and not a separate symbol. For example, "
PRINT #0" are the same thing,[b] just presented differently.
Atari BASIC includes 12 functions for mathematical and trigonometric calculations. The TAN function is not included, but may be derived via the EXP function. DEG and RAD are used to set whether trigonometric functions use radians or degrees (radians being the default). The RND function generates a number between 0 and 1, with the parameter to the function not being used. The number is derived via the POKEY random number register at address $D20A.
Atari BASIC differs considerably from Microsoft-style BASICs in the way it handles strings. Microsoft BASIC mostly copied the string-handling system of DEC's BASIC-PLUS, in which strings are first-class types with variable bounds. This allows both string variables as well as arrays of strings, as both are represented internally by a computer word pointing to storage on a heap. In contrast, Atari BASIC copied the string-handling system of Hewlett-Packard BASIC, where the basic data type is a single character and strings are arrays of characters.
The side-effect of this design is that there are no true string arrays and each string variable must be DIMensioned before it can be used. For example:
10 DIM A$(20) 20 PRINT "ENTER MESSAGE: "; 30 INPUT A$ 40 PRINT A$
In this program, a 20 character string is reserved, and any characters in excess of the string length will be truncated. The maximum possible length of a string in Atari BASIC is 32,768 characters.
MS BASIC included function for accessing bits of strings, for instance,
LEFT$(A$,10) would return the leftmost 10 characters of
A$. In Atari BASIC the string is represented by an array, and was access using array indexing functions. The equivalent statement in Atari BASIC would be
A$(1,11); note that the arrays are 1-indexed, not 0-indexed as in most modern variations. Because this "slicing" syntax was the same as two-dimensional arrays in other BASICs, there was no way to define or work with arrays of strings.
Atari BASIC does not initialize array variables and a string or array may contain whatever random data was present in memory when it was allocated. The following trick allows fast string initialization, and it is also useful for clearing large areas of memory of unwanted garbage (numeric arrays can only be cleared with a very slow FOR...NEXT loop)
10 REM Initialize A$ with 1000 characters of X 20 DIM A$(1000) 30 A$="X":A$(1000)=A$:A$(2)=A$
String concatenation in Atari BASIC works as in the following example. The target string must be large enough to hold the combined string or an error will result:
10 DIM A$(12),B$(6) 20 A$="Hello ":B$="there!" 30 A$(LEN(A$)+1)=B$ 40 PRINT A$
The INPUT statement cannot be used with a prompt nor with array variables. The latter must be filled indirectly via a statement like 20 INPUT A:B(1)=A. Array variables in Atari BASIC also may contain two subscripts.
Strings included in DATA statements do not have to be enclosed in quote marks in Atari BASIC, as a result it is also not possible for data items to contain a comma. The READ statement also cannot be used with array variables.
Arrays have a base index of 0, so a statement such as DIM A(10) actually creates an 11-element array (elements 0-10).
The Atari OS includes a subsystem for peripheral device input/output (I/O) known as CIO (Central Input/Output). Most programs can be written independently of what device they might use, as they all conform to a common interface; this was rare on home computers at the time. New device drivers could be written fairly easily that would automatically be available to Atari BASIC and any other program using the Atari OS, and existing drivers could be supplanted or augmented by new ones. A replacement E:, for example could displace the one in ROM to provide an 80-column display, or to piggyback on it to generate a checksum whenever a line is returned (such as used to verify a type-in program listing).
Atari BASIC supports CIO access with reserved words OPEN #, CLOSE #, PRINT #, INPUT #, GET #, PUT #, NOTE #, POINT # and XIO #. There are routines in the OS for graphics fill and draw, but they are not all available as specific BASIC keywords. PLOT and DRAWTO for line drawing are supported while a command providing area fill is not. The fill feature can be used through the general CIO entry point, which is called using the BASIC command XIO.
The BASIC statement OPEN # prepares a device for I/O access:
10 REM Opens the cassette device on channel 1 for reading in BASIC 20 OPEN #1,4,0,"C:MYPROG.DAT"
Here, OPEN # means "ensure channel 1 is free," call the C: driver to prepare the device (this will set the cassette tape spools onto tension and advance the heads keeping the cassette tape player "paused". The 4 means "read" (other codes are 8 for write and 12 = 8 + 4 for "read-and-write"). The third number is auxiliary information, set to 0 when not needed. The C:MYPROG.DAT is the name of the device and the filename; the filename is ignored for the cassette driver. Physical devices can have numbers (mainly disks, printers and serial devices), so "P1:" might be the plotter and "P2:" the daisy-wheel printer, or "D1:" may be one disk drive and "D2:" and so on. If not present, 1 is assumed.
The LPRINT statement is used to output strings to the printer.
Atari BASIC does not include an equivalent of the Microsoft BASIC GET or INKEY$ commands to detect a keypress, this can be simulated either by POKEing the keyboard driver directly or opening it as a file (e.g. OPEN 1,4,0,"K:":GET #1,A$) although the latter will wait for a keypress unlike GET or INKEY$.
DOS from BASIC will exit to the Atari DOS command menu. Any unsaved programs will be lost. There is no command to display a disk directory from within BASIC and this must be done by exiting out to DOS.
DOS occupies roughly 5k of memory, thus a cassette-based Atari machine (48k or greater) will have around 37,000 bytes of free BASIC program memory and 32,000 bytes if DOS is present. BASIC cannot use the extra RAM on XL and XE machines.
Graphics and sound support
Atari BASIC has built-in support of sound, (via the SOUND statement), graphics (GRAPHICS, SETCOLOR, COLOR, PLOT and DRAWTO), joysticks (STICK, STRIG), and paddles (PADDLE, PTRIG). There isn't a supplied PAINT command to fill an arbitrary shape with pixels, but a limited operating system function exists and can be called with the XIO command. There are also no commands for drawing lines or graphics primitives, a combination of the PLOT and DRAWTO statements can be used to draw lines.
There is no dedicated command for clearing the screen in Atari BASIC, this is usually done with
PRINT CHR$(125), which PRINTs the clear screen control code (analogous to
PRINT CHR$(147) in Commodore BASIC). Atari BASIC does not include a TAB function; this can be simulated by either POKEing the cursor column position at $55 or the tab position at $C9, which has a default value of 10. The changed values will not take effect until a PRINT statement is executed. There is also no SPC function in Atari BASIC.
Advanced aspects of the hardware such as player/missile graphics (sprites), redefined character sets, setting the color palette/luminance tables, scrolling, and custom graphics modes are not supported by BASIC; these will require machine language routines or PEEK/POKE statements. A few graphics modes cannot be accessed from BASIC on the Atari 400/800 as the OS ROMs do not support them; the only way to access them is in machine language by setting the ANTIC registers and Display List manually. The OS ROMs on the XL/XE added support for these modes.
Bitmap modes in BASIC are normally set to have a text window occupying the last three rows at the bottom of the screen so the user may display prompts and enter data in a program. If a 16 is added to the mode number invoked via the GRAPHICS statement, the entire screen will be in bitmap mode (e.g. GRAPHICS 8+16). If bitmap mode in full screen is invoked, Atari BASIC will automatically switch back into text mode when program execution is terminated unlike many other BASICs which leave the user in bitmap mode and have an unreadable screen that can only be switched out of via typing a blind command or resetting the computer.
Bitmap coordinates are calculated in the range of 1 to maximum row/column minus one, thus in Mode 6 (160x192), the maximum coordinates for a pixel can be 159 and 191. If the user goes over the allowed coordinates for the mode, BASIC will exit out with an error.
Unlike MS-derived BASICs, Atari BASIC allows numeric variables and expressions to be used to supply line numbers to
GOSUB commands. This can be used to clarify code. For instance, a subroutine that clears the screen could be written as
GOSUB CLEARSCREEN, which is much easier to understand than the typical
GOSUB 10000. If a particular subroutine is executed frequently, placing its line number in a variable will also improve execution speed as it is faster for BASIC to look up a constant in a variable instead of processing it each time the statement is executed.
Most BASICs of the era allow the
LIST command to send the source code to a printer or other device. Atari BASIC also includes the
ENTER command, which reads source code from a device and merges it back into the program, as if the user had typed it in. This allows programs to be saved out in sections, reading them in using
ENTER to merge or replace existing code. By carefully using blocks of line numbers that do not overlap, programmers can build libraries of subroutines and merge them into new programs as needed.
Embedded machine language
Atari BASIC can call machine code subroutines. The machine code is generally stored in strings, which can be anywhere in memory so the code needs to be position independent, or in the 256-byte Page 6 area (starting at address 153610, 60016), which is not used by BASIC or the operating system. Code can be loaded into Page 6 by reading it from
Machine code is invoked with the
USR function. The first parameter is the address of the machine code routine and the following values are parameters. For example, if the machine language code is stored in a string named
ROUTINE$ it can be called with parameters as
Parameters are pushed onto the hardware stack as 16-bit integers in the order specified in the
USR function in low byte, high byte order. The last value pushed to the stack is a byte indicating the number of arguments. The machine language code must remove all of these values before returning via the
RTS instruction. A value can be returned to the BASIC program by placing it in addresses 21210 and 21310 (D416 and D516) as a 16-bit integer.
Running on original hardware, Atari BASIC is slower than other home computer BASICs, often by a large amount. On two widely used benchmarks of the era, Byte magazine's Sieve of Eratosthenes and the Creative Computing benchmark test written by David H. Ahl, the Atari was much slower than the Apple II, and even the Sinclair ZX81, finishing near the end of the list in terms of performance. This is despite the Atari's CPU running at 1.79 MHz, twice the speed of most other 6502-based computers. Most of the language's slowness stemmed from two problems.
The first is that all numeric values in BASIC are stored in floating-point binary coded decimal (BCD) format, and this includes numbers that can only be integers, like line numbers or array indexes.[c] Every time such a number is encountered, the interpreter has to convert it from the BCD format to an internal binary representation using routines in the operating system. Floating point math routines on the Atari were very slow, notably the BCD to binary conversion function, and this affected all programs. In the Byte benchmark, the constant conversion of the array indexes greatly slows the program down. In the Ahl benchmark, a single exponent operation, which loops over a poorly optimized multiplication function, was responsible for much of the machine's poor showing.
The second problem is due to how Atari BASIC implemented loops and branches. To perform a branch in a
GOSUB, the interpreter searches through the entire program for the matching line number it needs.[d] On the Atari, this is already slowed by the need to convert these numbers to binary. However, there was a more serious problem; in the case of a
NEXT loop, most interpreters would push a pointer to the location of the
FOR on a stack, so when it reached the
NEXT it could easily return to the
FOR again. In Atari BASIC, it was not the location in memory that was placed on the stack, but the line number itself. This meant every time a
NEXT was encountered, the system had to search through the entire program to find that line. Any loops in an Atari BASIC program cause a large loss of performance relative to other BASICs.
Several BASICs for the Atari addressed some or all of these issues, resulting in large performance gains. BASIC XL reduced the time for the Byte benchmark from 194 to 58 seconds, over three times as fast. This was accomplished by caching the location of
FOR/NEXT loops, as in other BASICs, but and this same cache was also used by
GOSUB for further improvements. Turbo-BASIC XL included similar caching, as well as a re-written, high-performance, floating-point library. On the Ahl benchmark, Atari BASIC required 405 seconds, while exactly the same code in Turbo BASIC took 41.6 seconds.
Differences from Microsoft BASIC
- Atari BASIC uses a different string model and does not allow arrays of strings. String concatenation is not supported.
DEF FNis not supported.
INPUTcannot include a prompt.
- There is no equivalent of the
INKEY$, which returns a single keycode without waiting (unlike
INPUT). This could be simulated by
PEEKing the keyboard driver.
- There is no support for integer variables.
- All string variables and arrays must be dimensioned prior to use while Microsoft BASIC defaults to 10 elements if an array is not dimensioned.
- There are no bitwise operators (AND, OR, XOR, etc.)
- Variable names can be of arbitrary length.
TABfunction is not supported.
?as in Microsoft BASIC, but Atari BASIC does not tokenize it into
LIST-ing a program will still show the question mark.
- The target of
GOSUBcan be a variable or expression.
FOR..NEXTloops in Atari BASIC must have a variable name referenced by the
NEXTstatement while Microsoft BASIC does not require it.
- Multiple variables are not permitted with
NEXTstatements as they are in Microsoft BASIC (e.g.,
- Atari BASIC does not support
|ABS||Returns the absolute value of a number|
|ADR||Returns the address in memory of a variable (mostly used for machine code routines stored in variables)|
|ASC||Returns the ATASCII value of a character|
|ATN||Returns the arctangent of a number|
|BYE||Transfers control to the internal "Self Test" program ("Memo Pad" on early models)|
|CHR$||Returns a character given an ATASCII value|
|CLOAD||Loads from cassette tape a tokenized program that was saved with CSAVE|
|CLOG||Returns the common logarithm of a number|
|CLOSE||Terminates pending transfers (flush) and closes an I/O channel|
|CLR||Clears variables' memory and program stack|
|COLOR||Chooses which logical color to draw in|
|COM||Implementation of MS Basic's COMMON was cancelled. Recognized but the code for DIM is executed instead|
|CONT||Resumes execution of a program after a STOP at the next line number (see STOP)|
|COS||Returns the cosine of a number|
|CSAVE||Saves to cassette tape a program in tokenized form (see CLOAD)|
|DATA||Stores data in lists of numeric or string values|
|DEG||Switches trigonometric functions to compute in degrees (radians is the default mode) (see RAD)|
|DIM||Defines the size of a string or array (see COM)|
|DOS||Transfers control to the Disk Operating System (DOS); if DOS was not loaded, same as BYE|
|DRAWTO||Draws a line to given coordinates|
|END||Finishes execution of the program, closes open I/O channels and stops any sound|
|ENTER||Loads and merges into memory a plain text program from an external device, usually from cassette tape or disk (see LIST)|
|FOR||Starts a for loop|
|FRE||Returns the amount of free memory in bytes|
|GET||Reads one byte from an I/O channel (see PUT)|
|GOSUB||Jumps to a subroutine at a given line in the program, placing the return address on the stack (see POP and RETURN)|
|GOTO and GO TO||Jumps to a given line in the program. GOTO can be omitted in "IF ... THEN GOTO ..."|
|GRAPHICS||Sets the graphics mode|
|IF||Executes code depending on whether a condition is true or not|
|INPUT||Retrieves a stream of text from an I/O channel; usually data from keyboard (default), cassette tape or disk|
|INT||Returns the floor of a number|
|LEN||Returns the length of a string|
|LET||Assigns a value to a variable. LET can be omitted|
|LIST||Lists (all or part of) the program to screen (default), printer, disk, cassette tape, or any other external device (see ENTER)|
|LOAD||Loads a tokenized program from an external device; usually a cassette tape or disk (see SAVE)|
|LOCATE||Stores the logical color or ATASCII character at given coordinates|
|LOG||Returns the natural logarithm of a number|
|LPRINT||Prints text to a printer device (same result can be achieved with OPEN, PRINT and CLOSE statements)|
|NEW||Erases the program and all the variables from memory; automatically executed before a LOAD or CLOAD|
|NEXT||Continues the next iteration of a FOR loop|
|NOTE||Returns the current position on an I/O channel|
|ON||A computed goto - performs a jump based on the value of an expression|
|OPEN||Initialises an I/O channel|
|PADDLE||Returns the position of a paddle controller|
|PEEK||Returns the value at an address in memory|
|PLOT||Draws a point at given coordinates|
|POINT||Sets the current position on an I/O channel|
|POKE||Sets a value at an address in memory|
|POP||Removes a subroutine return address from the stack (see GOSUB and RETURN)|
|POSITION||Sets the position of the graphics cursor|
|PRINT and ?||Writes text to an I/O channel; usually to screen (default), printer, cassette tape or disk (see LPRINT and INPUT)|
|PTRIG||Indicates whether a paddle trigger is pressed or not|
|PUT||Writes one byte to an I/O channel (see GET)|
|RAD||Switches trigonometric functions to compute in radians (see DEG)|
|READ||Reads data from a DATA statement|
|REM||Marks a comment in a program|
|RESTORE||Sets the position of where to read data from a DATA statement|
|RETURN||Ends a subroutine, effectively branching to the line immediately following the "calling" GOSUB (see GOSUB and POP)|
|RND||Returns a pseudorandom number|
|RUN||Starts execution of a program, optionally loading it from an external device (see LOAD)|
|SAVE||Writes a tokenized program to an external device; usually a cassette tape or disk (see LOAD)|
|SETCOLOR||Maps a logical color to a physical color|
|SGN||Returns the signum of a number|
|SIN||Returns the sine of a number|
|SOUND||Starts or stops playing a tone on a sound channel (see END)|
|SQR||Returns the square root of a number|
|STATUS||Returns the status of an I/O channel|
|STEP||Indicates the increment used in a FOR loop|
|STICK||Returns a joystick position|
|STOP||Stops the program, allowing later resumption (see CONT)|
|STRIG||Indicates whether a joystick trigger is pressed or not|
|STR$||Converts a number to string form|
|THEN||Indicates the statements to execute if the condition is true in an IF statement|
|TO||Indicates the limiting condition in a FOR statement|
|TRAP||Sets to jump to a given program line if an error occurs (TRAP 40000 cancels this order)|
|USR||Calls a machine code routine, optionally with parameters|
|VAL||Returns the numeric value of a string|
|XIO||General-purpose I/O routine (from "Fill screen" to "Rename file" to "Format disk" instructions)|
- BASIC A+, BASIC XL, BASIC XE – Extended BASICs for the Atari, from Optimized Systems Software
- Turbo-Basic XL - Freeware BASIC compatible with Atari BASIC, also available with a compiler for greater speed and extra commands.
- Although the parse tree is implemented as a set of tables, which is really an implementation detail.
- Although 0 is actually explicitly disallowed here by BASIC assuming it to be a coding error, isn't it?
- The line numbers at the front of the line, as in
100 REM a remarkwere stored as 16-bit integers in memory. However, references to those lines, as in the case of
GOTO 100, stored the value 100 as a floating-point type.
- One minor improvement found in most Microsoft-derived BASICs is to compare the target line number to the current line number, and search forward from that point if it is greater, or start from the top if less. MS BASIC (and most others) linked lines together only in one direction and could not search backward.
- Wilkinson, O'Brien & Laughton 1983.
- Decuir 2004.
- Wilkinson 1982, p. ix.
- Steil, Michael (20 October 2008). "Create your own Version of Microsoft BASIC for 6502". Some Assembly Required.
- Wilkinson 1982, pp. iv-v.
- Wilkinson 1982, p. v.
- Wilkinson 1982, p. x.
- Cherry, Charles (June 1987). "BASIC Bonanza". Antic.
- Wilkinson 1982, p. vi.
- "Atari BASIC Bugs". Compute!. July 1986. p. 10.
- Radcliff, Matthew (September 1995). "Revision C Converter". Antic.
- Chadwick 1985, p. 230.
- Chadwick 1985, pp. 250-251.
- Hardy, Bob (February 1993). "Keycode Getter". Atari Classics. p. 18.
- Winner, Lane (1982). "De Re Atari, Chapter 10: Atari BASIC". Atari, Inc.
- Wilkinson, O'Brien & Laughton 1983, p. 5.
- Atari BASIC Reference Manual. p. 54.
- "ATR: chpt.15: Display Lists".
- Ahl, David (November 1983). "Benchmark comparison test". Creative Computing. pp. 259–260.
- Ahl, David (January 1984). "Creative Computing Benchmark". Creative Computing. p. 12.
- Wilkinson 1985, p. 139.
- Wilkinson, O'Brien & Laughton 1983, p. 17.
- "Ahl's Benchmark?". 28 November 2007.
- The ATARI BASIC Reference Manual, Atari Inc, 1980, archived from the original on May 1, 2005
- Chadwick, Ian (1985). Mapping the Atari. Compute! Publications. ISBN 0-87455-004-1.
- Wilkinson, Bill (1982). Inside Atari DOS. Optimized Systems Software,Inc. ISBN 0-942386-02-7. Retrieved 2009-04-04.
- Decuir, Joe (December 30, 2004). 3 Generations of Game Machine Architecture (Speech). Classic Gaming Expo 2004. San Jose Convention Center.
- Wilkinson, Bill; O'Brien, Kathleen; Laughton, Paul (1983). The Atari BASIC Source Book. Compute! Books. ISBN 0-942386-15-9.
- Wilkinson, Bill (February 1985). "INSIGHT: Atari". Creative Computing. pp. 139–140.