which registers must be preserved for the caller

Mason slash.tmp@free.fr
Mon Aug 21 15:21:00 GMT 2017


On 19/08/2017 09:10, Andrew Makhorin wrote:

> The document "System V ABI: Intel386 Architecture Processor Supplement"
> says that contents of %ebx, %esi, and %edi must be preserved for the
> caller. Does GCC for 32-bit GNU/Linux and for 32-bit Cygwin conform to
> this ABI? If not, how to determine which registers are expected to be
> saved by calling C functions?

(NB: GCC supports dozens of platforms)

You seem to be interested in the x86 "cdecl" ABI.

https://en.wikipedia.org/wiki/X86_calling_conventions#cdecl

I think the SysV and Microsoft ABI are close, but may differ
over details, e.g. returning structs.

Regards.



More information about the Gcc-help mailing list