0% found this document useful (0 votes)
12 views

Code 2

mide

Uploaded by

HujungLangit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Code 2

mide

Uploaded by

HujungLangit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

LCD

SECS
MINS
HRS
RS
E
ORG
AJMP

EQU
EQU
EQU
EQU
BIT
BIT
0H
MAIN

ORG
CLR
MOV
MOV
MOV
ACALL
ACALL
ACALL
AJMP

30H
P2.1
SECS,#0D
MINS,#0D
HRS,#0D
LP1
LP2
calendar
$

LP1:
LOOP1:

MOV
CLR
MOVC
ACALL
INC
JNZ
RET

DPTR,#MYCOM
A
A,@A+DPTR
comnWrt
DPTR
LOOP1

LP2:

MOV
ACALL
MOV
ACALL
MOV
ACALL
MOV
ACALL
MOV
ACALL
RET

A,#80H
comnWrt
A,#82H
comnWrt
A,#":"
dataWrt
A,#85H
comnWrt
A,#":"
dataWrt

calendar:

ACALL

updateDays

ACALL
ACALL
ACALL
ACALL
INC
MOV
CJNE
MOV
INC
MOV
CJNE
MOV
INC
MOV
CJNE
MOV
CJNE
ADD

updateHrs
updateMins
updateSecs
delaySec
SECS
A,SECS
A,#60,C1
SECS,#0
MINS
A,MINS
A,#60,C1
MINS,#0
HRS
A,HRS
A,#12,C2
A,6AH
A,#1,C4
A,#1

MAIN:

C1:

P0
30H
31H
32H
P2.0
P2.2

C2:
C4:

MOV
6AH,A
CJNE
A,#13,C1
MOV
HRS,#1
AJMP calendar

delaySec:
MOV
MOV
AGAIN: MOV

R2,#15
TMOD,#1
TL0,#1

MOV
SETB
JNB
CLR
CLR
DJNZ
RET

TH0,#53
TR0
TF0,$
TR0
TF0
R2,AGAIN

updateSecs:
MOV
ACALL
MOV
MOV
DIV
ORL
ACALL
MOV
ORL
ACALL
RET

A,#86H
comnWrt
A,SECS
B,#10
AB
A,#30H
dataWrt
A,B
A,#30H
dataWrt

updateMins:
MOV
ACALL
MOV
MOV
DIV
ORL
ACALL
MOV
ORL
ACALL
RET

A,#83H
comnWrt
A,MINS
B,#10
AB
A,#30H
dataWrt
A,B
A,#30H
dataWrt

updateHrs:
MOV
ACALL
MOV
MOV
DIV
ORL
ACALL
MOV
ORL
ACALL
RET
updateDays:

MOV
ACALL

A,#80H
comnWrt
A,HRS
B,#10
AB
A,#30H
dataWrt
A,B
A,#30H
dataWrt
A,#88H
comnWrt

AM:

PM:

comnWrt:

dataWrt:

CJNE
MOV
ACALL
MOV
ACALL
RET
MOV
ACALL
MOV
ACALL
RET

A,#1,PM

MOV
CLR
SETB
ACALL
CLR
RET
MOV
SETB
SETB
ACALL
CLR
RET

LCD,A
RS
E
DELAY
E

A,#"A"
dataWrt
A,#"M"
dataWrt
A,#"P"
dataWrt
A,#"M"
dataWrt

LCD,A
RS
E
DELAY
E

DELAY:
S11:
S21:

MOV
MOV
DJNZ

MYCOM: DB

R7,#6
R6,#150
R6,S21
DJNZ
R7,S11
RET
ORG
300H
38H,0FH,01H,06H,80H,0H
END

You might also like