#include <tiny2313.h>
#include <delay.h> 

// Timer 0 overflow interrupt service routine
interrupt [TIM0_OVF] void timer0_ovf_isr(void)
{
        PORTB=0; 
}

// Timer 0 output compare A interrupt service routine
interrupt [TIM0_COMPA] void timer0_compa_isr(void)
{
        PORTB.0=1;        
}

// Timer 0 output compare B interrupt service routine
interrupt [TIM0_COMPB] void timer0_compb_isr(void)
{
        PORTB.2=1;
}

// Declare your global variables here

void main(void)
{
// Declare your local variables here

// Crystal Oscillator division factor: 1
#pragma optsize-
CLKPR=0x80;
CLKPR=0x00;
#ifdef _OPTIMIZE_SIZE_
#pragma optsize+
#endif

PORTB=0x00;
DDRB=0xFF;

PORTD=0x00;
DDRD=0x00;

TCCR0A=0x00;
TCCR0B=0x03;
TCNT0=0x00;
OCR0A=0x00;
OCR0B=0xFF;

// Timer(s)/Counter(s) Interrupt(s) initialization
TIMSK=0x07;


#asm("sei")

while (1)
        {
                OCR0A++;
                OCR0B--;
                delay_ms(50)       ;
        }
      
}
