RCA COSMAC CDP180219768-bit3 MHzno stack · no multiply · no divide

Four programs.
One chip from 1976.
Every byte written by hand.

STELLAR is a multitasking virtual machine for the RCA 1802, written straight in hex with no assembler. The four screens below are running on STELLAR's real firmware, on an emulated 1802, right now in your browser. It isn't a video and it isn't a re-implementation. The picture beside them is the chip's memory, lit up as it works.

clock
The die 32 KB of RAM · one pixel per byte
hover the die
CIDP$2F00
time on a real Elf2K
0:00
1802 instructions
0
STELLAR opcodes
0
1802 instructions per opcode
—
running now
—
who has the CPU the scheduler's hand-offs · newest on the right · width = time

One detail the browser changes. A real Elf2K has one serial port, so these four programs would share one terminal and draw over each other. Here each byte is sorted by the VM that sent it, and each key you type goes only to the screen you clicked. Everything else, including the scheduling, the timing and every instruction, is the real firmware. Click Invaders and press a key to play.

01

Fair by opcode, not by time

Watch the timeline while Invaders waits at press any key. STELLAR's scheduler gives every VM the same turn, three opcodes, and then moves on. That's fair by count. But opcodes aren't equal. While it waits, Invaders keeps calling $C3 RAND to stir its random seed, and a single RAND costs thousands of 1802 instructions. So its three opcodes take far longer than anyone else's, and the pink VM ends up with most of the chip.

Press a key in Invaders and watch its share fall. The program's own listing says it plainly:

; D 400B C3             RAND                   Stir the generator while we wait
; D 400C CC             SERST                  A key yet?
; D 400D A1 00 0B       IFFALSEI SEED
; D 4010 CB             SERIN                  Take it and discard it
02

One opcode, all the way down

Choose a VM and follow its most recent instruction through every layer: from the STELLAR bytecode it was written in, to the 1802 machine code the firmware runs to carry it out, to the bytes of RAM that change as a result. Freeze the machine to read one, and Step to move on by exactly one opcode.

A STELLAR bytecode what the programmer wrote
B The opcode one instruction of the virtual machine
C 1802 machine code what the chip actually ran for it
D Bytes in RAM this VM's 256-byte core
03

There is no assembler

STELLAR's firmware lives in a Word document with two columns: notes on the left and hex on the right. Every instruction of the 1802 code you just watched was worked out by hand, typed as bytes and tested on a real Elf2K. The firmware image this page runs is extracted straight from that document.

Programs are delivered the same way, as D-lines that the Elf2K's monitor loads byte by byte. The tools on this site (the disassembler, this emulator, the opcode table) came later, and were written to check the hand work, not to replace it.

The workbench

The rest of the site covers the same machine one piece at a time.