# Start here: the SM8521's CPU on one page ## Sources and their tiers | Short name | Source | Tier | Licence, verdict | | --- | --- | --- | --- | | **DS** | Sharp, *SM8521 8-Bit Single-Chip Microcomputer (Controller For Hand-Held Equipment)*, 57 pages (`reference/docs/sharp-sm8521.pdf`, SHA-256 `ce783f9a...`; an archived copy of the datasheetcatalog URL GameComHDK cites) | **2** (manufacturer) | Sharp's copyright: facts only, cited by page | | **DB96** | Sharp *1996 Microcomputer Data Book*, book pages 64-80: SM8502-SM8506, the general-purpose SM8500 series on the same SM85CPU core (`reference/docs/1996_Sharp_Microcomputer_Data_Book.pdf`, bitsavers, SHA-256 `3c672781...`, OCR) | 2 (manufacturer, a sibling chip) | facts only | | **HDK** | GameComHDK `Hexcode instructions.txt` V1 (Blitpost: Tpot, StoneBanana, Mr.Potatobadger), commit `35daac5` | 3-5 (a community opcode map, incomplete, method not stated; probably read off Sharp's assembler output) | MIT: code OK with notice | | **MAME** | MAME 0.285 binary, `gamecom` driver, CPU device "Sharp SM8500" at 5,529,600 Hz | 5 (detector) | `src/devices/cpu/sm8500/sm8500.cpp`, `sm85ops.h`, `sm8500d.cpp`: `license:BSD-3-Clause`, Wilbert Pol (header lines read 2026-11-26). **Not opened** (decision 2) | | **FW** | the Game.com's own firmware (internal 4 KB mask ROM, external 256 KB kernel ROM; SHA-1s in gamecom-python census.md) run in MAME | (real code that ran on real units) | never copied; read in place | **No tier-1 oracle exists** (no die photos, no captures, no SingleStepTests corpus for this CPU). DS is the judge for what it states: the programmer's model, addressing, data formats, interrupts, standby, and the instruction list with one-line semantics. **DS gives no opcode encodings and no per-instruction cycle counts**; for those only HDK (incomplete) and MAME (a model) exist. That gap is the main problem this core has (decode-and-timing.md). Set aside: manualmachine.com (robots.txt disallows ClaudeBot; it hosts a copy of DS): not used. alldatasheet.com and getdatasheet.com refused automated requests (403/410): not used. ## The chip (DS p. 2-4) - **SM85CPU**: 8-bit, "general registers allocated on RAM": R0-R15 are 16 bytes of internal RAM chosen by the 5-bit register pointer (RP) in PS0, in 8-byte steps over 0000-00FF. Control registers PS0, PS1, SYS, SPH/SPL live in the register file at 0019-001F; PC is the only register outside memory. - 67 instructions (8 load, 19 arithmetic, 7 logic, 9 program control, 8 bit, 8 rotate and shift, 8 CPU control), 23 addressing modes, 8 x 8 -> 16 multiply, 16 / 8 divide. - **Big-endian** words: the upper byte at the lower (even) address (DS Fig. 3). The firmware's vector table at 1000-101F reads as big-endian addresses 1085, 106A, ... (OBSERVED: the internal ROM's first 32 bytes). - Internal ROM 4 KB (1000-1FFF; mostly FFh in the Game.com: 3,965 of 4,096 bytes, OBSERVED), internal RAM 1 KB (0000-03FF, the register file overlapping 0000-007F). - Reset: PC = **1020h** after the warm-up counter (about 2^18 main-clock periods); the CPU starts at **1/32 of the main clock** (CKC = 00h). - Clock: main oscillator 1.5-10 MHz in the DS; its clock figure names fCK = 11.0592 MHz (DS Fig. 7), the Game.com's crystal. System clock = fCK/2 ... fCK/32 or sub-clock/2 (32.768 kHz sub-clock). MAME clocks its CPU at 5,529,600 Hz = fCK/2. - Interrupts: 10 sources, 2 non-maskable (watchdog, NMI/illegal instruction), 8 maskable at priorities 1-8, vectors 1000-101F (DS Table 3). - Standby: HALT (CPU stops, peripherals run) and STOP (main clock stops; also the mechanism for changing the system clock: DS p. 19, p. 27). ## Where the line falls between this core and the board The core: R0-R15 through RP, PS0, PS1, SYS, SP, PC; all instructions and addressing modes; the interrupt acceptance logic (IM in PS0, I in PS1, priorities, vectors, the illegal trap); HALT/STOP as states the board can wake; the bus as callbacks (memory reads and writes, register-file accesses at 0010-007F routed to the board). The board (gamecom-python): IE0/IE1/IR0/IR1, ports, MMU, LCDC/DMA, sound, timers, watchdog, UART, CKC's clock selection (the board owns time). Decision 3 in the brief. ## What to read next cpu.md, decode-and-timing.md, validation.md, mame-oracle.md, provenance.md, handoff-brief.md; then DS pages 8-29 and 51-54 and DB96 pages 74-80. ```sh python -I scripts/fetch_references.py # about 14 MB python -I scripts/fetch_references.py --verify MAME_ROMPATH=... python -I scripts/mame_trace.py --seconds 2 ```