doc: README for args example

Also started a README in the root examples directory.

Updates #14
This commit is contained in:
Michael McLoughlin
2019-01-01 15:46:42 -08:00
parent 4550badf58
commit 1b0ce66552
6 changed files with 137 additions and 0 deletions

View File

@@ -9,6 +9,11 @@ import (
func main() {
Package("github.com/mmcloughlin/avo/examples/args")
TEXT("Second", "func(x, y int32) int32")
y := Load(Param("y"), GP32v())
Store(y, ReturnIndex(0))
RET()
TEXT("StringLen", "func(s string) int")
strlen := Load(Param("s").Len(), GP64v())
Store(strlen, ReturnIndex(0))