Skip to main content

py65-compatible 6502/6510 MPU, assembler, and disassembler with first-class NMOS illegal-opcode support.

Project description

jennings

A py65-compatible 6502/6510 MPU, assembler, and disassembler with first-class support for all 105 documented NMOS 6510 illegal opcodes. Drop-in for py65: change import py65… to import jennings….

Where py65 stubs the illegals (inst_not_implemented — a 0-cycle skip), jennings executes them byte- and cycle-exact via deity-informant's hardware-validated lift + PcodeVM engine, and its assembler/disassembler decode them as real mnemonics instead of ???.

Install

pip install jennings          # pulls deity-informant (pure-Python engine)
pip install jennings[dev]     # + test/lint tooling (pytest, black, pylint, py65)

Use

from jennings.devices.mpu6502 import MPU
from jennings.memory import ObservableMemory
from jennings.disassembler import Disassembler
from jennings.assembler import Assembler

mpu = MPU(memory=ObservableMemory())     # same API as py65.devices.mpu6502.MPU
mpu.memory[0:2] = [0xAF, 0x10]           # LAX $10 — an illegal py65 cannot run
mpu.step()                               # a, x <- mem[$10]; cycle-exact

Assembler(MPU()).assemble("SLO $20")     # [0x07, 0x20]
Disassembler(MPU()).instruction_at(pc)   # (len, "SLO $20")

Compatibility

Mirrors the py65 API surface used in practice: devices.mpu6502.MPU (.step/.reset/.irq/.nmi, a/x/y/sp/p/pc/memory/processorCycles, ByteAt/WordAt, disassemble/instruct/cycletime/extracycles), memory.ObservableMemory, disassembler.Disassembler, assembler.Assembler, utils.addressing.AddressParser.

Every legal opcode is validated byte-, flag-, and cycle-exact against py65 in CI; the illegals are validated by NMS decomposition and (via the engine) byte-exact against sidplayfp. See docs/design.md, docs/illegal-opcodes.md, and docs/migrating-from-py65.md.

Limitations

No BCD (decimal-mode ADC/SBC), matching the deity-informant engine and the C64 target domain (playroutines run CLD). py65.monitor is not reimplemented.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jennings-0.1.1.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jennings-0.1.1-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file jennings-0.1.1.tar.gz.

File metadata

  • Download URL: jennings-0.1.1.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for jennings-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fdc76021ac43bd76fd83b77bfa9efdcc98a2e0ec9112e333bca90602abde350f
MD5 e7af94572c75de8008152014c1cf68f1
BLAKE2b-256 7e71e09bbbd216f5c215342b6eb3bb78721ff8f261d5df1dcf4f4deee83a9fac

See more details on using hashes here.

Provenance

The following attestation bundles were made for jennings-0.1.1.tar.gz:

Publisher: publish.yml on anarkiwi/jennings

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jennings-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: jennings-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for jennings-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e7ebab85f07df7a131e75415bed5fb30c0eb8216174c3ff57a48ce9db32af3e0
MD5 c7ada4c30dd022dd2012322e9cc594fd
BLAKE2b-256 37d5c4eb5ac2834448abaf3e893381c34d531ebd6becb0e35774c8d1bfab0fbd

See more details on using hashes here.

Provenance

The following attestation bundles were made for jennings-0.1.1-py3-none-any.whl:

Publisher: publish.yml on anarkiwi/jennings

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page