;Timer0 -Initialization for Timer0_overflow interrupt
init_timer0:
	ldi	tmp1,prescaler_timer	
	out	tccr0,tmp1
	ldi	tmp1,ft_div	
	mov	rint,tmp1
	out	tcnt0,tmp1
	ldi	tmp1,1
	out	timsk,tmp1
;Soft Timers
	ret
soft_timer:
	lds	tmp1,s_timer0
	tst	tmp1
	breq	sft1
	dec	tmp1
	sts	s_timer0,tmp1
sft1:
	lds	tmp1,s_timer1
	tst	tmp1
	breq	ex_sft
	dec	tmp1
	sts	s_timer1,tmp1
ex_sft:
	ret
;Interrupt service routine for timer0 overflow
isr_t0_ov:
	out	tcnt0,rint
	in	rsav,sreg
	push	tmp1
	rcall	soft_timer
	pop	tmp1
	out	sreg,rsav
	reti
