1.1.3 Segmented Architecture

The 8086 processors differ from many other microprocessors in that they use a segmented architecture: that is, each address is represented in two parts—a segment and an offset. Segmented addresses affect many aspects of assembly-language programming, especially addresses and pointers.

Summary: Only 64K of data can be addressed by a 16-bit segment address.

Segmented architecture was originally designed to enable a 16-bit processor to access an address space larger than 64K. (Section 1.1.5, “Segmented Addressing,” explains how the processor uses both the segment and offset to create addresses larger than 64K.) DOS is an example of an operating system that uses segmented architecture on a 16-bit processor.

With the advent of protected-mode processors such as the 80286, segmented architecture gained a second purpose. Segments can separate different blocks of code and data to protect them from undesirable interactions. OS/2 1.x is an operating system that takes advantage of the protection features of the 16-bit segments on the 80286.

Segmented architecture went through another significant change with the release of 32-bit processors, starting with the 80386. These processors are backward compatible with the older 16-bit processors, but they also offer a 32-bit mode that minimizes the memory limitations of a 16-bit segmented architecture. Both offer paging to maintain segment protection. XENIX 386 is an example of a 32-bit segmented operating system using segment protection.

OS/2 2.x takes advantage of the 32-bit processors to allow a nonsegmented memory configuration. The processor still uses 32-bit segments, but from the user's viewpoint, there is only one segment. The flat memory model used by OS/2 2.x places code and data in a single segment. See Section 2.2.1, “Defining Basic Attributes with .MODEL,” for more information about the flat memory model.