DSP Core Reference Manual

7-32 SC140 DSP Core Reference Manual
Static Programming Rules
Rule L.L.3
The following instructions are not allowed in a short loop:
COF instructions
STOP and WAIT
DI
DEBUG
DOENn/DOENSHn
MOVE-like instructions that read any LCn register
MOVE-like instructions that write any LCn register
MOVE-like instructions that read the SR register
MOVE-like instructions that write the SR register
This rule does not apply to other instructions that affect status bits in SR.
Example 7-56. Instructions in Short Loops
doensh0 #$10
nop
loopstart0
jmp end ;not allowed
loopend0
doensh1 #count2
move.w #num,d2
loopstart1
doen1 #5 ;not allowed
loopend1
Rule L.L.4
The LA of a short loop cannot be at LA-1 of a long loop.
Example 7-57. Short Loop LA at the End of a Long Loop
dosetup0 label1
doen0 #count1
move.w #num,d1
nop
nop
loopstart0
nop
nop
label1 inc d1
doensh1 #count2
move.w #num1,d2
loopstart1
label2 inc d2 impyuu d1,d2,d3 ;not allowed
loopend1
nop
loopend0