Én se értem mi az ötleteddel a gond: *d = (r & 0x8000) != 0; r <<= 1;Ezt C-ből máshogy nem nagyon oldod meg; ott nincs carry flag.