dsp56800e Freescale Semiconductor, Inc, dsp56800e Datasheet - Page 443

no-image

dsp56800e

Manufacturer Part Number
dsp56800e
Description
16-bit Digital Signal Controller Core
Manufacturer
Freescale Semiconductor, Inc
Datasheet
CMP.B
Operation:
D – S
Description: Compare 8-bit portions of two registers or a register and an immediate value. The two operands are
Usage:
Note:
Example:
Explanation of Example:
Condition Codes Affected:
Freescale Semiconductor
Before Execution
A2
0
(no parallel move)
subtracted to perform the comparison, and the CCR is updated accordingly. The result of the subtrac-
tion operation is not stored. The result is not affected by the state of the saturation bit (SA).
This instruction can be used for both integer and fractional two’s-complement data.
This instruction subtracts 8-bit operands. When a register is specified, the low-order 8 bits of the reg-
ister is used for the comparison, unless the register is an accumulator, in which case the low-order
8 bits of the FF1 portion are used. Both registers and immediate values are sign extended internally to
20 bits before comparison.
CMP.B
Prior to execution, the 36-bit A accumulator contains the value $0:0020:0000. Execution of the CMP.B
instruction automatically sign extends the immediate value to 20 bits, sign extends the low-order 8 bits
of A1, and subtracts the immediate from the accumulator. The CCR is updated based on the result of
the 8-bit comparison; the A accumulator is unchanged.
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 7 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 7 of the result
0020
P4
14
A1
#$24,A
13
P3
SR
P2
12
MR
P1
11
0000
0300
A0
P0
10
Instruction Set Details
Compare Byte
; compare value in A accumulator to hex 24
I1
9
Assembler Syntax:
CMP.B
I0
8
SZ
7
After Execution
6
L
A2
0
5
E
S,D
U
4
CCR
0020
A1
N
3
(no parallel move)
SR
2
Z
V
1
0000
0319
C
0
A0
CMP.B
A-99

Related parts for dsp56800e