Re:A fundamental introduction to x86 assembly programming
by acdimalev on Sunday May 15, 2016 @03:29AM
(#11699902)
And once you start reading the docs on the more efficient but far less consistent 64-bit calling convention, you may find yourself choosing words to describe it other than the "improved" that this author opted for.
[ Parent
| on HN ]
Re:A fundamental introduction to x86 assembly programming
by aktau on Sunday May 15, 2016 @10:41AM
(#11701067)
I take it you're a fan of the plan9 calling convention (f. ex.: all arguments and return value(s) are on the stack)?
Curiously, it doesn't actually appear all that ineffecient. Go uses it AFAIK. I wonder whether anyone has studied it. I also wonder whether gccgo uses that convention or defaults to SysV x64.
Re:A fundamental introduction to x86 assembly programming
by acdimalev on Monday May 16, 2016 @05:25PM
(#11709760)
I didn't know it was a System V thing. Thank you for cluing me in!
I don't think of it in terms of like-vs-dislike. My observation is that it's a difficult thing to get right without a compiler, and thus avoided for introductory material.
As far as I am aware, storing values in a register requires fewer instructions. However, I have never personally confirmed the performance difference of this calling convention.
Handling of all calling conventions is one of the many things that I am personally much happier leaving up to GCC and LLVM in practice.