# CHK Instruction

CHecK register against bounds. Is often used in high level languages to check if variables are in range. The lowest 16 bits of a data register are compared with an effective address. If the result is less than 0 (if bit 15 is 1) or greater than the limit, the result will be a CHK-interrupt.
ADDRESS METHODS: Dn, (An), (An)+, -(An), x(An), x(An,xr.s), x.w, x(PC), x(PC,xr.s), #x
DATA LENGTH: Word

FLAGS: | X - U
N - Set if the data register is less than zero, cleared if the data register is greater than the higher limit. Else undefined.
Z - U
C - U
V - U

SYNTAX: CHK <ea>,Dn

#