A Python assembler and disassembler for the Signetics 2650 microprocessor
Project description
pyvacs
A Python assembler and disassembler for the Signetics/Philips 2650 microprocessor family.
pyvacs is a clean-room Python reimplementation of the classic
VACS 1.24 assembler by A.C. Verschueren and
W.H. Taphoorn (later ported to Windows by D.D. Spreen). It targets the same
2650 instruction set and opcode encodings, and adds a round-trip-safe
disassembler so you can take a ROM image apart and put it back together
byte-for-byte.
The 2650 powered consoles such as the Emerson Arcadia 2001 and its international clones — including the Australian-market Fountain Force 2 — as well as the Interton VC 4000 and a number of arcade boards.
Features
- Full 2650 instruction set with every addressing mode (inherent, register, immediate, relative, absolute, zero-page branch, and absolute-indexed with auto-increment/decrement).
- Two-pass assembler with labels,
EQU/SET, expressions, and theORG,DB/BYTE,DW/WORD,DD,DS,DBX,DBFILLdirectives. - VACS-style number literals (
$1F,%1010,&17,0FFh,1010b) and a full expression evaluator (+ - * / MOD, shifts, bitwise, comparisons,HI/LO,$location counter, character constants). - Predefined condition symbols (
eq,gt,lt,un, plusz/p/n). - Round-trip-safe disassembler: any byte it cannot decode as a faithful
instruction is emitted as a
db, guaranteeing reassembly reproduces the original bytes. - Two command-line tools and a small importable API.
Install
pip install pyvacs
Or from a checkout:
pip install -e ".[dev]"
Command line
Assemble source to a binary:
pyvacs-asm program.asm -o program.bin
Disassemble a binary (with an address/hex listing):
pyvacs-dasm program.bin --listing
Disassemble to reassemblable source loaded at a given address:
pyvacs-dasm game.bin --origin 0x0000 -o game.asm
Library
from pyvacs import assemble, to_source
binary = assemble("""
org $0000
start: eorz r0
bctr,un start
end start
""").to_bytes()
source = to_source(binary, origin=0) # round-trips back to `binary`
Example
org $0000
start: eorz r0 ; clear register 0
bctr,un go
retc,un
go: lodi,r0 $00
loda,r0 msg,r1,+ ; load, auto-increment index r1
comi,r0 $ff
bcfr,eq done
bcta,un go
done: nop
msg: db $21,$1e,$ff
end start
Development
pip install -e ".[dev]"
pytest # tests + coverage (>85% enforced)
black --check src tests
pylint src/pyvacs
ROM test fixtures
The test-suite round-trips real Fountain Force 2 / Arcadia 2001 cartridge
ROMs through the disassembler and assembler. The ROM images are not checked
into this repository: on first run the tests download the
TOSEC Arcadia 2001 set
from the Internet Archive and cache it under tests/.romcache/ (git-ignored).
If the download is unavailable the ROM-dependent tests skip automatically, so
the core suite still runs offline. Set PYVACS_SKIP_ROM_TESTS=1 to skip them
explicitly.
License
Apache License 2.0. See LICENSE.
The 2650 instruction encodings are derived by inspection of the public-domain VACS sources; no VACS code is included here.
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 pyvacs-0.1.0.tar.gz.
File metadata
- Download URL: pyvacs-0.1.0.tar.gz
- Upload date:
- Size: 35.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b8fe70a9fd033a64410d44c45c9396ec2e60d4e09ade8faa4406c518178daeb
|
|
| MD5 |
6139aeba4688fccfb4a2843ae39aad5e
|
|
| BLAKE2b-256 |
16361a9f164c06c6991109643306f0c94fed9c566f53edfad094d9462994f663
|
Provenance
The following attestation bundles were made for pyvacs-0.1.0.tar.gz:
Publisher:
publish.yml on anarkiwi/pyvacs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyvacs-0.1.0.tar.gz -
Subject digest:
0b8fe70a9fd033a64410d44c45c9396ec2e60d4e09ade8faa4406c518178daeb - Sigstore transparency entry: 1869588709
- Sigstore integration time:
-
Permalink:
anarkiwi/pyvacs@195fdd46e56ed0568ec29c928bff820cc62ff486 -
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@195fdd46e56ed0568ec29c928bff820cc62ff486 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyvacs-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pyvacs-0.1.0-py3-none-any.whl
- Upload date:
- Size: 26.4 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 |
30f3c08531e4a738e92475f5235a496d95ac4f81bdeb6eda920d5d5364dcdb60
|
|
| MD5 |
8c93183cc0a31e02dca7ed9c18ca1716
|
|
| BLAKE2b-256 |
b3a504cf668a8b129d8cbbe460fdf572807be8c16cbc41b36753ecb91292f8f4
|
Provenance
The following attestation bundles were made for pyvacs-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on anarkiwi/pyvacs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyvacs-0.1.0-py3-none-any.whl -
Subject digest:
30f3c08531e4a738e92475f5235a496d95ac4f81bdeb6eda920d5d5364dcdb60 - Sigstore transparency entry: 1869588813
- Sigstore integration time:
-
Permalink:
anarkiwi/pyvacs@195fdd46e56ed0568ec29c928bff820cc62ff486 -
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@195fdd46e56ed0568ec29c928bff820cc62ff486 -
Trigger Event:
release
-
Statement type: