package main
|
|
import "fmt"
|
|
the function’s body is empty |
func add(x, y int64) int64
|
func main() {
fmt.Println(add(2, 3))
}
|
We declare the |
TEXT ·add(SB),$0-24
|
The |
MOVQ x+0(FP), BX
MOVQ y+8(FP), BP
|
The |
ADDQ BP, BX
|
The result is moved at address |
MOVQ BX, ret+16(FP)
|
The last instruction simply returns to the caller. |
RET
|
Next example: Hello.