Back to the machine

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

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.

AddressOctalInstruction
000 000041 000 000LXI H,0initialise the counter
000 003026 200MVI D,80hset up the initial display bit
000 005001 016 000LXI B,0Ehhigher value = faster
000 010032LDAX Ddisplay the bit on the address lamps
000 011032LDAX D
000 012032LDAX D
000 013032LDAX D
000 014011DAD Bincrement the counter
000 015322 010 000JNC 0008hnot time yet, keep displaying
000 020333 377IN 0FFhread the sense switches
000 022252XRA Dkill the bit that matches
000 023017RRCrotate the display
000 024127MOV D,A
000 025303 010 000JMP 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.

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.