
15
AT75C DSP Subsystem
1368B–06/01
Rn (k LSBs) <- Rn+q (k LSBs); Otherwise
When M = |q| (i.e., MODx = 0), modulo operation is:
Rn <- Rn.
Notes: 1. R0 ≥ R3 can only work with STEPI and MODI, while R4 • R5 can work only with STEPJ and
MODJ.
2. The modulo operation can work for modulo values greater than 512 when the M - |STEPx| ≥
511 and constraints 3a, 3b, 3c and 3d are met.
Examples:
1. M = 7 with STEPx = 1 (or +1 selected in instruction), MODx = 7 - 1 = 6, Rn = 0x0010
(hexa). The sequence of Rn values will be:
0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0010,0x0011,...
2. M = 8 with STEPx = 2, MODx = 8 - 2 = 6, Rn = 0x0010. The sequence of Rn values will
be: 0x0010,0x0012,0x0014,0x0016,0x0010,0x0012,...
3. M = 9 with STEPx = -3, MODx = 9 - |-3| = 6, Rn = 0x0016. The sequence of Rn values
will be:
0x0016,0x0013,0x0010,0x0016,0x0013,...
4. M = 8 with STEPx = 3, (23 = 8 - full modulo support), MODx = 8 - 3 = 5, Rn = 0x0010.
The sequence of Rn values will be:
0x0010,0x0013,0x0016,0x0011,0x0014,0x0017,0x0012,0x0015,0x0010,0x0013,...
Index Modifier The OakDSPCore has short and long index addressing modes. The base register is RB, one
of the DAAU registers. In the short index addressing mode, the base register, together with a
7-bit signed short immediate value (-64 to +63) embedded in the instruction opcode, is used to
point to a data memory location in a single cycle. In the long index addressing mode, the base
register, together with a signed 16-bit offset, given as the second word of the instruction, is
used to access the memory in two cycles. Unlike the linear and modulo addressing modes, in
both index addressing modes, address pre-modification is performed prior to accessing the
memory. The base register is unaffected. Indexed addition, subtraction, compare, AND, OR,
XOR and move from/into the pointed data memory location can be performed in either one or
two cycles, using the short or long mode, respectively.
The base register can be used as an array pointer or in conjunction with the stack pointer (SP)
register. When the stack is used for transferring routine parameters, initializing the base regis-
ter by the SP value enables quick access to routine parameters transferred using the stack.
The index addressing mode is useful for supporting C-compiler.
The RB register is part of the global register set and can be used as a general-purpose
register.
Software Stack The OakDSPCore contains a software stack, pointed to by a dedicated 16-bit register, the
stack pointer (SP). The SP contains the address of the top value in the stack; therefore, it
points to the last value pushed onto the stack. The stack is filled from high memory address to
low memory address. A POP instruction performs a post-increment; a PUSH instruction per-
forms a pre-decrement. The Program Counter (PC) is automatically pushed to the stack
whenever a subroutine call or an interrupt occurs and popped back on return from subroutine
or interrupt. Other values can be pushed and popped using the PUSH and POP instructions.
The top of stack can be read without affecting SP using a dedicated MOV instruction.
The software stack can reside anywhere in the data space (X-RAM and Y-RAM) and can be
accessed by any other pointer (R0 to R5 and RB).
The software stack is useful for supporting the C-compiler. The stack can be used for transfer-
ring routine parameters (e.g., C-automatic variables). Thus, after initializing the base register