1
0
mirror of https://github.com/chai2010/advanced-go-programming-book.git synced 2025-05-24 04:22:22 +00:00

Merge pull request #522 from damonchen/patch-1

fix: compile error of pkg_amd64.s
This commit is contained in:
Xargin 2020-10-11 12:03:04 +08:00 committed by GitHub
commit e04e007edb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,7 +72,9 @@ var Id int
我们将完整的汇编代码放到pkg_amd64.s文件中 我们将完整的汇编代码放到pkg_amd64.s文件中
``` ```
GLOBL ·Id(SB),$8 #include "textflag.h"
GLOBL ·Id(SB),NOPTR,$8
DATA ·Id+0(SB)/1,$0x37 DATA ·Id+0(SB)/1,$0x37
DATA ·Id+1(SB)/1,$0x25 DATA ·Id+1(SB)/1,$0x25
@ -98,6 +100,7 @@ func main() {
} }
``` ```
对于Go包的用户来说用Go汇编语言或Go语言实现并无任何区别。 对于Go包的用户来说用Go汇编语言或Go语言实现并无任何区别。
## 3.1.3 定义字符串变量 ## 3.1.3 定义字符串变量