<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Wed, 03 Aug 1994 16:04:14 +0100
From   : jfid@... (James Fidell)
Subject: Re: Stack behaviour.

Stephen Quan wrote:

> Pretty perculiar isn't it?!  But this goes back to what you guys
> were saying that the BRK flag always seems to be set.  Hmmmm... I
> find that truly odd, there must be a case when the BRK flag is clear.
> What happens if I tried to disable interrupts?  ie.
> 
>           LDA #4
>           PHA
>           PLP
>           PHP
>           PLA
>           RTS
> 
> Would be the value of A be?  &34???  or something else?

Definitely &34.

> If it is &34 then are we going to assume that the BRK flag is always
> set or can anyone give a case where the BRK flag will be cleared???

The BRK flag is always set, as far as I can determine.  However,
when a hardware interrupt occurs (ie the CPUs IRQ line is pulled down)
the bit in the position of the BRK flag is cleared in the image of
the SR pushed onto the stack when the CPU processes the IRQ.

James.

-- 
 "Yield to temptation --             |
  it may not pass your way again"    |     jfid@...        
                                     |
        - Lazarus Long               |              James Fidell
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>