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

Negative Flag: Difference between revisions

From SnesLab
Jump to: navigation, search
(SEP/REP example)
(mentioned BPL/BMI)
Line 47: Line 47:


Also, [[LSR]] always clears the negative flag.
Also, [[LSR]] always clears the negative flag.
[[BPL]] and [[BMI]] examine the negative flag to decide whether or not to branch.


=== See Also ===
=== See Also ===

Revision as of 18:43, 4 August 2024

The Negative Flag (N) exists on the 65c816 as bit 7 of the status register. Although there are no dedicated SEN or CLN instructions to set or clear it, it can be set with SEP and cleared with REP:

SEP #$80
REP #$80

These instructions also affect the negative flag (this bulleted list being 37 long):

Also, LSR always clears the negative flag.

BPL and BMI examine the negative flag to decide whether or not to branch.

See Also

Reference