Re:32-bit x86 Position Independent Code – It's That Bad
by icebraining on Wednesday April 15, 2015 @11:41AM
(#9381686)
"The calling convention of the System V AMD64 ABI is followed on Solaris, Linux, FreeBSD, Mac OS X, and other UNIX-like or POSIX-compliant operating systems."
http://en.wikipedia.org/wiki/X86_calling_conventions#System_...
Re:32-bit x86 Position Independent Code – It's That Bad
by gwu78 on Wednesday April 15, 2015 @10:21PM
(#9385552)
int80h.org
Anyway, the original question was _why_ does Linux use registers to pass arguments. Arguments can be passed on the stack, but Linux chose to use registers. Why this choice over the other option?
Do you know the answer?
Just curious.
Re:32-bit x86 Position Independent Code – It's That Bad
by icebraining on Thursday April 16, 2015 @03:58AM
(#9386501)
It's because in theory, it's faster to copy the values to registers than to have to push them all to the stack and then have the callee pop them. At least that was the thought behind Microsoft's __fastcall, which was their original version of a calling convention using registers, though in that case it seems the benchmarks aren't conclusively in support of the theory.
Does Minix use that convention? How about BSD?