When Intel defined the original 8086, it was a 16-bit processor with a 20-bit address bus (see below). They defined 8 general-purpose 16-bit registers - but gave them specific roles for certain instructions:
AX
The Accumulator register.DX
The Data register.AX
- for example, as the result of a multiply.CX
The Count register.LOOPNE
(loop if not equal) and REP
(repeated move/compare)BX
The Base register.SI
The Source Index register.DI
The Destination Index register.SP
The Stack Pointer register.PUSH
and POP
operations, implicitly for CALL
and RET
with subroutines, and VERY implicitly during interrupts. As such, using it for anything else was hazardous to your program!BP
The Base Pointer register.BP
could be used to hold the current stack frame, and then when a new subroutine was called it coould be saved on the stack, the new stack frame created and used, and on return from the inner subroutine the old stack frame value could be restored.The first three registers cannot be used for indexing into memory.
BX
, SI
and DI
by default index into the current Data Segment (see below).
MOV AX, [BX+5] ; Point into Data Segment
MOV AX, ES:[DI+5] ; Override into Extra Segment
DI
, when used in memory-to-memory operations such as MOVS
and CMPS
, solely uses the Extra Segment (see below). This cannot be overridden.
SP
and BP
use the Stack Segment (see below) by default.