📄 1274.lst
字号:
C51 COMPILER V6.12 1274 03/28/2007 08:50:05 PAGE 1
C51 COMPILER V6.12, COMPILATION OF MODULE 1274
OBJECT MODULE PLACED IN .\1274.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE .\1274.c DEBUG OBJECTEXTEND
stmt level source
1 //数码管前三位显示一个跑表,从000到999之间以1%秒速度运行,
2 //当按下一个独立键盘时跑表停止,松开手后跑表继续运行。
3
4 #include<reg52.h>
5 #define uc unsigned char
6 #define ui unsigned int
7 sbit L4=P3^4;
8 sbit dus=P2^6;
9 sbit wes=P2^7;
10 uc code table[]={
11 0x3f,0x06,0x5b,0x4f,0x66,0x6d,
12 0x7d,0x07,0x7f,0x6f,0x77};
13 uc code tableh[]={
14 0xbf,0x86,0xdb,0xcf,0xe6,0xed,
15 0xfd,0x87,0xff,0xef,0xf7};
16 uc a2,a1,a0,count;
17 ui num;
18 display(uc,uc,uc);
19 delay(uc);
20 void main()
21 {
22 1 EA=1;
23 1 ET1=1;
24 1 TMOD=0x10;
25 1 TH1=(65536-10000)/256;
26 1 TL1=(65536-10000)%256;
27 1 TR1=1;
28 1 while(1)
29 1 {
30 2 if(count==1)
31 2 {
32 3 count=0;
33 3 num++;
34 3 if(num==999)num=0;
35 3 if(L4==0)
36 3 {
37 4 delay(60);
38 4 if(L4==0)
39 4 {
40 5 TR1=0;
41 5 while(!L4)
42 5 { display(a2,a1,a0);}
43 5 while(!L4);
44 5 TR1=1;
45 5 }
46 4 }
47 3
48 3 }
49 2 a2=num/100;
50 2 a1=num%100/10;
51 2 a0=num%100%10;
52 2 display(a2,a1,a0);
53 2 }
54 1 }
55 delay(uc x)
C51 COMPILER V6.12 1274 03/28/2007 08:50:05 PAGE 2
56 {
57 1 uc i,j;
58 1 for(i=20;i>0;i--)
59 1 for(j=x;j>0;j--);
60 1 }
61 void time1() interrupt 3 using 1
62 {
63 1 TH1=(65536-10000)/256;
64 1 TL1=(65536-10000)%256;
65 1 count++;
66 1 }
67 display(uc bi,uc si,uc ge)
68 {
69 1 P0=0xff;
70 1 wes=1;
71 1 wes=0;
72 1
73 1 P0=tableh[bi];
74 1 dus=1;
75 1 dus=0;
76 1 P0=0xfe;
77 1 wes=1;
78 1 wes=0;
79 1 delay(1);
80 1
81 1 P0=0xff;
82 1 wes=1;
83 1 wes=0;
84 1
85 1 P0=table[si];
86 1 dus=1;
87 1 dus=0;
88 1 P0=0xfd;
89 1 wes=1;
90 1 wes=0;
91 1 delay(1);
92 1
93 1 P0=0xff;
94 1 wes=1;
95 1 wes=0;
96 1
97 1 P0=table[ge];
98 1 dus=1;
99 1 dus=0;
100 1 P0=0xfb;
101 1 wes=1;
102 1 wes=0;
103 1 delay(1);
104 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 246 ----
CONSTANT SIZE = 22 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 6 ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -