赞
踩
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
程序:
ORG 0000H
LJMP MAIN
ORG 000BH
LJMP TIME
ORG 1000H
HOUR1 EQU 10h
HOUR2 EQU 12h
MIN1 EQU 14h
MIN2 EQU 16h
SEC1 EQU 18H
COUNT EQU 20H
NUM1 EQU 22H
NUM2 EQU 24H
LL4 EQU 26H
s1 bit P1.0
s2 bit P1.1
s3 bit P1.2
s4 bit P1.3
A1 EQU 36H
A2 EQU 38H
B1 EQU 40H
B2 EQU 42H
WELA bit P1.6
DULA bit P1.7
C1 EQU 48H
C2 EQU 50H
D1 EQU 52H
D2 EQU 54H
F1 EQU 56H
E1 EQU 58H
TIMEEPRO EQU 60H
MAIN:
MOV SP,#50H
MOV P3,#0FFH
START:
MOV HOUR1,#00H
MOV MIN1,#00H
MOV SEC1,#00H
MOV HOUR2,#01H
MOV MIN2,#00H
MOV COUNT,#00H
MOV NUM1,#00H
MOV NUM2,#00H
MOV TMOD,#01H
MOV TH0,#0D8H
MOV TL0,#0EFH
SETB ET0
SETB EA
SETB TR0
LOOP:
MOV A,NUM2
JNZ LOOP1
LCALL DISPLAY1
LCALL KEYTIME
LCALL SETTIME
LJMP LOOP LOOP1:
LCALL DISPLAY2
LCALL KEYTIME
LCALL SETTIME
LJMP LOOP ;***************SETTIME PROGRAM**********
MM2:
LCALL DISPLAY2
MOV A,NUM2
CJNE A,#2,LL5
DEC MIN2
MOV A,MIN2
CJNE A,#0,LL5
MOV MIN2,#60
LL5:
LCALL DISPLAY2 RET ;***************KEYTIME PROGRAM************
KEYTIME:
L1:
JB S2,L3
LCALL DELAY5
MSTOP2:
JB S2,L3
MOV C,S2
JNC MSTOP2
INC NUM1
MOV A,NUM1
CJNE A,#1,L2
CLR TR0
L2:
CJNE A,#4,L3
MOV NUM1,#0
SETB TR0
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。