Convert 7 outstanding it.todo markers into actual passing tests now
that the chips and bus infrastructure can support them:
- 4004 LDM: ACC observed via SRC + WMP X2 bus drive
- 4004 FIM: register pair observed via SRC X2/X3 nibble drives
- 8080 hand-built loop: LXI/MVI/INR/DCR/JNZ decrements counter
- Z80 IM 2: vector table at I:00 → ISR via INT̅ low
- 8086 1 MB wrap: DS=0xFFFF + offset 0x11 lands at physical 0x00001
- 8086 ALE pulse: counts ALE rising edges per bus cycle
- 8086 AD release: external drive sticks during T2 (chip released)
- 8086 hello-world: 5 MOV BYTE [imm], imm writes to memory-mapped
"UART" at DS:0x9000; bus capture + RAM peek verify "Hello"
Plus: remove redundant 8080 CPUDIAG and Z80 ZEXDOC todos — the
actual end-to-end runs already pass in dedicated cpudiag.test.js
and zexdoc.test.js files.
Suite is now 125/126 passing, 1 todo (Busicom 141-PF demo, awaiting
firmware ROM), 0 failed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| 8080.c | ||
| 8080.test.js | ||
| README.md | ||
| cpudiag.test.js | ||
README.md
test_8080 — Intel 8080 as a velxio custom chip
See ../autosearch/02_intel_chips_overview.md for the spec.
Status
✅ Implemented. 18/20 tests passing. ~470 LOC clean-room C in
8080.c compiled to fixtures/8080.wasm.
Validated against:
- Intel 8080 Microcomputer Systems User's Manual (Sept 1975, doc 98-153B)
- Intel 8080/8085 Assembly Language Programming Manual (May 1981, doc 9800301D)
- Cross-checked AC flag rules, DAA, status bytes, and CALL/RST stack
ordering against
superzazu/8080(MIT, passes 8080EXM) andmayawarrier/intel8080-emulator(MIT). No code was copied — only authoritative spec consultation.
The 2 remaining it.todo tests are integration milestones (hand-built
loop, CPUDIAG ROM run) deferred until a generic rom-32k chip exists.
Pin contract (40-pin DIP)
Power simplified: real 8080 needed +12 V / +5 V / −5 V; we collapse to
single VCC / GND. Documented under
../autosearch/05_open_questions.md.
| Group | Pins | Dir |
|---|---|---|
| Address bus | A0..A15 |
out |
| Data bus | D0..D7 |
I/O |
| Status/ctl | SYNC, DBIN, WR̅, INTE |
out |
| Inputs | RESET, READY, HOLD, INT |
in |
| Outputs | WAIT, HLDA |
out |
| Clock | φ1, φ2 |
in |
| Power | VCC, GND |
power |
Total registered pins: 16 (addr) + 8 (data) + 4 (status) + 4 (inputs) +
2 (outputs) + 2 (clock) + 2 (power) = 38. Two real-silicon pins
(+12, −5) are dropped.
Bus cycle reference
For each machine cycle:
T1: drive A0..A15 with target address.
Drive D0..D7 with status byte (memory read = 0x82, etc.).
Pulse SYNC high.
T2: deassert SYNC. Switch D0..D7 to input (for reads) or hold them
as data output (for writes). Assert DBIN (read) or WR̅ (write).
T3: sample D0..D7 (read) or hold (write).
TW: optional, while READY is low.
T4..T5: instruction-internal work, no bus activity.
In the timer-driven model we collapse all five T-states into a single "step one instruction" callback that internally walks T1→T3 and emits the pin events in order. A faithful single-step mode driven by an external clock chip is a follow-up.
Target demo sketch
CP/M-style "hello world" via memory-mapped UART: 8080 wired to a
ROM chip (program), a RAM chip (stack/heap), and a UART chip
(velxio's uart-rot13.c example shows that custom UARTs work).
Program prints to UART; user sees output in the velxio serial monitor.
This is a real, recognisable retro-computing demo.
Implementation plan
- Spike a minimal 8080 chip that runs MOV / ADD / JMP only,
driving an LED off
D0of a memory-mapped output port. Confirms the bus state machine works. - Port the full ISA from a permissively-licensed reference (see
autosearch/04) into8080.c. - Run CPUDIAG (the standard 8080 self-test program) — load it as ROM, verify it prints "CPU IS OPERATIONAL" via the UART.
- Add interrupt support (8259-style PIC is out of scope; just
INTpin → fixed RST vector for the first cut).
Files to create later
8080.chip.json8080.c(or split into8080.c+8080_decode.hif it gets large)roms/cpudiag.bin(public-domain test ROM)8080.test.ts