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 - as mentioned in an earlier section, the following pragma defines the calling http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
As mentioned in an earlier section, the following pragma defines the calling
convention for functions compiled by Microsoft C.


     #pragma aux MS_C "_*"                                  \
                      parm caller []                        \
                      value struct float struct routine [ax]\
                      modify [ax bx cx dx es];

Let us discuss this pragma in detail.

"_*"
    specifies that all function and variable names are preceded by the
    underscore character (_) when translated from source form to object
    form.

parm caller []
    specifies that all arguments are to be passed on the stack (an empty
    register set was specified) and the caller will remove the arguments
    from the stack.

value struct
    marks the section describing how the called routine returns structure
    information.

    float
        specifies that floating-point arguments are returned in the same way
        as structures are returned.

    struct
        specifies that 1, 2 and 4-byte structures are not to be returned in
        registers.

    routine
        specifies that the called routine allocates storage for the return
        structure and returns with a register pointing at it.

    [ax]
        specifies that register AX is used to point to the structure return
        value.

modify [ax bx cx dx es]


    specifies that registers AX, BX, CX, DX and ES are not preserved by the
    called routine.

Note that the default method of returning integer values is used; 1-byte
characters are returned in register AL, 2-byte integers are returned in
register AX, and 4-byte integers are returned in the register pair DX:AX.

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