# 6502decoder: hoglet67's decode6502, fetched and built (6502decoder-build 0.1.0) David Banks's (hoglet67) 6502Decoder, the decoder for logic-analyser captures of a 6502, 65C02 or 65816 bus, built at its pin as the program `decode6502` (`CHANGELOG.md`). The family runs it as a closed box: w65c02-python's `scripts/decode_capture.py` and `tests/capture_replay.py` (rung 4, real captures of a BBC Master, a BBC B with a Rockwell R65C02 and NMOS machines) give it a capture and read its decoded instructions and register states; w65c02-rust reaches it through that test module. Moved here on 2026-11-25 (decisions page T3): w65c02-python fetched the decoder's source and built it in its own MIT repository before. It is a program with its own command line; it does not write the shared contract's manifest (`build.py` has the contract's `--version` and exit codes). ## Paths | Path under `$EMU_TOOLS_GPL` | What | | --- | --- | | `tools/6502decoder/build.py` | fetches 6502Decoder at the pin (GitHub's archive of the commit) into `upstream/` and builds: `python3 -I build.py` | | `tools/6502decoder/build/decode6502` | the program (git-ignored); its `--help` lists its options (the consumers use `--phi2= --mem=00F --machine=... [--cpu=r65c02] -a -h -i -y [-s -Y] CAPTURE`) | | `tools/6502decoder/build/build-info.json` | the pin and options | | `tools/6502decoder/tests/smoke.py` | the smoke test | ## The build As w65c02-python's `scripts/build_tools.py --only decoder` built it: `gcc -O2 -D_GNU_SOURCE` of `src/main.c memory.c em_6502.c em_65816.c em_6800.c em_scmp.c profiler.c profiler_instr.c profiler_block.c profiler_call.c tube_decode.c musl_tsearch.c symbols.c`, with libm. A build already present is kept; nothing is deleted. ## What it measures The decoder models the CPU and memory and checks every later sample of a capture against its prediction, so its output says which instructions ran, with their cycle counts and the register state after each, and which predictions failed. **Every output is OBSERVED** (6502Decoder at the pin): a program's reading of a hardware capture, whose CPU model was tuned on those captures; the captures themselves are the hardware evidence (sources.md: no licence statement, fetched as evidence, never committed). ## Upstream, licence and pin - **6502Decoder** by David Banks (hoglet67), , **GPL-3.0** (its `LICENSE.txt`), pinned at `c32dd60091493558e06e1c682dbea50b904a9fdc` (2026-10-22). Checked against `emulator-lineage/docs/sources.md` (`decode6502`: closed box only). - **`build.py`:** ours (alewman), GPL-3.0-or-later here; its step was first published under MIT in w65c02-python (`../../notices/MIT-emulator-family.txt`). - 6502Decoder is not committed here. If the built program is ever shared, its source at the pin and this folder go with it.