From collectibles to cars, buy and sell all kinds of items on eBay
home | pay | site map
Shop for itemsSell your itemTrack your eBay activitiesLearn, connect, and stay informed-for business and for funGet help, find answers and contact Customer SupportAdvanced Search
Home > Listing Index > Games > Applesoft BASIC

Games - Applesoft BASIC


Applesoft BASIC was the second dialect of BASIC supplied on the Apple II
computer, superseding Integer BASIC
. Applesoft BASIC was supplied by Microsoft
; Apple was looking for a new version of BASIC for the Apple II Plus computer with 48 KB of RAM, and after their success with Altair BASIC
, Microsoft had become the BASIC vendor of choice. Apple licensed a 10 KB assembly language version of BASIC called "Applesoft." It was similar to (and indeed shared a common code base with) BASIC implementations on other 6502-based computers, such as Commodore BASIC
: it used line numbers, spaces were not necessary in lines. While it was much slower than Integer BASIC, it had some killer features that the older BASIC lacked:

  • Atomic strings. A string is no longer an array of characters (like in C); it is instead a garbage-collected object (like in Scheme and Java). This allows for string arrays; DIM A$(10) resulted in a vector of eleven string variables numbered 0 to 10.
  • Multidimensional arrays.
  • Single-precision floating point variables with an 8-bit exponent and a 31-bit significand and improved math capabilities, including a trigonometry library.
  • Commands for high-resolution graphics.
  • CHR$, ASC, STR$, and VAL functions for converting between string and numeric types
  • LET statement optional
  • User defined functions (just simple one-line functions with simple parameters written in BASIC).
  • Error-trapping, allowing BASIC programs to handle unexpected errors by means of a subroutine written in BASIC.
Relatively few action games were written in Applesoft BASIC, for several reasons:

  • In this era of carefully counting clock cycles and limited memory, it was silly to write speed-dependent programs that ran on a runtime interpreter.
  • The use of real numbers for all math operations created unnecessary overhead and degraded performance. Applesoft actually converted integer numbers to real before performing operations on them them, then converted them back to integers if necessary. Microsoft did not optimize this.
  • So-called shape tables are a slow alternative to bitmaps. No provision existed for mixing text and graphics, except for the limited "Hardware split screen" of the Apple II (four lines of text at the bottom of the screen). Many graphics programs thus contained their own bitmap character generator routines. No provision was added in the 128 KB Apple IIe
    and Apple IIc
    models' BASIC interpreters for the new machines' extra memory and double-resolution graphics, or for the Apple IIGS'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, and although Applesoft programs were not very long compared to today's software, on a 1 MHz 6502 this could be a significant bottleneck.
  • No sound support aside from a PEEK command that could be used to click the speaker. The language was not fast enough to produce more than a baritone buzz from repeated clicks anyway. However, compiled assembly language was fast enough, and music spanning several octaves could be played by repeated calls to a machine-language tone generator.
  • The closed source movement was just beginning; software publishers found it was harder to crack a machine-language binary than an interpreted source.
Here's Hello World in Applesoft BASIC:

10 TEXT:HOME 20 ?"HELLO WORLD"

Multiple commands could be included on the same line of code if separated by a colon (:). The ? can be used in Applesoft BASIC as a shortcut for "PRINT", though spelling out the word is not only acceptable but canonical -- Applesoft converted "?" in entered programs to "PRINT" and the question mark would be "expanded" when entered program lines were listed back out. So the program above would actually appear in a LIST command as shown below:

10 TEXT : HOME 20 PRINT "HELLO WORLD"

This article includes text from , licensed under GFDL.

Trivia

  • There was a well-documented bug in Applesoft BASIC that could actually crash the interpreter if ONERR GOTO was in effect and numerous program errors occurred. Apple provided a short assembly-language routine which could be POKEd into RAM and CALLed to ameliorate the problem to an extent. Later it was discovered by an enterprising hacker that the required code was actually in the Applesoft ROM (though it was never executed) and could be called there instead.

[ Visit the complete Wikipedia entry for Applesoft BASIC ]


Searches on eBay

Some related entries: Attack! | Macified | John Ball Park | Tim Anderson | MegaZeux | One Away | Core Foundation | The Mines of Bloodstone | Visual FoxPro | Clip compiler | Isabelle

eBay Pulse | eBay Reviews | eBay Stores | Half.com | Kijiji | PayPal | Popular Searches | ProStores | Rent.com | Shopping.com
Australia | Austria | Belgium | China | France | Germany | India | Italy | Spain | United Kingdom

About eBay | Announcements | Security Center | Policies | Site Map | Help