https://github.com/retroenv/retroasm
Modern Assembler for Retro Computer Systems
https://github.com/retroenv/retroasm
Last synced: 5 months ago
JSON representation
Modern Assembler for Retro Computer Systems
- Host: GitHub
- URL: https://github.com/retroenv/retroasm
- Owner: retroenv
- License: apache-2.0
- Created: 2023-12-15T17:26:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-11-07T21:54:25.000Z (7 months ago)
- Last Synced: 2025-11-07T23:28:32.303Z (7 months ago)
- Language: Go
- Homepage:
- Size: 172 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/funding.yml
- License: LICENSE
Awesome Lists containing this project
README
# retroasm - an assembler for retro computer systems
[](https://github.com/retroenv/retroasm/actions)
[](https://pkg.go.dev/github.com/retroenv/retroasm)
[](https://goreportcard.com/report/github.com/retroenv/retroasm)
[](https://codecov.io/gh/retroenv/retroasm)
retroasm is a modern assembler for retro computer systems that compiles assembly language into machine code for classic hardware platforms.
## Features
* **Multi-Format Support** - Compatible with asm6, ca65, and nesasm assembly syntax
* **Library API** - Use as a Go library for compiler integration and code generation
* **AST-based Assembly** - Direct AST input for programmatic assembly
* **Configuration Files** - ca65-style configuration for custom memory layouts
* **Modern Implementation** - Fast, reliable Go codebase with comprehensive tests
## Supported Systems
| System | Architecture | Assemblers | Status |
|--------|-------------|------------|--------|
| **NES** | 6502 | asm6, ca65, nesasm | Stable |
## Quick Start
### Installation
**Option 1:** Download a binary from [Releases](https://github.com/retroenv/retroasm/releases)
**Option 2:** Install from source:
```bash
go install github.com/retroenv/retroasm/cmd/retroasm@latest
```
### Basic Usage
Assemble a program:
```bash
retroasm -o game.nes program.asm
```
With ca65-style configuration:
```bash
retroasm -c memory.cfg -o game.nes main.asm
```
### Command-Line Options
```
usage: retroasm [options]
-c string
assembler config file (ca65 compatible)
-cpu string
target CPU architecture: 6502 (default "6502")
-debug
enable debug logging with detailed output
-o string
output ROM file name (required)
-q perform operations quietly (minimal output)
-system string
target system: nes (default "nes")
```
## Library Usage
retroasm can be used as a Go library for integrating assembly into compilers and code generators:
```go
import "github.com/retroenv/retroasm/pkg/retroasm"
assembler := retroasm.New()
// Assemble from text
output, err := assembler.AssembleText(ctx, input)
// Or assemble from AST for code generation
output, err := assembler.AssembleAST(ctx, astInput)
```
See [examples/](examples/) for complete examples.
## System Requirements
* **Linux:** 2.6.32+
* **Windows:** 10+
* **macOS:** 10.15 Catalina+
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.