# Unknowns and contradictions Numbered so that code, tests and the brief can cite them. **U** is something no source found settles; **C** is a place where sources disagree, with the tier of each side and what the core does. Source keys are in [start-here.md](start-here.md); tiers in [validation.md](validation.md). Every default below is a named setting of a row, so that a later capture can change one line. ## Unknowns **U1. Does the W65C02S write or read the stack during reset?** DS 3.11 says "a reset sequence lasting seven clock cycles" and nothing about the stack. The Rockwell part reads and the GTE part writes (CAP). MAME reads for every CMOS part. No capture of a W65C02S reset was found (George Foot's capture is of the data bus only and starts after reset). Default: reads. **U2. The Lynx cell's reset.** VDS says a six-cycle sequence and does not say whether the stack is written; GDS, for the part the row is named after, says six cycles and writes; a real G65SC12 takes seven with three writes (CAP). Nothing on a Lynx can see the difference except three bytes of page one that change at reset. The Lynx II's cell, which has the bit instructions (C12), may be a different design again. Default: seven cycles and writes for both Lynx rows, as a setting. **U3. `$CB` and `$DB` on parts without `WAI`/`STP`.** GDS Table V, VDS Table 2 and NDS say `XB`: one byte, one cycle. CL's grid says one byte, one cycle. Dormann's test with `wdc_op = 0` expects one-byte NOPs. SST (`rockwell65c02`, `synertek65c02`) has `$CB` as one byte, two cycles and `$DB` as two bytes, four cycles. No capture executes either opcode. Default: one byte, one cycle, no poll (as the other one-cycle NOPs). **U4. The addresses of dummy cycles.** The captures have no address bus. Named by a manufacturer: the page-crossing re-read of the last instruction byte, and the double read in read-modify-write. **Mostly settled by rung 4** (2026-11-12): the capture lockstep compares the byte of every read with a model of memory, and on both captured parts every dummy read the programs execute agrees with the address timing.md now gives, in every execution (validation.md has the counts). Seven of those addresses are not the corpus's (C10, C13 to C18). Still unknown, because no capture executes them or the data cannot tell: the address of reset's first two cycles; `BRK`; the seventh cycle of `BBR`/`BBS` and the page-crossing cycle of the `abs,X` shifts; the fourth cycle of `$5C` (two agreeing executions only); `WAI` and `STP`; and everything on the parts that were not captured (the W65C02S, the Lynx cells), which are assumed to behave as the two that were. Default for what is unknown: the rule the captures show elsewhere (the extra cycle repeats the read before it), which is also SST's address in each of those cases. **U5. Interrupt poll points.** No CMOS equivalent of the NMOS part's die-level analysis was found. Unknown: whether `CLI`/`SEI`/`PLP` delay by one instruction exactly as on NMOS; whether a taken branch polls differently (GW: "there seems to be a difference between NMOS and CMOS in this area"; the forum topic it points to was not read); whether an interrupt pending during `BRK` is taken before or after the handler's first instruction. One measured point: on real Lynxes `CLI` admits a pending IRQ only after the following instruction (LT `cpu` test 1), as the frame's rule gives. Default: the frame's rule, uniformly, no branch exception. What rung 4 adds: in the captures of two real parts none of 65,772 interrupt entries began at a boundary where this rule forbids one (directly after `CLI`, `PLP` or a one-cycle NOP; directly after `BRK` or another entry). The IRQ line is not in the captures, so they cannot show an interrupt the chip would have taken sooner than the core does: the unknown stands. **U6. `WAI` wake timing.** How many cycles pass between IRQ or NMI going low and the next opcode fetch or the first cycle of the entry. GW: "no more than 1 cycle" for the I = 1 case. GF saw `WAI` as a three-cycle instruction once the RDY-low cycles were excluded. Default: each `step()` while waiting is one cycle reading the next opcode's address; the first `step()` that finds a request ends the wait and is itself the interrupt entry or the next instruction. **U7. One-cycle NOPs and interrupts.** CL section 9 (Laughton's bench): an interrupt never begins directly after a one-cycle NOP. No capture is published, and which part he tested is not stated beyond "the 65C02" (LK counts 32 `xxxxx011` NOPs, so a part with bit instructions). LT `cpu` test 8 expects the same on real Lynxes of both models (five of each `x3`/`xB` opcode in a row, the IRQ taken only after the block): tier 3 with hardware-derived expectations, for the Lynx cells. Default: on every row, a one-cycle NOP does not poll. **U8. Early WDC, Synertek and NCR parts as separate rows.** The Apple IIc and enhanced IIe shipped 65C02s without bit instructions from several makers. NDS matches the `G65SC02` row on paper (178 opcodes, the same NOP table, six-cycle reset). No Synertek data sheet was found. Whether any of them reads the stack at reset, or has `WAI`/`STP`, is unknown. Default: no rows beyond the three; an Apple board would start from `G65SC02` and add a row when evidence arrives. **U9. `$5C`'s addresses per part.** LK observed `$FFxx` then `$FFFF` four times on one chip. The count (8) is captured on two parts. Rung 4 adds, for those two parts and for Foot's chip: the last four cycles return the byte at `$FFFF` in 35 of 36 reads the model could judge (never another byte), the fourth cycle the byte at `$FF00 + low operand` in the 3 of 9 executions where the model knew it, and MAME's reading (the next opcode's address) differs from the captured bytes in every execution. Default: LK's, on every row; the other reading stays available as `nop_5c_reads = "pc"` for a part not captured. **U10. Is Mikey's cell the VL65NC02?** LS says "a 65C02 cell" and "the VTI specification"; the match with VDS is an inference, and it can hold for the Lynx I only (C12). No decap or netlist of a Mikey was found; `lynx-python` pins logic-analyser captures of a Lynx II's RAM strobes (page mode), which carry no CPU data bus. Default: Lynx I = the `G65SC02` row. **U11. Decimal results on the W65C02S and on the Lynx cell.** BC Appendix A is stated for "the 65C02"; the two captured parts both agree with the decoder's model of it across Clark's full test (CAP). The other parts are assumed the same. **U12. RDY as an input.** The core has none (the family's contract: the host stretches inside its callback). The exact cycle in which the chip samples RDY and the interrupt lines during a stretched write is not documented beyond DS 3.10. Default: `note_stall()` semantics as for reads. **U13. SOB, VPB, MLB, BE.** The set-overflow input and the W65C02S's extra outputs are not modelled. Nothing in the family uses them. If a board needs SOB, it sets V itself between steps. ## Contradictions **C1. `$5C`: 8 cycles or 4.** DS Table 7-1, GDS, VDS, NDS, CL: 3 bytes, 8 cycles. CAP: 8 on the G65SC12 and on the R65C02. SST: 4 cycles in all three sets. Core: 8. Rung 1 counts the 30,000 cases as a known corpus error. **C2. `x7`/`xF` without bit instructions.** GDS, VDS, NDS, CL, Dormann (`rkwl_wdc_op = 0`), the decoder: one byte, one cycle. CAP on the G65SC12: one cycle each, and Dormann's test (which checks their length) runs through. SST `synertek65c02`: `x7` two bytes, 3 or 4 cycles; `xF` three bytes, 3 or 4 cycles; origin unknown (its generator's source has no citation). Core: one byte, one cycle. Rung 1 counts 320,000 cases. **C3. `$CB`/`$DB` in SST's Rockwell and Synertek sets** against the data sheets and CL: see U3. Core: one byte, one cycle. Rung 1 counts 40,000 cases. **C4. Reset: six cycles or seven.** GDS, VDS, NDS: "an initialization sequence lasting six clock cycles". RDS, DS: seven. CAP: seven on both parts, counted from the SYNC cycle to the first opcode fetch. MAME's traces start at `totalcycles` 8. Core: seven. (The six may count from a different edge.) **C5. Does the R65C02 have `WAI`/`STP`?** RDS's opcode matrix and Table 2 have neither; CL and GW say WDC only. MAME's `r65c02` device has both (its description: the Rockwell variant with the bit instructions and `STP`/`WAI`). Core: no. A MAME trace of an `r65c02` driver that executes `$CB`/`$DB` will diverge there. **C6. `BRK` with an interrupt pending.** DS, GDS, RDS, NDS: `BRK` is executed, then the interrupt. MAME's `brk_c_imp`: with an NMI pending during a `BRK` instruction it pushes P with B clear and still loads `$FFFE`. Core: the data sheets; B set, `$FFFE`. **C7. VDS against itself.** Its feature list says 178 opcodes and 27 new; its tables, shared with a fuller part, list `BBR` `BBS` `RMB` `SMB` `STP` `WAI` and "210 op codes", with the note that columns 7 and F are NOPs in the 65NC02. Core: 178, and `$CB`/`$DB` by its Table 2 (`XB`: one byte, one cycle). **C8. `$CB`/`$DB` on the Lynx.** Handy executes them as `WAI` and `STP`; MAME and Felix as one-cycle NOPs; VDS Table 2 says NOPs. Core: NOPs. If a Lynx game is found that depends on either reading, that is board evidence and goes in an issue here. **C9. Dummy-read addresses between emulators.** SST uses one pattern for all three sets. MAME uses an NMOS-like pattern for `w65c02`/`r65c02`/`g65sc02` and another for `w65c02s` ("different dummy fetch patterns for indexed modes": `zp,X` re-reads `PC+1`, read-modify-write's second read is of `ea+1`, the pulls read `PC` twice). Neither cites a measurement. Core: neither. Rung 4 decides each address from the captures of two real parts (U4); where that contradicts SST the entry is one of C10, C13 to C18. **C10. `$DC`/`$FC`'s fourth cycle.** CL (note i) and LK: a read of the absolute address. SST: `PC+2` again. MAME: `base-page:(low+X)`. Core: the absolute address (research with a stated bench observation outranks an emulator). CAP agrees where it can tell: `$DC` and `$FC` ran 12 times in the captures, the model knew the byte at the absolute address in 8 of them, and the captured byte was that byte in all 8. Rung 1 counts the cases whose bus then differs. **C11. `INC`/`DEC abs,X`.** Some 65C02 documents give 6 cycles without a page cross, as for the shifts. CL section 7: always 7. CAP: `$DE` and `$FE` 7 in every execution; SST: 7. Core: 7. **C12. The Lynx II's bit instructions.** VDS: columns 7 and F are NOPs in the 65NC02. MAME: one `G65SC02` for every Lynx. Handy, Felix: no bit instructions. LT `cpu` test 7 (expectations from hardware) and 42Bastian (AtariAge 283383): NOPs on a Lynx I, working `RMB`/`SMB`/`BBR`/`BBS` on a Lynx II. Core: LT. The Lynx II row has `bit_instructions` on. The test checks results, not cycles, so their cycle counts on a Lynx II are assumed to be the R65C02's (5; 5 to 7). ### Found in the build: the corpus's dummy addresses against the captures Each of the following is a dummy read whose **address** differs between SingleStepTests (tier 5; all three sets use one pattern) and the captures of two real parts (CAP, tier 1; the G65SC12 and the R65C02 agree with each other in every one). The cycle counts and directions agree. The captures hold no address bus: the address is inferred in the capture lockstep (rung 4), where a read from the corpus's address disagrees with the memory model and a read from the address given here agrees in every execution; rung 7 seeds the corpus's address back in and shows the lockstep catching it. Core: CAP's, in each. Rung 1 counts the affected cases by these names. **C13. The cycle decimal mode adds to `ADC` and `SBC`.** CAP: a read of the next opcode's address (the captured byte is the opcode fetched in the following cycle). SST: a second read of the operand; for the immediate forms a fixed address unrelated to the instruction, different in each set (`$007F` in `wdc65c02`, `$0059` in `rockwell65c02` for `$69`): an artifact of its generator. MAME reads `PC`, as CAP. **C14. The extra cycle of an indexed store, and of `INC`/`DEC abs,X`, when no page is crossed** (`STA abs,X`, `STA abs,Y`, `STZ abs,X`, `INC abs,X`, `DEC abs,X`). CAP: a read of the operand's own address, as on the NMOS part. SST: a second read of `PC+2`. When a page is crossed both read `PC+2` again (DS Table 7-1 "extra read of last instruction byte", which speaks only of the crossing). **C15. The extra cycle of `(zp),Y`.** CAP: a second read of the pointer's high byte, `(zp+1) AND $FF`: across a page for the instructions that read, and in every execution of `STA (zp),Y`. SST: a second read of `PC+1`. **C16. A branch taken across a page: the fourth cycle.** CAP: the next opcode's address a second time (cycles 3 and 4 return the same byte). SST: the old page with the target's low byte, as the NMOS part. **C17. `JMP (abs)` and `JMP (abs,X)`.** CAP, `JMP (abs)`: `PC+2` a second time, then the pointer's low byte, then its high byte from `pointer+1`. SST: the pointer's low byte, then the high byte from the NMOS part's wrong address (the pointer's own page), then from `pointer+1`. CAP, `JMP (abs,X)`: `PC+2` a second time before the pointer. SST: `PC+1` there. MAME orders `JMP (abs)` differently again (C9). **C18. The third cycle of `zp,X`, `zp,Y` and `(zp,X)`.** CAP: the operand byte a second time (`PC+1`). SST: the unindexed zero-page address, as the NMOS part. MAME's `w65c02s` device re-reads `PC+1`, its other CMOS devices read the zero page (C9). One sentence covers C15 to C18 and the manufacturers' own statement: where the NMOS part spent a cycle reading a half-formed address, these two CMOS parts read again the address of the cycle before. ### Found in the build: MAME against the data sheets **C19. `ASL`, `LSR`, `ROL`, `ROR abs,X` within a page: 6 cycles or 7.** DS Table 7-1 ("Read/Modify/Write instructions absolute indexed in same page: six cycles"), GDS Tables IV and V, CL section 7, SST: 6, and 7 across a page. CAP: 6 in every execution on both parts (`1E 3E 5E 7E`, no run crossed a page). MAME 0.285's `w65c02`, `g65sc02` and `r65c02` devices: 7 always, as the NMOS part (found by rung 5: 25 executions in the `bbcm` trace, 32 in `cexpert`). Core: 6, and 7 across a page.