Freescale Semiconductor SC140 Rule L.L.3, Rule L.L.4, Example 7-56. Instructions in Short Loops

Models: SC140

1 760
Download 760 pages 48.94 Kb
Page 282
Image 282

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

#count2

 

doensh1

 

move.w

#num1,d2

 

loopstart1

;not allowed

label2 inc d2

impyuu d1,d2,d3

loopend1

 

nop

 

 

loopend0

 

7-32

SC140 DSP Core Reference Manual

Page 282
Image 282
Freescale Semiconductor SC140 specifications Rule L.L.3, Rule L.L.4, LA of a short loop cannot be at LA-1 of a long loop