Complete the existing pure-Python NMOS 6502 instruction core in `F:\storage-dev\6502-python` so that it implements all 256 opcodes and can be published as a complete reference core. This is a continuation of a working, green codebase. It is NOT a new build and NOT a governance canary. Product must accumulate in this repository. ## Approved execution boundary - Work only in `F:\storage-dev\6502-python`. - Use only the target-local interpreter `F:\storage-dev\6502-python\.venv\Scripts\python.exe` for project commands. - Do not read, copy, or import source or tests from any sibling `6502-python-*` directory. Those are abandoned experiments. - Keep all generated and temporary artifacts inside this checkout. - Never modify, regenerate, move, or delete anything under `tests/6502_test_vectors/`. That corpus is the immutable oracle. ## Starting state (verified, do not re-derive) - `sixfiveohtwo.core.OFFICIAL_OPCODES` currently defines exactly 151 opcodes. - The full suite is 514 passed and 105 xfailed. - The oracle corpus is 256 JSON files, one per opcode, `00.json` through `FF.json`, under `tests/6502_test_vectors/6502/v1/`. It is roughly 1 GB and is git-ignored on purpose. - The project is Ruff-clean and fully formatted at HEAD. ## Objective Implement the 105 undocumented/illegal NMOS 6502 opcodes so every one of the 256 oracle files passes. ## Definition of done There is exactly one xfail site in the repository, in `tests/test_6502_vectors.py`, inside `_file_case()`: if opcode not in OFFICIAL_OPCODES: return pytest.param(path, id=file_id, marks=pytest.mark.xfail(...)) The campaign is complete when that branch is removed and all 256 vector files pass under the target-local interpreter, with Ruff lint and format clean. ## The 105 opcodes, by family - NOP (27): 04 0C 14 1A 1C 34 3A 3C 44 54 5A 5C 64 74 7A 7C 80 82 89 C2 D4 DA DC E2 F4 FA FC - JAM (12): 02 12 22 32 42 52 62 72 92 B2 D2 F2 - SLO (7): 03 07 0F 13 17 1B 1F - RLA (7): 23 27 2F 33 37 3B 3F - SRE (7): 43 47 4F 53 57 5B 5F - RRA (7): 63 67 6F 73 77 7B 7F - SAX (4): 83 87 8F 97 - LAX (6): A3 A7 AF B3 B7 BF - DCP (7): C3 C7 CF D3 D7 DB DF - ISC (7): E3 E7 EF F3 F7 FB FF - ANC (2): 0B 2B - ALR/ARR/SBX/USBC (4): 4B 6B CB EB - ANE/LXA/TAS/LAS (4): 8B AB 9B BB - SHA/SHX/SHY (4): 93 9F 9E 9C ## Required phase order Implement in this order. Do not reorder; later phases depend on decode-table and addressing work settled earlier. 1. NOP and JAM (39 opcodes). Decode, dummy reads, cycle counts, halt semantics. 2. SLO, RLA, SRE, RRA (28). Read-modify-write composed with existing ALU ops. 3. SAX, LAX, DCP, ISC (24). Load/store/compare combinations. 4. ANC, ALR, ARR, SBX, USBC (6). Stable immediate-mode forms. ARR's decimal behavior is the known trap. 5. ANE, LXA, TAS, LAS, SHA, SHX, SHY (8). Unstable, magic-constant and high-byte dependent forms. Hardest; expect iteration. 6. Remove the xfail branch, run the complete 256-file sweep, and update `README.md` to state full 256-opcode coverage. ## The oracle is the only authority on behavior Expected behavior for every opcode is defined solely by the SingleStepTests vector files already present in the checkout. Do not infer behavior from other emulators, from prose descriptions, or from your own expectations. When an implementation disagrees with a vector, the vector is correct. Do not weaken, skip, xfail, or narrow any oracle assertion to make a test pass. Do not add tolerances. If an opcode cannot be made to match its vector file, stop and report it rather than relaxing the check. ## Verification discipline - The full suite takes roughly 8 minutes today and will grow. During ordinary task work, run only the tests your task owns. - Reserve the complete 256-file oracle sweep for phase 6. - Every task must leave Ruff lint and format clean under the target-local interpreter. ## Out of scope Do not add a host memory map, peripherals, video, audio, cartridge, operating system, or a complete machine. This remains an embeddable instruction core with a small host boundary for memory access and external signal state. No runtime dependencies. Keep using hatchling, pytest, and Ruff.