The assembly documentation in golang.org/doc/asm.html is accurate in this
respect, I believe. By "in this respect" I mean both what the assembler
accepts and interprets and what is intended.

The compiler output for -S has not been brought to the same standard and
may well use SP when FP would be more correct.

-rob


On Fri, Mar 24, 2017 at 11:27 AM, Caleb Spare <cesp...@gmail.com> wrote:

> I hope someone else knows. I've also been confused by the difference
> in the offsets in the past, and when I asked about it I was told that
> the output of go tool compile -S is just different than what you write
> by hand. Unfortunately I don't think that the -S output is documented.
> You might have to read source to figure it out.
>
> On Fri, Mar 24, 2017 at 4:39 AM,  <nsa...@gmail.com> wrote:
> > Should not the first parameter of a function be passed in 0(FP)? See this
> > example assembly (produced by go tool compile -S), where 0(FP) gets
> skipped
> > over and the argument is apparently loaded from 8(FP):
> >
> > https://drive.google.com/open?id=0B63rdrZtwIE9dHZqWmoxdXIzNnc
> >
> > Another confusing thing is that conditional jumps are sometimes invoked
> with
> > two operands, see any of the 8 almost equal functions here:
> >
> > https://drive.google.com/open?id=0B63rdrZtwIE9R3M4cGxrSFhmT00
> >
> > (also, the first parameter is even further from 0(FP) now).
> >
> >
> > Regards,
> > Neven
> >
> > --
> > 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.
>
> --
> 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.
>

-- 
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.

Reply via email to