Texas Instruments TMS320C28x Reference Manual page 469

Dsp cpu and instruction set
Table of Contents

Advertisement

RPT #8bit/loc16
RPT #8bit/loc16
SYNTAX OPTIONS
RPT #8bit
RPT loc16
Operands
#8bit
loc16
Description
Flags and
Modes
Repeat
Example
;
Copy the number of elements specified in VarA from Array1
;
to Array2:
;
int16 Array1[N]; // Located in high 64K of program space
;
int16 Array2[N]; // Located in data space
;
for(i=0; i < VarA; i++)
;
Array2[i] = Array1[i];
MOVL
RPT
|| XPREAD *XAR2++,*(Array1)
6-312
1111 0110 CCCC CCCC
1111 0111 LLLL LLLL
8-bit constant immediate value (0 to 255 range)
Addressing mode (see Chapter 5)
Repeat the next instruction. An internal repeat counter (RPTC) is loaded with a value
N that is either the specified #8bit constant value or the content of the location pointed
to by the "loc16" addressing mode. After the instruction that follows the RPT is exe-
cuted once, it is repeated N times; that is, the instruction following the RPT executes
N + 1 times. Because the RPTC cannot be saved during a context switch, repeat loops
are regarded as multicycle instructions and are not interruptible.
Note on syntax:
Parallel bars (||) before the repeated instruction are used as a reminder that
the instruction is repeated and is not interruptable.
When writing inline assembly, use the syntax
asm(||
RPT #8bt/ loc16 || instruction");
Not all instructions are repeatable. If an instruction that is not repeatable follows the
RPT instruction, the RPTC counter is reset to 0 and the instruction only executes
once. The 28x Assembly Language tools check for this condition and issue warnings.
None
This instruction is not repeatable. If this instruction follows the RPT instruction, it re-
sets the repeat counter (RPTC) and executes only once.
XAR2,#Array2
@VarA
Repeat Next Instruction
OPCODE
OBJMODE
; XAR2 = pointer to Array2
; Repeat next instruction
; [VarA] + 1 times
; Array2[i] = Array1[i],
; i++
RPT
CYC
X
1
X
4

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMS320C28x and is the answer not in the manual?

Table of Contents

Save PDF