Motorola CPU32 Reference Manual page 99

Hide thumbs Also See for CPU32:
Table of Contents

Advertisement

CHK2
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 both 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. If the
register value is less than the lower bound or greater than the upper bound, a
CHK instruction exception, vector number 6, occurs.
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.
CPU32
REFERENCE MANUAL
Check Register Against Bounds
If Rn < lower bound or Rn > upper bound then TRAP
CHK2 〈ea〉, Rn
Size = (Byte, Word, Long)
Compares the value in Rn to each bound. The effective address
V
C
U
*
INSTRUCTION SET
CHK2
MOTOROLA
4-51

Advertisement

Table of Contents
loading

Table of Contents