Decoded: Altair BASIC

May 2025 -- work in progress!

Altair BASIC

Last month, Bill Gates celebrated the 50th anniversary of Microsoft by releasing its earliest known source code: the Altair BASIC interpreter 3.0. The significance of Microsoft's first endeavor has been discussed ad nauseum by industry and insiders for decades - to which, I have nothing to add.

As for the source code, I hope to help future code readers enjoy exploring minds from an earlier era. The first hurdle? Converting the 314 pages of fanfold impact printouts into something easier to analyze. Here you go:

Altair BASIC 3.0 source on GitHub:

  • WYSIWYG from the paper feed (repo / raw)
  • Assembly only (with and without line numbers)
  • ...and more view slices discussed in the repo

Armed with accessible source, we're ready to start the journey to appreciate what Gates called "the coolest code I've ever written".

My Goal: To break knowledge barriers preventing modern programmmers from jumping in to the code by collecting foundational knowledge in one place (right here!)


Solid Foundations

Computing in 1975 was more simple than today. It was possible for a young person to grasp the entire computation chain: from hardware and machine instructions through the single running program to the display / teleprinter. Much like three talented 20-somethings that shoehorned this BASIC interpreter in to 4K of memory. Simple, but foreign by today's standards.

Our first step is to walk through the tools of the era roughly in order of importance. The top tools are essential understand exactly what we're seeing in the source code without constant cross-referencing to ask "What is this?". As we move down the list, the resources will address the broad implications of "Why" rather than "What or How".

The Intel 8080 CPU

Key Resource:The 8080 Assembly Language Programming Manual (1975)

The MACRO-10 Assembler

Key Resource:The MACRO Assembler Reference Manual (1973 and 1978*)

stuff

*The 1978 reference didn't exist when Altair BASIC was developed, but it is higher quality and easier to read

The Altair 8800

Key Resource: Altair 8800 Theory of Operations and Schematics

The basics of BASIC

The design, structure, and operation of a BASIC interpreter were well-known concepts at the time of Altair BASIC's development. Dartmouth BASIC had been widely shared and universities included interpreter design and implementation in computer science curricula. This simplified the upfront challenge of product design.

Likewise, it is very helpful as code readers to understand what a generic BASIC intepreter does and how it is implemented so we can focus on the optimizations that made the Altair implementation feasible.

Optional Resource:


The Source Code


Analysis in progress...

FAQ

More questions added as they roll in