tst

Test

Sets the condition codes from the operand, as if comparing it with zero.

Sizes .b .w .l, .w by default

XNZVC –●●00
  • ● set from the result
  • 0 always 0
  • – not changed

Forms

Operands

<ea>
An operand using one of the instruction’s supported addressing modes, such as d0, (a0)+ or 4(a1). It may name a register, memory or an immediate value. More
* --- Testing different values ---
move.l #$80, d0
tst.b d0 ; N flag set (bit 7 = 1)

move.l #$00, d1
tst.b d1 ; Z flag set

move.l #$7F, d2
tst.b d2 ; no flags (positive, nonzero)