# Documents Read in this order. | Document | What it holds | | --- | --- | | [start-here.md](start-here.md) | The MCS-48 as the core will model it: the accumulator and the two register banks with BS, the 12-bit program counter with its 2 KB pages and the DBF flip-flop, the PSW and its stack pointer, internal RAM with the eight-level stack, `MOVX` and external memory, P1/P2/BUS and the 8243 expander, T0/T1/INT, the timer and its ÷32 prescaler, the interrupt model and `RETR` versus `RET`, the conditional jumps, and the complete instruction set with opcodes, bytes, cycles and flag effects. Cites Intel's *MCS-48 Family User's Manual* (9800270D, 1978) by section and page, and MAME 0.285's `mcs48` device (BSD-3-Clause, transcribed with attribution) for everything the manual leaves ambiguous. | | [timing.md](timing.md) | The ÷3 ÷5 divider chain and the 15-clock machine cycle, the one- and two-cycle split, the ALE/PSEN/RD/WR/PROG rules a host must honour, the crystal each arcade board runs its MCS-48 at (confirmed from MAME's drivers, with the derived cycle and timer figures), how to schedule an MCU against a main CPU, and the two real-silicon measurements that say MAME's timer timing is a cycle out. | | [undocumented-behavior.md](undocumented-behavior.md) | Twelve corners, each tagged **documented** / **MAME** / **hardware** / **[unverified]**: the 26 undefined opcodes and what MAME does with them, PSW bit 3, the silently wrapping eight-level stack, `SEL MB` as a flip-flop rather than a PC write, the interrupt-in-progress lockout and why `RET` wedges the machine, the two hardware measurements, `JTF`'s unconditional clear, page-relative jumps taking the page of the *second* byte, port read-modify-write on the latch, what reset leaves alive, RAM beyond the part's size, and the UPI-41 corners. | | [validation.md](validation.md) | The oracle-tier rule with the extra rung this processor needs; every oracle with tier, licence, URL, coverage and limits; the T48 verification suite (102 self-checking programs, GPL-2.0) and how to run it against a software core; a table of the things that were searched for and **do not exist**; and the gates in order. | | [mame-oracle.md](mame-oracle.md) | Tracing Donkey Kong's 8035 sound MCU headlessly under MAME 0.285: how the `:soundcpu` tag and the MB8884 part were confirmed, the register symbols this core exposes (there is no `psw`), the working command line, four inherited gotchas re-tested and one corrected, how the MCU was provoked out of its idle loop, verified samples from reset and from gameplay, cost, and how to read a divergence. | | [handoff-brief.md](handoff-brief.md) | The brief for the session that builds the core: context, what makes this processor different from the Z80 and 6502 repositories, the host contract, six milestones with acceptance tests in oracle-tier order, constraints, what done looks like. | Scripts: [`scripts/fetch_sources.py`](../scripts/fetch_sources.py) fetches the five pinned MAME files the documents rest on and verifies each against a SHA-256; [`scripts/check_instruction_table.py`](../scripts/check_instruction_table.py) re-derives the opcode table from them and diffs it against `start-here.md`; [`scripts/mame/trace_dkong.sh`](../scripts/mame/trace_dkong.sh) and [`trace_dkong.lua`](../scripts/mame/trace_dkong.lua) produce the trace.