www.ti.com
Instructions
PUSH RB
Push the RB Register onto the Stack
Operands
RB
repeat block register
Opcode
LSW: 1111 1111
1111 0000
Description
Save the RB register on the stack. If a high-priority interrupt contains a RPTB instruction,
then the RB register must be stored on the stack before the RPTB block and restored
after the RTPB block. In a low-priority interrupt RB must always be saved and restored.
This save and restore must occur when interrupts are disabled.
Flags
This instruction does not affect any flags floating-point Unit:
Flag
TF
ZI
NI
ZF
NF
LUF
LVF
Modified
No
No
No
No
No
No
No
Pipeline
This is a single-cycle instruction for the first iteration, and zero cycles thereafter.
Example
A high priority interrupt is defined as an interrupt that cannot itself be interrupted. In a
high priority interrupt, the RB register must be saved if a RPTB block is used within the
interrupt. If the interrupt service routine does not include a RPTB block, then you do not
have to save the RB register.
; Repeat Block within a High-Priority Interrupt (Non-Interruptible)
_Interrupt:
; RAS = RA, RA = 0
...
PUSH RB
; Save RB register only if a RPTB block is used in the
ISR
...
RPTB #BlockEnd, AL
; Execute the block AL+1 times
...
...
BlockEnd
; End of block to be repeated
...
POP
RB
; Restore RB register
...
IRET
; RA = RAS, RAS = 0
A low-priority interrupt is defined as an interrupt that allows itself to be interrupted. The
RB register must always be saved and restored in a low-priority interrupt. The RB
register must stored before interrupts are enabled. Likewise before restoring the RB
register interrupts must first be disabled.
; Repeat Block within a Low-Priority Interrupt (Interruptible)
_Interrupt:
; RAS = RA, RA = 0
...
PUSH RB
; Always save RB register
...
CLRC INTM
; Enable interrupts only after saving RB
...
...
; ISR may or may not include a RPTB block
...
SETC INTM
; Disable interrupts before restoring RB
...
POP
RB
; Always restore RB register
...
IRET
; RA = RAS, RAS = 0
See also
SPRUEO2A – June 2007 – Revised August 2008
Instruction Set
113
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 ...