Motorola DSP56305 User Manual Page 38

  • Download
  • Add to my manuals
  • Print
  • Page
    / 112
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 37
Program Control
Using the Stack Extension
MOTOROLA Optimizing DSP56300/DSP56600 Applications 3-9
Table 3-3. 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
extension + 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 (hardware +;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
Page view 37
1 2 ... 33 34 35 36 37 38 39 40 41 42 43 ... 111 112

Comments to this Manuals

No comments