Motorola DSP56800 Manual page 378

16-bit digital signal processor
Table of Contents

Advertisement

REP
Example:
REP
INCW
Before Execution
X0
Y1
LC
Explanation of Example:
Prior to execution, the 16-bit X0 register contains the value $0003, and the 16-bit LC register contains
the value $00A5. Execution of the REP X0 instruction takes the lower 13 bits of the value in the X0
register and stores it in the 13-bit LC register. Then, the single word INCW instruction immediately
following the REP instruction is repeated $0003 times. The contents of the LC register before the REP
loop are restored upon exiting the REP loop.
Example:
REP
INCW
ASL
Before Execution
X0
Y1
LC
Explanation of Example:
Prior to execution, the 16-bit X0 register contains the value $0000, and the 16-bit LC register contains
the value $00A5. Execution of the REP X0 instruction takes the lower 13 bits of the value in the X0
register and stores it in the 13-bit LC register. Since the loop count is zero, the single word INCW in-
struction immediately following the REP instruction is skipped and execution continues with the ASL
instruction. The contents of the LC register before the REP loop are restored upon exiting the REP
loop.
A-148
Repeat Next Instruction
X0
; repeat (X0) times
Y1
; increment the Y1 register
0003
0000
00A5
X0
; repeat (X0) times
Y1
; increment the Y1 register
Y1
; multiply the Y1 register by 2
0000
0005
00A5
DSP56800 Family Manual
After Execution
X0
0003
Y1
0003
LC
00A5
After Execution
X0
0000
Y1
000A
LC
00A5
REP

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents