Motorola DSP96002 User Manual page 267

32-bit digital signal processor
Table of Contents

Advertisement

DOR
Start PC Relative Hardware Loop
Operation:
LA
SSH; LC
SSL; X:<ea>
PC
SSH; SR
SSL; PC+xxxx
LA
SSH; LC
SSL; Y:<ea>
PC
SSH; SR
SSL; PC+xxxx
LA
SSH; LC
SSL; S
PC
SSH; SR
SSL; PC+xxxx
LA
SSH; LC
SSL; #xxx
PC
SSH; SR
SSL; PC+xxxx
Description:
This instruction initiates the beginning of a PC relative hardware program loop. The current loop address
(LA) and loop counter (LC) values are pushed onto the system stack. With proper system stack manage-
ment, this allows unlimited nested hardware DO loops. The PC and SR are pushed onto the system stack.
The PC is added to the 32-bit address displacement extension word and the resulting address is loaded
into the loop address register (LA). The PC points to the next instruction when it is added to the displace-
ment. The effective address specifies the address of the loop count which is loaded into the loop counter
(LC). The DO loop is executed LC times. If LC=0, the loop is executed 2 ** 32 times. All address register
indirect addressing modes (less Long Displacement) may be used. Register Direct addressing mode may
also be used. If immediate short data is specified, the LC is loaded with the zero extended 19-bit immedi-
ate data.
During hardware loop operation, each instruction is fetched each time through the program loop. There-
fore, instructions being executed in a hardware loop are interruptible and may be nested. The value of the
PC pushed onto the system stack is the location of the first instruction after the DOR instruction. This
value is read from the top of the system stack to return to the start of the program loop. When DOR in-
structions are nested, the end of loop addresses must also be nested and are not allowed to be equal.
An example is shown below.
DOR
DOR
MOVE D0,X:(R0)+
END2
ADD
END1
The assembler calculates the end of loop address LA (PC relative address extension word xxxx) by eval-
uating the end of loop expression and subtracting one. Thus the end of loop expression in the source code
MOTOROLA
LC
LA; 1
LF
LC
LA; 1
LF
LC
LA; 1
LF
LC
LA; 1
LF
#n1,END1
#n2,END2
D1,D2
X:(R1)+,D3
DSP96002 USER'S MANUAL
Assembler Syntax:
DOR
X: ea, label
DOR
Y: ea, label
DOR
S,label
DOR
#count,label
DOR
A - 79

Advertisement

Table of Contents
loading

Table of Contents