NMOS 6510 illegal-opcode toolkit: a standalone 6510 -> raw-P-Code lifter + pure-Python P-Code VM, and a 6510 Ghidra/pypcode SLEIGH processor module.
Project description
deity-informant
A 6510 illegal-opcode toolkit: a standalone 6510 -> raw-P-Code lifter + pure-Python P-Code VM, and a 6510 Ghidra/pypcode SLEIGH processor module. All 105 documented NMOS 6510 illegal opcodes are first-class. No runtime dependency on py65 or Ghidra.
Why
Working on C64 code requires the NMOS 6510 illegal opcodes, and no existing backend handles them correctly:
- Real playroutines/demos use illegals as load-bearing instructions (A Mind Is Born runs
SRE; Automatas runsSBX/SAX/LAX/ANC/ALR). - Stock Ghidra's 6502 SLEIGH spec (and pypcode, which vendors it verbatim) defines zero illegals and has no catch-all — every illegal is a
BadDataError, so it cannot even disassemble such code, let alone decompile it. - Ghidra's decompiler only consumes P-Code from a compiled SLEIGH spec, so Python-generated P-Code cannot be injected — a SLEIGH language extension is the only way to make the decompiler illegal-aware.
- py65 is not a valid execution reference: it stubs the RMW illegals (
SLO/RLA/SRE/RRA/DCP/ISC,LAS/ANE/SH*) asinst_not_implemented— a 2-byte, 0-cycle skip, silently wrong on real code. - The known community 6510 Ghidra fork adds illegal disassembly only, with uncertain P-Code semantics — not trustworthy for decompilation or execution.
- deity-informant supplies both missing pieces: a compiled 6510 SLEIGH module (illegal-aware Ghidra/pypcode decompilation) and a hardware-validated lifter + VM (byte-exact vs sidplayfp) executing all 105 illegals.
Two products
- standalone lifter + VM —
lift(6510 -> raw P-Code), thePcodeVMinterpreter, and therun_sub/run_irq/run_irq_drivendrivers. Pure Python, no Ghidra, no py65. 6510SLEIGH module (ghidra/6510/) — stock 6502 legal spec + generated6510_illegal.sincthat makes Ghidra's disassembler and decompiler, and pypcode, illegal-aware. Language id6510:LE:16:default.
Install
pip install deity-informant # core, no deps
pip install deity-informant[oracle] # + py65 (legal-opcode differential oracle)
pip install deity-informant[ghidra] # + pypcode (SLEIGH build / lift backend)
pip install deity-informant[dev] # test + lint tooling
CLI
Console script deity-informant:
deity-informant disasm IMAGE [--org ADDR] [--start ADDR] [--count N] # 6510 disassembly (illegal-aware)
deity-informant pcode IMAGE --at ADDR [--org ADDR] # raw P-Code for one instruction
deity-informant run IMAGE --init ADDR [--play ADDR --frames N] # execute in PcodeVM, dump $D400.. grid
deity-informant emit-sleigh [-o DIR] [--magic 0xEE] # build/install the 6510 SLEIGH module
Python API
from deity_informant import lift, PcodeVM, run_sub
insn = lift(mem, pc) # {"ops", "len", "cyc", "pen", "ctrl"}
vm = PcodeVM(mem); run_sub(vm, entry, {}, lift) # execute a subroutine to its RTS
Use with Ghidra
python ghidra/6510/build.py --install "$GHIDRA_INSTALL_DIR/Ghidra/Processors/6510/data/languages"
Compiles 6510.sla, resolving the stock 6502.slaspec + SLEIGH compiler from $GHIDRA_INSTALL_DIR (or a pypcode install). Restart Ghidra, import the C64 image as Raw Binary language 6510:LE:16:default at base $0000; illegals now decode instead of BadData. Full steps: docs/ghidra.md.
Illegal opcodes
All 105 documented NMOS 6510 illegals lifted as genuine P-Code (not stubs), semantics/cycles per "No More Secrets — NMOS 6510 Unintended Opcodes" (csdb.dk/release/?id=258111). Full table: docs/illegal-opcodes.md.
Docs
- docs/design.md — architecture (lifter + VM, SLEIGH module, raw vs high P-Code, cycle layer).
- docs/illegal-opcodes.md — illegal-opcode reference.
- docs/nms-provenance.md — reference-source provenance.
- docs/ghidra.md — using the 6510 module with Ghidra / pypcode.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deity_informant-0.1.0.tar.gz.
File metadata
- Download URL: deity_informant-0.1.0.tar.gz
- Upload date:
- Size: 28.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4abc4bea2b5b432226622ff2a915c1b1561aa8f3f06984cbc841bc8c7de84666
|
|
| MD5 |
b70e5c1e81321bb243b09962b6d3ee77
|
|
| BLAKE2b-256 |
641c107054a1a22be3d7664e8f822f1a9c87a7fd7e06a7204c31cfaee5bf15f7
|
Provenance
The following attestation bundles were made for deity_informant-0.1.0.tar.gz:
Publisher:
publish.yml on anarkiwi/deity-informant
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
deity_informant-0.1.0.tar.gz -
Subject digest:
4abc4bea2b5b432226622ff2a915c1b1561aa8f3f06984cbc841bc8c7de84666 - Sigstore transparency entry: 2146858419
- Sigstore integration time:
-
Permalink:
anarkiwi/deity-informant@9ba1a87f488ceb7f21d7f9372ce1def619a771a8 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/anarkiwi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9ba1a87f488ceb7f21d7f9372ce1def619a771a8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file deity_informant-0.1.0-py3-none-any.whl.
File metadata
- Download URL: deity_informant-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55ad010d0ca4a64e947f859325676da63de14e8e602daf6abcf11c01c637b575
|
|
| MD5 |
834f37fe2542f68c739cfa7051cf1fe6
|
|
| BLAKE2b-256 |
a3a41ab86ad3ee2f9e62ca8ab58f6cf5dca78d49d13a21e89790183da9b61bbe
|
Provenance
The following attestation bundles were made for deity_informant-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on anarkiwi/deity-informant
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
deity_informant-0.1.0-py3-none-any.whl -
Subject digest:
55ad010d0ca4a64e947f859325676da63de14e8e602daf6abcf11c01c637b575 - Sigstore transparency entry: 2146858795
- Sigstore integration time:
-
Permalink:
anarkiwi/deity-informant@9ba1a87f488ceb7f21d7f9372ce1def619a771a8 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/anarkiwi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9ba1a87f488ceb7f21d7f9372ce1def619a771a8 -
Trigger Event:
push
-
Statement type: