Re: A89: disabling interrupt 1


[Prev][Next][Index][Thread]

Re: A89: disabling interrupt 1




> > Well, in user mode you're not allowed to change the SR. You have to do
> > something
> >  like this instead:
> >
> >   move.w #$2100,sr
> >   trap #1   ;Puts old SR in d0
> >  ...
> >   code that saves d0 or doesn't alter it
> >  ...
> >   trap #1 ;Restore SR from what was stored in d0. You could also load d0
> with
> >  #$2000.
>
> so, to do this, l would have to save d0 to some other variable.  When is it,
> then that the interrupt 1 has to be restored?

If you always restore the SR to the same value (like $2000) then you can simply
put that value in d0 before calling trap 1 again.
trap #1 alters the sr to the value in d0 (or at least parts of it).

 / Niklas Brunlid
Check out Prosit for the TI-89 / TI-92+ at http://prosit.ticalc.org
Random PQF Quote follows:

"Let's just say that if complete and utter chaos was lightning, he'd be the
sort to stand on a hilltop in a thunderstorm wearing wet copper armour and
shouting 'All gods are bastards'."
        -- Rincewind discussing Twoflower
           (Terry Pratchett, The Colour of Magic)




Follow-Ups: References: