If Dn < 0 or Dn > Source then TRAP

Compatibility: M68000 Family

Assembler Syntax:
CHK <ea>, Dn

Attributes: Size = (Word, Long*)
*(MC68020/MC68030/MC68040 only)

Description: Compares the value in the data register specified
in the instruction to zero and to the upper bound (effective
address operand). The upper bound is a twos complement
integer. If the register value is less than zero or greater
than the upper bound, a CHK instruction exception, vector
number 6, occurs.

Condition Codes:
X Not affected.
N Set if Dn < 0; cleared if Dn > effective address operand.
Undefined otherwise.
Z Undefined.
V Undefined.
C Undefined.

Instruction Format:
\i1-+--3Reg,2Size,-u6Effective Address,3Mode,3Reg,

Instruction Fields:
Register field -- Specifies the data register that contains the
value to be checked.
Size field -- Specifies the size of the operation.
11 -- Word operation.
10 -- Long operation.
Effective Address field -- Specifies the upper bound operand.
Only data addressing modes are allowed as shown:

Related Instructions: