A special flag in an ALU also remembers whether the result of a computation is zero. This is usually called the Z flag for “zero”. The equation to compute the Z-flag after an add operation is quite simple:
z =
In other words, the Z-flag has a 1 iff all bits of the sum are zeroes. As with the most significant carry flag, the Z-flag is also latched so that the result of a prior add operation can be used in a later instruction.