Atmel ATMega8 doesn't hold "HIGH" state of PB0 and PB1
Which ATmega exactly? What is your fuse configuration?

You can try calling wdt_disable() at the beginning (it is defined in &lt;avr/wdt.h&gt;), as the watchdog can be enabled for example by previous firmware (watchdog is not disabled after a reset) or can be by always enabled at reset.

There is also a fuse setting that does not allow disabling of the watchdog - you have to call wdt_reset() somewhere in the main loop.