program

package
v0.0.0-...-6b8dc72 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2018 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inst

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

An Inst represents an assembler instruction.

func (*Inst) Comment

func (i *Inst) Comment() string

Comment returns the original GNU assembler instruction string, if it cannot be transformed into Go assembly. Otherwise it returns an empty string.

func (*Inst) String

func (i *Inst) String() string

String returns a string representation of the instruction.

type Program

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

A Program represents an assembler program.

func New

func New() *Program

New returns a new Program.

func (*Program) AddBytes

func (p *Program) AddBytes(b []string)

AddBytes adds opcodes to a latest instruction.

func (*Program) AddInst

func (p *Program) AddInst(addr, op, args string, bytes []string)

AddInst adds an instruction to the program.

func (*Program) Instrs

func (p *Program) Instrs() []*Inst

Instrs returns a slice of instructions the program contains.

func (*Program) Label

func (p *Program) Label(i *Inst) string

Label returns a label for an instruction, if there are any jumps or calls referencing it. Otherwise it returns an empty string.

Jump to

Keyboard shortcuts

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