Re: A89: disabling interrupt 1
[Prev][Next][Index][Thread]
Re: A89: disabling interrupt 1
> > If you mean interrupt level 1 (as opposed to vector number 1, which is
> > the reset PC) then
> >
> > move.w #$2100,%sr
> >
> > should pretty well work.
>
> l tried doing that in the .asm library l am writing, where this is the only
> code:
> ...
> keylib@0002:
> move.w #$2100,sr
> rts
> ...
>
> and it exits out with a "privilege violation" when that function is called.
> ???
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.
/ 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)
References: