Motorola DSP56800 Manual page 306

16-bit digital signal processor
Table of Contents

Advertisement

DO
Example:
END
Explanation of Example:
This example illustrates a DO loop with a REP loop nested within the DO loop. In this example, "cnt1"
values are fetched from memory; each is left shifted by "cnt2" counts and is stored back in memory.
The DO loop executes "cnt1" times while the ASL instruction inside the REP loop executes ("cnt1" *
"cnt2") times. The END label is located at the first instruction past the end of the DO loop, as men-
tioned previously.
Instruction Fields:
Operation
DO
Timing:
6 oscillator clock cycles
Memory:
2 program words
A-76
Start Hardware Do Loop
DO
#cnt1, END
MOVE
X:(R0),A
REP
#cnt2
ASL
A
MOVE
A,X:(R0)+
:
Operands
C
#xx,xxxx
6
DDDDD,xxxx
6
DSP56800 Family Manual
; begin DO loop
; nested REP loop
; repeat this instruction
; last instruction in DO loop
; (outside DO loop)
W
2
Load LC register with unsigned value and start
hardware DO loop with 6-bit immediate loop count.
The last address is 16-bit absolute. #xx = 0 not
allowed by assembler.
2
Load LC register with unsigned value. If LC is not
equal to zero, start hardware DO loop with 16-bit
loop count in register. Otherwise, skip body of loop
(adds three additional cycles). The last address is
16-bit absolute.
Any register allowed except: SP, M01, SR, OMR,
and HWS.
DO
Comments

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents