1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
| $MOD51
ORG 0000H
mov r0,#00H
mov r1,#00H
MOV P1,A
SETB P2.3
SETB P2.4
clr p2.6
LCALL WAITING;
LOP:
LOOP1:
MOV A,P2
RLC A
RLC A
RLC A
RLC A
JC CHECK;
cjne r0,#09,CLOSE
mov r0,#00H
CLOSE:inc r0;
LCALL RECHARGE;
CHECK:
ACALL DELAY1
MOV A,P2
RLC A
RLC A
RLC A
RLC A
RLC A
Jc OVER1;
DEC r0;
cjne r0,#00,Open
clr p2.6
Open:ACALL OVER;
OVER1:
JC LOP;
RECHARGE:
MOV A,#38H
ACALL COMNWRT
ACALL DELAYY
MOV A,#0EH
ACALL COMNWRT
ACALL DELAYY
MOV A,#01H
ACALL COMNWRT
ACALL DELAYY
MOV A,#06H
ACALL COMNWRT
ACALL DELAYY
MOV A,#81H
ACALL COMNWRT
ACALL DELAYY
MOV A,#'U'
ACALL DATAWRT
ACALL DELAYY
MOV A,#'P'
ACALL DATAWRT
ACALL DELAYY
MOV A,#'C'
ACALL DATAWRT
ACALL DELAYY
MOV A,#'O'
ACALL DATAWRT
ACALL DELAYY
MOV A,#'U'
ACALL DATAWRT
ACALL DELAYY
MOV A,#'N'
ACALL DATAWRT
ACALL DELAYY
MOV A,#'T'
ACALL DATAWRT
ACALL DELAYY
MOV A,#':'
ACALL DATAWRT
ACALL DELAYY
MOV A,#20H
ACALL DATAWRT
ACALL DELAYY
MOV A,r0
orl a,#30h
ACALL DATAWRT
ACALL DELAYY
SETB P2.6
ACALL LOOP1
RET
OVER:
MOV A,#38H
ACALL COMNWRT
ACALL DELAYY
MOV A,#0EH
ACALL COMNWRT
ACALL DELAYY
MOV A,#01H
ACALL COMNWRT
ACALL DELAYY
MOV A,#06H
ACALL COMNWRT
ACALL DELAYY
MOV A,#81H
ACALL COMNWRT
ACALL DELAYY
MOV A,#0c2H
ACALL COMNWRT
ACALL DELAYY
MOV A,#'D'
ACALL DATAWRT
ACALL DELAYY
MOV A,#'O'
ACALL DATAWRT
ACALL DELAYY
MOV A,#'W'
ACALL DATAWRT
ACALL DELAYY
MOV A,#'N'
ACALL DATAWRT
ACALL DELAYY
MOV A,#'C'
ACALL DATAWRT
ACALL DELAYY
MOV A,#'O'
ACALL DATAWRT
ACALL DELAYY
MOV A,#'U'
ACALL DATAWRT
ACALL DELAYY
MOV A,#'N'
ACALL DATAWRT
ACALL DELAYY
MOV A,#'T'
ACALL DATAWRT
ACALL DELAYY
MOV A,#':'
ACALL DATAWRT
ACALL DELAYY
MOV A,#20H
ACALL DATAWRT
ACALL DELAYY
MOV A,r0
orl a,#30h
ACALL DATAWRT
ACALL DELAYY
ACALL LOOP1;
ret
WAITING:
MOV A,#38H
ACALL COMNWRT
ACALL DELAYY
MOV A,#0FH
ACALL COMNWRT
ACALL DELAYY
MOV A,#01H
ACALL COMNWRT
ACALL DELAYY
MOV A,#80H
ACALL COMNWRT
ACALL DELAYY
MOV A,#"I"
ACALL DATAWRT
ACALL DELAYY
MOV A,#"N"
ACALL DATAWRT
ACALL DELAYY
MOV A,#"T"
ACALL DATAWRT
ACALL DELAYY
MOV A,#"E"
ACALL DATAWRT
ACALL DELAYY
MOV A,#"L"
ACALL DATAWRT
ACALL DELAYY
MOV A,#"L"
ACALL DATAWRT
ACALL DELAYY
MOV A,#"I"
ACALL DATAWRT
ACALL DELAYY
MOV A,#"G"
ACALL DATAWRT
ACALL DELAYY
MOV A,#"E"
ACALL DATAWRT
MOV A,#"N"
ACALL DATAWRT
ACALL DELAYY
MOV A,#"T"
ACALL DATAWRT
ACALL DELAYY
MOV A,#0c2H
ACALL COMNWRT
ACALL DELAYY
MOV A,#"V"
ACALL DATAWRT
ACALL DELAYY
MOV A,#"I"
ACALL DATAWRT
ACALL DELAYY
MOV A,#"S"
ACALL DATAWRT
ACALL DELAYY
MOV A,#"I"
ACALL DATAWRT
ACALL DELAYY
MOV A,#"T"
ACALL DATAWRT
ACALL DELAYY
MOV A,#"O"
ACALL DATAWRT
ACALL DELAYY
MOV A,#"R"
ACALL DATAWRT
ACALL DELAYY
MOV A,#"C"
ACALL DATAWRT
ACALL DELAYY
MOV A,#"O"
ACALL DATAWRT
ACALL DELAYY
MOV A,#"U"
ACALL DATAWRT
ACALL DELAYY
MOV A,#"N"
ACALL DATAWRT
ACALL DELAYY
MOV A,#"T"
ACALL DATAWRT
ACALL DELAYY
MOV A,#"E"
ACALL DATAWRT
ACALL DELAYY
MOV A,#"R"
ACALL DATAWRT
ACALL DELAYY
ret
COMNWRT: MOV P1,A
CLR P3.5
SETB P3.4
CLR P3.4
RET
DATAWRT: MOV P1,A
SETB P3.5
SETB P3.4
CLR P3.4
RET
DELAY1: MOV R3,#50
HERE22: MOV R4,#225
HEREe: DJNZ R4,HEREe
DJNZ R3,HERE22
RET
DELAYy: MOV TMOD,#10H
MOV R3,#01
Z33:MOV TL1,#08H;
MOV TH1,#01H;
SETB TR1
BACK33: JNB TF1,BACK33
CLR TR1
CLR TF1
DJNZ R3,Z33
RET
DELAY: MOV TMOD,#10H
MOV R3,#25D
Z334:MOV TL1,#08H;
MOV TH1,#01H;
SETB TR1
BACK334: JNB TF1,BACK334
CLR TR1
CLR TF1
DJNZ R3,Z334
RET
END |