gotypes: saving progress (temporarily broken tests)

This commit is contained in:
Michael McLoughlin
2018-12-07 18:37:42 -08:00
parent c86ef5ecae
commit bbbf6399a1
4 changed files with 187 additions and 4 deletions

View File

@@ -31,6 +31,19 @@ type Mem struct {
Scale uint8
}
// NewParamAddr is a convenience to build a Mem operand pointing to a function
// parameter, which is a named offset from the frame pointer pseudo register.
func NewParamAddr(name string, offset int) Mem {
return Mem{
Symbol: Symbol{
Name: name,
Static: false,
},
Disp: offset,
Base: reg.FramePointer,
}
}
func (m Mem) Asm() string {
a := m.Symbol.String()
if m.Disp != 0 {