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.0.tar.gz (20.3 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.0-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jennings-0.1.0.tar.gz
  • Upload date:
  • Size: 20.3 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.0.tar.gz
Algorithm Hash digest
SHA256 19c7e4d3ede3167ec5cddb0975db62abe8d1cc1b3bfeb8196e1a5a57fde96164
MD5 23c8e8c304c2e8d74cbe2f7ee12607a9
BLAKE2b-256 982f58d4717d5d17975088dc75d8a4a4efadcb0520f275b753a5cb1d6d5dbcd6

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: jennings-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.5 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8149ddf4a1dec9624fd1bffd09d6d45ac4488485931a0fb2d79afb49657a7ff2
MD5 34dd9e90ea595709e018a76ae1406b37
BLAKE2b-256 e9cd277698cfa34a4d3df729cfe72d5fdf89523b89ae31fa2a6532034e76e989

See more details on using hashes here.

Provenance

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