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.2.tar.gz (20.7 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.2-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jennings-0.1.2.tar.gz
  • Upload date:
  • Size: 20.7 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.2.tar.gz
Algorithm Hash digest
SHA256 2d6b64ce0db3eba5c6cbbad60cc8cc27998c56e82e009db958508d2040fc1971
MD5 b71df10c72e31e3db589b6f147780014
BLAKE2b-256 e28496aa7eec4d725fd5a623ca5be6b17c037d1037e2d1c1b2ad2eb6ec2dd4fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for jennings-0.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: jennings-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 16.7 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6c299def2187f9a6e63efbd8e67c0a48dc65a7b9596b4cae3662298b6619deda
MD5 303948e6cc905ce6e8e14847d244f39b
BLAKE2b-256 f0bff8ce7bca20159a25cfc12c122ce3223765728b050e27bc667240a44858cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for jennings-0.1.2-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