ich glaube, ich habe jetzt eine akzeptable Lösung gefunden:

register uint8_t Reg3 asm("r3");

static inline __attribute__((always_inline)) void SetReg3(uint8_t tmp)
{ asm volatile ("mov r3, %0" : : "r" (tmp): "r3");}

static inline __attribute__((always_inline)) uint8_t GetReg3(void)
{ uint8_t tmp; asm volatile ("mov %0, r3": "=r" (tmp)); return tmp;}

wird kompiliert zu "mov r3, r24" und "mov r24, r3". Je nach Konstellation ersetzt der Compiler r24 durch ein anderes Register.

Das Ganze ist (noch) nicht 100%-tig optimal, kommt der Anforderung aber schon sehr nahe. Hier hab ich noch einmal beschrieben.

vg RdBaron