	.DATA
	Org	50H
TabelDesimal	Ds	3
	.CODE


HexASCII2		EQU	00FAH
Delay_1detik		EQU	015CH

PosisiAwal_LCD		EQU	0216H
Init_LCD		EQU	0237H
Kirim_Karakter		EQU	0295H


ADCInterrupt	Bit	INT1
Alamat_ADC	EQU	0C000H

ROM			EQU	2000H

	Org	ROM			;Reset Vector
	Ajmp	Start			;
	Org	ROM+3H			;External Interrupt 0 Vector
	Reti				;
	Org	ROM+0BH			;Timer 0 Interrupt Vector
	Reti				;
	Org	ROM+13H			;External Interrupt 1 Vector
	Reti				;
	Org	ROM+1BH			;Timer 1 Interrupt Vector
	Reti				;
	Org	ROM+23H			;Serial Interrupt Vector
	Reti				;
Start:
	Lcall	Init_LCD
Loop:
	Lcall	PosisiAwal_LCD
	Mov	R7,#00H
	Acall	Ambil_ADC
	Mov	DPTR,#TabelVolt8bSuhu
	Movc	A,@A+DPTR
	Acall	Konversi1BDesimal
	Acall	TampilkanLCD
	Lcall	Delay_1detik
	Ajmp	Loop

Ambil_ADC:
	Mov	DPTR,#Alamat_ADC
	Movx	@DPTR,A
	Jb	ADCInterrupt,$
	Mov	B,#0FFH
	Djnz	B,*
	Movx	A,@DPTR
	Ret
	
TampilkanLCD:
	Mov	A,#TabelDesimal
TampilkanDesimal:
	Add	A,R6
	Mov	R0,A

LoopTampilLCD:
	Dec	R0
	Mov	A,@R0
	Add	A,#30H
	Lcall	Kirim_Karakter
	Djnz	R6,LoopTampilLCD
	Ret
	
	include	c:\programs\alds31\routines\tabsuhu.asm
	include	c:\programs\alds31\routines\hexdec1b.asm