C main app, Assembler interrupts?

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi!

How would i tell gcc to link the ISR calls to my assembler written ISR routines?

Now if i make a small c program:

#include 
#include 

int main()
{
}

ISR(TIMER1_COMPA_vect)
{
asm("nop");
}

this would produce:

jmp __vector_6

in the TIMER1_COMPA interrupt vector. How can i make gcc put jmp whatever_address in there instead?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Presumably you haven't spotted:

http://www.nongnu.org/avr-libc/u...

and specifically:

http://www.nongnu.org/avr-libc/u...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As you are looking at the links provided by Cliff, keep in mind-

Quote:
How can i make gcc put jmp whatever_address in there instead?
The ONLY thing needed to get into the vector table, is a function with a vector name. 'TIMER1_COMPA_vect' is just a define for '__vector6', so as soon as you use that name (either the define or the 'real' name), the vector will then rjmp/jmp to the function. If no '__vectorN' names are used, then the vector will rjmp/jmp to '__bad_interrupt'.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, that was helpful!