Motorola CPU32 Reference Manual page 109

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

Advertisement

III
CHK2
Operation:
Assembler
Syntax:
Attributes:
Check Register Against Bounds
CHK2
If Rn
<
lower bound or Rn
>
upper bound then TRAP
CHK2 (ea), Rn
Size
=
(Byte, Word, Long)
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 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
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.
MOTOROLA
4-56
INSTRUCTION SET
CPU32 REFERENCE MANUAL

Advertisement

Table of Contents
loading

Table of Contents