dsp56800e Freescale Semiconductor, Inc, dsp56800e Datasheet - Page 587

no-image

dsp56800e

Manufacturer Part Number
dsp56800e
Description
16-bit Digital Signal Controller Core
Manufacturer
Freescale Semiconductor, Inc
Datasheet
REP
Example 1:
Explanation of Example:
Example 2:
Explanation of Example:
Condition Codes Affected:
Freescale Semiconductor
REP
INC.W
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 stores X0 in the LC register. Then, the sin-
gle-word INC.W instruction that immediately follows the REP instruction is repeated $0003 times.
The contents of the LC register that existed before the REP loop began are restored when the REP loop
is exited.
REP
INC.W
ASL.W
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 stores X0 in the LC register. Since the loop
count is zero, the single-word INC.W instruction that immediately follows the REP instruction is
skipped, and execution continues with the ASL.W instruction. The contents of the LC register that ex-
isted before the REP loop began are restored when the REP loop is exited.
L
Before Execution
Before Execution
LF
15
— Set if data limiting occurred using accumulator as source operand
0000
0005
Y1
Y1
P4
14
X0
Y1
X0
Y1
Y1
13
P3
LC
LC
X0
X0
P2
12
MR
Repeat Next Instruction
P1
11
00A5
0003
00A5
8000
8000
0000
Y0
Y0
P0
10
Instruction Set Details
; repeat (X0) times
; increment the Y1 register
; repeat (X0) times
; increment the Y1 register
; multiply the Y1 register by 2
I1
9
I0
8
SZ
7
6
L
5
E
After Execution
After Execution
U
4
000A
0003
CCR
Y1
Y1
N
3
LC
LC
X0
X0
2
Z
V
1
00A5
00A5
8000
0003
8000
0000
Y0
Y0
C
0
REP
A-243

Related parts for dsp56800e