<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Wed, 27 Feb 2008 01:46:20 +0000
From   : jgh@... (Jonathan Graham Harston)
Subject: BBC FPGA Boots to BASIC... almost...

Pete Turnbull wrote:
> 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.
 
>P%=&900:[LDA #16:PHA:PLP:PHP:PLA:RTS
>P.~USR&900 AND 16
        10
>P%=&900:[LDA #0:PHA:PLP:PHP:PLA:RTS
>P.~USR&900 AND 16
        10
 
Well, I'll be! That's why IRQ handlers can't do PHA:PHP:PLA to
check the B bit - it doesn't exist!
 
> BASIC uses the bottom part of page 1 to store error messages, on
> the assumption that the stack will normally never get down that
 
No, BASIC, as any language, stores errors inline within the code.
Service ROMs, such as filing systems and extensions, copy errors
to &100 so the current language can access them.
 
Mark McDougall wrote:
> Now if it had been Z80, I probably could've assembled it in my
> head! :)
 
Me too ;) CD FD FF FE 00 C9...
 
-- 
J.G.Harston - jgh@...                - mdfs.net/User/JGH
There are three food groups: brown, green and ice cream.
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>