BASIC XL
- Medium
- Cartridge
- Year
- 1983
- Publisher
- Optimized Systems Software, Inc.
- Type
- Language
- Category
- Extended Atari BASIC interpreter (bank-switched cartridge)
- Developer
- Optimized Systems Software, Inc. (Bill Wilkinson, Stephen D. Lawrow)
- Language
- 6502 machine language
- Requirements
- Any Atari 400/800/XL/XE; 16K bank-switched cartridge (occupies 8K of address space); disk drive recommended
Overview
BASIC XL is Optimized Systems Software's cartridge successor to BASIC A+. Many people who used it consider it the best BASIC for the 400/800 generation. It has one big advantage over most rival BASICs: it uses the same tokens as Atari BASIC, so a program SAVEd from the built-in BASIC can be LOADed and RUN in BASIC XL with no changes. It then adds speed, structure and a large number of Atari-specific commands. Reviewing it for Antic in March 1984, Jerry White called it "the fastest and most powerful version of BASIC available for Atari computers" and said it was the language Atari should have built into its machines.
Features
- FAST mode. Ordinary Atari BASIC searches the program from the top every time it meets a
GOTO,GOSUB,FORloop return orWHILE. TheFASTcommand makes BASIC XL pre-compile the program in memory and replace every constant line number with the address of that line, so those jumps become direct. The manual warns that computed targets such asGOTO X*100are not converted and still run at normal speed. BASIC XL also switches on FAST automatically when you start a program withRUN "D:filename". - Structured statements.
IF … ELSE … ENDIFcan run over any number of lines and can be nested.WHILE … ENDWHILEloops are included, andLISTindents the blocks. - Better strings. BASIC XL has string arrays as well as Atari-style substrings, plus
LEFT$,MID$,RIGHT$,FINDandPRINT USING, which makes Microsoft-dialect listings much easier to convert. - Development aids.
NUMgives automatic line numbering andRENUMrenumbers the program.DELdeletes a range of lines.LVARlists every variable and the lines where it is used.TRACE/TRACEOFFshow each line number as it runs. Keywords can be typed in upper or lower case. - DOS from BASIC.
DIR,ERASE,RENAME,PROTECTandUNPROTECTwork without leaving the language, andBGET/BPUTandRGET/RPUThandle block and record I/O. - Graphics and games. Player/missile commands (
PMGRAPHICS,PMCLR,PMCOLOR,PMMOVE,MISSILE, plus thePMADRandBUMPfunctions), andHSTICK/VSTICKfor reading the joystick without decodingSTICKvalues.DPEEK/DPOKE,HEX$andMOVEhelp with the low-level work.
The manual's own formats give the flavour. Note that the block IF needs a colon and does not use THEN:
10 FAST
20 DIM N$(20):X=0
30 WHILE X<10
40 X=X+1
50 IF X>5:PRINT X;" IS BIG"
60 ELSE :PRINT X;" IS SMALL"
70 ENDIF
80 ENDWHILE
Behind the scenes
BASIC XL was the first OSS language in the SuperCartridge format: 16K of ROM that bank-switches so it uses only 8K of the computer's address space ($A000–$BFFF), the same as Atari BASIC. It was programmed by Bill Wilkinson and Stephen D. Lawrow. OSS later sold a disk of add-ons, the BASIC XL ToolKit (1984), for versions 1.02 and 1.03.
White's Antic benchmark used a 220-line program and a counting loop. Under Atari BASIC the loop took 15 jiffies at line 0 and 91 at line 32700. Plain BASIC XL took 10 and 88, and with FAST it took 10 at both ends. White also praised the manual, which opens with a tutorial called "30 Days to Understanding BASIC XL" before a reference section of about 135 pages. Two years later, Christopher Chabris's B/Graph regression benchmark in Antic came out at 30 seconds for Atari BASIC Rev. C and 12 seconds for BASIC XL v1.03.
Compatibility notes
Appendix F of the manual covers the few problems you may meet. The most common one comes from typed-in listings. BASIC XL has many more keywords, so a variable name that begins with one of them can be misread. The manual's example is NUMBER=7, which BASIC XL reads as the NUM command. The fix is to write LET NUMBER=7, or to rename array variables that clash with new functions, for instance BUMP becomes BUMPS. SET 5,0 turns off the automatic case conversion and makes listings come out upper case only, so they can be ENTERed back into Atari BASIC. Games that depend on BASIC's slowness for their timing may simply run too fast. White also found that some commercial Atari BASIC utilities would not run under BASIC XL.
Using it today
BASIC XL cartridge images run in Altirra and other emulators. Because it is a bank-switched SuperCartridge, a raw ROM dump needs the right OSS cartridge type (a .CAR image already carries it). A program saved by BASIC XL is conventionally named .BXL. If you use BASIC XL features, other people will need BASIC XL to run your program. Programs that keep to Atari BASIC statements, listed with SET 5,0, stay portable. On a 130XE you may prefer BASIC XE, its successor, which runs BASIC XL programs and can use the extra memory.
Credits
- Picture: A BASIC XL v1.02 SuperCartridge. — Cartridge scan from AtariMania (BASIC XL v1.02) (© Optimized Systems Software — used for identification/commentary)
- Antic Vol. 2 No. 12 (March 1984) — Product Reviews: BASIC XL, Jerry White — AtariMagazines.com (Kevin Savetz), 1984
- Antic Vol. 4 No. 9 (Jan 1986) — BASIC XE from O.S.S., Christopher Chabris — AtariMagazines.com (Kevin Savetz), 1986
- AtariMania — BASIC XL — Cartridge scan from AtariMania (BASIC XL v1.02) (© Optimized Systems Software — used for identification/commentary)
- AtariMania — BASIC XL ToolKit — Package scan from AtariMania (the_basic_xl_toolkit_d7_4.jpg), scans by Jon Bowers (Package art © Optimized Systems Software 1984 — used for identification/commentary)
- comp.sys.atari.8bit FAQ (Michael Current) — file extensions — Michael Current (comp.sys.atari.8bit FAQ)
