assembler

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

Builder allows you to assemble a series of instructions.

func NewBuilder

func NewBuilder(archStr string, cacheSize int) (*Builder, error)

NewBuilder constructs an assembler for the given architecture.

func (*Builder) AddInstruction

func (b *Builder) AddInstruction(p *obj.Prog)

AddInstruction adds an instruction to the list of instructions to be assembled.

func (*Builder) Assemble

func (b *Builder) Assemble() []byte

Assemble generates the machine code from the given instructions.

func (*Builder) NewProg

func (b *Builder) NewProg() *obj.Prog

NewProg returns a new instruction structure.

func (*Builder) Root

func (b *Builder) Root() *obj.Prog

Root returns the first instruction.

Jump to

Keyboard shortcuts

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