Skip to content
dfgordon edited this page Apr 15, 2023 · 3 revisions

Introduction

The Language

Applesoft BASIC is the high level language that was delivered with some of the earliest Apple computers. It is of interest today mainly as a matter of historical interest or nostalgia. It is an interpreted language, designed to be programmed by means of line entry. In particular, the programmer would enter a line, which was immediately tokenized (mainly replacing keywords with negative ASCII characters) by a very simple algorithm. The program could be listed back by way of a detokenizer, or changed by re-entering lines. Error checking only happened at runtime. In this programming cycle, line numbers are central. The entire Applesoft package had to fit within a 10 kilobyte memory footprint, which explains some of its limitations.

The Parser

The parser is a machine that takes lines of code and produces a syntax tree. Analyzing code is generally carried out by producing the syntax tree, and then walking through the nodes of the tree. The parser is a C library, but bindings exist for other languages, such as Rust, WASM, and Python.

References

Apple's documentation is a good starting point

  • Applesoft Tutorial
  • Applesoft BASIC Programming Reference Manual
  • Applesoft BASIC Programmer's Reference Manual Volumes 1 and 2 (later version)

For a more advanced look at Applesoft see

Clone this wiki locally