writer

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package writer implements common assembly file writing functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssemblerWriter

type AssemblerWriter interface {
	Write() error
}

AssemblerWriter defines a shared interface used by the different assembler compatibility packages. Their constructors need to return this shared interface, having them return the actual type instead of the interface results in compiler errors for the constructor variable that they are assigned to.

type Options

type Options struct {
	DirectivePrefix string // nesasm requires a space before a directive
	OffsetComments  bool
}

Options of the writer.

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

Writer implements common assembly file writing functionality.

func New

func New(app *program.Program, writer io.Writer, options Options) *Writer

New creates a new writer.

func (Writer) BundleDataWrites

func (w Writer) BundleDataWrites(data []byte, lineWriter lineWriterFunc) error

BundleDataWrites bundles writes of data bytes to print dataBytesPerLine bytes per line.

func (Writer) OutputAliasMap

func (w Writer) OutputAliasMap(aliases map[string]uint16) error

OutputAliasMap outputs an alias map, for constants or variables.

func (Writer) ProcessPRG

func (w Writer) ProcessPRG(bank *program.PRGBank, endIndex int) error

ProcessPRG processes the PRG segment and writes all code offsets, labels and their comments.

func (Writer) WriteCommentHeader

func (w Writer) WriteCommentHeader() error

WriteCommentHeader writes the CRC32 checksums and code base address as comments to the output.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL