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:
- 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:
- 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.
- 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.
- 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|