CPU status flag behavior: Difference between revisions

From NESdev Wiki
Jump to navigationJump to search
m (Created page with '== Status Flag Behavior == The status register doesn't implement bits 4 and 5. The only way to test those bits would be to push the status on the stack, but any time the status ...')
 
(merging into Status flags)
 
(15 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== Status Flag Behavior ==
#REDIRECT [[Status flags]]
 
The status register doesn't implement bits 4 and 5. The only way to test those bits would be to push the status on the stack, but any time the status is pushed on the stack, those bits are set to fixed values, as described below.
 
When an IRQ or NMI occurs, the current status with bit 4 clear and bit 5 set is pushed on the stack, then the I flag is set.
 
PHP and BRK push the current status with bits 4 and 5 set on the stack; BRK then sets the I flag.
 
RTI and PLP set the status to the byte popped off the stack.

Latest revision as of 20:17, 24 October 2018

Redirect to: