Clone this wiki locally
1976 was the year of BASIC interpreters. The legendary Dr. Dobb's magazine published many articles on designs and implementations of Tinybasic interpreters. I have added a zipped copy of the entire 1976 Dr. Dobb's to my archive. The articles are really fun reading.
In the rainy summer weekends 2021 I first implemented a Tinybasic following essentially the specifications of the Dr. Wang Palo Alto BASIC using the December article published by Roger Rauskolb (https://github.com/slviajero/tinybasic/wiki/Unforgotten---Dr.-Wang's-Palo-Alto-BASIC)
Writing this was easy at first but adding the Arduino features like lean serial code, PROGMEM and EEPROM use as well as array code was mildly challenging for various reasons. The original code offered 850 bytes useable for basic programs on a 1 kRAM 8080. It fitted into a 4k EPROM. My first code with almost exactly the same features plus tokenization needed 11 kB on an Arduino Diecimila. User programs can be 640 bytes long on this 1 kB machine. As an Arduino is a Harvard machine with a strictly separated program and data storage, a few things are harder to implement.
The second source I used is Steve Wozniak's preliminary manual on Apple 1 basic. This language seems simple but is really hard to implement in a low memory design once you try to include arrays and strings code. The array and string code added the complexity of left hand side evaluation of expressions as compared to Palo Alto BASIC. The interpreter is now almost fully compatible to the 1976 Apple Integer BASIC. See (https://github.com/slviajero/tinybasic/wiki/Language-features-of-Tinybasic,-Dr.-Wang's-Palo-Alto-BASIC-and-Apple-1-BASIC-compared) for differences. It doesn't fit on a Diecimila any more as more features were added.
It is worth mentioning the legendary book 101 BASIC Computer Games as well. A copy of the 1975 edition can be found here: ftp://bitsavers.informatik.uni-stuttgart.de/pdf/dec/_Books/101_BASIC_Computer_Games_Mar75.pdf. It is said that this was one main source of inspiration for Apple Integer BASIC. All the BASIC programs from this book have been typed in. I forked the repo here https://github.com/slviajero/bcg. They don't run because they have been ported to another BASIC dialect but maybe I will rewrite some of them.
More articles in this Wiki
- https://github.com/slviajero/tinybasic/wiki/All-the-things-you-need-to-know-in-a-nutshell (language features explained briefly)
- https://github.com/slviajero/tinybasic/wiki/Hardware-Platforms (hardware platform I am testing against and hardware features)
- https://github.com/slviajero/tinybasic/wiki/Interpreter-architecture-and-how-to-add-own-commands-and-function (the interpreter architecture and how to add own code)
- https://github.com/slviajero/tinybasic/wiki/Memory-consumption-and-interpreter-variables (a few words on memory)
The implementation here grew beyond the Apple Integer BASIC language set and offers now floating point, printing, terminal support, Arduino I/O and file I/O as optional language set. Storing in and running programs from EEPROM is possible on the AVR platforms. Building standalone computers is possible. See the project page for more info on what one can do with this piece of software.
An Arduino based standalone computer using this BASIC interpreter: