Misc; Stack Control; Return From Interrupt (Rti) - Analog Devices adsp-2100 Manual

Adsp-2100 family programmable single-chip microprocessors
Table of Contents

Advertisement

MISC

15

STACK CONTROL

Syntax:
Example:
Description:
instruction executes in one cycle regardless of how many stacks are specified.
The PUSH STS (Push Status Stack) instruction increments the status stack pointer by
one to point to the next available status stack location; and pushes the arithmetic
status (ASTAT), mode status (MSTAT), and interrupt mask register (IMASK) onto
the processor's status stack. Note that the PUSH STS operation is executed
automatically whenever an interrupt service routine is entered.
Any POP pops the value on the top of the designated stack and decrements the same
stack pointer to point to the next lowest location in the stack. POP STS causes the
arithmetic status (ASTAT), mode status (MSTAT), and interrupt mask (IMASK) to be
popped into these same registers. This also happens automatically whenever a
return from interrupt (RTI) is executed.
POP CNTR causes the counter stack to be popped into the down counter. When the
loop stack or PC stack is popped (with POP LOOP or POP PC, respectively), the
information is lost. Returning from an interrupt (RTI) or subroutine (RTS) also pops
the PC stack automatically.
Status Generated:
SSTAT:
PSE
PC Stack Empty: set if a pop results in an empty program counter stack; cleared otherwise.
CSE
Counter Stack Empty: set if a pop results in an empty counter stack; cleared otherwise.
SSE
Status Stack Empty: for PUSH STS, this bit is always cleared (indicating status stack not empty).
For POP STS, SSE is set if the pop results in an empty status stack; cleared otherwise.
SSO
Status Stack Overflow: for PUSH STS set if the status stack overflows; otherwise not affected.
LSE
Loop Stack Empty: set if a pop results in an empty loop stack; cleared otherwise.
Note that once any Stack Overflow occurs, the corresponding stack overflow bit is
set in SSTAT, and this bit stays set indicating there has been loss of information.
Once set, the stack overflow bit can only be cleared by resetting the processor.
Instruction Format:
Stack Control, Instruction Type 26:
23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5
0
0
Pp:
Cp:
15 – 84
[ PUSH STS ]
[ , POP CNTR] [ , POP PC] [ , POP LOOP] ;
POP
POP CNTR, POP PC, POP LOOP;
Stack Control pushes or pops the designated stack(s). The entire
7
6
5
LSO
LSE SSO SSE
*
*
*
0
0
0
1
0
0
PC Stack Control
Counter Stack Control
4
3
2
1
CSO CSE PSO PSE
*
0
0
0
0
0
0 0 0 0 0 0 Pp Lp Cp Spp
Lp:
Loop Stack Control
Spp:
Status Stack Control
0
*
4
3
2 1 0

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents