ORG 0000H
AJMP MAIN
ORG 000BH
AJMP T0ZD
ORG 00100H
MAIN:CLR TR0
CLR P3.0
SETB 20H.1
CLR 20H.0
MOV 40H,#00H
MOV 41H,#00H
MOV 42H,#00H
MOV 43H,#00H
MOV 44H,#06H
MOV 45H,#00H
MOV 46H,#02H
SETB EA
SETB ET0
MOV TMOD,#01H
MOV TL0,#0B0H
MOV TH0,#3CH
JPJC:LCALL XSCX
MOV P1,#0FFH
JB P1.0,JC12
LCALL XDYS
JB P1.0,JC12
PP10:JNB P1.0,DP10
AJMP MAIN
JC12:MOV P1,#0FFH
JB P1.2,JC11
LCALL XDYS
JB P1.2,JC11
PP12:JNB P1.2,DP12
ACALL TSCX
JC11:MOV P1,#0FFH
JB P1.1,JPJC
LCALL XDYS
JB P1.1,JPJC
PP11:JNB P1.1,DP11
CPL 20H.0
JB 20H.0,KSJS
CLR TR0
SETB 20H.1
AJMP JPJC
DP10:LCALL XSCX
AJMP PP10
DP11:LCALL XSCX
AJMP PP11
DP12:LCALL XSCX
AJMP PP12
KSJS:CLR 20H.1
SETB P2.5
JB P3.0,JPJC
SETB TR0
AJMP JPJC
XSCX:MOV DPTR,#TAB
MOV A,40H
MOVC A,@A+DPTR
MOV P2,#0FFH
MOV P0,A
CLR P2.0
ACALL XSYS
MOV DPTR,#TAB1
MOV A,41H
MOVC A,@A+DPTR
MOV P2,#0FFH
MOV P0,A
CLR P2.1
ACALL XSYS
MOV DPTR,#TAB
MOV A,42H
MOVC A,@A+DPTR
MOV P2,#0FFH
MOV P0,A
CLR P2.2
ACALL XSYS
MOV DPTR,#TAB1
MOV A,43H
MOVC A,@A+DPTR
MOV P2,#0FFH
MOV P0,A
CLR P2.3
ACALL XSYS
MOV DPTR,#TAB
MOV A,44H
MOVC A,@A+DPTR
MOV P2,#0FFH
MOV P0,A
CLR P2.4
ACALL XSYS
JNB 20H.1,ZBTC
MOV DPTR,#TAB2
MOV A,45H
MOVC A,@A+DPTR
MOV P2,#0FFH
MOV P0,A
CLR P2.5
ACALL XSYS
ZBTC:RET
TSCX:CLR TR0
CLR 20H.0
MOV 40H,#00H
MOV 41H,#00H
MOV 42H,#00H
MOV 43H,#00H
MOV 44H,#00H
SETB 20H.1
MOV 45H,#01H
MOV R0,#44H
JCTZ:ACALL XSCX
MOV P1,#0FFH
JB P1.3,NEXT
ACALL XDYS
JB P1.3,NEXT
DEN0:JNB P1.3,DEN1
AJMP JYCX
NEXT:MOV P1,#0FFH
JB P1.2,JCTZ
ACALL XDYS
JB P1.2,JCTZ
DEN2:JNB P1.2,DEN3
MOV A,44H
CJNE A,#06H,DEC4
AJMP TCTS
DEC4:DEC R0
CJNE R0,#3FH,JCTZ
AJMP TCTS
JYCX:CJNE R0,#44H,XIA1
CJNE @R0,#06H,INCR
AJMP SET0
XIA1:CJNE R0,#43H,XIA2
AJMP TZ09
XIA2:CJNE R0,#42H,XIA3
CJNE @R0,#05H,INCR
AJMP SET0
XIA3:CJNE R0,#41H,XIA4
AJMP TZ09
XIA4:CJNE R0,#40H,TCTS
TZ09:CJNE @R0,#09H,INCR
SET0:MOV @R0,#00H
AJMP JCTZ
INCR:INC @R0
AJMP JCTZ
DEN1:ACALL XSCX
AJMP DEN0
DEN3:ACALL XSCX
AJMP DEN2
TCTS:MOV TH0,#3CH
MOV TL0,#0B0H
MOV 45H,#00H
RET
T0ZD:CLR EA
CLR ET0
CLR TR0
DJNZ 46H,TCZD
MOV 46H,#02H
MOV R0,#40H
CJNE @R0,#01H,R040
INC R0
CJNE @R0,#00H,DEC1
INC R0
CJNE @R0,#00H,DEC1
INC R0
CJNE @R0,#00H,DEC1
INC R0
CJNE @R0,#00H,DEC1
AJMP JYFH
R040: CJNE @R0,#00H,DEC1
INC R0
CJNE @R0,#00H,R041
INC R0
CJNE @R0,#00H,R042
INC R0
CJNE @R0,#00H,R043
INC R0
CJNE @R0,#00H,R044
AJMP ZJFH
R041:MOV 40H,#09H
DEC 41H
AJMP TCZD
R042:MOV 40H,#09H
MOV 41H,#09H
DEC 42H
AJMP TCZD
R043:MOV 40H,#09H
MOV 41H,#09H
MOV 42H,#05H
DEC 43H
AJMP TCZD
R044:MOV 40H,#09H
MOV 41H,#09H
MOV 42H,#05H
MOV 43H,#09H
DEC 44H
AJMP TCZD
DEC1:DEC 40H
TCZD:MOV TH0,#3CH
MOV TL0,#0B0H
SETB EA
SETB ET0
SETB TR0
AJMP ZZFH
JYFH:DEC 40H
ZJFH:SETB P3.0
ZZFH:RETI
XDYS:ACALL XSCX
ACALL XSCX
RET
XSYS:MOV 55H,#20
DEL2: MOV 56H,#25
DEL1:DJNZ 56H,DEL1
DJNZ 55H,DEL2
RET
TAB:DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH
TAB1:DB 0BFH,86H,0DBH,0CFH,0E6H,0EDH,0FDH,87H,0FFH,0EFH
TAB2:DB 040H,79H
END
|