Kenbak-1
This is a from-scratch, in-browser emulator of the Kenbak-1 - the machine widely credited as the first commercial personal computer. John Blankenbaker built it in 1971, before the microprocessor existed, so there is no CPU chip inside: the processor is made entirely from TTL logic. It has 256 bytes of memory, three registers (A, B and X), and is programmed and read back through a front panel of eight lamps and buttons. This emulator models the whole machine faithfully, including the full instruction set and all five addressing modes, and runs real, originally-authored programs whose output lights the eight lamps.
Because the entire machine is plain JavaScript, it plugs into the shared debugger: single-step the TTL processor, disassemble memory, set breakpoints and write watchpoints, and inspect A / B / X / P and the overflow-carry flags live. The Kenbak-1 has no audio hardware, so this emulator is silent by design.
Runs on: Web browser
Kenbak-1 Online Emulator
Play Kenbak-1 using JavaScript directly in your browser.
Controls
Configurations
| Configuration | Emulator | Machine | OS | Legal | |
|---|---|---|---|---|---|
| Kenbak-1 — Larson scanner | Kenbak-1 | Kenbak-1 | open | Open ⛶ | |
| Kenbak-1 — Lamp counter | Kenbak-1 | Kenbak-1 | open | Open ⛶ | |
| Kenbak-1 — Simple add | Kenbak-1 | Kenbak-1 | open | Open ⛶ | |
| Kenbak-1 — Input echo | Kenbak-1 | Kenbak-1 | open | Open ⛶ |
Machines emulated
Chips
Notes
Embedding
There is no upstream runtime to vendor — the Kenbak-1 is written from scratch as three plain-global JavaScript modules, loaded in order:
// 1. the assembled programs, 2. the machine core, 3. the debugger plug-in
<script src="programs.js"></script> // window.KENBAK_PROG: original CC0 programs, 256-byte images
<script src="kenbak1.js"></script> // window.Kenbak1: the whole machine
<script src="kenbak-1-debug.js"></script> // EmuKit.defineMachine(...)
Boot. Construct the machine on a <canvas>, load a 256-byte memory image and run your own loop. One frame is a burst of instructions; you own it, so the debugger can pause and step it:
var k = new Kenbak1(canvas, KENBAK_PROG.larson.words, { speed: 900 });
k.running = true; // press START
(function loop(){
if (k.running) k.run(k.speed, bps); // bps = breakpoint Set (byte addresses)
k.render(); // draw the front panel
requestAnimationFrame(loop);
})();
The machine is plain objects — no wasm heap — so the debugger reaches everything directly:
| Member | Kind | What it does |
|---|---|---|
k.stepInsn() | method | Execute exactly one instruction; returns false when a HALT retires. The debugger's single-step primitive. |
k.run(n, bps) | method | Run up to n instructions, stopping on a HALT, a breakpoint or a watchpoint hit. |
k.ram | field | The whole 256-byte memory. A, B, X and P live in cells 0-3; OUTPUT (the lamps) is cell 0200, INPUT (the buttons) is cell 0377. |
k.control(name) | method | Drive a control button: 'clear', 'setaddr', 'dispaddr', 'read', 'store', 'start', 'stop'. |
k.dataButton(bit, down) | method | Press one of the eight data buttons — keys in a byte when stopped, drives INPUT when running. |
Debugger integration
The debugger plug-in (kenbak-1-debug.js) reads window.EMU_BOOT and calls EmuKit.defineMachine. Because the whole machine is ordinary JavaScript, single-stepping is just k.stepInsn(), registers are read and written straight off k.ram, and execution breakpoints are a host-side Set the loop checks against the program counter (cell 3) at each instruction boundary. Watchpoints wrap the memory write path (k.writeMem) and pause when a watched cell is written.
A new kenbak disassembler (/debugger/src/cpus/kenbak.js) decodes the instruction set — ADD/SUB/LOAD/STORE in the five addressing modes, AND/OR/LNEG, the shift/rotate group, the bit SKP/SET group and the JPD/JPI/JMD/JMI jumps. Instructions are one or two bytes in a single memory shared by code and data, so the disassembler returns a variable length and the PC and breakpoint gutter both use plain byte addresses.
Architecture
The Kenbak-1, designed by John Blankenbaker and sold by the Kenbak Corporation in 1971, is widely credited as the first commercially available personal computer — it predates the microprocessor era, so there is no CPU chip inside at all. Its processor is built entirely from small- and medium-scale TTL logic gates on a single board, and its 256 bytes of memory were MOS shift registers. Only a few dozen were ever made; the Computer History Museum recognises it as the first personal computer. This emulator is a from-scratch model of the whole machine:
- Serial TTL processor — no microprocessor. Three 8-bit registers A, B and X and the program counter P are memory-mapped into cells 0, 1, 2 and 3. Programs conventionally start at address 4.
- 256 bytes of memory — a single store shared by code and data. The OUTPUT register (cell 0200) drives the eight lamps; the INPUT register (cell 0377) reads the eight data buttons; three flag bytes (cells 0201-0203) hold the overflow (bit 0) and carry (bit 1) results for A, B and X.
- Instruction set — ADD, SUB, LOAD, STORE, AND, OR and LNEG, each in five addressing modes (immediate, memory, indirect, indexed and indirect-indexed); a shift/rotate group; bit skip and bit set; and unconditional and conditional jumps with an optional "mark" (jump-and-return) form.
- The front panel — the machine has no keyboard or screen. You enter programs and read results through eight lamps, eight data buttons and the control buttons CLEAR, DISPLAY ADDRESS, SET ADDRESS, READ MEMORY, STORE MEMORY, START and STOP. To enter a program you SET the address, then key each byte on the data buttons and press STORE (the address auto-advances); to run it you SET the start address and press START. While running, the lamps display whatever the program writes to the OUTPUT register.
Honest limits. The Kenbak-1 has no audio hardware, so this emulator is silent by design. Timing is modelled as a simple instruction budget per frame rather than the machine's true serial-memory cycle time; the shift-right instruction is treated as arithmetic (sign-preserving). Everything the bundled programs exercise — the full instruction set, all addressing modes, the flags and the front-panel workflow — is modelled faithfully.