Main:
	call Test
	jmp $		; endless
;------------------------------------------------------------
;serial interrupt
Ser_Int:
	jb TI, ExitISR	; ignore if it is a transmission
	jnb RI,ExitISR	; test if it is a reception
	clr RI		; clear reception flag for next reception
	mov A,SBUF		; read data from uart
ExitISR:
	reti
;------------------------------------------------------------
Test:
	mov	dptr,#Test_String
	call	OutStr
	ret
;********************************************************************
; Send a null terminated string out serial port
;********************************************************************
OutStr:
	clr a
      movc a,@a+dptr	; get character
      jz exit		; stop if char = null
	call	OutChar
      inc dptr		; point to next char
      sjmp OutStr
exit:
	ret

Test_String:
DB	'This is a Test',0dh,0ah,0
;-----------------------------------------------------------------
OutChar:
	mov	sbuf,a	;Load SBUF
	jnb	TI,$		;wait for last bit to transfer
	clr	TI		;get ready for next byte	
	RET			;
