Motorola CPU32 Reference Manual page 110

Hide thumbs Also See for CPU32:
Table of Contents

Advertisement

CMP2
Operation:
Assembler
Syntax:
Attributes:
Description:
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.
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
Z
U
*
X
Not affected.
N
Undefined.
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
0
0
0
D/A
REGISTER
MOTOROLA
4-62
Compare Register Against Bounds
Compare Rn < lower-bound or
Rn > upper-bound
and Set Condition Codes
CMP2 〈ea〉, Rn
Size = (Byte, Word, Long)
Compares the value in Rn to each bound. The effective address
V
C
U
*
12
11
10
9
0
0
SIZE
0
0
0
INSTRUCTION SET
NOTE
8
7
6
5
0
1
1
0
0
0
0
CMP2
4
3
2
1
EFFECTIVE ADDRESS
MODE
REGISTER
0
0
0
0
REFERENCE MANUAL
0
0
CPU32

Advertisement

Table of Contents
loading

Table of Contents