Turbo-BASIC XL

Year
1985
Publisher
Happy Computer (Markt & Technik), 1. Atari Sonderheft
Type
Language
Category
Extended BASIC interpreter + compiler (disk, XL/XE)
Developer
Frank Ostrowski
Language
6502 machine language
Requirements
Atari XL/XE with 64K (uses RAM under the OS ROM); disk drive; Atari BASIC disabled (hold OPTION on boot)
Atari start-up screen reading Happy Computer, Turbo-BASIC XL 1.5, (c) 1985 Frank Ostrowski

Overview

Turbo-BASIC XL is probably the most popular replacement BASIC for the Atari XL and XE. It was written by Frank Ostrowski, who later wrote GFA BASIC for the Atari ST. It was first published as a type-in and disk program in the West German magazine Happy Computer: It appeared in the magazine's first Atari special issue (1. Atari Sonderheft), dated December 1985. It soon spread through user groups and bulletin boards as free software. Three things made it popular. It loads and runs ordinary Atari BASIC programs, it runs them about three times faster, and it came with a compiler that speeds compiled programs up much further.

Features

Ron Fetzer's expanded English documentation, based on a translation by Dave and Laura Yearke of the Western New York Atari Users Group, counts 42 extra commands and 22 extra functions over Atari BASIC. It gives 34,021 bytes of free RAM, 1,747 more than Atari BASIC, because the interpreter runs from RAM under the XL/XE operating system ROM. Up to 256 variable names are allowed. The highlights are:

  • Structured programming: REPEAT … UNTIL, WHILE … WEND, DO … LOOP (all left with EXIT), multi-line IF … ELSE … ENDIF, and named procedures with PROC name … ENDPROC, called with EXEC name.
  • Labels instead of line numbers: # NAME marks a line, and GO# NAME, RESTORE #NAME and TRAP #NAME jump to it. Names may contain underscores, such as START_PROG.
  • DOS from BASIC: DIR, DELETE, RENAME, LOCK, UNLOCK, BLOAD and BRUN, with wildcards. There is no separate Turbo DOS: typing DOS drops you to DOS 2.5.
  • Graphics and sound: CIRCLE, PAINT, FCOLOR/FILLTO, TEXT for text on graphics screens, and DSOUND for 16-bit sound channels.
  • Memory and I/O: DPOKE/DPEEK, a fast MOVE (and -MOVE), and BGET/BPUT, %GET/%PUT for block and number I/O.
  • Maths and strings: DIV, MOD, FRAC, TRUNC, HEX$, DEC, $nnnn hex constants, the bitwise operators &, ! and EXOR, INSTR, INKEY$, TIME/TIME$, and the handy constants %0–%3.
  • Editing aids: RENUM, DEL, DUMP to list variables, TRACE, PAUSE, CLS, and -- to print a separator line in listings.

The documentation's own procedure example, slightly condensed:

10 CLS
20 EXEC TOO_HARD
30 EXEC JUST_RIGHT
40 END
50 --
60 PROC TOO_HARD
70 ? "THIS BED IS TOO HARD!"
80 ENDPROC
90 --
100 PROC JUST_RIGHT
110 ? "THIS ONE IS JUST RIGHT!"
120 ENDPROC

Turbo-BASIC keeps Atari BASIC's single-dimension strings and allows only numeric arrays (one or two dimensions). A disk containing a program called AUTORUN.BAS runs it automatically when Turbo-BASIC boots.

Behind the scenes

The language reached North America through user groups. In October 1988 Antic's New Products column listed Ron Fetzer's Complete Turbo-BASIC Kit, a $5 disk containing the interpreter, a 37-page documentation file, tutorials on arrays and sorting, and two utilities. The column called Turbo BASIC "the powerful public domain programming language". The conventional file extensions are .TUR for saved Turbo-BASIC programs and .CTB for compiled ones.

The language has kept being worked on. In 2014 AtariAge member MrFish published a cleaned-up PDF of the expanded documentation with a memory map and compiler instructions. In the same thread readers corrected the old documentation's claim that Ostrowski came "from Holland". In 2017 the FastBasic author dmsc posted a full MADS disassembly of version 1.5 that rebuilds the original binary byte for byte, which made patches and bug fixes practical. Cartridge versions exist as well. A 2020 thread compares a Video 61 cartridge, an S/XEGS RAM-cart build and a SIC! cartridge image that runs on modern flash carts such as the Ultimate Cart.

Using it today

  • Booting: put the Turbo-BASIC disk in drive 1 and switch on an XL/XE with OPTION held down so the built-in BASIC is disabled. On a disk with DOS 2.5 you can also rename TURBOBAS.COM to AUTORUN.SYS.
  • Emulators: use an XL/XE configuration with 64K and BASIC switched off, and boot the ATR. Turbo-BASIC is still a favourite in modern BASIC 10-liner competitions.
  • DOS choice: Turbo-BASIC needs the RAM under the OS, so it conflicts with DOS versions that put their own code there. Users of the time remember SpartaDOS setups causing exactly that conflict. Atari DOS 2.5, MyDOS, or small DOSes such as LiteDOS leave the most room. LiteDOS, for instance, frees 8K more memory under Turbo-BASIC XL.

Credits