Skip to content
WillStevens edited this page Mar 12, 2024 · 9 revisions

Introduction to 1K Tiny BASIC

In the early days of the microcomputer era BASIC interpreters helped to make small computers usable. When memory prices were high, BASICs that had a small memory footprint were important. Some of the smallest are based on Tiny BASIC, conceived in 1975. Seeing the small size of some Tiny BASIC implementations (Palo Alto Tiny Basic is less than 2K), I was curious to know whether a BASIC interpreter can fit in 1K, and if so then how feature-rich can a 1K implementation be? I chose the Intel 8080 for this project partly because at the time of writing it will soon be the 50th anniversary of this CPU.

Language features

1K Tiny BASIC supports the following statements:

PRINT INPUT LET IF GOTO GOSUB RETURN FOR NEXT END RUN LIST NEW

Signed 16-bit integer arithmetic is supported, with no overflow detection. Operators are + - * /.

Comparison operators are = <> < > <= >=.

26 variables named A-Z are available. A single array called @ is available. Two system variables are available in ^ (address of start of array) and _ (current state of Random Number Generator).

Three functions are available: ABS, USR and RND.

Program editing features are minimal - lines can be deleted by typing the line number by itself. Unlike in most BASIC implementations, overwriting a line is not permitted, a line must be deleted and then re-entered.