Enddo - Motorola DSP56000 Manual

24-bit digital signal processor
Hide thumbs Also See for DSP56000:
Table of Contents

Advertisement

ENDDO

Operation:
SSL(LF)
SR;SP – 1
SSH
LA; SSL
LC;SP –1
Description: Terminate the current hardware DO loop before the current loop counter
(LC) equals one. If the value of the current DO loop counter (LC) is needed, it must be
read before the execution of the ENDDO instruction. Initially, the loop flag (LF) is
restored from the system stack and the remaining portion of the status register (SR) and
the program counter (PC) are purged from the system stack. The loop address (LA) and
the loop counter (LC) registers are then restored from the system stack.
Restrictions: Due to pipelining and the fact that the ENDDO instruction accesses the
program controller registers, the ENDDO instruction must not be immediately preceded
by any of the following instructions:
Immediately before ENDDO
Also, the ENDDO instruction cannot be the last (LA) instruction in a DO loop.
Example:
:
DO Y0,NEXT
:
MOVEC LC,A
CMP Y1,A
JNE ONWARD
ENDDO
JMP NEXT
ONWARD
:
:
NEXT MOVE #$123456,X1
A - 98
INSTRUCTION DESCRIPTIONS
End Current DO Loop
SP
SP
MOVEC to LA, LC, SR, SSH, SSL, or SP
MOVEM to LA, LC, SR, SSH, SSL, or SP
MOVEP to LA, LC, SR, SSH, SSL, or SP
MOVEC from SSH
MOVEM from SSH
MOVEP from SSH
ORI MR
ANDI MR
REP
;exec. loop ending at NEXT (Y0) times
;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 registers
;go to NEXT
;LC not equal to Y1, continue DO loop
;(last instruction in DO loop)
;(first instruction AFTER DO loop)
INSTRUCTION SET DETAILS
Assembler Syntax:
ENDDO
ENDDO
MOTOROLA

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dsp56k

Table of Contents