Contd, Continue to next loop iteration, Operation assembler syntax – Freescale Semiconductor StarCore SC140 User Manual
Page 449

CONTD
SC140 DSP Core Reference Manual
A-135
CONTD
Continue to Next Loop Iteration
CONTD
Using a Delay Slot (AGU)
Description
Status and Conditions that Affect Instruction
Status and Conditions Changed by Instruction
Example
contd lbl3
Operation
Assembler Syntax
If LCn
> 1,
then SAn
→ PC, LCn-1 → LCn
else PC + displacement
→ PC
0
→ LFn,
0
→ LCn
CONTD label
CONTD label
Continues the active loop n from the start address of the loop (SAn) if its loop counter (LCn) is greater than
one. Otherwise, it clears the active loop flag (LFn), and branches to an address determined by a 16-bit
signed displacement [–2
16
≤ displacement < 2
16
,W
] added to the PC. In either case, the active loop counter
is decremented by one, and the execution set immediately following the execution set containing the
CONTD is executed. Some programming rules apply to the use of this instruction. If no loops are enabled,
this instruction is undefined.
Register Address
Bit Name
Description
SR[30:27]
LF[3:0]
Read loop flags to determine active loop.
Register Address
Bit Name
Description
SR[30:27]
LF[3:0]
Clear active loop flag if the active loop counter is less than or equal to
one.
Instruction
Result
dosetup strt0
; defines start address for loop 0
doen0 #$10
; activates loop 0 with a count of 16
loopstart0
; assembler directive defining starting address SA
strt0 mac d0,d1,d2
; DALU instruction at start address
add d5,d6,d7
contd lbl3
; PC returns to strt0 until LC = 1
inc d1
; executes in the delay slot each time, PC jumps to lbl3 when LC = 1
nop
nop