Thanks DaWei. This is for SPARC assembly, so the syntax is different and I'm not sure I can reference variable names within inline asm with my compiler.
But I found a similar solution:
register int tmp asm("l2");
asm(" ... "
"mov %l0, %l2"
" ... ");
return tmp;
I guess this allocates my local variable to the contents of register %l2, which is a local register for SPARC. I can modify that register in the asm block and the change is made to the variable as well.
