BASIC XE

Medium
Cartridge
Year
1985
Publisher
Optimized Systems Software, Inc.
Type
Language
Category
Extended Atari BASIC interpreter for XL/XE (cartridge + disk extensions)
Developer
Optimized Systems Software, Inc. (Bill Wilkinson credited)
Language
6502 machine language
Requirements
Atari XL/XE with 64K (not 400/800); 130XE or compatible banked memory for EXTEND; disk drive for the extensions file BASICXE.OSS
Black cartridge with a yellow label reading BASIC XE, Optimized Systems Software Inc., San Jose, California

Overview

When Atari shipped the 130XE in 1985, Optimized Systems Software saw that no BASIC used its second 64K. BASIC XE was OSS's answer. It is a superset of BASIC XL and runs only on XL and XE machines. Christopher Chabris reviewed it for Antic in January 1986, calling it the fastest and most powerful BASIC available for those computers and "the language that should have been built into the 130XE". It keeps Atari BASIC compatibility, and Bill Wilkinson put it at "98%-plus", so existing programs and habits carry straight over.

How it is packaged

BASIC XE is about 27K of code. 16K is in a bank-switched SuperCartridge and about 11K of extensions load from disk at boot. The language still takes up only 8K of address space. The manual's start-up routine is simple: put the XE Extensions disk in drive 1, insert the cartridge, switch on, and wait while the extensions load before the copyright banner and Ready prompt appear. The extensions are kept in a single DOS load file, BASICXE.OSS, which you can copy to your own boot disk.

Without the extensions BASIC XE still works, but it loses a set of features the manual lists by name: DEL, EXIT, FAST, LOCAL, LVAR, MOVE, PROCEDURE, RENUM, the fast maths routines and most player/missile commands. The manual also warns that BASIC XE will not run with any "translator" program. With the extensions loaded, it also clashes with a DOS XL configuration that uses the same memory.

Features

BASIC XE has about 140 built-in keywords. The ones that mattered most to reviewers were:

  • Named procedures with parameters. PROCEDURE … LOCAL … EXIT and CALL … USING … TO let you write subroutines that take arguments, keep private variables, return a value and even call themselves recursively. They work by name, with no line numbers or shared global variables. Array parameters are marked with !.
  • Structured flow inherited from BASIC A+ and BASIC XL: IF … ELSE … ENDIF and WHILE … ENDWHILE.
  • Speed. The extensions replace the operating system's floating-point package with faster routines. OSS claimed they were more accurate and twice as fast as Newell's FastChip. The FAST pre-compile mode from BASIC XL turns line-number references into addresses. OSS quoted an overall speed-up of two to six times over Atari BASIC.
  • 130XE memory. EXTEND moves your program into the secondary 64K bank and leaves main memory for variables, so the prompt changes to "XE Ready". Chabris quotes about 63K for program and 32K for data. PEEK, POKE, DPEEK, DPOKE, MOVE, BGET and BPUT take an optional bank number for the $4000–$7FFF window, so you don't have to set PORTB bits by hand.
  • Everything else from BASIC XL: string arrays and Microsoft-style string functions, PRINT USING, SORTUP/SORTDOWN for arrays, record I/O (RGET/RPUT), player/missile graphics, hex constants, DIR, RENUM and cross-reference listings.

This procedure example is adapted from the one in Chabris's review. It evaluates a polynomial:

30010 PROCEDURE "EVALPOLY" USING DEGREE,!P(),X:LOCAL E,V
30020 FOR E=DEGREE TO 0 STEP -1
30030 V=V+(X^E)*P(E)
30040 NEXT E
30050 EXIT V

Call it with CALL "EVALPOLY" USING 4,!F(),2.5 TO Y. The result goes into Y, and the local variables E and V disappear when the procedure exits.

Performance

Chabris timed a B/Graph regression analysis, which leans heavily on floating-point maths. It took 30 seconds in Atari BASIC Rev. C, 12 seconds in BASIC XL v1.03 and 7 seconds in BASIC XE v4.10. Without its extensions BASIC XE ran about as fast as BASIC XL. Using EXTEND mode made no difference to the timings. His wish list for a future version included REPEAT … UNTIL, integer variables and a compiler or runtime package.

Versions & compatibility

BASIC XE was released in 1985. Version 4.1 is the commonly preserved release, and Bill Wilkinson is credited as programmer. In September 2016 a long-lost version 4.2 turned up. The cartridge image is dated 1986-02-09 in its file name, and its assembler source was recovered too. Both were released to the public domain, as announced in AtariAge's "OSS-D-Day" thread. The poster reported that the image runs in Altirra as an OSS "043M" cartridge. Forum members then rebuilt the cartridge from the source with MAC/65, assembling from disk to get enough free memory. The cartridge needs XL/XE memory banking, so it will not run on a 400 or 800. An 800XL or 1200XL upgraded with ICD's RAMBO XL behaves like a 130XE in CPU mode, and Antic's RAMBO review confirms that BASIC XE runs on it. Some DOS setups clash with it. SpartaDOS 3.2gx, for example, keeps its buffers in RAM under the OS and so is incompatible with BASIC XE. Programs saved by BASIC XE are conventionally named .BXE.

Using it today

In an emulator, choose a 130XE (or an XL with 128K or more of compatible banked memory), attach the BASIC XE cartridge image as an OSS SuperCartridge type, and boot a disk containing BASICXE.OSS. Atari DOS 2.5 or another DOS that leaves RAM under the OS free works well. Try EXTEND on a long Atari BASIC program to see the extra memory: the procedure system is what keeps big programs manageable. Remember that anyone running your program will also need BASIC XE.

Credits