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

 1. the small data model,

 2. the big data model and

 3. the huge data model.

A small data model is one in which all references to data are made with near
pointers.  Near pointers are 16 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 64K.

A big data model is one in which all references to data are made with far
pointers.  Far pointers are 32 bits (a segment value and an offset relative
to the segment value).  This removes the 64K 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 64K.  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 64K bytes.  For example, an array
containing 40,000 integers does not fit into the big data model.  An object
such as this should be described as huge.

A huge data model is one in which all references to data are made with far
pointers.  This is similar to the big data model.  However, in the huge data
model, incrementing a far pointer will adjust the offset and the segment if
necessary.  The limit on the size of an object pointed to by a far pointer
imposed by the big data model is removed in the huge data model.

Notes:

 1. If your program contains less than 64K 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.

 2. The huge data model should be used only if needed.  The code generated
    in the huge data model is not very efficient since a run-time routine is
    called in order to increment far pointers.  This increases the size of
    the code significantly and increases execution time.

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