dsp56800 Freescale Semiconductor, Inc, dsp56800 Datasheet - Page 372

no-image

dsp56800

Manufacturer Part Number
dsp56800
Description
16-bit Digital Signal Controllers
Manufacturer
Freescale Semiconductor, Inc
Datasheet
REP
Example:
Explanation of Example:
Example:
Explanation of Example:
A-142
REP
INCW
Prior to execution, the 16-bit X0 register contains the value $0003, and the 13-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.
REP
INCW
ASL
Prior to execution, the 16-bit X0 register contains the value $0000, and the 13-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.
Before Execution
Before Execution
LC
LC
X0
Y1
X0
Y1
X0
Y1
X0
Y1
Y1
00A5
00A5
0003
0000
0000
0005
Repeat Next Instruction
DSP56800 Family Manual
After Execution
After Execution
; repeat (X0) times
; increment the Y1 register
; repeat (X0) times
; increment the Y1 register
; multiply the Y1 register by 2
LC
LC
X0
Y1
X0
Y1
00A5
000A
00A5
0003
0003
0000
Freescale Semiconductor
REP

Related parts for dsp56800