parameter loading

This commit is contained in:
Michael McLoughlin
2018-12-08 20:14:51 -08:00
parent bbbf6399a1
commit 69ee0e39cb
9 changed files with 355 additions and 61 deletions

18
build/pseudo.go Normal file
View File

@@ -0,0 +1,18 @@
package build
import (
"github.com/mmcloughlin/avo/reg"
"github.com/mmcloughlin/avo/gotypes"
)
//go:generate avogen -output zmov.go mov
func (c *Context) Load(src gotypes.Component, dst reg.Register) {
b, err := src.Resolve()
if err != nil {
c.AddError(err)
return
}
c.mov(b.Addr, dst, int(gotypes.Sizes.Sizeof(b.Type)), int(dst.Bytes()), b.Type)
}