(1) Setting key: in countdown mode, press this key to stop countdown and enter the setting state; If the key is already set, the key is invalid.
(2) Increment key: When setting the status, the number of the initial value will increase by 1 every time the increment key is pressed.
(3) Decrement key: When setting the status, the number of the initial value decreases by 1 every time the decrement key is pressed.
(4) Confirm key: When setting the state, after pressing this key, the single chip microcomputer will count down and display the count-down number according to the new initial value. This key is invalid if it is already in the timing state.
Time? EQU? 60H
Flag? EQU? 6 1H
KEY_R_ 1? EQU? P3.0
KEY_R_2? EQU? P3. 1
KEY_R_3? EQU? P3.2
KEY_R_4? EQU? P3.3
D_FLAG? EQU? 62H
ORG? 0000 hours
SJMP? begin
ORG? 000BH
LJMP? Timer 0 interrupt
ORG? 0030 hours
Start:
MOV? TMOD,#0 1H
MOV? TH0,#3CH
MOV? TL0,#0B0H
SETB? Electronic arts game company
SETB? ET0
CLR? TR0
MOV? One, #00
MOV? D_FLAG,A
Mainly:
LCALL? Key scanning
MOV? a,D_FLAG
CJNE? a,#0 1H,DIS
LCALL? Display 1
LJMP? primary
DIS:
LCALL? show
LJMP? primary
Key scanning:
MOV? I. Flag
CJNE? a,# 1,KEY_2
CLR? C
MOV? c,KEY_R_ 1
JC? Key _2
LCALL? Delay 20 milliseconds
MOV? c,KEY_R_ 1
JC? Key _2
JNB? KEY_R_ 1,$
CLR? TR0
MOV? One, #00
MOV? D_FLAG,A
MOV? Time, a
KEY_2:
CLR? C
MOV? c,KEY_R_2
JC? Key _3
LCALL? Delay 20 milliseconds
MOV? c,KEY_R_2
JC? Key _3
MOV? I. Time
December? A
CJNE? a,#255,KEY_2_E
MOV? I. No.99
MOV? Time, a
JNB? KEY_R_2,$
Key _2_E:
MOV? Time, a
JNB? KEY_R_2,$
Key 3:
CLR? C
MOV? c,KEY_R_3
JC? Key _4
LCALL? Delay 20 milliseconds
MOV? c,KEY_R_3
JC? Key _4
MOV? I. Time
INC? A
CJNE? a,# 100,KEY_3_E
MOV? Answer, #0
MOV? Time, a
JNB? KEY_R_3,$
Key _3_E:
MOV? Time, a
JNB? KEY_R_3,$
Key 4:
CLR? C
MOV? c,KEY_R_4
JC? Key _ Exit
LCALL? Delay 20 milliseconds
MOV? c,KEY_R_4
JC? Key _ Exit
JNB? KEY_R_4,$
SETB? TR0
MOV? a,#0FH
MOV? Flag, a
Critical exit:
Soak in water to soften
Show:
MOV? I. Time
MOV? b,# 10
DIV? ab blood type
MOV? A, b
MOV? DPTR, # tag
MOVC? I. @ I +DPTR
MOV? P0,A
SETB? P2. 1
CLR? P2.0
LCALL? Delay 1 ms
CLR? P2.0
CLR? P2. 1
MOV? I. Time
MOV? b,# 10
DIV? ab blood type
MOV? DPTR, # tag
MOVC? I. @ I +DPTR
MOV? P0,A
SETB? P2.0
CLR? P2. 1
LCALL? Delay 1 ms
CLR? P2.0
CLR? P2. 1
Soak in water to soften
Display 1:
MOV? R2, 40th place
Display 1_LOOP 1:
MOV? Answer, #0
MOV? DPTR, # tag
MOVC? I. @ I +DPTR
MOV? P0,A
SETB? P2. 1
CLR? P2.0
LCALL? Delay 1 ms
CLR? P2.0
CLR? P2. 1
MOV? Answer, 0
MOV? DPTR, # tag
MOVC? I. @ I +DPTR
MOV? P0,A
SETB? P2.0
CLR? P2. 1
LCALL? Delay 1 ms
CLR? P2.0
CLR? P2. 1
LCALL? Key scanning
DJNZ? R2, display 1_LOOP 1
MOV? R2, No.20
Display 1_LOOP:
LCALL? Delay 50 milliseconds
LCALL? Key scanning
SETB? P2.0
SETB? P2. 1
DJNZ? R2, display 1_LOOP.
Soak in water to soften
Delay 20 milliseconds:; Mistakes? 0 we
MOV? R6,#0D7H
DL0:
MOV? R5,#2DH
DJNZ? R5, USD
DJNZ? R6,DL0
Nototherwiseprovided(for) unless otherwise specified.
Nototherwiseprovided(for) unless otherwise specified.
Soak in water to soften
Delay 1 ms:; Mistakes? 0 we
MOV? R4,#0 1H
DD 1:
MOV? R6,#8EH
DD0:
MOV? R5,#02H
DJNZ? R5, USD
DJNZ? R6,DD0
DJNZ? R4,DD 1
Soak in water to soften
Delay 50 milliseconds:; Mistakes? 0 we
MOV? R6 # 0ADH
DG0:
MOV? R5,#8FH
DJNZ? R5, USD
DJNZ? R6,DG0
Soak in water to soften
end