📄 777.lst
字号:
C51 COMPILER V8.05a 777 07/26/2008 17:30:05 PAGE 1
C51 COMPILER V8.05a, COMPILATION OF MODULE 777
OBJECT MODULE PLACED IN 777.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE 777.c BROWSE DEBUG OBJECTEXTEND
line level source
1 #include <AT89X52.H>
2
3
4
5 unsigned char ps[]={1,2,3,4,5};
6
7
8
9 unsigned char code dispbit[]={0xfe,0xfd,0xfb,0xf7,
10
11 0xef,0xdf,0xbf,0x7f};
12
13 unsigned char code dispcode[]={0x3f,0x06,0x5b,0x4f,0x66,
14
15 0x6d,0x7d,0x07,0x7f,0x6f,
16
17 0x77,0x7c,0x39,0x5e,0x79,0x71,
18
19 0x00,0x40,0x73,0xff};
20
21 unsigned char dispbuf[8]={18,16,16,16,16,16,16,16};
22
23 unsigned char dispcount;
24
25 unsigned char flashcount;
26
27 unsigned char temp;
28
29 unsigned char key;
30
31 unsigned char keycount;
32
33 unsigned char pslen=5;
34
35 unsigned char getps[6];
36
37 bit keyoverflag;
38
39 bit errorflag;
40
41 bit rightflag;
42
43 unsigned int second3;
44
45 unsigned int aa,bb;
46
47 unsigned int cc;
48
49 bit okflag;
50
51 bit alarmflag;
52
53 bit hibitflag;
54
55 unsigned char oka,okb;
C51 COMPILER V8.05a 777 07/26/2008 17:30:05 PAGE 2
56
57
58
59
60
61 void main(void)
62
63 {
64 1
65 1 unsigned char i,j;
66 1
67 1
68 1
69 1 TMOD=0x01;
70 1
71 1 TH0=(65536-500)/256;
72 1
73 1 TL0=(65536-500)%256;
74 1
75 1 TR0=1;
76 1
77 1 ET0=1;
78 1
79 1 EA=1;
80 1
81 1
82 1
83 1 while(1)
84 1
85 1 {
86 2
87 2 P3=0xff;
88 2
89 2 P3_4=0;
90 2
91 2 temp=P3;
92 2
93 2 temp=temp & 0x0f;
94 2
95 2 if (temp!=0x0f)
96 2
97 2 {
98 3
99 3 for(i=10;i>0;i--)
100 3
101 3 for(j=248;j>0;j--);
102 3
103 3 temp=P3;
104 3
105 3 temp=temp & 0x0f;
106 3
107 3 if (temp!=0x0f)
108 3
109 3 {
110 4
111 4 temp=P3;
112 4
113 4 temp=temp & 0x0f;
114 4
115 4 switch(temp)
116 4
117 4 {
C51 COMPILER V8.05a 777 07/26/2008 17:30:05 PAGE 3
118 5
119 5 case 0x0e:
120 5
121 5 key=7;
122 5
123 5 break;
124 5
125 5 case 0x0d:
126 5
127 5 key=8;
128 5
129 5 break;
130 5
131 5 case 0x0b:
132 5
133 5 key=9;
134 5
135 5 break;
136 5
137 5 case 0x07:
138 5
139 5 key=10;
140 5
141 5 break;
142 5
143 5 }
144 4
145 4 temp=P3;
146 4
147 4 P1_1=~P1_1;
148 4
149 4 if((key>=0) && (key<10))
150 4
151 4 {
152 5
153 5 if(keycount<6)
154 5
155 5 {
156 6
157 6 getps[keycount]=key;
158 6
159 6 dispbuf[keycount+2]=19;
160 6
161 6 }
162 5
163 5 keycount++;
164 5
165 5 if(keycount==6)
166 5
167 5 {
168 6
169 6 keycount=6;
170 6
171 6
172 6
173 6 }
174 5
175 5 else if(keycount>6)
176 5
177 5 {
178 6
179 6 keycount=6;
C51 COMPILER V8.05a 777 07/26/2008 17:30:05 PAGE 4
180 6
181 6 keyoverflag=1;//key overflow
182 6
183 6 }
184 5
185 5 }
186 4
187 4 else if(key==12)//delete key
188 4
189 4 {
190 5
191 5 if(keycount>0)
192 5
193 5 {
194 6
195 6 keycount--;
196 6
197 6 getps[keycount]=0;
198 6
199 6 dispbuf[keycount+2]=16;
200 6
201 6 }
202 5
203 5 else
204 5
205 5 {
206 6
207 6 keyoverflag=1;
208 6
209 6 }
210 5
211 5 }
212 4
213 4 else if(key==15)//enter key
214 4
215 4 {
216 5
217 5 if(keycount!=pslen)
218 5
219 5 {
220 6
221 6 errorflag=1;
222 6
223 6 rightflag=0;
224 6
225 6 second3=0;
226 6
227 6 }
228 5
229 5 else
230 5
231 5 {
232 6
233 6 for(i=0;i<keycount;i++)
234 6
235 6 {
236 7
237 7 if(getps[i]!=ps[i])
238 7
239 7 {
240 8
241 8 i=keycount;
C51 COMPILER V8.05a 777 07/26/2008 17:30:05 PAGE 5
242 8
243 8 errorflag=1;
244 8
245 8 rightflag=0;
246 8
247 8 second3=0;
248 8
249 8 goto a;
250 8
251 8 }
252 7
253 7 }
254 6
255 6 errorflag=0;
256 6
257 6 rightflag=1;
258 6
259 6 a: i=keycount;
260 6
261 6 }
262 5
263 5 }
264 4
265 4 temp=temp & 0x0f;
266 4
267 4 while(temp!=0x0f)
268 4
269 4 {
270 5
271 5 temp=P3;
272 5
273 5 temp=temp & 0x0f;
274 5
275 5 }
276 4
277 4 keyoverflag=0;//?????????
278 4
279 4 }
280 3
281 3 }
282 2
283 2
284 2
285 2 P3=0xff;
286 2
287 2 P3_5=0;
288 2
289 2 temp=P3;
290 2
291 2 temp=temp & 0x0f;
292 2
293 2 if (temp!=0x0f)
294 2
295 2 {
296 3
297 3 for(i=10;i>0;i--)
298 3
299 3 for(j=248;j>0;j--);
300 3
301 3 temp=P3;
302 3
303 3 temp=temp & 0x0f;
C51 COMPILER V8.05a 777 07/26/2008 17:30:05 PAGE 6
304 3
305 3 if (temp!=0x0f)
306 3
307 3 {
308 4
309 4 temp=P3;
310 4
311 4 temp=temp & 0x0f;
312 4
313 4 switch(temp)
314 4
315 4 {
316 5
317 5 case 0x0e:
318 5
319 5 key=4;
320 5
321 5 break;
322 5
323 5 case 0x0d:
324 5
325 5 key=5;
326 5
327 5 break;
328 5
329 5 case 0x0b:
330 5
331 5 key=6;
332 5
333 5 break;
334 5
335 5 case 0x07:
336 5
337 5 key=11;
338 5
339 5 break;
340 5
341 5 }
342 4
343 4 temp=P3;
344 4
345 4 P1_1=~P1_1;
346 4
347 4 if((key>=0) && (key<10))
348 4
349 4 {
350 5
351 5 if(keycount<6)
352 5
353 5 {
354 6
355 6 getps[keycount]=key;
356 6
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -