The first level of support for 16-bit programs has already been discussed
in Chapter 13,
Chapter 14,
and Chapter 15. This chapter shows how 16-bit
and 32-bit modules can cooperate with one another, and how one module can
utilize both 16-bit and 32-bit operands and addressing.

The 80386 functions most efficiently when it is possible to distinguish
between pure 16-bit modules and pure 32-bit modules. A pure 16-bit module
has these characteristics:

All segments occupy 64 Kilobytes or less.

Data items are either 8 bits or 16 bits wide.

Pointers to code and data have 16-bit offsets.

Control is transferred only among 16-bit segments.

A pure 32-bit module has these characteristics:

Segments may occupy more than 64 Kilobytes (zero bytes to 4
gigabytes).

Data items are either 8 bits or 32 bits wide.

Pointers to code and data have 32-bit offsets.

Control is transferred only among 32-bit segments.

Pure 16-bit modules do exist; they are the modules designed for 16-bit
microprocessors. Pure 32-bit modules may exist in new programs designed
explicitly for the 80386. However, as systems designers move applications
from 16-bit processors to the 32-bit 80386, it will not always be possible
to maintain these ideals of pure 16-bit or 32-bit modules. It may be
expedient to execute old 16-bit modules in a new 32-bit environment without
making source-code changes to the old modules if any of the following
conditions is true:

Modules will be converted one-by-one from 16-bit environments to
32-bit environments.

Older, 16-bit compilers and software-development tools will be
utilized in the new32-bit operating environment until new 32-bit
versions can be created.

The source code of 16-bit modules is not available for modification.

The specific data structures used by a given module inherently utilize
16-bit words.

The native word size of the source language is 16 bits.

On the 80386, 16-bit modules can be mixed with 32-bit modules. To design a
system that mixes 16- and 32-bit code requires an understanding of the
mechanisms that the 80386 uses to invoke and control its 32-bit and 16-bit
features.