3-7
BASIC EXECUTION ENVIRONMENT
specific segments. For instance, some instructions assume that a pointer in the EBX register
points to a memory location in the DS segment.
The special uses of general-purpose registers by instructions are described in Chapter 6, Instruc-
tion Set Summary, in this volume, and Chapter 3, Instruction Set Reference in the Intel Architec-
ture Software Developers Manual, Volume 2. The following is a summary of these special uses:
EAXAccumulator for operands and results data.
EBXPointer to data in the DS segment.
ECXCounter for string and loop operations.
EDXI/O pointer.
ESIPointer to data in the segment pointed to by the DS register; source pointer for string
operations.
EDIPointer to data (or destination) in the segment pointed to by the ES register;
destination pointer for string operations.
ESPStack pointer (in the SS segment).
EBPPointer to data on the stack (in the SS segment).
As shown in Figure 3-4, the lower 16 bits of the general-purpose registers map directly to the
register set found in the 8086 and Intel 286 processors and can be referenced with the names
AX, BX, CX, DX, BP, SP, SI, and DI. Each of the lower two bytes of the EAX, EBX, ECX, and
EDX registers can be referenced by the names AH, BH, CH, and DH (high bytes) and AL, BL,
CL, and DL (low bytes).
3.6.2.Segment Registers
The segment registers (CS, DS, SS, ES, FS, and GS) hold 16-bit segment selectors. A segment
selector is a special pointer that identifies a segment in memory. To access a particular segment
Figure 3-4. Alternate General-Purpose Register Names
0
7
15
31
168
AHAL
BHBL
CHCL
DHDL
BP
SI
DI
SP
16-bit
AX
DX
CX
BX
32-bit
EAX
EBX
ECX
EDX
EBP
ESI
ESP
General-Purpose Registers
EDI