3-4
BASIC EXECUTION ENVIRONMENT
The primary reason for using segmented memory is to increase the reliability of programs and
systems. For example, placing a programs stack in a separate segment prevents the stack from
growing into the code or data space and overwriting instructions or data, respectively. Placing
the operating systems or executives code, data, and stack in separate segments also protects
them from the application program and vice versa.
With either the flat or segmented model, the IA provides facilities for dividing the linear address
space into pages and mapping the pages into virtual memory. If an operating system/executive
uses the IAs paging mechanism, the existence of the pages is transparent to an application
program.
The real-address mode model uses the memory model for the Intel 8086 processor, the first IA
processor. It was provided in all the subsequent IA processors for compatibility with existing
programs written to run on the Intel 8086 processor. The real-address mode uses a specific
implementation of segmented memory in which the linear address space for the program and the
operating system/executive consists of an array of segments of up to 64 Kbytes in size each. The
maximum size of the linear address space in real-address mode is 2
20
bytes. (Refer to Chapter
16, 8086 Emulation, in the Intel Architecture Software Developers Manual, Volume 3, for more
information on this memory model.)
3.4.MODES OF OPERATION
When writing code for the Pentium
®
Pro processor, a programmer needs to know the operating
mode the processor is going to be in when executing the code and the memory model being used.
The relationship between operating modes and memory models is as follows:
Protected mode. When in protected mode, the processor can use any of the memory
models described in this section. (The real-addressing mode memory model is ordinarily
used only when the processor is in the virtual-8086 mode.) The memory model used
depends on the design of the operating system or executive. When multitasking is imple-
mented, individual tasks can use different memory models.
Real-address mode. When in real-address mode, the processor only supports the real-
address mode memory model.
System management mode. When in SMM, the processor switches to a separate address
space, called the system management RAM (SMRAM). The memory model used to
address bytes in this address space is similar to the real-address mode model. (Refer to
Chapter 12, System Management Mode (SMM), in the Intel Architecture Software
Developers Manual, Volume 3, for more information on the memory model used in
SMM.)
3.5.32-BIT VS. 16-BIT ADDRESS AND OPERAND SIZES
The processor can be configured for 32-bit or 16-bit address and operand sizes. With 32-bit
address and operand sizes, the maximum linear address or segment offset is FFFFFFFFH (2
32
),
and operand sizes are typically 8 bits or 32 bits. With 16-bit address and operand sizes, the