I've been trying out Go's assembler, but I can't seem to get the most basic 
program to compile. Following the example on https://goroutines.com/asm, 
which introduces go's assembler through an example of an add function on 
amd64, I get the compile error:

# github.com/smasher164/asmtest
../../work/src/github.com/smasher164/asmtest/add_amd64.s:7: unexpected EOF
asm: assembly of ../../work/src/github.com/smasher164/asmtest/add_amd64.s 
failed

The relevant source for main.go:

// add.go
package main

import "fmt"

func add(x, y int64) int64

func main() {
fmt.Println(add(2, 3))
}

And for add_amd64.s:

#include "textflag.h"
TEXT ·add(SB),NOSPLIT,$0
MOVQ x+0(FP), BX
MOVQ y+8(FP), BP
ADDQ BP, BX
MOVQ BX, ret+16(FP)
RET

I get the the same exact compile error of unexpected EOF regardless of 
which example I try. In fact, trying the functions from the standard 
library like src/math/remainder_amd64.s gets me the same result. I am 
starting to wonder if there is a naming problem, or perhaps with my 
installation (go1.7.1 darwin/amd64). I appreciate anyone's help, thank you!

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to