build: add attributes argument to TEXT

Brings the TEXT() function signature closer to how the directive works
in assembly.

Also update almost all examples to use NOSPLIT.

Closes #11
This commit is contained in:
Michael McLoughlin
2019-01-06 20:04:51 -08:00
parent 76db5bb03f
commit 304c7425d2
25 changed files with 105 additions and 72 deletions

View File

@@ -5,7 +5,6 @@ package main
import (
"math"
. "github.com/mmcloughlin/avo/attr"
. "github.com/mmcloughlin/avo/build"
. "github.com/mmcloughlin/avo/operand"
)
@@ -21,7 +20,7 @@ func main() {
DATA(38, U8(0x66))
DATA(39, U8(0x77))
TEXT("DataAt", "func(i int) byte")
TEXT("DataAt", NOSPLIT, "func(i int) byte")
Doc("DataAt returns byte i in the 'bytes' global data section.")
i := Load(Param("i"), GP64())
ptr := Mem{Base: GP64()}