The wiki has been upgraded to MediaWiki 1.43. The wiki's theme is still being adapted to work with the new version, and may appear broken for the time being. --RanAS

Zero Flag

From SnesLab
(Redirected from Z Flag)
Jump to: navigation, search

The Zero Flag (Z) is bit 1 of the 65c816's status register. It indicates whether the last value computed, transferred, or pulled is zero: set if it is and clear if not. Although there are no dedicated SEZ or CLZ instructions to set or clear it, it can be directly set with SEP and cleared with REP:

SEP #$02
REP #$02

It is also affected by these 41 instructions:

The BEQ and BNE instructions examine the zero flag to decide whether or not to branch. Push instructions do not affect the zero flag.

The SPC700 and Super FX chips also have a zero flag.

The zero flag is invalid in decimal mode on the NMOS 6502, but it is valid in the 65c816's decimal mode.

See Also

References