Instructions
www.ti.com
SAVE FLAG, VALUE
Save Register Set to Shadow Registers and Execute SETFLG
Operands
FLAG
11 bit mask indicating which floating-point status flags to change.
VALUE
11 bit mask indicating the flag value; 0 or 1.
Opcode
LSW: 1110 0110
01FF FFFF
MSW: FFFF FVVV
VVVV VVVV
Description
This operation copies the current working floating-point register set (R0H to R7H and
STF) to the shadow register set and combines the SETFLG FLAG, VALUE operation in
a single cycle. The status register is copied to the shadow register before the flag values
are changed. The STF[SHDWM] flag is set to 1 when the SAVE command has been
executed. The SAVE and RESTORE instructions should be used in high-priority
interrupts. That is interrupts that cannot themselves be interrupted. In low-priority
interrupt routines the floating-point registers should be pushed onto the stack.
Restrictions
Do not use the SAVE instruction in the delay slots for pipelined operations. Doing so can
yield invalid results. To avoid this, the proper number of NOPs or non-pipelined
instructions must be inserted before the SAVE operation.
; The following is INVALID
MPYF32
R2H, R1H, R0H
; 2 pipeline-cycle instruction (2p)
SAVE
RNDF32=1
; INVALID, do not use SAVE in a delay slot
; The following is VALID
MPYF32
R2H, R1H, R0H
; 2 pipeline-cycle instruction (2p)
NOP
; 1 delay cycle, R2H updated after this instruction
SAVE
RNDF32=1
; VALID
Flags
This instruction modifies the following flags in the STF register:
Flag
TF
ZI
NI
ZF
NF
LUF
LVF
Modified
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Any flag can be modified by this instruction.
Pipeline
This is a single-cycle instruction.
Example
To make it easier and more legible, the assembler will accept a FLAG=VALUE syntax for
the STFLG operation as shown below:
SAVE
RNDF32=0, TF=1, ZF=0
; FLAG = 01001000100, VALUE = X0XX0XXX1XX
MOVST0
TF, ZF, LUF
; Copy the indicated flags to ST0
; Note: X means this flag will not be modified.
; The assembler will set these X values to 0.
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.
Instruction Set
120
SPRUEO2A – June 2007 – Revised August 2008
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 ...