retroasm is a modern assembler for retro computer systems that compiles assembly language into machine code for classic hardware platforms.
- 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
| System | Architecture | Assemblers | Status |
|---|---|---|---|
| NES | 6502 | asm6, ca65, nesasm | Stable |
Option 1: Download a binary from Releases
Option 2: Install from source:
go install github.com/retroenv/retroasm/cmd/retroasm@latestAssemble a program:
retroasm -o game.nes program.asmWith ca65-style configuration:
retroasm -c memory.cfg -o game.nes main.asmusage: retroasm [options] <file to assemble>
-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")
retroasm can be used as a Go library for integrating assembly into compilers and code generators:
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/ for complete examples.
- Linux: 2.6.32+
- Windows: 10+
- macOS: 10.15 Catalina+
This project is licensed under the MIT License - see the LICENSE file for details.