📄 text1.lst
字号:
C51 COMPILER V7.50 TEXT1 09/04/2006 19:25:15 PAGE 1
C51 COMPILER V7.50, COMPILATION OF MODULE TEXT1
OBJECT MODULE PLACED IN Text1.OBJ
COMPILER INVOKED BY: D:\Program Files\Keil\C51\BIN\C51.EXE Text1.c BROWSE DEBUG OBJECTEXTEND
line level source
1 #include<reg52.h>
2
3 unsigned char code table[]={0x3f,0x06,0x5b,0x4f,0x66,
4 0x6d,0x7d,0x07,0x7f,0x6f};
5 unsigned char dispcount=0; //计数
6 sbit gewei=P2^0; //个位选通定义
7 sbit shiwei=P2^1; //十位选通定义
8 void Delay(unsigned int tc) //延时程序
9 {
10 1 while( tc != 0 )
11 1 {
12 2 unsigned int i;
13 2 for(i=0; i<100; i++);
14 2 tc--;
15 2 }
16 1 }
17 void ExtInt0() interrupt 0 //中断服务程序
18 {
19 1 dispcount++; //每按一次中断按键,计数加一
20 1 if(dispcount==100) //计数范围0-99
21 1 {dispcount=0;}
22 1 }
23 void LED() //LED显示函数
24 {
25 1 if(dispcount>=10) //显示两位数
26 1 {
27 2 shiwei=0;
28 2 P0=table[dispcount/10];
29 2 Delay(8);
30 2 shiwei=1;
31 2 gewei=0;
32 2 P0=table[dispcount%10];
33 2 Delay(5);
34 2 gewei=1;
35 2 }
36 1 else //显示一位数
37 1 {
38 2 shiwei=1;
39 2 gewei=0;
40 2 P0=table[dispcount];
41 2 Delay(8);
42 2 }
43 1
44 1 }
45 void main()
46 {
47 1 P3=0x0F;
48 1
49 1 TCON=0x01; //中断设置
50 1 IE=0x81;
51 1 while(1) //循环执行
52 1 {
53 2 LED(); //只须调用显示函数
54 2 }
55 1 }
C51 COMPILER V7.50 TEXT1 09/04/2006 19:25:15 PAGE 2
56
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 127 ----
CONSTANT SIZE = 10 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 1 2
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 + -