General-Purpose Registers (Cont.)


The general-purpose registers are primarily used for arithmetic and data movement. They include 32-bit registers: , , , and .

†Note that an empty section may cause error.
EAX Register Output

 INCLUDE Irvine32.inc
 .data
  dummy WORD ?
 .code
 main PROC
  mov    eax, 12345678h
  mov    ax,  0ABCDh
  call   WriteHex
  exit
 main ENDP
 END main
    


 

Each register can also be addressed as 16-bit value. For example, the 16-bit register for is , which can be further addressed as two separate 8-bit values: and .

Accumulator
32-bit
16-bit 16-bit
  8-bit (high) 8-bit (low)
  AH AL
  AX
EAX
 
Base Pointer
32-bit
16-bit 16-bit
  8-bit (high) 8-bit (low)
  BH BL
  BX
EBX
 
Counter
32-bit
16-bit 16-bit
  8-bit (high) 8-bit (low)
  CH CL
  CX
ECX
 
Data / I/O
32-bit
16-bit 16-bit
  8-bit (high) 8-bit (low)
  DH DL
  DX
EDX

Source Index
32-bit
16-bit 16-bit
  SI
ESI
 
Destination Index
32-bit
16-bit 16-bit
  DI
EDI
 
Stack Base Pointer
32-bit
16-bit 16-bit
  BP
EBP
 
Stack Pointer
32-bit
16-bit 16-bit
  SP
ESP