We've just updated MediaWiki and its underlying software. If anything doesn't look or work quite right, please mention it to us. --RanAS

Zero Flag: Difference between revisions

From SnesLab
Jump to: navigation, search
(shorten description)
(SEP/REP example)
Line 1: Line 1:
The '''Zero Flag''' (Z) is bit 1 of the [[65c816]]'s [[status register]].  It indicates whether the last value computed or moved 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]]It is also affected by these 41 instructions:
The '''Zero Flag''' (Z) is bit 1 of the [[65c816]]'s [[status register]].  It indicates whether the last value computed or moved 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]]:
 
<pre>
SEP #$02
REP #$02
</pre>
 
It is also affected by these 41 instructions:


* [[ADC]]
* [[ADC]]

Revision as of 22:26, 12 August 2024

The Zero Flag (Z) is bit 1 of the 65c816's status register. It indicates whether the last value computed or moved 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.

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

See Also

Reference