this is the program that i used in my project
.equ en,p1.5
.equ rs,p1.3
.equ rw,p1.4
.equ lcdport,p2
.equ adport,p0
.equ rd,p1.0
.equ wr,p1.1
.equ intr,p1.2
.equ msec,5fh
.equ sec,5eh
.equ min,5dh
.equ hrs,5ch
ajmp start
.org 0bh
push acc
mov a,msec
inc a
mov msec,a
cjne a,#20,halas
mov msec,#0
mov a,sec
inc a
mov sec,a
cjne a,#60,halas
mov sec,#0
mov a,min
inc a
mov min,a
cjne a,#60,halas
mov min,#0
mov a,hrs
inc a
mov hrs,a
cjne a,#24,halas
mov hrs,#0
halas: mov th0,#3ch
mov tl0,#0b0h
pop acc
reti
start: mov sp,#5fh
mov msec,#0
mov sec,#0
mov min,#0
mov hrs,#0
mov tmod,#00000001b
mov th0,#3ch
mov tl0,#0b0h
mov ie, #10000010b
setb tr0
clr en
clr rw
;init LCD
clr rs
mov dptr,#initxt
init: clr a
movc a,@a+dptr
jz nxt
acall commwrt
inc dptr
acall dlay
sjmp init
nxt: mov dptr,#testtxt
acall txt_LCD
next: clr rs
mov a,#11000000b
acall commwrt
mov dptr,#testtxt2
acall txt_LCD
acall adconv
acall showhex
mov a,#'H'
acall write_LCD
mov a,#' '
acall write_LCD
acall showtime
stop: sjmp next
adconv: clr wr
setb wr
neoc: jb intr,neoc
clr rd
mov a,adport
setb rd
ret
showtime:
mov a,hrs
acall showdec
mov a,#':'