[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] interrupt in as
From: |
Kang Tin LAI |
Subject: |
Re: [avr-gcc-list] interrupt in as |
Date: |
Tue, 09 Oct 2001 22:42:08 +0800 |
Hi,
Try these:
void SIG_INTERRUPT0(void) __attribute__ ((naked));
void SIG_INTERRUPT0(void)
{
/* your codes */
}
No overhead, including "reti", even not in pure assembler code.
Kang
Torsten Hahn wrote:
>
> Hi,
>
> can explain me somebody how can i implement an interrupt-handler purely in
> assembler ?
>
> I would need an interrupt routine with no overhead from the c-compiler. If I
> use
>
> SIGNAL(INTERRUPT0)
> {
> asm("nop");
> }
>
> I get code output like this:
>
> 000000b4 <_interrupt1_>:
> b4: 1f 92 push r1
> b6: 0f 92 push r0
> b8: 0f b6 in r0, 0x3f ; 63
> ba: 0f 92 push r0
> bc: 11 24 eor r1, r1
> be: 00 00 nop
> c0: 0f 90 pop r0
> c2: 0f be out 0x3f, r0 ; 63
> c4: 0f 90 pop r0
> c6: 1f 90 pop r1
> c8: 18 95 reti
>
> The Problem is now, that i have an extremly time critical applikation and i
> have for some reasons only 16 (!) takt-cycles to handle this interrupt
> optimal. The code constructet wasts about 12 of them.
>
> Thanks,
> TH.
> --
> Torsten Hahn / Chemnitzer Str. 4 / 09599 Freiberg / Germany
> mail: address@hidden
> phone: (+49) 177 2181338
> pgp key avaiable at: http://math-www.uni-paderborn.de/pgpnet/wwwkeys.html
>
> _______________________________________________
> avr-gcc-list mailing list
> address@hidden
> http://avr.jpk.co.nz/mailman/listinfo/avr-gcc-list