Ian Collins wrote:
> It is standard practice for all native C compilers to use the came
> calling conventions on a particular machine. A C compiler that didn't
> would be next to useless as it wouldn't be able to generate code that
> used the native libraries.
One might think so, but I know of at least one counterexample, and it
certainly wouldn't surprise me if there were others.
The Win32 API contains no function that returns a floating-point value,
so no convention arose about how to do that. Given the following,
double foo( void );
double result;
result = foo();
the returned value is handled by Microsoft Visual C++ and Watcom 10.0
in different ways.
MSVC: call foo
fstp result ; pop ST(0) into result
Watcom: call foo
mov result, eax ; move edx:eax into result
mov result+4, edx
- Ernie
http://home.comcast.net/~erniew