	.CODE
Delay_100mS		EQU	016EH
Delay_500mS		EQU	0165H

;DF-88 Routines
Init_MT8888		EQU	0682H
Kirim_DTMF		EQU	0695H
Alamat_DF88		EQU	6000H

	Org	2000H			;Reset Vector
	Ajmp	Start			;
	Org	2003H			;External Interrupt 0 Vector
	Reti				;
	Org	200BH			;Timer 0 Interrupt Vector
	Reti				;
	Org	2013H			;External Interrupt 1 Vector
	Reti				;
	Org	201BH			;Timer 1 Interrupt Vector
	Reti				;
	Org	2023H			;Serial Interrupt Vector
	Reti				;

Start:
	Mov	DPTR,#Alamat_DF88	;Reset_MT8888
	Lcall	Init_MT8888		;
	Clr	P1.1			;Off Hook
	Lcall	Delay_500mS		;Delay 1/2 detik
	Mov	DPTR,#Nomor_Telephone	;Data Pointer menuju ke alamat tabel
					;nomor telephone

LoopPutar_Nomor:
	Movx	A,@DPTR			;Ambil nomor telephone yang ditunjuk
					;oleh Data Pointer
	Cjne	A,#0FH,Putar_Nomor	;Data <> 0F, putar nomor berikutnya
	Ajmp	*			;

Putar_Nomor:
	Push	DPH			;Simpan DPTR ke SP
	Push	DPL			;
	Mov	DPTR,#Alamat_DF88	;DPTR = Alamat DF88
	Lcall	Kirim_DTMF		;Konversi nomor telephone ke DTMF
	Lcall	Delay_100mS		;Delay 200mS
	Lcall	Delay_100mS
	Pop	DPL			;Ambil DPTR dari SP
	Pop	DPH			;
	Inc	DPTR			;Tunjuk ke tabel nomor telephone berikut
	Ajmp	LoopPutar_Nomor		;

Nomor_Telephone:
	DB	'08165454567',0FH
