📄 cs13-2.lst
字号:
C51 COMPILER V7.06 CS13_2 02/03/2007 15:56:04 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE CS13_2
OBJECT MODULE PLACED IN CS13-2.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE CS13-2.c BROWSE DEBUG OBJECTEXTEND
stmt level source
1 #include <REG51.H>
2 #define uchar unsigned char
3 #define uint unsigned int
4 uchar code SEG7[10]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
5 uchar code ACT[5]={0xfe,0xfd,0xfb,0xf7,0xef};
6 uint data shuzu[10];
7 /*******************************************************************/
8 uchar status;
9 uchar temp;
10 int max,f;
11 /*************************************************************************/
12 void delay_1ms(void)
13 {
14 1 uint k;
15 1 for(k=0;k<121;k++);
16 1 }
17 /************************************************************************/
18 void dis_max(void)
19 { P0=SEG7[max%10];P2=ACT[0];
20 1 delay_1ms();
21 1 P0=SEG7[(max/10)%10];P2=ACT[1];
22 1 delay_1ms();
23 1 P0=SEG7[max/100];P2=ACT[2];
24 1 delay_1ms();
25 1 }
26 /***************************************************************************/
27 void dis_input(void)
28 { P0=SEG7[f%10];P2=ACT[0];
29 1 delay_1ms();
30 1 P0=SEG7[(f/10)%10];P2=ACT[1];
31 1 delay_1ms();
32 1 P0=SEG7[f/100];P2=ACT[2];
33 1 delay_1ms();
34 1 P0=SEG7[status];P2=ACT[4];
35 1 delay_1ms();
36 1 }
37 /***************************************************************************/
38 void key_s1(void)
39 {
40 1 P3=0xff;
41 1 if(P3==0xfb)
42 1 {if(temp>30)temp=0;
43 2 if(temp==0)f++;
44 2 if(f>999)f=999;
45 2 temp++;
46 2 delay_1ms();
47 2 }
48 1 }
49 /**************************************************************/
50 void key_s2(void)
51 {
52 1 P3=0xff;
53 1 if(P3==0xf7)
54 1 {if(temp>30)temp=0;
55 2 if(temp==0)f--;
C51 COMPILER V7.06 CS13_2 02/03/2007 15:56:04 PAGE 2
56 2 if(f<0)f=0;
57 2 temp++;
58 2 delay_1ms();
59 2 }
60 1 }
61 /********************************************************************/
62 void key_s3(void)
63 {
64 1 P3=0xff;
65 1 if(P3==0xef)
66 1 {
67 2 switch (status)
68 2 { case 0:shuzu[0]=f;break;
69 3 case 1:shuzu[1]=f;break;
70 3 case 2:shuzu[2]=f;break;
71 3 case 3:shuzu[3]=f;break;
72 3 case 4:shuzu[4]=f;break;
73 3 case 5:shuzu[5]=f;break;
74 3 case 6:shuzu[6]=f;break;
75 3 case 7:shuzu[7]=f;break;
76 3 case 8:shuzu[8]=f;break;
77 3 case 9:shuzu[9]=f;break;
78 3 default:break;
79 3 }
80 2 }
81 1 }
82 /**********************************************************************/
83 void key_s4(void)
84 {
85 1 P3=0xff;
86 1 if(P3==0xdf)
87 1 {if(temp>100)temp=0;
88 2 if(temp==0)status++;
89 2 if(status>10)status=0;
90 2 temp++;
91 2 delay_1ms();
92 2 }
93 1 }
94 /*************************************************************/
95 void conv(void)
96 {
97 1 uchar i;
98 1 max=shuzu[0];
99 1 for(i=1;i<10;i++)
100 1 {
101 2 if(shuzu[i]>max)max=shuzu[i];
102 2 }
103 1 }
104 /**********************************************************/
105 void main(void)
106 {
107 1 while(1)
108 1 {
109 2 key_s1();
110 2 key_s2();
111 2 key_s3();
112 2 key_s4();
113 2 conv();
114 2 if(status==10)dis_max();
115 2 else dis_input();
116 2 }
117 1 }
C51 COMPILER V7.06 CS13_2 02/03/2007 15:56:04 PAGE 3
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 544 ----
CONSTANT SIZE = 15 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 26 ----
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 + -