Re: "C" calling convention on x86
From: Dave Thompson (spamtrap_at_crayne.org)
Date: 09/20/04
- Next message: Tim Roberts : "Re: Writing simple profiler"
- Previous message: Tim Roberts : "Re: A Register Preservation Macro for Procedures"
- In reply to: Mike : "Re: "C" calling convention on x86"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 20 Sep 2004 05:38:55 +0000 (UTC)
On Mon, 13 Sep 2004 11:10:03 +0000 (UTC), Mike <spamtrap@crayne.org>
wrote:
> >>- 4 byte floating point no's pushed onto stack as single DWORDs
> >>
> >
> > Except when dealing with variable-argument functions, here 4-byte
> > floating point values (real4, float, whatever) will be promoted to
> > 8-byte double (I believe this is standardized C behaviour, too lazy
> > to look it up in the reference though.)
> >
>
> Thank you, I hadn't even begun thinking about vararg calls yet :-)
>
> You mention "the reference". I spent quite a bit of time googling for an
> authoritative source on calling conventions and never really found
> anything. Who is the keeper of "the reference"?
>
As already said there is no single reference for calling conventions.
The C standard does provide that for varargs, and for unprototyped aka
old-style or K&R1 calls all args, values of integer types 'below' int
(char and short, both signed and unsigned forms, and bitfields) are
promoted to (signed) int -- or in some cases unsigned int, which are
required to be the same size and mostly though not completely the same
layout -- and 'float' is promoted to 'double'. Those aren't required
to be 4-byte and 8-byte specifically, but they are required to support
precision and range which in practice usually works out to that.
- David.Thompson1 at worldnet.att.net
- Next message: Tim Roberts : "Re: Writing simple profiler"
- Previous message: Tim Roberts : "Re: A Register Preservation Macro for Procedures"
- In reply to: Mike : "Re: "C" calling convention on x86"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|