static int getReg(){ int32_t reg; asm ( "mov %[reg], r12 \n" :[reg] "=&r" (reg) ); return reg; }