User Guide

Overview of the AMD64 Architecture 7
24592—Rev. 3.15—November 2009 AMD64 Technology
instructions, these defaults can be overridden on an instruction-by-instruction basis using instruction
prefixes. REX prefixes specify the 64-bit operand size and register extensions.
RIP-Relative Data Addressing. 64-bit mode supports data addressing relative to the 64-bit
instruction pointer (RIP). The legacy x86 architecture supports IP-relative addressing only in control-
transfer instructions. RIP-relative addressing improves the efficiency of position-independent code
and code that addresses global data.
Opcodes. A few instruction opcodes and prefix bytes are redefined to allow register extensions and
64-bit addressing. These differences are described in “General-Purpose Instructions in 64-Bit Mode”
in Volume 3 and “Differences Between Long Mode and Legacy Mode” in Volume 3.
1.2.3 Compatibility Mode
Compatibility mode—the second submode of long mode—allows 64-bit operating systems to run
existing 16-bit and 32-bit x86 applications. These legacy applications run in compatibility mode
without recompilation.
Applications running in compatibility mode use 32-bit or 16-bit addressing and can access the first
4GB of virtual-address space. Legacy x86 instruction prefixes toggle between 16-bit and 32-bit
address and operand sizes.
As with 64-bit mode, compatibility mode is enabled by the operating system on an individual code-
segment basis. Unlike 64-bit mode, however, x86 segmentation functions the same as in the legacy x86
architecture, using 16-bit or 32-bit protected-mode semantics. From the application viewpoint,
compatibility mode looks like the legacy x86 protected-mode environment. From the operating-
system viewpoint, however, address translation, interrupt and exception handling, and system data
structures use the 64-bit long-mode mechanisms.
1.2.4 Legacy Mode
Legacy mode preserves binary compatibility not only with existing 16-bit and 32-bit applications but
also with existing 16-bit and 32-bit operating systems. Legacy mode consists of the following three
submodes:
Protected Mode—Protected mode supports 16-bit and 32-bit programs with memory
segmentation, optional paging, and privilege-checking. Programs running in protected mode can
access up to 4GB of memory space.
Virtual-8086 Mode—Virtual-8086 mode supports 16-bit real-mode programs running as tasks
under protected mode. It uses a simple form of memory segmentation, optional paging, and limited
protection-checking. Programs running in virtual-8086 mode can access up to 1MB of memory
space.
Real Mode—Real mode supports 16-bit programs using simple register-based memory
segmentation. It does not support paging or protection-checking. Programs running in real mode
can access up to 1MB of memory space.