accessing assembler from within the Arduino IDE

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?

Thanks!

unsing inline attribut perhaps http://www.nongnu.org/avr-libc/user-manual/inline_asm.html

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:

http://www.nongnu.org/avr-libc/user-manual/inline_asm.html

Needless to say that this is somewhat tricky stuff. But if you are asking something like this then you probably know what you are heading into.

Udo, that's the same document linked in the first reply above.

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.

Well to be honest I've never done assembler programming on an AVR before, but I used to do it all the time on 6502 and 68HC11 projects.

Might as well move on to AVR now, right? It is the wave of the... present ;)

p.s. thanks all for the help!

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! :))

--Philip;