AppleSoft
The floating-point BASIC Apple licensed from Microsoft in 1977 and put in the ROM of every Apple II from the II Plus onward, giving the machine real numbers, string functions and high-resolution graphics that Wozniak's Integer BASIC lacked.
Created by Microsoft (usually credited to Marc McDonald and Ric Weiland), adapted for the Apple II at Apple by Randy Wigginton and colleagues
AppleSoft — almost always written Applesoft, and formally Applesoft BASIC — is the BASIC interpreter that Apple licensed from Microsoft and shipped on the Apple II. Its name is a contraction of the two companies’ names, and that is a fair description of what it was: a Microsoft 6502 BASIC with Apple’s graphics commands grafted on. From June 1979, when the Apple II Plus replaced Steve Wozniak’s Integer BASIC in ROM, until the Apple IIe was discontinued in November 1993, Applesoft was the language that greeted anyone who switched on an Apple II without a disk in the drive.
It is one of the most widely used dialects of BASIC in the history of personal computing, not because it was good — it was slow, its variable names were effectively two characters long, and it could not open a file by itself — but because it was there, in ROM, on a machine that sold in the millions and sat in a great many classrooms.
A Note on the Year and the Name
The 1977 date refers to Applesoft I, the first release, which came on cassette tape carrying a Microsoft copyright notice for 1977. Apple II History dates that cassette release to October 1977 in its chronology, while its chapter on languages places Applesoft I in January 1978; the 1977 copyright on the surviving cassette label supports the earlier date, so 1977 is best read as when the first Applesoft appeared rather than a precisely fixed release day.
The version nearly everyone actually used is Applesoft II, from 1978. The master list this encyclopedia follows also carries a separate Applesoft BASIC row, and there is a companion entry for Apple IIe BASIC; all of them are the same language, listed under the names by which different sources and machines referred to it.
History & Origins
Why Apple needed it
Wozniak wrote the Apple II’s original BASIC himself, by hand, without an assembler. He left out floating-point arithmetic deliberately — he was, as he later put it, primarily interested in writing games, and integers were enough for that. Customers disagreed. Business and scientific users wanted real numbers, and Commodore had licensed Microsoft’s 6502 BASIC for the PET, which shipped with floating-point arithmetic.
Microsoft had seen the problem coming from the other direction. Microsoft had a 6502 BASIC by 1976 — usually credited to Marc McDonald and Ric Weiland — and no 6502 computer of its own to sell it on. When Microsoft approached Apple, Jobs turned them down, saying Apple had its own BASIC. As the complaints mounted, Apple changed its mind.
The license
Accounts of the terms differ in detail but agree on the shape. Apple II History records a flat-fee license in two halves, with Apple paying $10,500 for the first half, for a total of $21,000; Wikipedia gives a flat fee of $31,000. Andy Hertzfeld, writing about the aftermath, records the crucial term: the license ran for eight years. That clock, started in 1977, ran out in September 1985 and cost Apple dearly.
Getting it to work
Adapting the interpreter was not a simple port. The source listing Apple received was buggy, and Integer BASIC’s commands had to be added to it so that existing Apple II programs and habits would carry over. Apple had no 6502 assembler in-house, so Wigginton assembled the code by sending it down a 110-baud modem line to a timesharing service, Call Computer — an agonizingly slow loop. When Call Computer lost the source to an equipment failure and its backups proved useless, Cliff Huston rescued the project by cross-assembling the code on his own IMSAI 8080.
Applesoft I, then Applesoft II
Applesoft I (1977), built on Microsoft 6502 BASIC version 1.1, loaded from cassette as an approximately 10K program and reportedly took several minutes to read in. It had no high-resolution graphics commands at all — its graphics vocabulary was a set of oddly abbreviated low-resolution commands such as PLTG, TEX, PLTC, PLTP, PLTH and PLTV — and the interpreter occupied the memory the hi-res screen needed anyway.
Microsoft had meanwhile fixed a number of bugs and offered Apple version 2 of its 6502 BASIC. In spring 1978 Wigginton and others reworked it into Applesoft II, which added the high-resolution graphics commands, renamed the low-resolution ones to match Integer BASIC, and added ONERR error trapping and the & hook. It reached customers in several forms: cassette, diskette, the Applesoft Firmware Card for original Apple II owners, the Language Card, and finally ROM on the Apple II Plus of June 1979.
Design Philosophy
Applesoft was not designed so much as assembled from two lineages that pulled in opposite directions:
- Microsoft’s 6502 BASIC supplied the core: floating-point arithmetic, garbage-collected strings as whole values, multi-dimensional arrays,
DATA/READ/RESTORE,DEF FN, and the tokenised linked-list program representation common to the whole Microsoft BASIC family. - Apple’s additions supplied the machine: the low- and high-resolution graphics commands, shape tables, the text-window and display controls, and the
&statement that let assembly-language packages bolt new commands onto the language.
The governing principle after 1979 was compatibility, and it hardened fast. Because an enormous amount of Apple II software called undocumented entry points inside the interpreter, Apple’s engineers deliberately avoided changing it. That decision is why the language shipped on the 1986 Apple IIGS is substantially the language of 1978, and why the interpreter still could not properly drive the Apple IIe’s 80-column display when that machine shipped in 1983.
Key Features
Data types
| Type | Suffix | Notes |
|---|---|---|
| Real | none | 40-bit binary floating point: an 8-bit exponent, a sign bit and a 31-bit significand, giving roughly nine significant digits |
| Integer | % | Range -32767 to 32767 as documented in the Applesoft manuals (Wikipedia gives -32768 to 32767); stored compactly, but arithmetic is still done in floating point |
| String | $ | Up to 255 characters, handled as whole values with garbage collection, not as character arrays |
Arrays of any of these can be multi-dimensional. The integer type saves memory rather than time: Applesoft converts to floating point to compute, which is the root of its reputation for slowness.
What it had, and what it did not
Applesoft gave the Apple II a great deal that Integer BASIC lacked: floating-point math, string arrays, CHR$, STR$ and VAL, DATA/READ, user-defined one-line functions with DEF FN, hi-res graphics with HPLOT, DRAW, XDRAW, ROT= and SCALE=, and error trapping with ONERR GOTO and RESUME.
What it lacked is just as characteristic:
- No file or disk handling of its own. Disk commands came from the operating system — DOS 3.3 intercepted output, so programs issued commands by printing a CONTROL-D followed by text such as
OPENorCATALOG; from 1984, ProDOS’sBASIC.SYSTEMdid the same job. - No
MOD, which Integer BASIC had had, and no bitwise operators. - No
INSTR,PRINT USING,INKEY$orLPRINT— conveniences present in various other BASICs of the era. - Effectively two-character variable names. A name may be long, but only its first two characters are significant, so
LOWandLOSSare the same variable. Worse, a name containing a reserved word is rejected:SCOREfails because it containsOR. - No lowercase for keywords on machines before the Enhanced IIe of 1985, except inside string literals.
| |
Escaping the language
Two hooks let programs leave BASIC behind: the USR function, which calls a machine-language routine and returns a value, and the & statement, whose vector programs could point at their own code. Together with PEEK, POKE and CALL, these were how commercial Apple II software got its speed while keeping BASIC as the outer shell — and how third parties added the commands Apple never did.
Performance
Applesoft is noticeably slower than Wozniak’s Integer BASIC, for two structural reasons: every arithmetic operation goes through the floating-point routines even when the values are integers, and the program is a linked list of lines, so each GOTO or GOSUB searches from the start of the program to find its target. Apple II programmers responded with folk optimisations — putting frequently called subroutines at the very top of the listing so the search would find them sooner, and using variables rather than numeric literals in tight loops, since a literal has to be re-converted from text each time it is evaluated.
The commercial answer was compilation. Microsoft’s TASC manual claims that Applesoft programs compiled with TASC “normally run from two to twenty times faster than the same programs run under the interpreter” — a vendor claim, comparing the same programs interpreted versus compiled to machine code on the same Apple II hardware, with the width of the range reflecting how much of a given program’s time was spent in interpreter overhead rather than in the work itself.
Known bugs
Two defects are well documented. The ONERR GOTO mechanism does not restore the stack if a handler fails to exit through RESUME, so error-handling code that simply jumps elsewhere can eventually crash the machine. And the RND function’s seeding makes the sequence it produces more predictable than the documentation implies.
Evolution
There is remarkably little to tell, which is the point. After Applesoft II in 1978, the language proper barely changed:
| Machine | Date | What changed for Applesoft |
|---|---|---|
| Apple II Plus | June 1979 | Applesoft II moves into ROM, replacing Integer BASIC; Autostart ROM boots straight into BASIC when no disk is found |
| Apple IIe | January 1983 | Same interpreter; new firmware adds 80-column and arrow-key editing around it |
| Apple IIc | April 1984 | Applesoft kept in ROM; Apple deliberately avoided larger interpreter changes for compatibility |
| Enhanced IIe | March 1985 | Lowercase command entry accepted; GET, HTAB, TAB, SPC and comma tabbing fixed for 80-column mode |
| Apple IIGS | September 1986 | Applesoft still in ROM for compatibility, alongside Apple’s separate GS BASIC, which John Arkley derived from Apple III Business BASIC rather than from Applesoft |
The environment around the language moved more than the language did. DOS 3.3 gave way to ProDOS in 1984, changing how disk commands reached the interpreter; the Language Card and later machines changed what memory was available to programs; and the whole ecosystem of third-party & packages, compilers and program editors grew up to supply what Apple would not change.
The price of the license
The most consequential event in Applesoft’s later history had nothing to do with the code. Hertzfeld’s account is that as the eight-year license approached its September 1985 expiry, Apple was still dependent on Apple II revenue and could not walk away from the language its entire software base ran on. Microsoft used that leverage: Apple abandoned MacBASIC — selling it to Microsoft for one dollar — and granted a perpetual license to the Macintosh user interface, in a deal Sculley signed in November 1985. Hertzfeld calls it “probably the single worst deal in Apple’s history.” Donn Denman, who had written MacBASIC, was told to destroy the source.
Current Relevance
Applesoft is historical. Apple has not sold a machine that runs it natively since 1993, and there is no official container image or supported toolchain.
It survives in three places. Emulators — AppleWin, Virtual ][, MAME’s Apple II drivers — run the original ROM interpreter itself, and remain actively developed. Reimplementations, most visibly Joshua Bell’s Applesoft BASIC in JavaScript, run listings in a browser with no emulation of the hardware at all. And the documentation survives: the Applesoft reference manuals, tutorials and the TASC manual are scanned and full-text searchable at the Internet Archive, and the Apple II ROMs have been disassembled and annotated in public.
Retrocomputing hobbyists still write new Applesoft programs, and type-in listings from Nibble, Call-A.P.P.L.E. and Creative Computing are still circulated and run.
Why It Matters
- It put floating-point BASIC in front of a generation. For most people who learned to program on an Apple II — and in the early 1980s that was a substantial share of everyone who learned to program at all — Applesoft was programming.
- It shows how a licensed dependency can capture a company. Apple did not own its own system language, and eight years later Microsoft charged what the position was worth.
- It is a case study in compatibility freezing a design. Because so much software reached into the interpreter’s internals, Apple could not safely improve it, and shipped a 1978 language on 1986 hardware.
- It carried Microsoft BASIC’s design into the mainstream. Two-character variable significance, tokenised linked-list storage, string garbage collection and
ONERRwere not Apple inventions; through Applesoft, Commodore BASIC and their siblings, Microsoft’s 6502 BASIC became the shape most people think of when they think of 8-bit BASIC.
Timeline
Notable Uses & Legacy
Akalabeth: World of Doom
Richard Garriott wrote Akalabeth, the game that led to the Ultima series, mostly in Applesoft BASIC during 1979 while in high school; California Pacific Computer Company published it for the Apple II in 1980
Learning to program on the Apple II
Applesoft was the language at the ] prompt of millions of home and classroom Apple IIs, and Apple shipped tutorials for it for a decade, including A Touch of Applesoft BASIC (1986) for the IIe, IIc and IIGS
Commercial software distribution via TASC
Microsoft's TASC compiler let developers ship a machine-language build of an Applesoft program instead of a listing, which both sped the program up and kept the source out of buyers' hands
Apple II clones and compatibles
Compatibility mattered enough that clone makers replicated the language: VTech licensed an Applesoft-compatible BASIC from Microsoft for the Laser 128, and Coleco claimed the Adam's SmartBASIC was source-compatible with Applesoft
Ampersand and USR extensions
Because Apple changed the ROM interpreter so little, third parties extended the language instead, hanging new commands off the & statement and the USR function to reach machine-language routines
Modern emulation and reimplementation
Applesoft programs still run in Apple II emulators such as AppleWin, and in Joshua Bell's Applesoft BASIC in JavaScript, which runs listings in a web browser