
Program Control
Using the Stack Extension
MOTOROLA
Optimizing DSP56300/DSP56600 Applications
3-9
. The use of SP bits for stack status when the stack
extension is disabled, instead of OMR for both cases, is for code
compatibility with the 56K family. The user’s stack error interrupt
routine should test the SEN bit (Stack Extension Enable) in OMR to
know what register to consult for stack status information.
Following is a full example of stack extension initialization.The
memory area allocated is in addresses Y:1024–1536 (512 locations).
This space can accommodate 256 stack locations in the stack
ext fourteen locations in the hardware stack.
;========== initializing the stack extension ====================
;recommended only before interrupts are enabled
;care should be taken in cases where the code is used after
;a stack error event so that part of the initialization routine
;will clear sticky bits and resume the engine state to the
;reset initial state
EXTEN_START
equ
1024
;start address of stack
;extension in data area
MEM_SIZE
equ 512
;stack ext. size in data area
;maximum stack size (ha;extension),
;in units of two 24-bit words.
STACK_LIMIT equ MEM_SIZE/2+14
move
#EXTEN_START,ep;set ext. pointer in data memory
move
#STACK_LIMIT,sz;set stack limit
bset #M_XYS,omr
;select y space
bset
#M_SEN,omr
;enable stack extension
Note:
The stack extension was designed to operate transparently,
with no user software overhead. The mechanism ensures that
within stack size limit, data that is pushed into the stack will
be popped from the top of the stack in the same order. The
actual split of stack data between the hardware stack and the
stack extension is not readily apparent. The user therefore is
advised to access stacked data directly by software only
through the top of the stack.
Table 3-3
Stack Status Information
Stack
Extension
Status
Info.
Bit
Name
Function
Comments
disabled
SEN = 0
SP
SE
Stack Error flag
All these bits
are sticky
UF
Stack Underflow flag
enabled
SEN = 1
OMR
WRP
Extended Stack Wrap flag
EOV
Extended Stack Overflow
EUN
Extended Stack Underflow
Содержание DSP56300
Страница 49: ...3 20 Optimizing DSP56300 DSP56600 Applications MOTOROLA Program Control Using Fast Interrupts ...
Страница 95: ...7 10 Optimizing DSP56300 DSP56600 Applications MOTOROLA Compact Opcode Use Special Instructions ...
Страница 99: ...A 4 Optimizing DSP56300 DSP56600 Applications MOTOROLA Saving Power Disabling Functional Blocks ...
Страница 103: ...B 4 Optimizing DSP56300 DSP56600 Applications MOTOROLA Debug and Test Support Address Tracing ...