2.1.2 Repeat Block Register (RB)
CPU Registers
www.ti.com
The repeat block instruction (RPTB) is a new instruction for C28x+FPU. This instruction allows you to
repeat a block of code as shown in
.
Example 2-2. The Repeat Block (RPTB) Instruction uses the RB Register
; find the largest element and put its address in XAR6
MOV32
R0H, *XAR0++;
.align 2
; Aligns the next instruction to an even address
NOP
; Makes RPTB odd aligned - required for a block size of 8
RPTB
VECTOR_MAX_END, AR7
; RA is set to 1
MOVL
ACC,XAR0
MOV32
R1H,*XAR0++
; RSIZE reflects the size of the RPTB block
MAXF32
R0H,R1H
; in this case the block size is 8
MOVST0
NF,ZF
MOVL
XAR6,ACC,LT
VECTOR_MAX_END:
; RE indicates the end address. RA is cleared
The C28x_FPU hardware automatically populates the RB register based on the execution of a RPTB
instruction. This register is not normally read by the application and does not accept debugger writes.
Figure 2-3. Repeat Block Register (RB)
31
30
29
23
22
16
RAS
RA
RSIZE
RE
R-0
R-0
R-0
R-0
15
0
RC
R-0
LEGEND: R = Read only; -
n
= value after reset
Table 2-3. Repeat Block (RB) Register Field Descriptions
Bits
Field
Value
Description
31
RAS
Repeat Block Active Shadow Bit
When an interrupt occurs the repeat active, RA, bit is copied to the RAS bit and the RA bit is cleared.
When an interrupt return instruction occurs, the RAS bit is copied to the RA bit and RAS is cleared.
0
A repeat block was not active when the interrupt was taken.
1
A repeat block was active when the interrupt was taken.
30
RA
Repeat Block Active Bit
0
This bit is cleared when the repeat counter, RC, reaches zero.
When an interrupt occurs the RA bit is copied to the repeat active shadow, RAS, bit and RA is cleared.
When an interrupt return, IRET, instruction is executed, the RAS bit is copied to the RA bit and RAS is
cleared.
1
This bit is set when the RPTB instruction is executed to indicate that a RPTB is currently active.
29-23
RSIZE
Repeat Block Size
This 7-bit value specifies the number of 16-bit words within the repeat block. This field is initialized
when the RPTB instruction is executed. The value is calculated by the assembler and inserted into the
RPTB instruction's RSIZE opcode field.
0-7
Illegal block size.
8/9-0x7F A RPTB block that starts at an even address must include at least 9 16-bit words and a block that
starts at an odd address must include at least 8 16-bit words. The maximum block size is 127 16-bit
words. The codegen assembler will check for proper block size and alignment.
18
CPU Register 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 ...