CPU Description
Pointers and Index Registers
These 16-bit registers serve as base pointers and index registers when
accessing the memory using the based addressing,
indexed
addressing, or based indexed addressing modes. They can also be
used for data transfer and for arithmetic and logical operations in the
same manner as the general purpose registers.
The base pointers are known as the BP and SP [BP and SP]. These
are primarily used to reference the stack. The SP is generally used to
point to the top of stack, and the BP to variables within the stack. This
is usually done when passing parameters on the stack within a
program.
The index registers are primarily used for string manipulations. The
two index registers, IX [SI] and IY [DI], are used to point to strings
within the source and destination segments, the DS0 [DS] and DS1
[ES], respectively. The index registers are adjusted automatically
during string transfers.
6-7