Please excuse this simple question - I'm a bit new to AVR assembler, but have many many years of other assemblers and languages.
In the ATmega48 manual (2545-AVR-09/07) on page 52 the follow code is commented as "Clear WDRF in MCUSR":
in r16, MCUSR andi r16,(0xff & (0<<WDRF)) out MCUSR, r16
Am I missing something here? The above looks like it sets MCUSR to zero. In my ignorance, I would have expected:
... andi r16, ~(1<<WDRF) ...
...or similar which only clears the specified bit.