[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [avr-gcc-list] Avoid register saving
From: |
Filipe Campos |
Subject: |
RE: [avr-gcc-list] Avoid register saving |
Date: |
Thu, 1 Apr 2004 09:42:35 +0100 |
Hi.
In some application the save register can be good.
But if You write a little RTOS Kernell, the kernell shall do this, not the
compiler. It´s worst if You have a little RAM to use.
But You give a good idea, How the ISR can be writen in ASM and than compiled
by the AVR-GCC ?
Bye.
Filipe Campos
> -----Original Message-----
> From: Artur Lipowski [SMTP:address@hidden
> Sent: Thursday, April 01, 2004 7:30 AM
> To: address@hidden
> Subject: Re: [avr-gcc-list] Avoid register saving
>
> Bernhard Huber wrote:
>
> > How can I tell avr-gcc (gcc version 3.0 20010605 (prerelease)) that a
> > bunch of registers (r2 to r16) must not be saved when entering a
> > interrupt service routine.
> ...
> You should trust compiler. If it try save these regs it means that they
> probably can be corrupted if not saved.
>
> At least version 3.3.3 of the GCC (current stable) can reduce number of
> saved registers in case when no other functions are called from given
> ISR. There is no way to tell compiler that given function will use only
> subset of regs and compiler must assume that whole calling convention
> apply and it means that "call-used registers: r18-r27, r30-r31" must be
> preserved by caller.
>
> If saving a couple of regs does matter for your ISR that means that
> response time is (probably) very important and it is good time to start
> writing ISR in assembler.
>
> Regards
> --
> Artur Lipowski
>
> _______________________________________________
> avr-gcc-list mailing list
> address@hidden
> http://www.avr1.org/mailman/listinfo/avr-gcc-list
_______________________________________________
avr-gcc-list mailing list
address@hidden
http://www.avr1.org/mailman/listinfo/avr-gcc-list