FAQ
Hi,

To learn continuous stack in golang , i wrote a test program, like this:
package main

func f() int {
     sum := 0
     elements := make([]int, 1000)
     for _, e := range elements {
         sum += e
     }
     return sum
}

func main() {
     f()
}

check the compile code generated by go tool:

"".f t=1 size=160 value=0 args=0x8 locals=0x1f40
     0x0000 00000 (test.go:3) TEXT "".f(SB), $8000-8
     0x0000 00000 (test.go:3) MOVQ (TLS), CX
     0x0009 00009 (test.go:3) MOVQ 16(CX), SI
     0x000d 00013 (test.go:3) CMPQ SI, $-1314
     0x0014 00020 (test.go:3) JEQ 138
     .....
     0x008a 00138 (test.go:3) CALL runtime.morestack_noctxt(SB)
     .....

i am so confused by the CMPQ SI, $-1314, what does -1314 mean?

tx for replying.


--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 3 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 11, '15 at 1:22a
activeNov 12, '15 at 3:49a
posts3
users2
websitegolang.org

2 users in discussion

Kai Ding: 2 posts Ian Lance Taylor: 1 post

People

Translate

site design / logo © 2022 Grokbase