subx

Subtract extended

Subtracts the source and X flag from the destination, and stores the result in the destination.

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

XNZVC ●●●●●
  • ● depends on the result
  • Reads X

Forms

  • subx ,
  • subx ,

Operands

Dn
A data register, d0 to d7. More
-(An)
Decreases an address register by 1, 2 or 4 bytes for a byte, word or long access, then accesses memory there. A byte access through sp decreases it by 2 to keep it even. More

Both operands must be data registers, or both must use predecrement addressing. The registers need not be the same. For a value split into several parts, start with the least significant part so X carries each borrow into the next subtraction.

Z is cumulative: a zero result preserves its previous value, and a nonzero result clears it. Set Z and clear X before the first part, for example with move.w #4, ccr. Z then remains set only if every result part is zero. C and X report the borrow from the current part.