dsp56800e Freescale Semiconductor, Inc, dsp56800e Datasheet - Page 252

no-image

dsp56800e

Manufacturer Part Number
dsp56800e
Description
16-bit Digital Signal Controller Core
Manufacturer
Freescale Semiconductor, Inc
Datasheet
Program Controller
8.2.9
The fast interrupt return address (FIRA) is a 21-bit register that holds a copy of the program counter when
fast interrupt processing is initiated. This address is used to return control to the interrupted program when
the fast interrupt service routine is complete.
This register is not affected by processor reset.
8.3
The software stack is a last-in-first-out (LIFO) stack of arbitrary depth that is located in data memory. Any
instruction that accesses data memory can be used to access locations on the stack, although typically
accesses are made using the stack pointer register (SP).
The JSR and BSR instructions use the software stack for saving the program counter and status register
when a subroutine or interrupt service routine is called. The stack can also be used for passing parameters
to subroutines, for creating variables that are local to a subroutine, or for any other temporary-storage
needs.
The stack pointer value is undefined after reset, and it must be set in software before the stack can be used.
The initial value for the stack pointer is the lower boundary of the stack—the software stack on the
DSP56800E grows up as values are pushed onto it.
8.3.1
Because the stack grows up in memory, and because the SP register always points at the item that is on the
top of the stack, the stack pointer must be pre-incremented when values are pushed on the stack. This
process involves two instructions, as shown in Example 8-1.
; Placing One value onto the software stack
; Performed in 2 cycles, 2 instruction words
For pushing multiple values to the stack, there is a more efficient technique in terms of both time and
space. Instead of repeating the two-instruction sequence for each value to be stored, implement the push
operations that are shown in Example 8-2.
; Faster technique for pushing four values onto the software stack
; Finishes in 5 cycles, 5 instruction words
8-14
Software Stack
Fast Interrupt Return Address
Pushing and Popping Values
ADDA
MOVE.L
ADDA
MOVE.L
MOVE.L
MOVE.L
MOVE.L
Be careful when initializing the stack pointer to set aside enough space for
the stack. If the address space used by the stack overlaps other data areas,
erratic behavior may result. For maximum performance, the software stack
should be located in on-chip memory.
Example 8-2. Pushing Multiple Values on the Software Stack
Example 8-1. Pushing a Value on the Software Stack
#2,SP
A10,X:(SP)
#2,SP
A10,X:(SP)+
B10,X:(SP)+
R0,X:(SP)+
R1,X:(SP)
DSP56800E Core Reference Manual
; Increment the SP (1 cycle, 1 Word)
; Place value onto the stack
; Increment the SP (1 cycle, 1 Word)
; <== No post-increment SP on last MOVE
NOTE:
Freescale Semiconductor

Related parts for dsp56800e