asm

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Label  string
	Instrs []*Instr

	Block *ir.Block
}

type Emitter

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

func NewEmitter

func NewEmitter(out io.Writer) *Emitter

func (*Emitter) Func

func (emit *Emitter) Func(fn *Func)

type Fmt

type Fmt interface {
	Template() string
	Vars(val *ir.Value) []*Var
}

type Func

type Func struct {
	Comment string
	Label   string

	Globals []*Global
	Blocks  []*Block
	Func    *ir.Func
}

type Global

type Global struct {
	Section Section
	Comment string
	Label   string
	Strings []string
	Value   *ir.Value
}

type Instr

type Instr struct {
	Op     Op
	Args   []*Var
	Indent bool
}

type Op

type Op interface {
	Asm() string
	Fmt() Fmt
	IsMove() bool
	IsCall() bool
}

type Program

type Program struct {
	Pkg   *ir.Package
	Funcs []Func
}

type Section

type Section string
const (
	Code Section = "code"
	Data Section = "data"
	Bss  Section = "bss"
)

type Var

type Var struct {
	String string
	Value  *ir.Value
	Block  *ir.Block
}

Jump to

Keyboard shortcuts

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