.org 22
	 rjmp	USART_RXC			;USART Rx Complete
.org 24
	 rjmp	USART_UDRE			;USART Data Registry Empty


USART_Init:		;Инициализация
	ldi temp,25
	out UBRRL,temp
	ldi temp,(1<<RXEN)|(1<<TXEN)
	out UCSRB,temp
	ldi temp,(1<<URSEL)|(3<<UCSZ0)
	outUCSRC,temp
	sbi UCSRB,RXCIE
	ret

Out_com:	;Вывод символа
	sbis 	UCSRA,UDRE
	rjmp 	out_com
	out 	UDR,temp
	ret
In_com:		;Ждем символ
	sbis	UCSRA,RXC
	rjmp	In_com
	in		temp,UDR
	ret
USART_RXC:
	in 		temp,UDR
	cbi 	UCSRB,RXCIE
	cpi		temp,$31
	breq	send_symbol
	sbi		UCSRB,RXCIE
	cbi		UCSRA,RXC
	reti
USART_UDRE:
	out	UDR,temp
	cbi UCSRB,UDRIE
	ldi	temp,$AA
	rcall 	Out_com	
	sbi UCSRB,UDRIE
	reti
send_symbol:
 	ldi temp,$BF
	rcall out_com
	ret