Hardware Loops
SC140 DSP Core Reference Manual
5-29
5.4.6 Loop Control Instructions
Table 5-10 lists the loop instructions.
The instructions that activate the loop are either DOENn or DOENSHn. In nested loops, DOENn or
DOENSHn must be re-executed in order to re-activate the inner loops. In other words, the DOENn or
DOENSHn instruction for an inner loop must be contained in its corresponding outer loop. DOSETUPn is
only used to initialize SAn in long loops and need not be re-executed if the value of the SAn register is
unchanged. In short loop initialization, DOSETUPn is not needed at all. The instructions SKIPLS, CONT,
and BREAK (along with their variants) are optional, to be used only if needed.
The above instructions are assembled from source mnemonics in the conventional way. They are also
disassembled normally. In addition, looping bits are encoded in the instruction prefix. When coding a
hardware loop in assembly, two loop-related assembly directives must be used to set the LPMARKA and
LPMARKB bits as follows:
•
LOOPSTARTn
— Placed immediately before SA.
•
LOOPENDn
— Placed immediately after LA.
By definition, a loop body n is enveloped by the LOOPSTARTn and LOOPENDn directives.
In disassembled code, the LOOPSTART and LOOPEND directives are not available. The start address
information is encoded as an offset in the DOSETUPn instruction for long loops, or in the LPMARK
prefix bits for short loops. The last address information is encoded in the LPMARK prefix bits for long
loops. The assembler normally places the LPMARKB bit at LA-2. For special cases, such as a SKIPLS
Table 5-10. Loop Control Instructions
Instruction
Operation
DOSETUPn <label>
Initialize register SAn with <label> address.
Used only in long loops.
DOENn (reg or imm)
Activate loop n as a long loop. Performs the
following operations:
• Initializes LCn
• Sets LFn in the SR
DOENSHn (reg or imm)
Activate loop n as a short loop. Performs the
following operations:
• Initializes LCn
• Sets LFn and SLF in the SR
SKIPLS <label>
If LCn <= 0, jumps to <label>, clearing LFn.
CONT <label>
Within an active loop, if LC > 1, jumps to SAn and
decrements LCn. If LC <= 1 jumps to <label> and
clears the LCn register as well as LFn.
CONTD <label>
Provides a delayed version of the CONT
instruction.
BREAK <label>
Within an active loop, jumps to <label> and clears
LFn.
Содержание SC140 DSP Core
Страница 12: ...xii SC140 DSP Core Reference Manual ...
Страница 18: ...xviii SC140 DSP Core Reference Manual ...
Страница 32: ...1 6 SC140 DSP Core Reference Manual Core Architecture Features ...
Страница 180: ...4 70 SC140 DSP Core Reference Manual Trace Unit Registers ...
Страница 250: ...6 70 SC140 DSP Core Reference Manual Programming Rules ...
Страница 314: ...7 64 SC140 DSP Core Reference Manual NOP Definition ...
Страница 385: ...BMCHG W SC140 DSP Core Reference Manual A 71 u16 iiiiiiiiiiiiiiii 16 bit unsigned immediate data ...
Страница 388: ...A 74 SC140 DSP Core Reference Manual BMCHG W s16 AAAAAAAAAAAAAAAA 16 bit signed SP address offset ...
Страница 391: ...BMCLR SC140 DSP Core Reference Manual A 77 u16 iiiiiiiiiiiiiiii 16 bit unsigned immediate data ...
Страница 454: ...A 140 SC140 DSP Core Reference Manual DECA u5 iiiii 5 bit unsigned immediate data 1 set by the assembler ...
Страница 463: ...DI SC140 DSP Core Reference Manual A 149 15 8 7 0 DI 1 1 4 1 0 0 1 1 1 1 1 0 1 1 1 1 1 0 1 ...
Страница 478: ...A 164 SC140 DSP Core Reference Manual EI ...
Страница 592: ...A 278 SC140 DSP Core Reference Manual MOVE L a32 aaaaaaaaaaaaaaaaAAAAAAAAAAAAAAAA 32 bit absolute long address ...
Страница 618: ...A 304 SC140 DSP Core Reference Manual MOVES 4F s15 sssssssssssssss Signed 15 bit offset ...
Страница 638: ...A 324 SC140 DSP Core Reference Manual MPYR ...
Страница 660: ...A 346 SC140 DSP Core Reference Manual OR W s16 AAAAAAAAAAAAAAAA Signed 16 bit SP address offset ...
Страница 746: ...A 432 SC140 DSP Core Reference Manual ZXTA x ...
Страница 758: ...I 10 Index ...
Страница 759: ...SC140 DSP Core Reference Manual i ...
Страница 760: ......