Data Registers 
There are 4 16-bit general-purpose registers, which can be used by the programmer for arithmetic and data movement. In addition to being general-purpose, each of these registers has a special function within the CPU. Also each register can be addressed as either a 16-bit or 8-bit value. These registers (shown in Figure 3.1) and their special functions are listed below:

  1. AX (accumulator): This is the accumulator register (it can hold an operand to an arithmetic operation and the result of the operation). As shown in Figure 3.1 below, this register:

    Can be addressed as a 16-bit value as AX

    Its upper 8-bits can be addressed as AH (hence bit 0 in AH corresponds to bit 8 in AX and bit 7 in AH corresponds to bit 15 in AX)

    Its lower 8-bits can be addressed as AL (hence bit 0 in AL corresponds to bit 0 in AX and bit 7 in AL corresponds to bit 7 in AX)

    For example: If 1100110001101100 is moved to AX, then the value of AL would be:

    01101100


    and the value of AH would be:

    11001100



  2. BX (base register): This register can hold the address of a procedure or a variable. It can also perform arithmetic and data movement. Again as with the AX, this register can be addressed as a 16-bit value BX, as an 8-bit value BH corresponding to the higher 8-bits of BX, or as BL corresponding to the lower 8-bits of BX.

  3. CX (counter): This register acts as a counter for repeating or looping instructions. These instructions automatically repeat and decrement CX. Similar to AX and BX, it is possible to address the 16-bit value as CX, the upper 8-bits value as CH or the lower 8-bits as CL.

  4. DX (data): This register has a special role in multiply and divide operations. When multiplying, for example, it holds the upper 16-bits of the product. Again, the 16-bit value can be addressed as DX, the upper 8-bits value as DH or the lower 8-bits as DL.




Fig. m010321.1 Data Registers of the x86 processors