Atari BASIC

from Wikipedia, the free encyclopedia

Atari BASIC (rarely Shepardson BASIC is called) a ROM -residenter BASIC - interpreter for Atari 8-bit home computer . The first version was supplied with the Atari 400/800 systems as an 8 KB plug-in cartridge; it was permanently installed in the Atari XL / XE series computers and started automatically when the cartridge slot was not occupied and the Computer was not booted with the OPTION key pressed . The complete annotated source text and description of the architecture of Atari-BASIC was published in book form very early on. The basic description of the parser and interpreter produced a whole family of BASICs that were heavily influenced by them.

History of the Atari BASIC

The Atari 400/800 series was originally planned as the successor to the Atari 2600 game console , before the decision was made to enter the growing home computer market. Atari urgently needed a basic interpreter, as this was a basic requirement for a home computer at the time. Atari, like many other computer manufacturers, decided to use the 8 KB version of Microsoft BASIC , the BASIC dialect prevailing at the time, and also acquired a license from Microsoft . However, when porting from the 8080 to the 6502 processor , the memory requirement increased from 8 kB to 11 kB, as the 6502 has a smaller instruction set. This was too much for a ROM module at the time.

An Atari BASIC program as entered in the editor, in the example the Euclidean algorithm .

As the announced release date for the Atari computers approached, they turned to Shepardson Microsystems, Inc., who had already written some programs for Apple II computers and who were in the process of developing their own BASIC interpreter. Shepardson proposed a complete redesign, the result was a BASIC version that differed greatly from the originally planned Microsoft BASIC. Due to a bonus regulation in the contract, the development progressed quickly and could be completed in time for the computer. A total of three versions of the Atari BASIC have been released:

  • Revision A was only included with the systems of the Atari 400/800 series as a cartridge. The programmers at Shepardson discovered some bugs before the release, but by then the cartridges were already in production. The most serious bug in this version was that the keyboard of the computer sometimes completely hung up when deleting program code, including the reset button, so that only a cold start helped.
  • Revision B was built into the Atari XL computers. The "keyboard hangup" had been eliminated, but a far more serious error was introduced: 16 bytes were added to the program each time it was saved, so that one could run the risk of running out of memory prematurely. On the 600 XL, which only had 16 kB of RAM for BASIC programs, this was a far more serious problem.
  • Revision C was sold as a cartridge in small numbers from 1983 onwards , but it was not installed in computers until 1984 . It was used in the last Atari 800-XL computers as well as all systems of the Atari XE series.

Special features of Atari-BASIC

Speed ​​and data types

Atari BASIC is significantly slower than other BASIC versions of that time, although the processor of the Atari computers was clocked very quickly with 1.77 MHz (PAL) or 1.79 (NTSC) at that time. The reason is, on the one hand, that the memory address is not jumped to directly in the case of jumps and returns, but rather the line number is always referenced, for which the program must be searched every time. An example of this is the delay loop, which was very popular in BASIC at the time :

…
10000 FOR I=1 TO 1000
10010 NEXT I
…

When the FORloop is called, the program line "10000" is saved as the return address. If the program arrives at the appropriate NEXTstatement, the interpreter now searches the program from the first line of the program until it encounters line 10000 and continues processing there. In loops, especially at the end of a long program, this costs performance.

In addition, Atari-BASIC knows no whole number arithmetic (integers), all numbers are basically stored as 7-byte BCD . When it comes to arithmetic, Atari-BASIC uses routines of the operating system that have been optimized for storage space and not for speed.

The biggest difference to other Basic dialects is the way arrays and strings are handled. Atari-BASIC only knows one-dimensional arrays, string arrays are not possible at all. Strings must always be dimensioned for program start, commands such as LEFT$, MID$, RIGHT$for String treatment do not exist under Atari BASIC, this one has but direct access to each string element. With A$(5,5)you access the 5th character in the string A$, with A$(4,6)the characters 4 to 6 and with A$(6)the 6th to the last character. This can also be used to manipulate individual string elements in a targeted manner, which among other BASIC dialects i. d. Is usually not possible.

Graphics and sound instructions

In contrast to other BASIC dialects of that time, Atari BASIC already has commands for graphics and sound programming. So z. B. draw points and lines with PLOTand DRAWTO, SETCOLORchange color registers with (but not read out) and with SOUNDyou have access to the four separate sound channels of the POKEY chip. There are also functions for querying the joystick and paddle . On other home computers such as On the C-64 , for example , you had to call operating system routines or use cryptic POKE and PEEK instructions .

However, the graphics commands in the Atari BASIC in particular can only be described as rudimentary. There are e.g. B. no functions to draw circles or ellipses or to fill areas. Also for the programming of player missiles (the Atari equivalent of sprites ) is not supported, here you are again on POKEs and z. T. subroutines instructed in machine language.

The input and output via XIO

For output and input to / from printers, plotters, cassettes, floppy disks, modems, etc. a. the universal instruction exists: XIO (abbreviation for extended input / output). You can use XIO commands to e.g. B. Rename or delete files on the floppy disk without having to go to the DOS menu. There are basic aliases for some XIO commands, some XIO functions are exclusive.

Successor to Atari-BASIC

In 1981 programmers from Shepardson Microsystems went into business for themselves, founded the company Optimized Software Systems (OSS), acquired the rights to Shepardson BASIC and developed it further into BASIC A + . This BASIC interpreter eliminated the greatest weaknesses of Atari-BASIC like the insufficient speed and added numerous commands for graphic processing (including player missile graphics). OSS is continuing this series with BASIC XL and BASIC XE . Atari finally published its port of Microsoft BASIC. All of these languages ​​had the disadvantage that the user had to own the interpreter to execute the programs. There was no compiler, at least a freely distributable runtime was included for BASIC XL.

The unofficial successor to Atari-BASIC, Turbo-BASIC XL , which was published in 1985 as listing of the month in Happy Computer magazine , was much more successful , and a compiler was added later. As programs for typing in, interpreters and compilers were available almost free of charge, so that this dialect, which is downwardly compatible with Atari BASIC, could quickly establish itself as the standard.

See also Atari Microsoft BASIC .

literature

  • Kathleen O'Brien, Bill Wilkinson, Paul Laughton: Atari BASIC Source Book . Compute! Publications Inc., US, 1983, ISBN 0-942386-15-9 (English, full source code).
  • Lon Poole, Martin McNiff & Steven Cook: My ATARI computer . te-wi, Munich 1983, ISBN 3-921803-18-7 .
  • Dr. Hans-Joachim Sacht: BASIC dialects . Humboldt-Taschenbuchverlag, Munich 1985, ISBN 3-581-66524-7 .