User Guide

Memory Model 9
24592—Rev. 3.15—November 2009 AMD64 Technology
2 Memory Model
This chapter describes the memory characteristics that apply to application software in the various
operating modes of the AMD64 architecture. These characteristics apply to all instructions in the
architecture. Several additional system-level details about memory and cache management are
described in Volume 2.
2.1 Memory Organization
2.1.1 Virtual Memory
Virtual memory consists of the entire address space available to programs. It is a large linear-address
space that is translated by a combination of hardware and operating-system software to a smaller
physical-address space, parts of which are located in memory and parts on disk or other external
storage media.
Figure 2-1 on page 10 shows how the virtual-memory space is treated in the two submodes of long
mode:
64-bit mode—This mode uses a flat segmentation model of virtual memory. The 64-bit virtual-
memory space is treated as a single, flat (unsegmented) address space. Program addresses access
locations that can be anywhere in the linear 64-bit address space. The operating system can use
separate selectors for code, stack, and data segments for memory-protection purposes, but the base
address of all these segments is always 0. (For an exception to this general rule, see “FS and GS as
Base of Address Calculation” on page 17.)
Compatibility mode—This mode uses a protected, multi-segment model of virtual memory, just as
in legacy protected mode. The 32-bit virtual-memory space is treated as a segmented set of address
spaces for code, stack, and data segments, each with its own base address and protection
parameters. A segmented space is specified by adding a segment selector to an address.