Motorola CPU32 Reference Manual page 120

M68300 series central processor unit
Hide thumbs Also See for CPU32:
Table of Contents

Advertisement

CMP2
Operation:
Assembler
Syntax:
Attributes:
Compare Register Against Bounds
Compare Rn
<
lower-bound or
Rn > upper-bound
and Set Condition Codes
CMP2 (ea), Rn
Size
=
(Byte, Word, Long)
CMP2
Description:
Compares the value in Rn to each bound. The effective address contains the bounds
pair: the lower bound followed by the upper bound. For signed comparisons, the arithmetically
smaller value should be used as the lower bound. For unsigned comparisons, the logically smaller
value should be the lower bound.
The size of the data and the bounds can be specified as byte, word, or long. If Rn is a data register
and the operation size is byte or word, only the appropriate low-order part of Rn is checked. If Rn
is an address register and the operation size is byte or word, the bounds operands are sign-
extended to 32 bits and the resultant operands are compared to the full 32 bits of An.
If the upper bound equals the lower bound, the valid range is a single value.
NOTE
This instruction is identical to CHK2, except that it sets condition codes rather
than taking an exception when the value in Rn is out of bounds.
Condition Codes:
x
N
u
X Not affected.
N Undefined.
Z
v
C
u
Z Set if Rn is equal to either bound. Cleared otherwise.
V Undefined.
C Set if Rn is out of bounds. Cleared otherwise.
Instruction Format:
15
14
13
12
11
10
9
8
7
0
0
0
0
0
SIZE
0
1
D/A
REGISTER
0
o
I
0
0
0
6
5
4
3
2
EFFECTIVE ADDRESS
1
MODE
REGISTER
0
0
I
o
I
0
o
I
o
I
o
a
CPU32 REFERENCE MANUAL
INSTRUCTION SET
MOTOROLA
4-67
III

Advertisement

Table of Contents
loading

Table of Contents