INIT_UART:			
	MOV	SCON,#50H	;UART mode 1, REN=1
	MOV	PCON,#80H	;SMOD=1
	MOV	TMOD,#20H	;C/T=0, M1=1, M0=0
	MOV	TH1,#0FAH	;auto reload value
	MOV	TCON,#40H	;TR1=1 - start counting
	RET		
GETCHR:			
	CLR	C	
	JB	RI,GETCHR1	;if character received
	RET		
GETCHR1:	MOV	A,SBUF	;get it
	CLR	RI	;always clear flag!
	SETB	C	;inform main program
	RET		

SENDCHR:			
	CLR	C	
	JB	TI,SENDCHR1	;check if transmitter ;ready
	RET		
SENDCHR1:			
	CLR	TI	
	MOV	SBUF,A	;start sending
	SETB	C	;set carry to inform main
			;program
	RET		
