How can I write an assembly ISR in a C program (AVR)?
21:21 15 Apr 2011

Following on from my other question, Help optimising this C (AVR) code? :), I just realised that I don't really know the mechanics of how to implement an ISR in assembly within my C program. I googled, but I didn't find anything too useful.

Basically, I want to set up everything else in my C project (including the registers to get the interrupt to fire), but I want the interrupt to execute some assembly code that I've written.

I'm using AVR Studio 6 on Windows if that helps. I've been told I need to use .s files, but apart from that I'm not really sure what to do. Is the basic structure just the following?

#include 
TIMER1_COMPA_vect:
    ; assembly instructions here

If I want the assembly to run when the TIMER1_COMPA_vect interrupt is fired (this is the name of the ISR in C). Or am I totally off track? What is a basic template of what I need to do? Or if it's a dumb question, is there a link where I can find more information?

c assembly avr