92. Negate Binary Coded Decimal with extend

92.1. Name

NBCD -- Negate binary coded decimal with extend

92.2. Synopsis

        NBCD        <ea>

        Size = (Byte)

92.3. Function

The specified BCD number and the extend bit are subtracted from zero. Therefore, if the extend bit is set a nines complement is performed, else a tens complement is performed. The result is placed back in the specified <ea>.

It can be useful to set the zero flag before performing this operation so that multi precision operations can be correctly tested for zero.

92.4. Format

        -----------------------------------------------------------------
        |15 |14 |13 |12 |11 |10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
        |---|---|---|---|---|---|---|---|---|---|-----------|-----------|
        | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |    MODE   | REGISTER  |
        ----------------------------------------=========================
                                                           <ea>

92.5. Result

        X - Set the same as the carry bit.
        N - Undefined.
        Z - Cleared it the result is non-zero, unchanged otherwise.
        V - Undefined.
        C - Set if a borrow was generated, cleared otherwise.

92.6. See also

NEG NEGX