[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Hard coded asm in an interrupt routine
From: |
Larry Barello |
Subject: |
Re: [avr-gcc-list] Hard coded asm in an interrupt routine |
Date: |
Thu, 25 Jul 2002 13:34:26 -0700 |
GCC pushes all registers used by the ISR in the prolog. If you have
little C code and no procedure calls, it probably won't save much.
You better check what it saves (compile using the -S option) and add,
in your asm, additional pushes to make some temporary work space.
Better yet: punt C altogether and just save what you need. There is
*no* reason to use a C declaration if you don't plan on using C code.
Take a look at the source of some of the libraries to see how to write
an ASM module. It is pretty simple. E.g:
----- Snip here ---
.func SomeFunc
.global SomeFunc
SomeFunc:
asm
asm
asm
reti
.endfunc
--- Snip here ----
Cheers!
----- Original Message -----
From: "Grant Stockly" <address@hidden>
...
> My most important question is in an ISR in C, can I use the
temporary
> registers in the AVR for anything that I want? I don't plan on
having any
> C code in the ISR. Just a C shell.
>
> Grant
>
> avr-gcc-list at http://avr1.org
>
avr-gcc-list at http://avr1.org