Fixed memory location is a global variable. This only applies to 386, not amd64. This applies only to (SB) dereferences, not to any other (SP, FP, or standard register).
The text doesn't really say it, but it applies to LEAL as well as loads and stores. On Saturday, March 30, 2019 at 2:40:28 PM UTC-7, Neven Sajko wrote: > > The official documentation on using the Go assembly [0] says this: > > > When using the compiler and assembler's -dynlink or -shared modes, any > > load or store of a fixed memory location such as a global variable must > > be assumed to overwrite CX. Therefore, to be safe for use with these > > modes, assembly sources should typically avoid CX except between memory > > references. > > A couple unclear things are: what is a "fixed memory location"; and > does this apply to amd64 or just to 386? > > The text implies that a writer of 386 Go assembly code should assume > CX clobbered after dereferencing SB. But what about dereferencing FP, > SP, or a real register like AX or R10, does that also clobber CX? > > [0] https://golang.org/doc/asm > -- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.