ORG 0000H
LJMP START
ORG 0003H
RETI
ORG 000BH
LJMP INTT0
ORG 0013H
RETI
ORG 001BH
LJMP INTT1
ORG 0023H
RETI
ORG 002BH
RETI
START:
MOV R0, #70H
MOV R7, #0BH
MOV 20H, #00H
CLEARDISP:
MOV @R0, #00H
INC R0
DJNZ R7,CLEARDISP
MOV 7AH,#0AH
MOV TMOD,#11H
MOV TL0, #0B0H
MOV TH0, #3CH
MOV TL1, #0B0H
MOV TH1, #3CH
SETB EA
SETB ET0
SETB TR0
MOV R4,#14H
START1:
LCALL DISPLAY
JNB P3.2,SETMM1
SJMP START1
SETMM1:
LJMP SETMM
INTT0:
PUSH ACC
PUSH PSW
CLR ET0
CLR TR0
MOV A,#0B7H
ADD A,TL0
MOV TL0,A
MOV A,#3CH
ADD A,TH0
MOV TH0,A
SETB TR0
DJNZ R4, OUTT0
ADDSS:
MOV R4,#14H
MOV R0,#71H
ACALL ADD1
MOV A,R3
CLR C
CJNE A,#60H,ADDMM
ADDMM:
JC OUTT0
ACALL CLR0
MOV R0,#77H
ACALL ADD1
MOV A,R3
CLR C
CJNE A,#60H,ADDHH
ADDHH:
JC OUTT0
ACALL CLR0
MOV R0,#79H
ACALL ADD1
MOV A,R3
CLR C
CJNE A,#24H,HOUR
HOUR:
JC OUTT0
ACALL CLR0
OUTT0:
MOV 72H,76H
MOV 73H,77H
MOV 74H,78H
MOV 75H,79H
POP PSW
POP ACC
SETB ET0
RETI
INTT1:
PUSH ACC
PUSH PSW
MOV TL1, #0B0H
MOV TH1, #3CH
DJNZ R2,INTT1OUT
MOV R2,#06H
CPL 02H
JB 02H,FLASH1
MOV 72H,76H
MOV 73H,77H
MOV 74H,78H
MOV 75H,79H
INTT1OUT:
POP PSW
POP ACC
RETI
FLASH1:
JB 01H,FLASH2
MOV 72H,7AH
MOV 73H,7AH
MOV 74H,78H
MOV 75H,79H
AJMP INTT1OUT
FLASH2:
MOV 72H,76H
MOV 73H,77H
MOV 74H,7AH
MOV 75H,7AH
AJMP INTT1OUT
ADD1:
MOV A,@R0
DEC R0
SWAP A
ORL A,@R0
ADD A,#01H
DA A
MOV R3,A
ANL A,#0FH
MOV @R0,A
MOV A,R3
INC R0
SWAP A
ANL A,#0FH
MOV @R0,A
RET
CLR0:
CLR A
MOV @R0,A
DEC R0
MOV @R0,A
RET
SETMM:
CLR ET0
CLR TR0
LCALL DL1S
JB P3.2,CLOSEDIS
MOV R2,#06H
SETB ET1
SETB TR1
SET2:
JNB P3.2,SET1
SETB 00H
SET4:
JB P3.2,SET3
LCALL DL05S
JNB P3.2,SETHH
MOV R0,#77H
LCALL ADD1
MOV A,R3
CLR C
CJNE A,#60H,HHH
HHH:
JC SET4
LCALL CLR0
CLR C
AJMP SET4
CLOSEDIS:
SETB ET0
SETB TR0
CLOSE:
JB P3.2,CLOSE
LCALL DISPLAY
JB P3.2,CLOSE
WAITH:
JNB P3.2,WAITH
LJMP START1
SETHH:
CLR 00H
SETHH1:
JNB P3.2,SET5
SETB 01H
SET6:
JB P3.2,SET7
LCALL DL05S
JNB P3.2,SETOUT
MOV R0,#79H
LCALL ADD1
MOV A,R3
CLR C
CJNE A,#24H,HOUU
HOUU:
JC SET6
LCALL CLR0
AJMP SET6
SETOUT:
JNB P3.2,SETOUT1
LCALL DISPLAY
JNB P3.2,SETOUT
CLR 01H
CLR 00H
CLR 02H
CLR TR1
CLR ET1
SETB TR0
SETB ET0
LJMP START1
SET1:
LCALL DISPLAY
AJMP SET2
SET3:
LCALL DISPLAY
AJMP SET4
SET5:
LCALL DISPLAY
AJMP SETHH1
SET7:
LCALL DISPLAY
AJMP SET6
SETOUT1:
LCALL DISPLAY
AJMP SETOUT
DISPLAY:
MOV R1,#70H
MOV R5,#0BFH
PLAY:
MOV A,R5
MOV P2,A
MOV A,@R1
MOV DPTR,#TAB
MOVC A,@A+DPTR
MOV P0,A
LCALL DL1MS
INC R1
MOV A,R5
JNB ACC.1,ENDOUT
RR A
MOV R5,A
AJMP PLAY
ENDOUT:
SETB P2.1
MOV P0,#0FFH
RET
TAB:
DB 28H,7EHH,0A2H,62H,74H,61H,21H,7AH,20H,60H
DL1MS:
MOV R6,#14H
DL1:
MOV R7,#19H
DL2:
DJNZ R7,DL2
DJNZ R6,DL1
RET
DS20MS:
ACALL DISPLAY
ACALL DISPLAY
ACALL DISPLAY
RET
DL1S:
LCALL DL05S
LCALL DL05S
RET
DL05S:
MOV R3,#20H
DL05S1:
LCALL DISPLAY
DJNZ R3,DL05S1
RET
END