func (l LabelRef) Asm() string {
	return string(l)
}
Asm returns an assembly syntax representation of l.
package operand
import (
	"fmt"
	"github.com/mmcloughlin/avo/reg"
)
type Op interface {
	Asm() string
}
type Symbol struct {
	Name   string
	Static bool  
}
func NewStaticSymbol(name string) Symbol {
	return Symbol{Name: name, Static: true}
}
func (s Symbol) String() string {
	n := s.Name
	if s.Static {
		n += "<>"
	}
	return n
}
type Mem struct {
	Symbol Symbol
	Disp   int
	Base   reg.Register
	Index  reg.Register
	Scale  uint8
}
func NewParamAddr(name string, offset int) Mem {
	return Mem{
		Symbol: Symbol{
			Name:   name,
			Static: false,
		},
		Disp: offset,
		Base: reg.FramePointer,
	}
}
func NewStackAddr(offset int) Mem {
	return Mem{
		Disp: offset,
		Base: reg.StackPointer,
	}
}
func NewDataAddr(sym Symbol, offset int) Mem {
	return Mem{
		Symbol: sym,
		Disp:   offset,
		Base:   reg.StaticBase,
	}
}
func (m Mem) Offset(idx int) Mem {
	a := m
	a.Disp += idx
	return a
}
func (m Mem) Idx(r reg.Register, s uint8) Mem {
	a := m
	a.Index = r
	a.Scale = s
	return a
}
func (m Mem) Asm() string {
	a := m.Symbol.String()
	if a != "" {
		a += fmt.Sprintf("%+d", m.Disp)
	} else if m.Disp != 0 {
		a += fmt.Sprintf("%d", m.Disp)
	}
	if m.Base != nil {
		a += fmt.Sprintf("(%s)", m.Base.Asm())
	}
	if m.Index != nil && m.Scale != 0 {
		a += fmt.Sprintf("(%s*%d)", m.Index.Asm(), m.Scale)
	}
	return a
}
type Rel int32
func (r Rel) Asm() string {
	return fmt.Sprintf(".%+d", r)
}
type LabelRef string