Re: [cc65] 6502.h

Date view Thread view Subject view

From: Piotr Fusik (
Date: 2003-01-09 14:51:08

On Thu, 9 Jan 2003, Ullrich von Bassewitz wrote:

> The break and interrupt disable flag are ignored. I'm not sure if the break
> flag can be set by PHA/PLP anyway. My copy of Rodney Zacks "Programming the
> 6502" says the B flag can be set by PLP, but other books disagree. Allowing to
> set the I flag would make sense, I think.

To my knowledge, there is no real B flag state in 6502.
This bit is only used when invoking an interrupt: BRK pushes flags with B
bit set, other interrupts with reset. PHP always pushes 1.
As for the unused bit, it is always pushed (by PHP and interrupt) as 1.
> >     	and	#%11001011
> >
> > >>> Bits 4 and 5 are ignored by plp on 6502, but not on 65816, I think.
> > >>> I'm not sure about other CPUs.
> > >>> Enabling interrupts is not a good idea IMHO.
> So I will change this to %11001111 to remove the break flag.

Again, why?
Bits 4 and 5 are used for some extensions in other 65xx family CPUs, so I
don't see a reason to always clear them.


To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.

Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-01-09 14:51:43 CET