How to program an Altair 8800 by hand
No keyboard, no screen, no operating system. A program goes in one byte at a time through sixteen switches, and the lamps are the only thing that tells you it worked.
Open the panel and follow along
The machine on this site takes the same presses in the same order. It runs in the page, on a phone as well as a laptop, with nothing to download. Every switch setting and every lamp reading below is produced by driving that emulator through this exact procedure, so the page cannot drift away from the machine.
What you are working with
The bottom row has sixteen switches, numbered 15 down to 0. They are the address switches, and they do two jobs. A switch is a bit: up is one, down is zero. When you EXAMINE, all sixteen are read as an address. When you DEPOSIT, only the low eight are read, and they are the byte that gets stored.
Above them sit the control switches. Four of them matter here.
- EXAMINE takes the address off the switches and shows you what is stored there. The ADDRESS lamps follow the switches and the DATA lamps show the byte.
- DEPOSIT stores the byte on the low eight switches at the address the machine is sitting on.
- DEPOSIT NEXT moves on one address and stores there, which is how a program of any length gets entered without setting the address again.
- RESET puts the program counter back to address zero, and STOP/RUN starts and stops the processor.
Everything is written in octal, in groups of three digits. That is not a preference: the switches are grouped in threes on the panel, so three switches spell one octal digit and a byte is three digits. An address is two bytes, so it is printed here as two groups of three, high byte first.
The program
The smallest thing that proves the machine is a computer: load two numbers, add them, store the answer, halt. Fourteen bytes, twelve of them instructions and two of them the numbers.
| Address | Octal | Instruction | |
|---|---|---|---|
| 000 000 | 072 020 000 | LDA 0010h | fetch the first number |
| 000 003 | 107 | MOV B,A | keep it in B |
| 000 004 | 072 021 000 | LDA 0011h | fetch the second number |
| 000 007 | 200 | ADD B | add them |
| 000 010 | 062 022 000 | STA 0012h | store the sum |
| 000 013 | 166 | HLT | stop — watch the HLTA lamp light |
| 000 020 | 002 | DB 2 | first number |
| 000 021 | 002 | DB 2 | second number |
There is a gap in it. The instructions run from 000 000 to 000 013, and the two numbers sit at 000 020 and 000 021, out of the way of the code. That gap is why the procedure below has a second EXAMINE in the middle of it: DEPOSIT NEXT walks forward one address at a time and has no way of jumping.
The procedure
One row per press. The switches column is what the sixteen switches should read before you touch the control switch beside it, and the lamps column is what the machine answers with: the ADDRESS lamps, then the DATA lamps where they mean anything. Those lamp readings are not typed here. They are what the emulator on this site produced when a test drove it through every press in the table, which is also why the page cannot quietly stop matching the machine.
| Step | Switches | Press | Lamps, address · data | |
|---|---|---|---|---|
| 1 | OFF/ON | Flip OFF/ON up. The machine wakes with rubbish in memory, which is what a real one did. | ||
| 2 | 000 000 | EXAMINE | 000 000 | Set all sixteen address switches down and lift EXAMINE. This is where the program starts. |
| 3 | 072 | DEPOSIT | 000 000 · 072 | LDA 0010h, fetch the first number |
| 4 | 020 | DEPOSIT NEXT | 000 001 · 020 | the next byte of the one above |
| 5 | 000 | DEPOSIT NEXT | 000 002 · 000 | the next byte of the one above |
| 6 | 107 | DEPOSIT NEXT | 000 003 · 107 | MOV B,A, keep it in B |
| 7 | 072 | DEPOSIT NEXT | 000 004 · 072 | LDA 0011h, fetch the second number |
| 8 | 021 | DEPOSIT NEXT | 000 005 · 021 | the next byte of the one above |
| 9 | 000 | DEPOSIT NEXT | 000 006 · 000 | the next byte of the one above |
| 10 | 200 | DEPOSIT NEXT | 000 007 · 200 | ADD B, add them |
| 11 | 062 | DEPOSIT NEXT | 000 010 · 062 | STA 0012h, store the sum |
| 12 | 022 | DEPOSIT NEXT | 000 011 · 022 | the next byte of the one above |
| 13 | 000 | DEPOSIT NEXT | 000 012 · 000 | the next byte of the one above |
| 14 | 166 | DEPOSIT NEXT | 000 013 · 166 | HLT, stop — watch the HLTA lamp light |
| 15 | 000 020 | EXAMINE | 000 020 | The code has run out and the numbers live further along, so set the switches again and EXAMINE there. |
| 16 | 002 | DEPOSIT | 000 020 · 002 | DB 2, first number |
| 17 | 002 | DEPOSIT NEXT | 000 021 · 002 | DB 2, second number |
| 18 | RESET | RESET puts the program counter back to address zero. | ||
| 19 | RUN | Push STOP/RUN down. It is over in microseconds and stops on the HLT, so the HLTA lamp comes on. | ||
| 20 | STOP | Push STOP/RUN up. A HLT stops the processor but does not hand the machine back, and until it does the switches reach nothing. | ||
| 21 | 000 022 | EXAMINE | 000 022 · 004 | The answer, where the program stored it. |
The last two steps are the part people get wrong. A HLT stops the processor, but it does not hand the machine back to the panel: until STOP/RUN comes up, EXAMINE and DEPOSIT reach nothing at all and appear simply to be broken. MITS said so plainly in the Theory of Operation, and this emulator behaves the same way.
When it does not work
Usually one byte is wrong. Fourteen switch settings is fourteen chances to leave a switch up, and nothing warns you: the machine runs whatever it was given. The fix is the one MITS printed in the Altair BASIC Reference Manual, Appendix A, steps 10 to 15. Set the switches back to the first address, EXAMINE, and compare the DATA lamps with what you meant to store. Press EXAMINE NEXT to walk forward one byte at a time. Where the lamps disagree with your listing, set the correct byte on the switches, DEPOSIT, and carry on.
The panel on this site has that check built in, because entering bytes and never verifying them is the usual reason a first program does nothing. It walks the memory, finds the first byte that differs from the listing, and puts that address on the switches for you, which is where step 11 leaves you on the real machine.
Where the procedure comes from
MITS's own documents. Each one is cited in full in the engineering notebook, which is where the rest of the evidence behind this machine lives.
- Operator's Manual, part 3, what each switch and lamp does, one control at a time.
- Theory of Operation and Schematics, EXAMINE and DEPOSIT as circuits, and the rule on page 5 that the machine must be stopped for any panel switch except RESET to reach anything.
- Altair BASIC Reference Manual, 1975, whose Appendix A is the EXAMINE-back checking procedure described above.
After the first program
This is how every program arrived until the machine had something better to read from. The next step up is a sixteen-byte bootstrap loader toggled in the same way, which then reads a paper tape or a cassette and fills memory for you. That is how Altair BASIC got in: a program entered by hand whose only job is to read the program you actually wanted.
- The guided walkthrough does this on the panel, one step at a time, and checks each step against the machine.
- Kill the Bit is the next program worth typing in, and it uses the switches as a game controller.
- Inside the machine lists everything else that is in here, from the card cage to the disks.
- The engineering notebook has the panel, the lamp circuit and the loaders, with the documents they came from.