www.ti.com
Instructions
Example
The following example shows a complete context save and restore for a high-priority
interrupt. Note that the CPU automatically stores the following registers: ACC, P, XT,
ST0, ST1, IER, DP, AR0, AR1 and PC. If an interrupt is low priority (that is it can be
interrupted), then push the floating point registers onto the stack instead of using the
SAVE and RESTORE operations.
; Interrupt Save
_HighestPriorityISR:
; Uninterruptable
ASP
; Align stack
PUSH
RB
; Save RB register if used in the ISR
PUSH
AR1H:AR0H
; Save other registers if used
PUSH
XAR2
PUSH
XAR3
PUSH
XAR4
PUSH
XAR5
PUSH
XAR6
PUSH
XAR7
PUSH
XT
SPM
0
; Set default C28 modes
CLRC
AMODE
CLRC
PAGE0,OVM
SAVE
RNDF32=1
; Save all FPU registers
...
; set default FPU modes
...
; Interrupt Restore
...
RESTORE
; Restore all FPU registers
POP
XT
; restore other registers
POP
XAR7
POP
XAR6
POP
XAR5
POP
XAR4
POP
XAR3
POP
XAR2
POP
AR1H:AR0H
POP
RB
; restore RB register
NASP
; un-align stack
IRET
; return from interrupt
See also
SPRUEO2A – June 2007 – Revised August 2008
Instruction Set
115
Summary of Contents for TMS320C28 series
Page 2: ...2 SPRUEO2A June 2007 Revised August 2008 Submit Documentation Feedback ...
Page 12: ...Introduction 12 SPRUEO2A June 2007 Revised August 2008 Submit Documentation Feedback ...
Page 20: ...CPU Register Set 20 SPRUEO2A June 2007 Revised August 2008 Submit Documentation Feedback ...
Page 136: ...Instruction Set 136 SPRUEO2A June 2007 Revised August 2008 Submit Documentation Feedback ...