nbcd

Negate decimal with extend

Subtracts the packed decimal byte and X from zero and stores the packed decimal result in the operand.

Size .b

XNZVC ●?●?●
  • ● depends on the result
  • ? undefined (do not rely on it)
  • Reads X

Forms

Operands

<ea>
An operand using one of the addressing modes listed for this form. The list determines whether it can be a register, memory or an immediate value. With opt p=68020, an allowed d(An,Xn) or d(PC,Xn) mode also permits the corresponding 68020 indexed and memory indirect forms. See 68020 addressing. More

Each half of the byte holds one decimal digit. To negate a decimal number stored in several bytes, process its least significant pair of digits first. C and X carry a borrow into the next byte.

Set Z and clear X before the first byte, for example with move.w #4, ccr. Each zero result preserves Z, and each nonzero result clears it, so the final Z tests the whole result.