Absolute Address - Motorola DSP96002 User Manual

32-bit digital signal processor
Table of Contents

Advertisement

Example:
DO
DO
MOVE D0,X:(R0)+
END2
ADD
END1
The assembler calculates the end of loop address (LA) (absolute address extension word xxxx) by evalu-
ating the end of loop expression and subtracting one. Thus the end of loop expression in the source code
represents the "next address" after the end of the loop. If a simple end of loop address label is used, it
should be placed after the last instruction in the loop.
The LA register is compared to the PC to determine when the end of loop is reached. If the end of loop is
reached, the loop counter (LC) is tested for one. If LC is not equal to one then it is decremented by one.
If LC is equal to one, the system stack is purged and instruction fetches continue at the incremented PC
address. Otherwise, the PC value on the top of the stack is read to fetch the start of the loop again.
Since the end of loop comparison is at fetch time and ahead of the end of loop execution, instructions which
change program flow or change the system stack may not be used near the end of the loop without some
restrictions. Proper DO loop operation is guaranteed if no instruction starting at address LA-2, LA-1 or LA
specifies the program controller registers SR, SP, SSL, LA, LC or (implicitly) PC as a destination register;
or specifies SSH as a source or destination register. Also, SSH cannot be specified as a source register
in the DO instruction itself. The assembler will generate a warning if the restricted instructions are found
within their restricted boundaries. See Section A.10 for the complete list of restrictions.
Implementation Notes:
DO SP,label The actual value that will be loaded in the LC is the value of the SP before the DO instruction
incremented by one.
DO SSL,label The LC will be loaded with its previous value that was saved in the stack by the DO in-
struction itself.
CCR Condition Codes: Not affected.
ER Status Bits: Not affected.
IER Flags: Not affected.
Instruction Format: DO
31
0000
0001
MOTOROLA
#n1,END1
#n2,END2
D1,D2
X:(R1)+,D3
#count,label
1011
i i i i

ABSOLUTE ADDRESS

DSP96002 USER'S MANUAL
14 13
i i
i i
i i i i
0
i i i i
i i i i
A - 77

Advertisement

Table of Contents
loading

Table of Contents