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 - an application may have been compiled so that the segment register ds does http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
An application may have been compiled so that the segment register DS does
not contain the segment address of the default data segment (group
"DGROUP").  This is usually the case if you are using a large data memory
model.  Suppose you wish to call a function that assumes that the segment
register DS contains the segment address of the default data segment.  It
would be very cumbersome if you were forced to compile your application so
that the segment register DS contained the default data segment (a small
data memory model).

The following form of the auxiliary pragma will cause the segment register
DS to be loaded with the segment address of the default data segment before
calling the specified function.

+--------------------------------------------------------------------------+
|      #pragma aux sym parm loadds [;]                                     |
|                                                                          |
+--------------------------------------------------------------------------+

where
    description

sym
    is a function name.

Alternatively, the following form of the auxiliary pragma will cause the
segment register DS to be loaded with the segment address of the default
data segment as part of the prologue sequence for the specified function.

+--------------------------------------------------------------------------+
|      #pragma aux sym loadds [;]                                          |
|                                                                          |
+--------------------------------------------------------------------------+

where
    description

sym
    is a function name.

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