Motorola M68000 User's Guide Page 211

  • Download
  • Add to my manuals
  • Print
  • Page
    / 256
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 210
The 68020 197
MOVE.W SEM,DO
LOOP: MOVE.W DO,Dl
ADDQ.W #1,D1
CAS.W DO/DlfSEM
BNE LOOP
The CAS2 instruction operates in a similar manner to the CAS except
that it has additional operands, and two compares are performed instead
of just one. Both comparisons must show a match for the update registers
to be stored in the destination addresses. The destination addresses must
be specified using register indirect addressing with either a data register
or an address register. If one or both of the compares fails, the
destination operands are copied to the compare registers just as in the
case of the CAS. The CAS instruction allows byte, word and longword
operations. The CAS2 is restricted only to word or longword operations.
CHK2 The CHK2 instruction is an extended version of the CHK instruc
tion. CHK2 will check a data value in either a data register or an address
register against a pair of bounds. The general form of this instruction is:
CHK2I.<size>] <ea>,Rn
<size> = B, W, L
The effective address must be to a pair of memory operands. The first is
the lower bound. It is a byte, word, or longword. The second is the upper
bound. This is located at the next byte, word, or longword in memory
above the lower bound. If the register, Rn, is less than the lower bound or
greater than the upper bound, an exception is generated. The exception
vector is the same as for the CHK instruction. The CHK2 instruction can
be used for both signed and unsigned operands.
CMP2 The CMP2 instruction is very similar to the CHK2 instruction. It
has the same general form:
CMP21.<size>] <ea>,Rn
<size> = B, W, L
The operands are identical to the CHK2 instruction. The difference is
that this instruction does not generate an exception if the register is out
of bounds; instead, the condition codes are used to indicate the success
or failure of the operation. The carry condition is set if the register value
is out of bounds. The zero condition is set if the register value is equal
to either the upper or lower bound. Here is how to test for whether the
value in register DO is greater than 100 or less than 100:
CMP2.L BOUNDS,DO
BOUNDS: DC.L -100,100
Coprocessor Support Instructions The 68020 provides direct coproces
sor support. A coprocessor is a special purpose chip that operates in con
Page view 210
1 2 ... 206 207 208 209 210 211 212 213 214 215 216 ... 255 256

Comments to this Manuals

No comments