Re: A89: Re: Disabling Interrupts
[Prev][Next][Index][Thread]
Re: A89: Re: Disabling Interrupts
hmm... I apologize if this ends up here twice, but it didn't seem to
show up on the list...
That is not entirely true that you'd have to make a "wrapper" for the
interrupt. Check this:
void myHandler(void)
{
// Your code
asm("unlk %a6; rte");
}
Zeljko Juric wrote:
> Such handler is incorrect
>
> void myHandler(void)
> {
> // Your code
> asm("rte");
> }
>
> because "rte" will not be happy with the content of the stack frame
> which is created on the beginning of each function. So, the interrupt
> handler must be a pure assembly procedure (which may call any other
> C procedure). I suggest the following handler:
>
> void myHandler(void);
> asm("myHandler:
> movem.l %a0-%a6/%d0-%d7,-(%sp)
> bsr myHandler_main
> movem.l (%sp)+,%a0-%a6/%d0-%d7
> rte");
>
> void myHandler_main(void)
> {
> // Your code (in C)
> }
>
> I hope that it helps.
>
> Cheers,
>
> Zeljko Juric
--
Scott "Wrath" Dial
wrath@calc.org
ICQ#3608935
Member of TCPA - tcpa.calc.org
PGP key available
____________NetZero Free Internet Access and Email_________
Download Now http://www.netzero.net/download/index.html
Request a CDROM 1-800-333-3633
___________________________________________________________
Follow-Ups:
References: