Zitat Zitat von thewulf00
Also fhs. Deine Posts begeistern mich immer wieder. Starkes Stück Code!
Ja, guter Ansatz. Nur schade, dass das mühsam errechnete Ergebnis so achtlos weggeworfen wird. Bild  

Besser:
Code:
static inline void bitswp2_4(uint8_t *b) {
    asm volatile (
       "mov __tmp_reg__, %0"   "\n\t"
       "bst %0,2"   "\n\t"
       "bld %0,4"   "\n\t"
       "bst __tmp_reg__,4" "\n\t"
       "bld %0,2"  "\n\t"
       : "=d" (*b)
       : "0" (*b)
    );
}