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

ch3.4: fix swap

This commit is contained in:
chai2010 2018-08-27 11:19:05 +08:00
parent 852e6026b3
commit ace223d1d5

View File

@ -278,8 +278,8 @@ Go语言中函数调用是一个复杂的问题因为Go函数不仅仅要了
```
// func Swap(a, b int) (int, int)
TEXT ·Swap(SB), $0-32
MOVQ a-8*2(SP), AX // a
MOVQ b-8*1(SP), BX // b
MOVQ a+0(FP), AX // AX = a
MOVQ b+8(FP), BX // BX = b
SWAP(AX, BX, CX) // AX, BX = b, a