Documentation
¶
Overview ¶
Package assembler implements the assembler functionality for retrocomputers.
The assembler converts assembly language source code into machine code for retro computer systems. It supports multiple assembly formats (asm6, ca65, nesasm) and follows a multi-stage pipeline architecture:
1. Parse AST nodes (text → AST or direct AST input) 2. Process macros and expand definitions 3. Evaluate expressions and resolve symbols 4. Update data sizes based on expressions 5. Assign memory addresses to instructions and data 6. Generate opcodes for target architecture 7. Write final output to memory segments
The assembler is designed for both library integration (AST-first) and CLI usage (text-based), providing flexible APIs for different use cases.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assembler ¶
type Assembler[T any] struct { // contains filtered or unexported fields }
Assembler is the assembler implementation for retro computer systems. It processes assembly language and converts it into machine code through a multi-stage pipeline. The generic type T represents the target architecture.
func (*Assembler[T]) Process ¶
Process processes assembly source code from a reader and assembles it into the output writer. This is the primary text-based API for CLI usage. For library integration with pre-parsed AST nodes, use ProcessAST instead.
func (*Assembler[T]) ProcessAST ¶
ProcessAST processes pre-parsed AST nodes and assembles them into the output writer. This is the primary AST-based API for library integration where AST nodes are already available. For text-based assembly from readers, use Process instead.