dsp56800e Freescale Semiconductor, Inc, dsp56800e Datasheet - Page 476

no-image

dsp56800e

Manufacturer Part Number
dsp56800e
Description
16-bit Digital Signal Controller Core
Manufacturer
Freescale Semiconductor, Inc
Datasheet
ENDDO
Operation:
If NL == 1
HWS1 → HWS0
NL → LF
0 → NL
Description: Terminate the current hardware DO loop immediately. Normally, a hardware DO loop is terminated
Example:
Explanation of Example:
Note:
Restrictions:
Condition Codes Affected:
A-132
LC2 → LC, LA2 → LA
when the last instruction of the loop is executed and the current LC equals one, but this instruction can
terminate a loop before normal completion. If the value of the current DO LC is needed, it must be read
before the execution of the ENDDO instruction. Initially, the LF is restored from the NL bit, and the
top-of-loop address is purged from the HWS. The contents of the second HWS location are written into
the first HWS location, and the NL bit is cleared.
times
ters
CONTINU
ENDLP
This example illustrates the use of the ENDDO instruction to terminate the current DO loop. The value
of the LC is compared with the value in the Y1 register to determine if execution of the DO loop should
continue. The ENDDO instruction updates certain program controller registers but does not automat-
ically jump past the end of the DO loop. Thus, if this action is desired, a JMP or BRA instruction (such
as JMP NEXT) must be included after the ENDDO instruction to transfer program control to the first
instruction past the end of the DO loop.
The ENDDO instruction updates the program controller registers appropriately but does not automat-
ically jump past the end of the loop. This must be done explicitly by the programmer if it is desired.
Refer to Section 10.4, “Pipeline Dependencies and Interlocks,” on page 10-26.
The condition codes are not affected by this instruction.
DO
:
MOVE.W
CMP
JNE
ENDDO
JMP
MOVE.W
DSP56800E Core Reference Manual
End Current DO Loop
Y0,ENDLP
LC,A
Y1,A
CONTINU
ENDLP
:
:
#$1234,X0
Assembler Syntax:
ENDDO
; execute loop ending at ENDLP for (Y0)
; get current value of loop counter (LC)
; compare loop counter with value in Y1
; go to ONWARD if LC not equal to Y1
; LC equal to Y1, restore all DO regis-
; go to NEXT
; LC not equal to Y1, continue DO loop
; (last instruction in DO loop)
; (first instruction AFTER DO loop)
Freescale Semiconductor
ENDDO

Related parts for dsp56800e