Kill the Bit
A game for a computer with no screen. One lit lamp travels along the top row of the front panel, and the only control you have is the switch underneath it.
Open the panel with the game running
That link loads these twenty-four bytes into the Altair 8800 on this site and starts it. It runs in the page, on a phone as well as a laptop, and there is nothing to download.
What it is
Kill the Bit was written by Dean McDaniel on 15 May 1975, four months after the Altair 8800 appeared on the cover of Popular Electronics. The machine it was written for had no screen, no keyboard, and only as much memory as its owner had bought on a card. What it had was a row of lamps showing the address bus and a row of switches the program could read back. That is the whole of the hardware this game uses.
The listing that circulated with it states the object in one paragraph: "Kill the rotating bit. If you miss the lit bit, another bit turns on leaving two bits to destroy. Quickly toggle the switch, don't leave the switch in the up position. Before starting, make sure all the switches are in the down position."
How to play it
- Start with every switch down. The program reads the switches as a number and removes any bit you are holding up, so a switch left up takes the moving bit out the moment it arrives, and the game is over before it starts.
- Watch the top row of lamps. One lamp is lit, and it steps sideways. The eight lamps it moves across are the high half of the address bus, A15 to A8.
- Flip the switch below the lit lamp up, then straight back down. Those eight switches are the sense switches. The program reads them at port 377 octal and removes whatever bit you are showing it from the bit it is displaying.
- Miss, and you have two bits to chase. The rotate happens whether you hit anything or not, so a wrong switch adds a bit rather than costing you a turn.
Speed is a constant in the program. The value loaded into the BC register pair is added to a counter over and over, and the display changes when the counter overflows, so a larger value means a faster game. The listing's own comment on that line reads "higher value = faster". This copy uses 016 octal, which is the value the original listing carries.
The program
Twenty-four bytes. The octal column is the one that matters at the panel, because the switches are grouped in threes and octal is what those groups spell. The same bytes are loaded by the link above, so what you read here is what runs.
| Address | Octal | Instruction | |
|---|---|---|---|
| 000 000 | 041 000 000 | LXI H,0 | initialise the counter |
| 000 003 | 026 200 | MVI D,80h | set up the initial display bit |
| 000 005 | 001 016 000 | LXI B,0Eh | higher value = faster |
| 000 010 | 032 | LDAX D | display the bit on the address lamps |
| 000 011 | 032 | LDAX D | |
| 000 012 | 032 | LDAX D | |
| 000 013 | 032 | LDAX D | |
| 000 014 | 011 | DAD B | increment the counter |
| 000 015 | 322 010 000 | JNC 0008h | not time yet, keep displaying |
| 000 020 | 333 377 | IN 0FFh | read the sense switches |
| 000 022 | 252 | XRA D | kill the bit that matches |
| 000 023 | 017 | RRC | rotate the display |
| 000 024 | 127 | MOV D,A | |
| 000 025 | 303 010 000 | JMP 0008h |
To put it in by hand instead, the procedure is the same one every Altair program needed: how to program an Altair 8800 by hand walks through it press by press on a shorter program first.
What the lamps are actually doing
The game has no display hardware, so it borrows the address lamps. The moving bit lives in the D register, and the four LDAX D instructions in the loop read memory at the address held in D and E. Reading an address puts that address on the bus, and the bus is wired to the lamps, so the bit in D shows up on the top eight lamps for as long as those reads take. Four of them in a row is the program buying itself a brighter picture.
This site draws the lamps from the bus the same way, by sampling every bus cycle and lighting each lamp by how much of the time its line was high. That is why the moving bit reads as one steady lamp while the bottom of the address row flickers with the addresses of the loop itself. The engineering notebook has the lamp circuit and the measurements: why the lamps blur.
Where this copy comes from
The bytes are transcribed from the listing below, not reconstructed from a disassembly, and the octal in the table matches the octal printed on it. The same listing is the one the panel loads when you press Load and run in the program picker on the main page.
- Kill the Bit, Dean McDaniel, 15 May 1975, the original listing with the octal for entry at the panel.
- Altair 8800b documentation, MITS, May 1977, for the front panel and its sense switches.
More of what is in this machine: inside the machine, an index of the cards, programs and languages, and the engineering notebook, which is the evidence under all of it.