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 - the following form of the auxiliary pragma can be used to specify the http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
The following form of the auxiliary pragma can be used to specify the
registers that are to be used to return a function's value.

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

where
    description

sym
    is a function name.

reg_set
    is a register set.

Note that the method described below for returning values of type float or
double is supported only when the "fpc" option is used.

Depending on the type of the return value, only certain registers are
allowed in reg_set.

1-byte
    For 1-byte return values, only the following registers are allowed:  AL,
    AH, DL, DH, BL, BH, CL or CH.  If no register set is specified, register
    AL will be used.

2-byte
    For 2-byte return values, only the following registers are allowed:  AX,
    DX, BX, CX, SI or DI.  If no register set is specified, register AX will
    be used.

4-byte
    For 4-byte return values (except far pointers), only the following
    register pairs are allowed:  DX:AX, CX:BX, CX:AX, CX:SI, DX:BX, DI:AX,
    CX:DI, DX:SI, DI:BX, SI:AX, CX:DX, DX:DI, DI:SI, SI:BX or BX:AX.  If no
    register set is specified, registers DX:AX will be used.  This form of
    the auxiliary pragma is legal for functions of type float when using the
    "fpc" option only.

far pointer
    For functions that return far pointers, the following register pairs are
    allowed:  DX:AX, CX:BX, CX:AX, CX:SI, DX:BX, DI:AX, CX:DI, DX:SI, DI:BX,
    SI:AX, CX:DX, DX:DI, DI:SI, SI:BX, BX:AX, DS:CX, DS:DX, DS:DI, DS:SI,
    DS:BX, DS:AX, ES:CX, ES:DX, ES:DI, ES:SI, ES:BX or ES:AX.  If no
    register set is specified, the registers DX:AX will be used.

8-byte
    For 8-byte return values (including functions of type double), only the
    following register combination is allowed:  AX:BX:CX:DX.  If no register
    set is specified, the registers AX:BX:CX:DX will be used.  This form of
    the auxiliary pragma is legal for functions of type double when using
    the "fpc" option only.

Notes:

 1. An empty register set is not allowed.

 2. If you are compiling for a memory model which has a small data model,
    any of the above register combinations containing register DS becomes
    illegal.  In a small data model, segment register DS must remain
    unchanged as it points to the program's data segment.

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