dsp56800e Freescale Semiconductor, Inc, dsp56800e Datasheet - Page 449

no-image

dsp56800e

Manufacturer Part Number
dsp56800e
Description
16-bit Digital Signal Controller Core
Manufacturer
Freescale Semiconductor, Inc
Datasheet
CMP.W
Operation:
D – S
Description: Compare two 16-bit operands. The operands are subtracted, and the CCR is updated based on the re-
Usage:
Note:
Example:
Explanation of Example:
Condition Codes Affected:
Freescale Semiconductor
Before Execution
A2
0
(no parallel move)
sult. The result of the subtraction operation is not stored.
This instruction can be used for both integer and fractional two’s-complement data.
This instruction subtracts 16-bit operands. When an accumulator is used as one of the operands, the
FF1 portion is compared. Registers and 16-bit immediate values are sign extended internally to 20 bits
before the subtraction is performed. Five-bit immediate values are zero extended to 20 bits. The CCR
is updated based on the 16-bit result, with the exception of the U and E bits, which are based on the
20-bit result.
CMP.W
Prior to execution, the 36-bit A accumulator contains the value $0:0020:0000, and the 16-bit Y0 reg-
ister contains the value $0024. Execution of the CMP.W Y0,A instruction automatically sign extends
the 16-bit value in Y0 to 20 bits and subtracts the result from the FF2:FF1 portion of the A accumula-
tor. The CCR is updated based on the result of the subtraction. Neither the Y0 nor the A registers are
changed.
E
U
N
Z
V
C
LF
15
— Set if the extension portion of the 20-bit result is in use
— Set if the 20-bit result is not normalized
— Set if bit 15 of the result is set
— Set if result equals zero
— Set if overflow has occurred in result
— Set if a carry (or borrow) occurs from bit 15 of the result
0020
2000
P4
14
A1
Y1
Y0,A
13
P3
SR
P2
12
MR
P1
11
0000
0024
0300
A0
Y0
P0
10
Instruction Set Details
Compare Word
; compare Y0 and A
I1
9
Assembler Syntax:
CMP.W
I0
8
SZ
7
After Execution
6
L
A2
0
5
E
S,D
U
4
CCR
0020
2000
A1
Y1
N
3
(no parallel move)
SR
2
Z
V
1
0000
0024
0319
C
0
A0
Y0
CMP.W
A-105

Related parts for dsp56800e