📄 text1.lst
字号:
C51 COMPILER V8.08 TEXT1 11/05/2008 21:39:48 PAGE 1
C51 COMPILER V8.08, COMPILATION OF MODULE TEXT1
OBJECT MODULE PLACED IN Text1.OBJ
COMPILER INVOKED BY: E:\学习软件\keil\C51\BIN\C51.EXE Text1.c BROWSE DEBUG OBJECTEXTEND
line level source
1 #include<reg52.h>
2 unsigned char code dispbitcode[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
3 unsigned char dispbuf[4];
4 unsigned int i;
5 unsigned int j;
6 unsigned int getdata;
7 unsigned int temp;
8 unsigned int temp1;
9 unsigned char count;
10 unsigned char d;
11 sbit ST=P3^0;
12 sbit OE=P3^1;
13 sbit EOC=P3^2;
14 sbit CLK=P3^3;
15 sbit P34=P3^4;
16 sbit P35=P3^5;
17 sbit P36=P3^6;
18 sbit P20=P2^0;
19 sbit P21=P2^1;
20 sbit P22=P2^2;
21 sbit P23=P2^3;
22 sbit P17=P1^7;
23 //sbit s3=P2^7; //位定义,控制模拟开关
24 sbit s2=P2^6;
25 sbit s1=P2^5;
26 #define _v10 {s1=1;s2=0;}
27 #define _v20 {s1=0;s2=1;}
28
29
30 unsigned char m;
31
32 void TimeInitial();
33 void Delay(unsigned int i);
34
35 void TimeInitial()
36 { TMOD=0x10;
37 1 TH1=(65536-200)/256;
38 1 TL1=(65536-200)%256;
39 1 EA=1;
40 1 ET1=1;
41 1 TR1=1;
42 1 }
43 void Delay(unsigned int i)
44 {
45 1 unsigned int j;
46 1 for(;i>0;i--)
47 1 {
48 2 for(j=0;j<125;j++)
49 2 {;}
50 2 }
51 1 }
52
53 void Display()
54
55 {
C51 COMPILER V8.08 TEXT1 11/05/2008 21:39:48 PAGE 2
56 1 P1=dispbitcode[dispbuf[3]];
57 1 P20=0;
58 1 P21=1;
59 1 P22=1;
60 1 P23=1;
61 1 Delay(10);
62 1 P1=0x00;
63 1 P1=dispbitcode[dispbuf[2]];
64 1 P17=1;
65 1 P20=1;
66 1 P21=0;
67 1 P22=1;
68 1 P23=1;
69 1 Delay(10);
70 1 P1=0x00;
71 1 P1=dispbitcode[dispbuf[1]];
72 1 P20=1;
73 1 P21=1;
74 1 P22=0;
75 1 P23=1;
76 1 Delay(10);
77 1 P1=0x00;
78 1 P1=dispbitcode[dispbuf[0]];
79 1 P20=1;
80 1 P21=1;
81 1 P22=1;
82 1 P23=0;
83 1 Delay(10);
84 1 P1=0x00;
85 1 }
86 void main()
87 {
88 1 TimeInitial();
89 1 P34=0;
90 1 P35=0;
91 1 P36=0;
92 1 _v20;
93 1 m=4;
94 1 while(1)
95 1 {
96 2 ST=0;
97 2 OE=0;
98 2 ST=1;
99 2 ST=0;
100 2 while(EOC==0);
101 2 OE=1;
102 2 getdata=P0;
103 2 OE=0;
104 2
105 2 if ( s1==0&&s2==1 && getdata<128)
106 2 {
107 3 _v10;
108 3 m=2;
109 3
110 3
111 3 }
112 2 else if( s1==1&&s2==0&& getdata>254)
113 2 {
114 3 _v20;
115 3 m=4;
116 3
117 3 }
C51 COMPILER V8.08 TEXT1 11/05/2008 21:39:48 PAGE 3
118 2 temp=(getdata*1.0/255)*500*m;
119 2 dispbuf[0]=temp%10;
120 2 dispbuf[1]=temp/10%10;
121 2 dispbuf[2]=temp/100%10;
122 2 dispbuf[3]=temp/1000;
123 2 Display();
124 2
125 2 }
126 1 }
127
128 void t1(void) interrupt 3 using 0
129 {
130 1 TH1=(65536-200)/256;
131 1 TL1=(65536-200)%256;
132 1 CLK=~CLK;
133 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 352 ----
CONSTANT SIZE = 10 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 17 ----
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 + -