Running Altair BASIC on a Modern Computer, Part 1: Background

If any immediate problems with MITS software are encountered, feel free to give us a call at (505) 265-7553. The Software Department is at Ext. 3; and the joint authors of the ALTAIR BASIC Interpreter, Bill Gates, Paul Allen and Monte Davidoff, will be glad to assist you

-- The ALTAIR BASIC Reference Manual, 1975

In 1975, Bill Gates and Paul Allen (then college students at Harvard), heard about the Altair 8800 computer in the January 1975 issue of Popular Electronics. The Altair was being sold as a kit by Micro Instrumentation and Telemetry Systems (MITS), an electronics company based out of Albuquerque.

Correctly guessing that microcomputers were about to explode in popularity and knowing that a BASIC interpreter would greatly increase the usefulness of the Altair, they saw a business opportunity. Allen phoned MITS's co-founder, Ed Roberts, falsely informed him that they had created a BASIC interpreter for the Altair, and asked if he would be interested in a business arrangement. Roberts agreed to meet them in a few weeks for a demo.

Working at breakneck speed on Harvard's PDP-10 and enlisting the help of fellow Harvard student Monte Davidoff to write the math routines, Gates and Allen managed to put together a BASIC interpreter over the course of the next few weeks. Allen flew to Albuquerque to demo it, but realized during the flight that they had forgotten to write a bootstrap program to load the interpreter into memory. Writing in 8080 assembly on paper tape, he managed to write one just before the plane landed.

When demoing the interpreter, everything worked perfectly. Roberts agreed to enter into a business partnership with Gates and Allen whereby MITS would distribute their BASIC interpreter (branded Altair BASIC) and pay a royalty for each copy sold. Gates and Allen decided to name their new venture Micro-Soft (later dropping the hyphen). The rest is history.

The original Altair BASIC was incredibly compact, fitting into four kilobytes of memory. Microsoft later produced larger versions of BASIC such as 8K BASIC, which, as the name would suggest, was 8 kilobytes in size and supported several more features, including variable names longer than two characters, string variables and a cosine function.

Digging around online, I managed to find binaries from the 1970s for versions 3.2 and 4.0 of Altair BASIC 4K and 8K respectively. Needing a project to work on this summer, and wanting to feel like Bill Gates, I set out to emulate an Altair 8800 and run Altair BASIC on it.

The Altair 8800 was an 8-bit microcomputer sold as a kit that required assembly. It was based on the Intel 8080 CPU and shipped with a whopping 256 bytes of memory. Programming the Altair was quite tedious, requiring the programmer to manually key in each instruction in binary on the front panel, and then flip the "deposit opcode" switch to write each byte into memory. This contributed to the success of Altair BASIC as using an interpreted high-level language eliminated this process.

To emulate the Altair and run BASIC, the first order of business was to get a working Intel 8080 emulator written. Since the 8080 was used in several systems, I decided to write an emulation library that can be incorporated into other projects rather than a standalone emulator. This way I can easily emulate other 8080 based systems in the future (space invaders anybody?).

In part two of this series, we'll look at the design of the Intel 8080 and my library for emulating it. Until then, check out the library code here.

© Rhys Rustad-Elliott. Built using Pelican. Best viewed with NCSA Mosaic.