Arduino Gcc and SPI

I think arduino is based on Gcc, so can i write ASM code in the arduino?

I was readin Gcc manuals and i found this:

int foo ()
{
int x = 42;
int *y = &x;
int result;
asm ("magic stuff accessing an 'int' pointed to by '%1'"
"=&d" (r) : "a" (y), "m" (*y));
return result;
}

What i want to do is create a SPI library to use some AtMegas like SPI to UART devices, for that i need create some code in low level, and this must be created to be Master/Slave and Reader/Writer.

So can be done this?, In the Atmel MEga Pdf saids this can be done and in a full-duplex version. So some one try this?

Best Regasds.
Frank

This doesn't answer your question, but you don't have to use assembly to access SPI or I2C. Check the playground for examples - there's at least one (the external EEPROM, IIRC) that gives C code examples of SPI.

-j