Program works as a 8bit counter and its state is written on ports B. If counter overflows it is cleared and counts upward again.