# Domains and speed ## Domains and channels (charter, "Domains and channels") | Domain | Contents | Channels to the others | | --- | --- | --- | | **M** main | Z80B, ASIC (display fetch, contention, paging, interrupts, CLUT, LPEN/HPEN), RAM, ROM, keyboard, border, beeper (BORDER b4), EAR/MIC | - | | **S** sound | SAA1099 synthesis | ports 1FF (address) and FF (data): **write-only**, so S never answers M: a pure producer fed by a timestamped write log (the chip's DTACK is the one possible back-channel, U10) | | **F** floppy | one VL-1772-02 per drive, drives, images | ports E0-E7 / F0-F7 (reads of status and data are joins: M waits until F has run up to that T-state); polled, no interrupt line on the connector (U12) | | **I** MIDI and mouse | MIDI in/out shift registers, the mouse interface | port FD, STATUS bits, /INT; FE when A8-A15 are high (mouse). Optional; may stay in M | M is one domain because the ASIC sets the length of every Z80 access. The order of record in x-python: M runs, logging S's writes and stepping F inside M at each port access (F's own clock is the same 8 MHz family, locked to M: stepped, not threaded, in x-python). ## Instructions per second, with the arithmetic - Z80: 6,000,000 T-states/s. MAME's boot trace ran 55,296 instructions in 359,419 T-states (6.5 T per instruction, OBSERVED; tight ROM loops in ROM, mostly uncontended). With contention over the screen, typical code runs 7-10 T per instruction: **0.6-0.92 M instructions/s**. A frame is 119,808 T-states (asic.md). - ASIC: 48 cells x 312 lines x 50.08 = **750,000 cell steps/s** (each cell: one display fetch decision, one contention phase); up to 512 x 192 x 50 = 4.9 M pixels/s written in mode 3 (a pure producer from the register-write log in the fast tiers). - SAA1099: 8 MHz input, but its fastest observable events are the PWM chop at 62.5 kHz and tones up to 7.81 kHz on six channels: about **0.1-0.5 M internal steps/s** depending on how the core divides the clock. - WD1772: 250 kbit/s MFM, **31,250 bytes/s** at sector level while a command runs; nothing while idle. ## The no-JIT path (proposals/2026-11-jit.md, accepted) The SAM is a 6 MHz Z80 machine: about 1.7 x the Spectrum's Z80 work (3.5 M T/s) and 1.7 x the ColecoVision's (3.58 MHz). - **x-python**: colecovision-python measured 0.3-0.5 x real time on CPython and 0.6-2.9 x on PyPy for a 3.58 MHz Z80 board (MEASURED there); scaled by 1.7 that is roughly 0.2-0.3 x on CPython and 0.35-1.7 x on PyPy (an estimate, not measured). The Python board is the specification; sub-real-time is acceptable (reference boards: correct, not fast). - **x-rust**: a Z80 at under 1 M instructions/s plus a cell-level ASIC is far below what the family's Rust Z80 boards already run; z80-wasm plays a 3.072 MHz Z80 arcade board at full speed in the browser (live). Real time on desktop, phone and browser with large margin (estimate). - **x-rust-fast**: room for run-ahead (1-2 frames) and rewind; no threads needed. S as a pure producer on its own thread only if a phone's audio measures the need. - `recompile: none` on every target.