dsp56800 Freescale Semiconductor, Inc, dsp56800 Datasheet - Page 304

no-image

dsp56800

Manufacturer Part Number
dsp56800
Description
16-bit Digital Signal Controllers
Manufacturer
Freescale Semiconductor, Inc
Datasheet
DO
Example:
Explanation of Example:
Instruction Fields:
Timing:
Memory:
A-74
Operation
DO
END:
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.
6 oscillator clock cycles
2 program words
DDDDD,<ABS16>
#<1-63>,<ABS16>
Operands
DO
MOVE
REP
ASL
MOVE
Start Hardware Do Loop
DSP56800 Family Manual
#cnt1,END
X:(R0),A
#cnt2
A
A,X:(R0)+
C
6
W
2
; begin DO loop
; nested REP loop
; repeat this instruction
; last instruction in DO loop
; (outside DO loop)
Load LC register with unsigned value and start hardware
DO loop with 6-bit immediate loop count. The last
address is 16-bit absolute.
Loop_count of 0 is not allowed by assembler.
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 addi-
tional cycles). The last address is 16-bit absolute.
Any register allowed except: SP, M01, SR, OMR, and
HWS.
Comments
Freescale Semiconductor
DO

Related parts for dsp56800