Program works as a 16bit counter and its state is written on ports B,E (where B is the high and E is the low byte). When counter overflow it is cleared and counts upward again.