Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ User's Guide - there are a few ways available for specifying how the value for a function http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
There are a few ways available for specifying how the value for a function
whose type is float or double is to be returned.

The following form of the auxiliary pragma can be used to specify that
function return values whose type is float or double are not to be returned
in registers.  Instead, the caller will allocate space on the stack for the
return value and point register ESI to it.

+--------------------------------------------------------------------------+
|      #pragma aux sym value struct float [;]                              |
|                                                                          |
+--------------------------------------------------------------------------+

where
    description

sym
    is a function name.

In other words, floating-point values are to be returned in the same way
structures are returned.

The following form of the auxiliary pragma can be used to specify that
function return values whose type is float or double are not to be returned
in 80x87 registers when compiling with the "fpi" or "fpi87" option.
 Instead, the value will be returned in 80x86 registers.  This is the
default behaviour for the "fpc" option.  Function return values whose type
is float will be returned in register EAX.  Function return values whose
type is double will be returned in registers EDX:EAX.  This is the default
method for the "fpc" option.

+--------------------------------------------------------------------------+
|      #pragma aux sym value no8087 [;]                                    |
|                                                                          |
+--------------------------------------------------------------------------+

where
    description

sym
    is a function name.

The following form of the auxiliary pragma can be used to specify that
function return values whose type is float or double are to be returned in
ST(0) when compiling with the "fpi" or "fpi87" option.  This form of the
auxiliary pragma is not legal for the "fpc" option.

+--------------------------------------------------------------------------+
|      #pragma aux sym value [8087] [;]                                    |
|                                                                          |
+--------------------------------------------------------------------------+

where
    description

sym
    is a function name.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson