		Org	*

ASCII_Out:
	Acall	Hex_ASCII2
	Acall	Serial_Out
	XCH	A,B
	Acall	Serial_Out
	Ret

Out_DPTR:
	Acall	Enter_Code
	Mov	A,DPH
	Acall	ASCII_Out
	Mov	A,DPL
	Acall	ASCII_Out
	Ret

Enter_Code:
	Push	A
	Mov	A,#0DH
	Acall	Serial_Out
	Mov	A,#0AH
	Acall	Serial_Out
	Pop	A
	Ret

Init_Serial:
	MOV     SCON,#52H        ; Mode 1 Ren
	MOV	TMOD,#20H        ; T0 Mode 2, T1 Mode 2
	MOV	TH1,#0FDH        ; 9600 Baudrate
	MOV     TCON,#040H       ; T1 On, T0 Off
	MOV     PCON,#00H        ;
	RET   

Serial_Out:
	Clr	TI
	Mov	SBUF,A
TungguKirim:
	Jnb	TI,TungguKirim
	Ret

Serial_In:
	Clr	RI
TungguTerima:
	Jnb	RI,TungguTerima
	Mov	A,SBUF
	Ret

KirimPesan_Serial:
	Mov	A,#00H
	Movc	A,@A+DPTR
	Cjne	A,#0FH,KirimTerus
	Ret

KirimTerus:
	Acall	Serial_Out
	Inc	DPTR
	Ajmp	KirimPesan_Serial
