BASIC Programming
BASIC Programming is an Atari Video Computer System (later called the Atari 2600) cartridge that teaches simple computer programming using a dialect of BASIC. Written by Warren Robinett and released by Atari, Inc. in 1979, this BASIC interpreter is one of a few non-game cartridges for the console. The Atari VCS's RAM size of 128 bytes restricts the possibilities for writing programs.
BASIC Programming | |
---|---|
Developer(s) | Atari, Inc. |
Publisher(s) | Atari, Inc. |
Designer(s) | Warren Robinett[1] |
Platform(s) | Atari 2600 |
Release | 1979 |
Details
The BASIC Programming display is divided into six regions:
- Program is where instructions are typed. It has a maximum of eleven lines of code.
- Stack shows temporary results of what the program does.
- Variables stores the values of any variables that the program is using.
- Output displays any output values that the program creates.
- Status shows the amount of available memory remaining.
- Graphics contains two colored squares that can be manipulated by the program.
Input is given through two Atari keypad controllers, which came with special overlays to show how to type the different commands and letters.[2] Programs are restricted to 64 characters in size and normally 9 lines of code, limiting the programs that can be written (users can disable all windows except Program and keep selecting "New Line" until 11 lines of code are present).
Language features
Atari BASIC supported the following keywords:[3]
- Statements:
Print
- Structure:
Goto
,If-Then-Else
- Graphics:
Clear
- Functions:
Hit
,Key
- Math: + - × ÷
Mod
- Relational operators: < > =
Unlike most BASIC implementations of the time:
- Atari BASIC used ← instead of = for assignment; e.g.,
A←A+1
. - Statements could be strung together on a line without a delimiter; e.g.,
Note←APrintA
. - An
If
statement could be used as a function, returning a value:Ver1←Ver1+IfVer1Mod2Then8Else92
. If
statements could take anElse
clause.
Special variable names:
Note
would sound a musical note, assigned numbers from 0 to 7- Numbers assigned to
Note
are implicitly assigned modulus 8, thus 8 becomes 0, 9 becomes 1, etc.
- Numbers assigned to
Hor1
,Hor2
- the horizontal coordinate of one of two squaresVer1
,Ver2
- the vertical coordinate of one of two squares
The language supported 26 unsigned integer variables A to Z. Atari BASIC only supported positive integers from 0 to 99. Math would wrap, so 99+1 would become 0, 99+2 would become 1, etc.
Sample code
The following example of a Pong game was provided.
1 Hor2←2+Key 2 IfVer1>90ThenVer1←88 3 IfHitThenVer1←9 4 Ver1←Ver1+IfVer1Mod2Then8Else92 5 Hor1←Hor1+7 6 Goto1
See also
References
- Interview:Warren Robinett, By James Hague, Halcyon Days, "How long did it take to write?...I had Adventure sort of done in the fall of 1978, but I wasn't satisfied. I sort of put it on the shelf for the next six months while I did the BASIC Programming cartridge, and finished them both simultaneously, in June 1979."
- Controllers - Atari Keypad, Atari KeypadSystem: Atari 2600, Model Number: CX50, Sold in pairs, functionally identical to the Kid's Controller and the Video Touch Pad. Included overlays with commands, meant to be used with Basic Programming.
- BASIC Programming: Atari Game Program Instructions. Sunnyvale, CA: Atari, Inc. 1979.
External links
- BASIC Programming at Atari Mania
- Compumate FAQ:BASIC PROGRAMME EXAMPLES FOR ATARI 2600 (BASIC PROGRAMMING & CompuMate) at the Wayback Machine (archived January 23, 2004)