# Reuse: the family's other x86 work, and what this core takes from it The brief's reuse-first rule: list each existing core and what it would need before proposing a new one. ## The family's x86 relatives | Repository | State (2026-11-26) | Scope | What it would need to be this core | | --- | --- | --- | --- | | [i8086-python](../../i8086-python) | Phase 0 only: documents, fetch script, MAME recipe for the V30 in R-Type, a provenance audit; no core code (its commits `560ee80`, `491a70c`, `6dd7152`) | Intel 8086, then NEC V30, real mode, 16-bit, judged by SingleStepTests 8088/8086/V20 (3.0 M + 0.6 M + 3.1 M hardware cases) | everything after 1978: 32-bit registers and operands, the 0Fh map, SIB, protected mode, paging, x87, MMX, SSE, caches. Its ModR/M, flag and string-instruction rules are a subset of this core's | | [v30mz-python](../../v30mz-python) | Phase 0 only (its `019acbe`) | NEC V30MZ for the WonderSwan: 80186-level, NEC clocks and undefined flags | the same as above, minus nothing it adds: its NEC differences do not apply to Intel parts | Neither has code to vary, so there is nothing to fork. This core gets its own repository (the chip rule: CPUs always do), like the two above. ## What is shared, and how 1. **Conventions, not code**: the host contract style (a board-owned bus with a `kind` per transaction, an interrupt acknowledge callback that returns the vector: i8086- python's brief), z80-python's readability contract (one instruction family per module, the mnemonic first in each handler's docstring, the hardware reason on the line that encodes it), sh2-python's decode table generated from a document into a committed module. 2. **One decode-table generator, possibly shared later.** Intel's XED datafiles (Apache-2.0, `reference/src/xed`) define every instruction's encoding and its ISA set, and `xed-chips.txt` names the sets per chip: `I86` for the 8086, `I186` for the 80186 level, `PENTIUM3` for this core. A generator that reads them and writes a committed, readable decode table would serve this core first; i8086-python could use the same generator with chip `I86` (the V30's NEC extensions and the V30MZ's are not in XED, so v30mz-python would add rows of its own). Sharing the generator is a later decision, once two cores exist (decision 2). The generated tables carry XED's Apache-2.0 notice beside them. 3. **The 16-bit real-mode rules** (segment arithmetic, the 8086-compatible flag rules, string instructions with REP) are written here from Intel's manuals for the P6 as they are; where the P6 differs from the 8086 (undefined flags, shifts masked to five bits, the 286+ behaviour of PUSH SP, the stack wrap), the difference is documented in both places by citation, not by import. 4. **Oracles in common**: SingleStepTests' 8086/80286/80386 corpora judge the real-mode subset of all three repositories; their runner shape (JSON or MOO, initial and final states, bus cycles) is the same family of formats. ## Other cores the Xbox board needs (for the board's reuse table) | Chip | Existing core | Need | | --- | --- | --- | | APU DSPs (GP, EP): "probably Parthus MediaStream", similar to the Motorola DSP56300 family (xboxdevwiki `DSP` r6690) | none in the family | a new CPU-class core; xbox-python decision | | PIC16LC63A system management controller | none (mcs48-python, upd7725-python are other families) | HLE first in the board (its firmware is Microsoft's and undumped publicly as far as we know: xbox-python smbus.md) | | DVD drive's MPU (H8/300H on the Thomson drive, MT1358E on Samsung's) | none | out: the drive is modelled at ATAPI level |