The first Basic language dialect on the Apple II computer was Integer Basic, coded and hand-assembled by Apple employees. It could only handle numbers between -32767 and 32767 and had some limitations with respect to string arrays, but it was fast.
Enter Bill Gates and Microsoft. Apple was looking for a new version of Basic for the Apple II Plus computer with 48 KB of RAM. It seems Microsoft was the Basic vendor of choice at the time; Apple licensed a 10 KB assembly version of Basic called "Applesoft." It was similar to Basic implementations on other 6502-based computers: it used line numbers, spaces were not necessary in lines, plus it had some killer features that Integer BASIC lacked:
- atomic strings. A string is no longer an array of characters (like in C); it's now a garbage-collected object (like in the Java and Scheme languages). This allows for string arrays; DIM J$(10) got you a vector of eleven string variables with indices from 0 to 10.
- multidimensional arrays.
- single-precision floating point variables with an 8-bit exponent and a 31-bit significand. Along with this came a trigonometry library.
- high-resolution graphics.
- CHR$, ASC, STR$, and VAL functions for converting between string and numeric types
- no more writing LET
Why weren't many action games written in Applesoft Basic?
- Integer variables had to be converted to reals before math could be performed on them; they were then converted back to integers. Slow. Microsoft forgot to special case this.
- So-called shape tables are a poor alternative to bitmaps. No provision for drawing text on top of graphics. No provision was added in the 128 KB Apple //e and //c models' Basic interpreters for the new machines' double-resolution graphics, or for the Apple IIGS computer's 16-color mode. (Beagle Bros offered machine-language workarounds for these problems.)
- The program was stored as a linked list of lines; a GOTO took O(n) (linear) time.
- No sound support.
- The closed source movement was just beginning; software publishers found it was harder to crack a binary than an interpreted source.
10TEXT:HOME
20?"HELLO WORLD"
Copyright 2000-2001 Damian Yerrick. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections or Cover Texts. A copy of the license is included in the writeup entitled "GNU Free Documentation License".