https://github.com/zserge/asmy
A minimal Python-based assembler for multiple architectures.
https://github.com/zserge/asmy
Last synced: 3 months ago
JSON representation
A minimal Python-based assembler for multiple architectures.
- Host: GitHub
- URL: https://github.com/zserge/asmy
- Owner: zserge
- License: mit
- Created: 2025-04-21T17:45:32.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-25T16:23:23.000Z (about 1 year ago)
- Last Synced: 2025-12-28T02:11:48.179Z (5 months ago)
- Language: Python
- Size: 37.1 KB
- Stars: 15
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Asmy - Python Multi-Architecture Assembler
[](https://pypi.org/project/asmy/)
[](https://github.com/zserge/asmy/actions)
[](LICENSE)
[](https://pypi.org/project/asmy/)
A minimal Python-based assembler for multiple architectures.
## Features
- Pythonic syntax for assembly
- Label support with fixups
- Little/big-endian aware
- ROM generation with .org/.db/.dw
- Bring your own macros and metaprogramming with Python
Supported architectures:
- [x] [CHIP-8](https://en.wikipedia.org/wiki/CHIP-8)
- [x] [Little Man Computer (LMC)](https://en.wikipedia.org/wiki/Little_man_computer)
- [x] [GMC-4](https://en.wikipedia.org/wiki/GMC-4)
- [x] [6502](https://en.wikipedia.org/wiki/MOS_Technology_6502)
- [x] [SWEET16](https://en.wikipedia.org/wiki/SWEET16)
## Example (CHIP-8)
```python
from asmy.chip8 import *
org(0x200)
with label("start"):
ld(V0, 0)
with label("loop"):
add(V0, 1)
cls()
jp("loop")
# Print resulting ROM in hex
print(asm.finalize().hex(" ", 2))
```
To try this example locally:
```bash
PYTHONPATH=. python3 examples/chip8_loop.py
```
## Installation
```bash
pip install asmy
```