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 two data models; http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
There are two data models;

 1. the small data model and

 2. the big data model.

A small data model is one in which all references to data are made with near
pointers.  Near pointers are 32 bits; all data references are made relative
to the segment value in segment register DS.  Hence, in a small data model,
all data comprising your program must be less than 4GB.

A big data model is one in which all references to data are made with far
pointers.  Far pointers are 48 bits (a 16-bit segment value and a 32-bit
offset relative to the segment value).  This removes the 4GB limitation on
data size imposed by the small data model.  However, when a far pointer is
incremented, only the offset is adjusted.  Watcom C/C++ assumes that the
offset portion of a far pointer will not be incremented beyond 4GB.  The
compiler will assign an object to a new segment if the grouping of data in a
segment will cause the object to cross a segment boundary.  Implicit in this
is the requirement that no individual object exceed 4GB.

+--------------------------------------------------------------------------+
|   Note:  If your program contains less than 4GB of data, you should use  |
| the small data model.  This will result in smaller and faster code since |
| references using near pointers produce fewer instructions.               |
+--------------------------------------------------------------------------+

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