beautypg.com

Motorola DSP96002 User Manual

Page 268

background image

A - 80

DSP96002 USER’S MANUAL

MOTOROLA

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 hardware 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 DOR 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:

DOR SP,label The actual value that will be loaded in the LC is the value of the SP before the DOR

instruction incremented by one.

DOR SSL,label The LC will be loaded with its previous value that was saved in the stack by the DOR

instruction itself.

CCR Condition Codes: Not affected.

ER Status Bits: Not affected.

IER Flags: Not affected.

Instruction Fields:

Rn - R0-R7 (All address register indirect addressing modes except (Rn+xxx) )

Instruction Format:

DOR #count,label

00

0000

0000

0000

31

14 13

0

PC RELATIVE REPLACEMENT

0000

0001

100S

MMMR

00

0000

0ddd

dddd

31

14 13

0

PC RELATIVE REPLACEMENT

0000

0001

1010

0000

00

i i

i i i i

0 i i i

i i i i

31

14 13

0

PC RELATIVE REPLACEMENT

0000

0001

1011

i i i i

i i

Instruction Format:

DOR S,label

Instruction Format:

DOR X: ea, label
DOR Y: ea, label