Skip to content

retroenv/retroasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

retroasm - an assembler for retro computer systems

Build status go.dev reference Go Report Card codecov

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

Option 2: Install from source:

go install github.com/retroenv/retroasm/cmd/retroasm@latest

Basic Usage

Assemble a program:

retroasm -o game.nes program.asm

With ca65-style configuration:

retroasm -c memory.cfg -o game.nes main.asm

Command-Line Options

usage: 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")

Library Usage

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.

System Requirements

  • Linux: 2.6.32+
  • Windows: 10+
  • macOS: 10.15 Catalina+

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Modern Assembler for Retro Computer Systems

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published