[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Avoid register saving
From: |
Artur Lipowski |
Subject: |
Re: [avr-gcc-list] Avoid register saving |
Date: |
Fri, 02 Apr 2004 07:55:24 +0200 |
User-agent: |
Mozilla Thunderbird 0.5+ (Windows/20040331) |
Filipe Campos wrote:
> 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.
I'm afraid that you cannot avoid writing core ISR handler in assembler
in such cace.
>
> But You give a good idea, How the ISR can be writen in ASM and than compiled
> by the AVR-GCC ?
#include <avr/io.h>
.global SIG_OVERFLOW0
SIG_OVERFLOW0:
push __tmp_reg__
in __tmp_reg__, _SFR_IO_ADDR(SREG)
push work1
.................................
pop work1
out _SFR_IO_ADDR(SREG), __tmp_reg__
pop __tmp_reg__
reti
Put above source into file with .S suffix and thats all.
If your system has problems with cases of letters in fineames then you
can use "-x assembler-with-cpp" as an option for the GCC.
Regards,
--
Artur Lipowski
_______________________________________________
avr-gcc-list mailing list
address@hidden
http://www.avr1.org/mailman/listinfo/avr-gcc-list