Loops and Sequencing
3-32
ADSP-2126x SHARC Processor Hardware Reference
The
LADDR
register contains the top entry on the loop address stack. This
register is readable and writable over the DM data bus. Reading from and
writing to
LADDR
does not move the loop address stack pointer; only a
stack push or pop performed with explicit instructions moves the stack
pointer.
LADDR
contains the value 0xFFFF FFFF when the loop address
“Loop Address Stack Register (LADDR)” on page A-35
lists all the bits in the
LADDR
register.
The sequencer pushes an entry onto the loop address stack when executing
a
DO/UNTIL
or
PUSH loop
instruction. The stack entry pops off the stack
two instructions before the end of its loop’s last iteration or on a
POP loop
instruction. A stack overflow occurs if a seventh entry (one more than full)
is pushed onto the loop stack. The stack is empty when no entries are
occupied.
The loop stacks’ overflow or empty status is available. Because the
sequencer keeps the loop stack and loop counter stack synchronized, the
same overflow and empty flags apply to both stacks. These flags are in the
sticky status register (
STKYx
). For more information on
STKYx
, see
. For more information on how these flags work
with the loop stacks, see
“Loop Counter Stack” on page 3-32
. Note that a
loop stack overflow causes a maskable interrupt.
Because the sequencer tests the termination condition two instructions
before the end of the loop, the loop stack pops before the end of the loop’s
final iteration. If a program reads
LADDR
at either of these instructions, the
value is already the termination address for the next loop stack entry.
Loop Counter Stack
The sequencer’s loop support, shown in
, includes
a loop counter stack. The sequencer keeps the loop counter stack synchro-
nized with the loop address stack. Both stacks always have the same
number of locations occupied. Because these stacks are synchronized, the
Summary of Contents for ADSP-21261 SHARC
Page 30: ...Contents xxx ADSP 2126x SHARC Processor Hardware Reference ...
Page 40: ...Register Diagram Conventions xl ADSP 2126x SHARC Processor Hardware Reference ...
Page 58: ...Differences From Previous SHARCs 1 18 ADSP 2126x SHARC Processor Hardware Reference ...
Page 112: ...Secondary Processing Element PEy 2 54 ADSP 2126x SHARC Processor Hardware Reference ...
Page 178: ...Summary 3 66 ADSP 2126x SHARC Processor Hardware Reference ...
Page 204: ...DAG Instruction Summary 4 26 ADSP 2126x SHARC Processor Hardware Reference ...
Page 322: ...Setting Up DMA 7 32 ADSP 2126x SHARC Processor Hardware Reference ...
Page 436: ...SPORT Programming Examples 9 86 ADSP 2126x SHARC Processor Hardware Reference ...
Page 521: ...ADSP 2126x SHARC Processor Hardware Reference 11 31 Input Data Port rts IDP_ISR end ...
Page 522: ...Input Data Port Programming Example 11 32 ADSP 2126x SHARC Processor Hardware Reference ...
Page 590: ...Timer Programming Examples 14 20 ADSP 2126x SHARC Processor Hardware Reference ...
Page 796: ...I O Processor Registers A 174 ADSP 2126x SHARC Processor Hardware Reference ...
Page 800: ...B 4 ADSP 2126x SHARC Processor Core Manual ...
Page 846: ...Index I 36 ADSP 2126x SHARC Processor Hardware Reference ...