Address Generation Unit
SC140 DSP Core Reference Manual
2-35
2.3.2.1 Address Registers (R0
–
R15)
The sixteen 32-bit address registers R0–R15 can contain addresses or general-purpose data. These are
32-bit read/write registers. The 32-bit address in a selected address register is used in calculating the
effective address of an operand. The contents of an address register can point directly to data, or can be
used as an index.
The sixteen address registers R0–R15 are composed of two separate banks, a low bank (R0–R7) and a high
bank (R8–R15). The high bank can be used alternatively as a base address register bank (B0–B7). Each
address register Rn of the high bank can serve as an address register on condition that the corresponding
B
n
-8
register is not used. Both Rn and B
n
-8
are mapped to the same physical register. For example, R8 is
available only if R0 is not being used in modulo addressing since this requires the base address register B0.
For future compatibility, SC140 code must not interchange the use of B and R registers. Base modulo
registers must use the B notation and pointers must use the R notation. For example, the following
sequence is not allowed:
MOVE.L #ADDRESS, B0
...
MOVE.W (R8), D0
See
Section 2.3.2.6, “Modifier Control Register (MCTL),”
for further information. The high bank of
registers can only be used as pointers in the linear mode of addressing since the other modes of addressing
are only encoded for the low bank in the MCTL register.
In addition, an address register can be post-updated according to the addressing mode selected. If an
address register is updated, one of the modifier registers (Mj) can be used to specify the type of update
arithmetic. Offset registers (Ni) are used for post-incrementing and indexing by offset.
The address register modification can be performed by either of the two AAUs. Most addressing modes
modify the selected address register in a read-modify-write fashion. The address register is read, its
contents are modified by the associated modulo arithmetic unit, and the register is written with the
appropriate output of the AAU. The form of address register modification performed by the address
arithmetic unit is controlled by the contents of the offset and modifier registers described in the following
sections.
2.3.2.2 Stack Pointer Registers (NSP, ESP)
The SC140 core has two stack pointer registers: the normal stack pointer (NSP) and the exception stack
pointer (ESP). These 32-bit registers are used implicitly in all PUSH and POP instructions. Only one stack
pointer is active at one time according to the mode:
In Normal mode, the NSP is used.
In Exception mode, the ESP is used.
The EXP bit in the status register (SR) determines the active mode. The active stack pointer (SP) is used
explicitly for memory references when used with the address register indirect modes. The stack pointers
point to the next unoccupied location in the stacks. They are post-incremented on all the implicit PUSH
operations and pre-decremented on all the implicit POP operations.
Note:
Both stack pointer registers must be initialized explicitly by the programmer after reset.