3.11 Z Status Bit
The Z Status bit is a special Zero Status bit that is useful for extended
precision arithmetic. The Z bit functions like a normal Z flag for all
instructions, except those that use the Carry/Borrow
input (ADDC
, CPB
, SUBB
and
SUBBR
). For the ADDC
,
CPB
, SUBB
and SUBBR
instructions, the Z bit can only be cleared and never set. If the result of one of
these instructions is non-zero, the Z bit will be cleared and will remain cleared,
regardless of the result of subsequent ADDC
,
CPB
, SUBB
or SUBBR
operations.
This allows the Z bit to be used for performing a simple zero check on the result
of a series of extended precision operations.
A sequence of instructions working on multiprecision data (starting with
an instruction with no Carry/Borrow input) will
automatically logically AND the successive results of the zero test. All results
must be zero for the Z flag to remain set at the end of the sequence of
operations. If the result of the ADDC
, CPB
,
SUBB
or SUBBR
instruction is non-zero, the
Z bit will be cleared and remain cleared for all subsequent ADDC
,
CPB
, SUBB
or SUBBR
instructions.