Applesoft BASIC

From Academic Kids

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 success with Altair BASIC, Microsoft was the BASIC vendor of choice at the time. 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, plus, while being much slower, it had some killer features that Integer 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 ten string variables.
  • 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

However, 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 only through a runtime interpreter.
  • Integer variables had to be converted to reals before math could be performed on them; they were then converted back to integers. Slowly. Microsoft did not special case 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). 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.
  • No sound support.
  • The closed source movement was just beginning; software publishers found it was harder to crack a compiled binary than an interpreted source.

Here's Hello World in Applesoft BASIC:

10 TEXT:HOME
20 ?"HELLO WORLD"

This article includes text from Everything2 (http://everything2.com/?node=Applesoft+BASIC), licensed under GFDL.

See also

Navigation

Academic Kids Menu

  • Art and Cultures
    • Art (http://www.academickids.com/encyclopedia/index.php/Art)
    • Architecture (http://www.academickids.com/encyclopedia/index.php/Architecture)
    • Cultures (http://www.academickids.com/encyclopedia/index.php/Cultures)
    • Music (http://www.academickids.com/encyclopedia/index.php/Music)
    • Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
  • Biographies (http://www.academickids.com/encyclopedia/index.php/Biographies)
  • Clipart (http://www.academickids.com/encyclopedia/index.php/Clipart)
  • Geography (http://www.academickids.com/encyclopedia/index.php/Geography)
    • Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
    • Maps (http://www.academickids.com/encyclopedia/index.php/Maps)
    • Flags (http://www.academickids.com/encyclopedia/index.php/Flags)
    • Continents (http://www.academickids.com/encyclopedia/index.php/Continents)
  • History (http://www.academickids.com/encyclopedia/index.php/History)
    • Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
    • Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
    • Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
    • Prehistory (http://www.academickids.com/encyclopedia/index.php/Prehistory)
    • Renaissance (http://www.academickids.com/encyclopedia/index.php/Renaissance)
    • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
    • United States (http://www.academickids.com/encyclopedia/index.php/United_States)
    • Wars (http://www.academickids.com/encyclopedia/index.php/Wars)
    • World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
  • Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
  • Mathematics (http://www.academickids.com/encyclopedia/index.php/Mathematics)
  • Reference (http://www.academickids.com/encyclopedia/index.php/Reference)
  • Science (http://www.academickids.com/encyclopedia/index.php/Science)
    • Animals (http://www.academickids.com/encyclopedia/index.php/Animals)
    • Aviation (http://www.academickids.com/encyclopedia/index.php/Aviation)
    • Dinosaurs (http://www.academickids.com/encyclopedia/index.php/Dinosaurs)
    • Earth (http://www.academickids.com/encyclopedia/index.php/Earth)
    • Inventions (http://www.academickids.com/encyclopedia/index.php/Inventions)
    • Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
    • Plants (http://www.academickids.com/encyclopedia/index.php/Plants)
    • Scientists (http://www.academickids.com/encyclopedia/index.php/Scientists)
  • Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
    • Anthropology (http://www.academickids.com/encyclopedia/index.php/Anthropology)
    • Economics (http://www.academickids.com/encyclopedia/index.php/Economics)
    • Government (http://www.academickids.com/encyclopedia/index.php/Government)
    • Religion (http://www.academickids.com/encyclopedia/index.php/Religion)
    • Holidays (http://www.academickids.com/encyclopedia/index.php/Holidays)
  • Space and Astronomy
    • Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)
    • Planets (http://www.academickids.com/encyclopedia/index.php/Planets)
  • Sports (http://www.academickids.com/encyclopedia/index.php/Sports)
  • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
  • Weather (http://www.academickids.com/encyclopedia/index.php/Weather)
  • US States (http://www.academickids.com/encyclopedia/index.php/US_States)

Information

  • Home Page (http://academickids.com/encyclopedia/index.php)
  • Contact Us (http://www.academickids.com/encyclopedia/index.php/Contactus)

  • Clip Art (http://classroomclipart.com)
Toolbox
Personal tools