<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Tue, 26 Feb 2008 21:55:57 +0000
From   : pete@... (Pete Turnbull)
Subject: BBC FPGA Boots to BASIC... almost...

On 26/02/2008 20:40, Jonathan Graham Harston wrote:
> Peter Coghlan wrote:
>> Getting back to BRK, it has always been clear when the B flag is
>> set but it I don't think I have ever found out when exactly it
>> is cleared. I assume it gets cleared when there is an IRQ? If
>  
> Looking through documentation I cannot find anything explicit.
> I've always assumed that a hardware IRQ clears 'B' and a software
> IRQ (ie BRK) sets it, and nothing else effects it, other than PLP.

Not even PLP, some textbooks notwithstanding.  I recall that the B flag 
isn't actually implemented as a bit in the status register.  Instead, 
that bit is forced to a one when the status register is pushed onto the 
stack, if the push is the result of a BRK rather than an IRQ.  That's 
why you have to read the value that was pushed initially; if you try 
something like PHP,PLA during the IRQ/BRK handler, it will always appear 
as a zero.  Or maybe as a one, I don't remember that detail.

-- 
Pete                                           Peter Turnbull
                                               Network Manager
                                               University of York
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>