Apple did make some changes to AppleSoft BASIC over the years between the first version on the Apple II and the last version on the Enhanced IIe and IIe card. What are the differences between the versions of AppleSoft BASIC?
The Wikipedia entry is a bit jumbled, ambiguous, and in some cases wrong.
Perhaps it makes more sense to list changes by Apple II model, as documented by the fantastic Apple II History site. (The book has even more detail.)
Apple II (1977)
- APPLESOFT I, based on Microsoft 6502 BASIC version 1.1
- Documented in the November 1977 "Blue Book"
- Available on tape
- Loaded into memory at $800-$29FF (8.5k)
- Program and variables at $2A00 up
- No built-in commands to manage hi-res graphics
- Option of allowing either LET and REM statements or the use of lo-res graphics
- Lo-res graphics commands: PLTG, TEX, PLTC, PLTP, PLTH, PLTV
- AND, OR and NOT perform bitwise operations
Apple II Plus (1979)
- APPLESOFT II, based on Microsoft 6502 BASIC version 2
- Documented in the August 1978 "Blue Book"
- In mainboard ROM (also available on tape, disk, firware card ROM)
- Tape version loaded into memory at $800-$2FFF (10k)
- Tape version programs and variables at $3000 up
- ROM version in memory at $D000-$F7FF (10k)
- ROM version program and variables at $800 up
- Added commands for hi-res graphics: HGR, HPLOT ETC
- Lo-res graphics commands renamed to Integer BASIC keywords: GR, PLOT etc
- AND, OR and NOT perform boolean operations
- Many new commands:
- Error-trapping: ONERR...GOTO and RESUME
- Machine-routine shorthand call: &
- Screen-clearing: HOME
- Text-output control: NORMAL, INVERSE, FLASH and SPEED=
- The print-space function: SPC()
- Cassette tape storage of numerical arrays: STORE and RECALL
- Device response: WAIT
- Program-line deletion: DEL
- Machine-routine access: CALL
- Peripheral device access: IN# and PR#
- Memory range control: HIMEM: and LOMEM:
- Execution tracking for debugging: TRACE and NOTRACE
- Screen-positioning: HTAB and VTAB
- Subroutine aborting: POP
- Read the analog controllers: PDL()
- Read the low-resolution graphics screen: SCRN()
Apple //e (1983)
Same as the Apple II Plus version
Apple //e Enhanced (1985)
Same as the Apple //e version, except:
- Allowed entry of lowercase commands
- Screen output commands (PRINT, TAB, HTAB, etc.) more properly handle the 80-column screen
- Program listings were changed to begin in column 2, making screen editing easier
Apple //c (1984) and //c Plus (1988)
Same as the Apple //e enhanced version, except:
- All of the cassette tape routines (LOAD, SAVE, SHLOAD, STORE, and RECALL) were removed
- The lo-res graphics commands (GR, HLIN, VLIN, PLOT, and SCRN) work with double lo-res
- PLOT had a destructive range bug
Apple IIgs (1986)
Same as the Apple //c version, except:
- Fixed the PLOT range bug
The AppleSoft BASIC Wikipedia page has quite a bit of info on this:
Not really a feature, but the RAM footprint changed between the 1 & 2.
- AppleSoft I - 8.5 kb
- AppleSoft II - 10 kb
AppleSoft I had these features over the "Integer BASIC" (which Woz had written):
- Atomic strings: A string is no longer an array of characters (as in Integer BASIC and C); it is instead a garbage-collected object (as in Scheme and Java). - This allows for string arrays;
DIM A$(10)resulted in a vector of eleven string variables numbered 0–10.
- Multidimensional arrays (numbers or strings)
- Single-precision floating point variables with an 8-bit exponent and a 31-bit significand and improved math capabilities, including trigonometry and logarithmic functions
RESTOREcommands, for representing numerical and string values in quantity
VALfunctions for converting between string and numeric types (both languages did have the
- User-defined functions: simple one-line functions written in BASIC, with a single parameter
Additionally, AppleSoft II had these feature improvements over AppleSoft I:
- All commands supporting Apple's "high resolution" graphics (9 total)
- Error-trapping with
- Machine-routine shorthand call
HOME(a call to a system ROM routine)
- Text-output control
- The print-space function
SPC()is listed among reserved words in the Applesoft I manual, but is not otherwise documented (the
TAB()print-function is documented in it)
- Cassette tape storage of numerical arrays:
- Device response:
Apple III Microsoft BASIC added:
INPUT$()function to replace Applesoft's
LINE INPUTstatement to input an entire line of text, regardless of punctuation, into a single string variable.
LPRINT USINGstatements to automatically direct output to paper.
RSETstatements to left- or right-justify a string expression within a given string variable's character length.
OCT$()function for output, and
&O-formatted expressions, for manipulating octal notation.
SPACE$()function for generating blank spaces outside of a
STRING$()function to do likewise with any character.
WENDstatements, for loop structures built on general Boolean conditions without an index variable.
- Bitwise Boolean (16-bit) operations (
NOT), with additional operators
- Line number specification in the
NEXT(to skip to the statement after that which caused the error) or a specified line number (which replaces the idea of exiting error-handling by
GOTO-line, thus avoiding Applesoft II's stack error problem).
- Multiple parameters in user-defined (
DEF FN) functions.
- A return to the old Applesoft One concept of having multiple
USR()functions at different addresses, by establishing ten different
USR9, with separate
USRxstatements to define the address of each. The argument passed to a
USRxfunction can be of any specific type, including string. The returned value can also be of any type, by default the same type as the argument passed.
Apple Business BASIC had big changes around direct memory access, and even removed
POKE from the language. Their provided functionality was replaced with functions like:
BUTTON()function to read game-controller buttons.
WINDOWstatement to define the active window of the text screen by its coordinates.
- Use of the
There was a lot of material quoted VERBATIM from the Wikipedia article that was "a bit jumbled, ambiguous, and in some cases wrong". I might ask what elements of the article these terms apply to.
Judging from the respective Applesoft I and II "blue books", it's not really possible to assert with certainty that the print-space function SPC() was added with Applesoft II. In the Applesoft I manual, it's never discussed, but "SPC" IS listed among "reserved words". What sounds likely is that the function did exist in Applesoft I, but they simply forgot to document it in the manual. But this can only be speculation.
Similarly, Applesoft I did not have commands called IN# and PR#, but among its reserved words were IN and OUT, not otherwise discussed in the manual. These MAY have been Applesoft I's equivalents of IN# and PR#, just as its lores graphics commands had different names.
One other point is that in Applesoft I, the argument for the USR function was the address to be called for its machine-language routine, not an argument "for the function" to utilize in calculating the function's value, as it was in Applesoft II. It's odd that in the Applesoft I manual, there is not one word said about having USR return a useful value of its own. Whenever an example in the manual employs USR to obtain a value, it just depicts the user-routine storing the value in some location that is PEEKed in a later statement.