[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] source code of crtm48.o
From: |
Joerg Wunsch |
Subject: |
Re: [avr-gcc-list] source code of crtm48.o |
Date: |
Fri, 23 Jul 2004 09:41:56 +0200 (MET DST) |
Erik Christiansen <address@hidden> wrote:
> For assembler ISRs, it appears to be " a name like __vector_N should
> appear, with N being a small integer number."
Well, rather use preprocessed assembler instead (filename suffix .S,
the capital letter `S'), and feed it through the compiler instead the
assembler. (The compiler driver will then chain the preprocessor
together with the assembler.) Then,
#include <avr/io.h>
..global SIG_INTERRUPT0
SIG_INTERRUPT0:
your
isr
goes
here
reti
> A trial build should show a handler for ISRs not "installed", at
> "__vector_default", if I've understood the doco correctly. How that
> would avoid competing for an interrupt that you wish to handle in
> assembler, is not quite clear to me yet, since I haven't tried it.
The vectors are pre-bound to so-called `weak symbols'. These symbols
satisfy the linker's search for undefined externals, but any non-weak
(global) symbol (supposedly supplied by the application itself) will
get precedence. That way, your vector as declared above will get
linked, instead of the jump to __vector_default. Note that
__vector_default itself is also a weak symbol (jumping back to address
0 as supplied by the library), so your application can overload it
with whatever seems reasonable.
--
J"org Wunsch Unix support engineer
address@hidden http://www.interface-systems.de/~j/