Instructions
www.ti.com
RPTB label, loc16
Repeat A Block of Code
Operands
label
This label is used by the assembler to determine the end of the repeat block and to
calculate RSIZE.
This label should be placed immediately after the last instruction included in the repeat
block.
loc16
16-bit location for the repeat count value.
Opcode
LSW: 1011 0101
0bbb bbbb
MSW: 0000 0000
loc16
Description
Initialize repeat block loop, repeat count from [loc16]
Restrictions
•
The maximum block size is
≤
127 16-bit words.
•
An even aligned block must be
≥
9 16-bit words.
•
An odd aligned block must be
≥
8 16-bit words.
•
Interrupts must be disabled when saving or restoring the RB register.
•
Repeat blocks cannot be nested.
•
Any discontinuity type operation is not allowed inside a repeat block. This includes all
call, branch or TRAP instructions. Interrupts are allowed.
•
Conditional execution operations are allowed.
Flags
This instruction does not affect any flags in the floating-point unit:
Flag
TF
ZI
NI
ZF
NF
LUF
LVF
Modified
No
No
No
No
No
No
No
Pipeline
This instruction takes four cycles on the first iteration and zero cycles thereafter. No
special pipeline alignment is required.
Example
The minimum size for the repeat block is 8 words if the block is even aligned and 9
words if the block is odd aligned. If you have a block of 8 words, as in the following
example, you can make sure the block is odd aligned by proceeding it by a .align 2
directive and a NOP instruction. The .align 2 directive will make sure the NOP is even
aligned. Since a NOP is a 16-bit instruction the RPTB will be odd aligned. For blocks of
9 or more words, this is not required.
; Repeat Block of 8 Words (Interruptible)
;
; find the largest element and put its address in XAR6
.align 2
NOP
RPTB
VECTOR_MAX_END, AR7
; Execute the block AR7+1 times
MOVL
ACC,XAR0
MOV32
R1H,*XAR0++
; min size = 8, 9 words
MAXF32
R0H,R1H
; max size = 127 words
MOVST0
NF,ZF
MOVL
XAR6,ACC,LT
VECTOR_MAX_END:
; label indicates the end
; RA is cleared
When an interrupt is taken the repeat active (RA) bit in the RB register is automatically
copied to the repeat active shadow (RAS) bit. When the interrupt exits, the RAS bit is
automatically copied back to the RA bit. This allows the hardware to keep track if a
repeat loop was active whenever an interrupt is taken and restore that state
automatically.
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
116
Instruction Set
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 ...