A minimal 6502 assembler system for bootstrapping research. This implements the historical workflow of writing assembly on paper, converting to punch cards, then feeding to a machine assembler.
Note: This project requires uv for Python dependency management. Install it from https://docs.astral.sh/uv/
Two assemblers that produce identical output:
- Python reference implementation (friendly format with comments)
- Hand-assembled 6502 assembler (punch card format, minimal parsing)
The 6502 assembler can assemble itself, demonstrating a complete bootstrap process.
make all # Build and test everything
make run-counter # Run example program
make test-bootstrap # Test self-assemblyAssembly source supports two formats:
- Friendly format: comments, flexible whitespace, human readable
- Punch card format: minimal, machine readable, no comments
Data definition:
"TEXT"- string literals#DEADBEEF- hex data
Relocation for bootstrap:
!1E00- set relocation offset@0200- set effective address
simple_asm.py- Python reference assemblersimple_6502_emulator.py- 6502 CPU emulatorpunch_card_formatter.py- Format converterassembler_source.asm- The 6502 assembler sourceexample_*.asm- Test programs
This is research into early computing constraints and self-hosting compilers, not a practical development tool.