Tiny BASIC in Python

Dress up in your best corduroy suit or patterned jumper, it’s time for some disco, so put the Bee Gees latest 45 on the turn table and let’s get coding like your grandparents!

OK, you really don’t have to dress in the epitome of 1970s fashions, do the bump, or listen to disco, but you will enjoy programming like it’s 1976! Tiny BASIC in Python (tbp) is an implementation of the Tiny BASIC language that ran on the Intel 8080, the Motorola 6800, and the MOS Technologies 6502 processors and fit into 4K of memory.

Obviously, tbp is humongous compared to the original, but it served as a way for me to learn about the infrastructure of programming languages.

It is a full-featured programming environment for the Tiny BASIC language. It also includes a full debugger, a linter, and complete documentation, which you are now reading. It’s also the first project I’ve ever done in Python.

Any problems/confusion? Please file an issue in the repository. I thank you kindly in advance!

Some Usage Hints

The links on the left of this page have detailed discussion of installation, usage, the Tiny BASIC language, and the tbp command language that controls the programming environment.

When using tbp, use the %help command to get links to the documentation, and help on the tbp command language.

Prompts and Command Line Editing

In tbp you will see various command line prompts.

  • tbp:> - The normal tbp prompt where you can enter both the Tiny BASIC language and the tbp command language.
  • [A]? - This prompt says a program is asking you for input with the INPUT Tiny BASIC statement.
  • DEBUG(420):> - When you stop at a breakpoint, this prompt shows the line number you stopped on. In this case, it is line 420 in your Tiny BASIC program. See the tbp debugger documentation for details about the debugger commands and help debugging.

The tbp command line uses Python’s readline module on macOS and Linux, and pyreadline3 on Windows, so all the normal editing, copy, paste, and arrow keys work.

Example Programs

The examples directory holds sample Tiny BASIC programs for your enjoyment. Some of these programs come from other sources and I provide links back to the original code. The original developers hold the copyrights to their work. In a few minor cases I had to slightly change the program to work under tbp, which I documented in comments at the top of the file. I appreciate and thank the others who wrote these programs and shared them. 1

  1. Note that I am not a lawyer but feel it was OK to share other’s work like this. If that’s not a correct interpretation, let me know as soon as possible, and I will remove any requested by the authors. 


Copyright © 2024 John Robbins. Distributed by an MIT license.