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
(improved description) |
(SEP/REP example) |
||
Line 1: | Line 1: | ||
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]] | 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]]: | ||
<pre> | |||
SEP #$80 | |||
REP #$80 | |||
</pre> | |||
These instructions also affect the negative flag (this bulleted list being 37 long): | These instructions also affect the negative flag (this bulleted list being 37 long): |
Revision as of 17:13, 24 July 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):
- ADC
- AND
- ASL
- BIT
- CMP
- CPX
- CPY
- DEC
- DEX
- DEY
- EOR
- INC
- INX
- INY
- LDA
- LDX
- LDY
- ORA
- PLA
- PLB
- PLD
- PLX
- PLY
- ROL
- ROR
- SBC
- TAX
- TAY
- TCD
- TDC
- TSC
- TSX
- TXA
- TXY
- TYA
- TYX
- XBA
Also, LSR always clears the negative flag.
See Also
Reference
- Labiak, Willam. Page 109: https://archive.org/details/Programming_the_65816/page/n119