Crossware

Table of Contents        Previous topic       Next topic       

MICROPROCESSOR INSTRUCTION REFERENCE->CHK

CHK    Check Data Register against Bounds

If Dn < 0 or Dn > (<ea>) then TRAP


Assembler Syntax:  CHK <ea>,Dn


<ea> - data only

Size:  Word, Long 1

1   68020 and CPU32 only

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:

N    Set if Dn < 0, clear if Dn > (<ea>) else undefined
Z    Undefined
V    Undefined
C    Undefined
X    Not affected

    
Allowable Addressing Modes
    
CHKDn,Dn
CHK(An),Dn
CHK(An)+,Dn
CHK-(An),Dn
CHK(d16,An),Dn
CHK(d8,An,Xn),Dn
CHK(bd,An,Xn),Dn
CHK([bd,An,Xn],od),Dn
CHK([bd,An],Xn,od),Dn
CHK(xxx).W,Dn
CHK(xxx).L,Dn
CHK#(data),Dn
CHK(d16,PC),Dn
CHK(d8,PC,Xn),Dn
CHK(bd,PC,Xn),Dn
CHK([bd,PC,Xn],od),Dn 1
CHK([bd,PC],Xn,od),Dn 1