Wie wäre es mit etwas inline Assembler ?

Beispiel:
Code:
asm volatile (
	    
	    "ldi %2,8"          "\n\t"
	    "0:"                "\n\t"
	    "lsr %0"            "\n\t"
            "rol __tmp_reg__"   "\n\t"
            "dec %2"            "\n\t"
            "brne  0b" "\n\t"
            "mov %0,__tmp_reg__" "\n\t"
	    : "=a" (tmp)
	    : "0" (tmp), "a" (count) 
);
Dreht mit hilfe von rol alle Bits in tmp um, also Bit 0 wird zu 7 1 zu 6 usw.

Gruß Sebastian