Freescale-semiconductor StarCore SC140 Uživatelský manuál Strana 279

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 760
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 278
Static Programming Rules
SC140 DSP Core Reference Manual 7-29
Rule L.N.2
A loop body n must be surrounded by the LOOPSTARTn and LOOPENDn assembly directives, and can
only be nested inside a loop body having a smaller index.
Example 7-49. Nested Loops with Ordered Index
doen1 #count1
move.w #num,d1
move.l #mem_l,r1
move.w #offset,n0
loopstart1
label1
inc d1
dosetup0 label2
doen0 #count2
move.w #num,d2
loopstart0 ;not allowed
label2
inc d2
impyuu d1,d2,d3
move.w d3,(r1)+
loopend0
nop
loopend1
Rule L.N.3
A DOENn/DOENSHn instruction having a different loop index and any LOOPEND directive cannot come
between the DOENn/DOENSHn instruction and LOOPSTARTn directive of loop n.
Also, it is not allowed to place a DOENSH instruction with any index between the DOENn and its
respective LOOPSTARTn directive, or a DOEN instruction with any index between the DOENSHn
instruction and its respective LOOPSTARTn directive.
Example 7-50. Nested DOENn/DOENSHn Instructions
count2 equ 5
...
move.w #count2,d6
dosetup0 label2
doen0 d6
doen1 #2 ; not allowed
loopstart0
doen1 #5
doen1 #6 ; allowed
loopstart1
Zobrazit stránku 278
1 2 ... 274 275 276 277 278 279 280 281 282 283 284 ... 759 760

Komentáře k této Příručce

Žádné komentáře