I need to write some interrupt handling routines that are very fast. They aren't very complicated, just some basic logic operations, but I want to write them in AVR assembler so that they will be as fast as possible. Is there a way to embed assembler instructions into a statement, or do I need to use AVRStudio to write this stuff?
The arduino compiler does a reasonable job of optimizing C code involving basic logic, you may want to look at the assembler output that is produced by the optimizer from the C coded version of your handler before deciding to roll your own. There are a number of Arduino threads discussing avr-objdump - the utility to dump the disassembled listing, here is one link: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1241117308
Of course there is. Even the arduino libraries do this. The "secret" is to understand that the arduino actually use GCC for compiling. Hence your question is basically how to embed assembler in C code. This is of course possible and described for example here:
If you want to use inline assembler (assembler embedded into C code, then it is possible as stated above)
If you want to write .S files, so assembler files that are not embedded in the C code, then you have a problem, because the current Arduino IDE does not support this. You can use the modified LumNet IDE (it supports .S files in the core at least) or wait for the next Arduino IDE release... I hope they will include assembler support soon.
If you want to write .S files, so assembler files that are not embedded in the C code, ... wait for the next Arduino IDE release... I hope they will include assembler support soon.
For anyone in the future that might find this thread, this support has been added to the version of the IDE in SVN which will become 0018. (Might I add, yay! :))