IA-32 Assembly Language Reference Manual

Operands

Three kinds of operands are generally available to the instructions: register, memory, and immediate. Indirect operands are available only to jump and call instructions.

The assembler always assumes it is generating code for a 32-bit segment. When 16-bit data is called for (e.g., movw %ax, %bx), the assembler automatically generates the 16-bit data prefix byte.

Byte, word, and long registers are available on the IA--32 processor. The instruction pointer (%eip) and flag register (%efl) are not available as explicit operands to the instructions. The code segment (%cs) may be used as a source operand but not as a destination operand.

The names of the byte, word, and long registers available as operands and a brief description of each follow. The segment registers are also listed.

Table 1-4 8-bit (byte) General Registers

%al 

Low byte of %ax register 

%ah 

High byte of %ax register 

%cl 

Low byte of %cx register 

%ch 

High byte of %cx register 

%dl 

Low byte of %dx register 

%dh 

High byte of %dx register 

%bl 

Low byte of %bx register 

%bh 

High byte of %bx register 

Table 1-5 16-bit (word) General Registers

%ax  

Low 16-bits of %eax register 

%cx  

Low 16-bits of %ecx register 

%dx  

Low 16-bits of %edx register 

%bx  

Low 16-bits of %ebx register 

%sp  

Low 16-bits of the stack pointer 

%bp  

Low 16-bits of the frame pointer  

%si  

Low 16-bits of the source index register  

%di  

Low 16-bits of the destination index register 

Table 1-6 32-bit (long) General Registers

%eax  

32-bit general register 

%ecx  

32-bit general register 

%edx  

32-bit general register 

%ebx  

32-bit general register 

%esp  

32-bit stack pointer 

%ebp  

32-bit frame pointer 

%esi  

32-bit source index register 

%edi  

32-bit destination index register 

Table 1-7 Description of Segment Registers

%cs 

Code segment register; all references to the instruction space use this register 

%ds 

Data segment register, the default segment register for most references to memory operands 

%ss 

Stack segment register, the default segment register for memory operands in the stack (i.e., default segment register for %bp, %sp, %esp, and %ebp) 

%es 

General-purpose segment register; some string instructions use this extra segment as their default segment 

%fs 

General-purpose segment register 

%gs 

General-purpose segment register