mirror of
https://github.com/golang/go
synced 2024-11-26 08:07:57 -07:00
The Go programming language
bbccfddb84
func add() int { var a int a += 10 a += 20 a += 30 a -= 10 a -= 20 a -= 30 return a } before --- prog list "add" --- 0000 (/home/dfc/src/add.go:5) TEXT add+0(SB),$0-4 0001 (/home/dfc/src/add.go:6) MOVW $0,R2 0002 (/home/dfc/src/add.go:7) MOVW $10,R0 0003 (/home/dfc/src/add.go:7) ADD R0,R2,R1 0004 (/home/dfc/src/add.go:8) MOVW $20,R0 0005 (/home/dfc/src/add.go:8) ADD R0,R1 0006 (/home/dfc/src/add.go:9) MOVW $30,R0 0007 (/home/dfc/src/add.go:9) ADD R0,R1 0008 (/home/dfc/src/add.go:10) MOVW $10,R0 0009 (/home/dfc/src/add.go:10) SUB R0,R1 0010 (/home/dfc/src/add.go:11) MOVW $20,R0 0011 (/home/dfc/src/add.go:11) SUB R0,R1 0012 (/home/dfc/src/add.go:12) MOVW $30,R0 0013 (/home/dfc/src/add.go:12) SUB R0,R1,R2 0014 (/home/dfc/src/add.go:12) MOVW R2,R0 0015 (/home/dfc/src/add.go:13) MOVW R2,R1 0016 (/home/dfc/src/add.go:13) MOVW R2,.noname+0(FP) 0017 (/home/dfc/src/add.go:13) RET , after --- prog list "add" --- 0000 (/home/dfc/src/add.go:5) TEXT add+0(SB),$0-4 0001 (/home/dfc/src/add.go:6) MOVW $0,R0 0002 (/home/dfc/src/add.go:7) ADD $10,R0 0003 (/home/dfc/src/add.go:8) ADD $20,R0 0004 (/home/dfc/src/add.go:9) ADD $30,R0 0005 (/home/dfc/src/add.go:10) SUB $10,R0 0006 (/home/dfc/src/add.go:11) SUB $20,R0 0007 (/home/dfc/src/add.go:12) SUB $30,R0,R2 0008 (/home/dfc/src/add.go:13) MOVW R2,R0 0009 (/home/dfc/src/add.go:13) MOVW R2,.noname+0(FP) 0010 (/home/dfc/src/add.go:13) RET , R=rsc, minux.ma, remyoudompheng CC=golang-dev https://golang.org/cl/6584056 |
||
---|---|---|
api | ||
doc | ||
include | ||
lib | ||
misc | ||
src | ||
test | ||
.hgignore | ||
.hgtags | ||
AUTHORS | ||
CONTRIBUTORS | ||
favicon.ico | ||
LICENSE | ||
PATENTS | ||
README | ||
robots.txt |
This is the source code repository for the Go programming language. For documentation about how to install and use Go, visit http://golang.org/ or load doc/install.html in your web browser. After installing Go, you can view a nicely formatted doc/install.html by running godoc --http=:6060 and then visiting http://localhost:6060/doc/install.html. Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file. -- Binary Distribution Notes If you have just untarred a binary Go distribution, you need to set the environment variable $GOROOT to the full path of the go directory (the one containing this README). You can omit the variable if you unpack it into /usr/local/go, or if you rebuild from sources by running all.bash (see doc/install.html). You should also add the Go binary directory $GOROOT/bin to your shell's path. For example, if you extracted the tar file into $HOME/go, you might put the following in your .profile: export GOROOT=$HOME/go export PATH=$PATH:$GOROOT/bin See doc/install.html for more details.