用8031单片机控制的数字钟
MOV A,30H
MOVX @R1,A
MOV R0,31H
MOV A,@R0
MOV DPTR,#SC
MOVC A,@A+DPTR
MOV R1,#22H
MOVX @R1,A
LCALL D1
MOV A,30H
RR A
MOV 30H,A
DEC 31H
DJNZ R7,SS1
DJNZ R6,SS2
RET
SC: DB 0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H,0FFH
KEY: MOV 42H,#00H
A0: MOV P1,#0FFH
MOV A,P1
ANL A,#38H
MOV R3,A
LCALL DELAY
MOV P1,#0FFH
MOV A,P1
ANL A,#38H
CLR C
SUBB A,R3
JNZ A0
MOV A,R3
CJNE A,#38H,A00
SJMP A0
A00: CJNE A,#30H,TOK2
INC 41H
MOV R2,41H
CJNE R2,#3CH,A1
MOV 41H,#00H
A1: MOV P1,#0FFH
MOV A,P1
ANL A,#08H
JNZ A0
LCALL DELAY
SJMP A1
TOK2: CJNE A,#28H,TOK3
DEC 41H
MOV R2,41H
CJNE R2,#0FFH,A2
MOV 41H,#3BH
A2: MOV P1,#0FFH
MOV A,P1
ANL A,#10H
JNZ A0
LCALL DELAY
SJMP A2
TOK3: CJNE A,#18H,A0
AA: MOV P1,#0FFH
MOV A,P1
ANL A,#20H
JNZ A3
LCALL DELAY
SJMP AA
A3: MOV P1,#0FFH
MOV A,P1
ANL A,#38H
MOV R3,A
LCALL DELAY
MOV P1,#0FFH
MOV A,P1
ANL A,#38H
CLR C
SUBB A,R3
JNZ A3
MOV A,R3
CJNE A,#38H,A33
SJMP A3
A33: CJNE A,#30H,TO2
INC 40H
MOV R2,40H
CJNE R2,#18H,A4
MOV 40H,#00H
A4: MOV P1,#0FFH
MOV A,P1
ANL A,#08H
JNZ A3
LCALL DELAY
SJMP A4
TO2: CJNE A,#28H,TO3
DEC 40H
MOV R2,40H
CJNE R2,#0FFH,A5
MOV 40H,#17H
A5: MOV P1,#0FFH
MOV A,P1
ANL A,#10H
JNZ A3
LCALL DELAY
SJMP A5
TO3: CJNE A,#18H,A3
RET
KEY0: MOV 41H,21H
MOV 40H,20H
CLR TR0
ACALL KEY
CLR PSW.5
MOV 22H,42H
MOV 21H,41H
MOV 20H,40H
MOV TL0,#0B7H
MOV TH0,#3CH
SETB TR0
RET
KEY1: MOV 41H,51H
MOV 40H,50H
LCALL KEY
CLR 7FH
MOV 51H,41H
MOV 50H,40H
RET
D1: MOV R4,#02H
D11: MOV R5,#0FFH
DJNZ R5,$
DJNZ R4,D11
RET
DELAY: PUSH ACC
LCALL CUTIN1
LCALL SSCAN
POP ACC
RET
- 用CPLD实现FIR数字滤波器的设计(08-07)
- 基于DSP的短波分集合成接收机(09-01)
- DSP+FPGA嵌入式多路视频监控系统硬件平台(04-10)
- 数字信号处理器TMS320F241在变频空调中的应用(04-28)
- 数字信号控制器在变频家电中的应用(05-15)
- 什么是DSP及DSP技术详解(05-15)