?? ad0809.lst
字號:
C51 COMPILER V8.02 AD0809 08/30/2007 14:37:15 PAGE 1
C51 COMPILER V8.02, COMPILATION OF MODULE AD0809
OBJECT MODULE PLACED IN AD0809.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE AD0809.C BROWSE DEBUG OBJECTEXTEND
line level source
1 #include <AT89X52.H>
2 unsigned char code dispbitcode[]={0xfe,0xfd,0xfb,0xf7,
3 0xef,0xdf,0xbf,0x7f};
4 unsigned char code dispcode[]={0x3f,0x06,0x5b,0x4f,0x66,
5 0x6d,0x7d,0x07,0x7f,0x6f,0x00};
6 unsigned char dispbuf[8]={10,10,10,10,10,0,0,0};
7 unsigned char code tab[]={0,0, 0, 1, 0, 2, 0, 0, 3, 0 ,
8 4, 0, 0, 5, 0, 6, 0, 0, 7, 0 ,
9 8, 0, 0, 9, 0, 0, 10, 0, 11, 0 ,
10 0, 12, 0, 13, 0, 0, 14, 0, 15, 0 ,
11 0, 16, 0, 17, 0, 0, 18, 0, 19, 0,
12 0, 20, 0, 0, 21, 0, 22, 0, 0, 23,
13 0, 24, 0, 0, 25, 0, 26, 0, 0, 27,
14 0, 28, 0, 0, 29, 0, 0, 30, 0, 31,
15 0, 0, 32, 0, 33, 0, 0, 34, 0, 35,
16 0, 0, 36, 0, 37, 0, 0, 38, 0, 39,
17 0, 0, 40, 0, 0, 41, 0, 42, 0, 0,
18 43,0, 44, 0, 0, 45, 0, 46, 0, 0,
19 47,0, 48, 0, 0, 49, 0, 50, 0, 0,
20 51,0, 0, 52, 0, 53, 0, 0, 54, 0 ,
21 55,0, 0, 56, 0, 57, 0, 0, 58, 0,
22 59,0, 0, 60, 0, 0, 61, 0, 62, 0,
23 0, 63, 0, 64, 0, 0, 65, 0, 66, 0,
24 0, 67, 0, 68, 0, 0, 69, 0, 70, 0,
25 0, 71, 0, 0, 72, 0, 73, 0, 0, 74,
26 0, 75, 0, 0, 76, 0, 77, 0, 0, 78,
27 0, 79, 0, 0, 80, 0, 0, 81, 0, 82,
28 0, 0, 83, 0, 84, 0, 0, 85, 0, 86,
29 0, 0, 87, 0, 88, 0, 0, 89, 0, 90,
30 0, 0, 91, 0, 0, 92, 0, 93, 0, 0,
31 94,0, 95, 0, 0, 96, 0, 97, 0, 0,
32 98,0, 99, 0, 0, 100,0, 0, 0};
33 unsigned char dispcount;
34
35 unsigned int R1;
36
37 sbit ST=P3^0;
38 sbit OE=P3^1;
39 sbit EOC=P3^2;
40 unsigned char channel=0xbc; //1011 1100,ABC=110選擇第三通道同時使ST=0,OE=0輸出數據線呈高阻狀態,EOC=1。
41 unsigned char getdata;
42 void main(void)
43 {
44 1 TMOD=0x01;
45 1 TH0=(65536-4000)/256;
46 1 TL0=(65536-4000)%256;
47 1 TR0=1;
48 1 ET0=1;
49 1 EA=1;
50 1 P3=channel;
51 1
52 1 while(1)
53 1 {
54 2 ST=0;
55 2 ST=1;
C51 COMPILER V8.02 AD0809 08/30/2007 14:37:15 PAGE 2
56 2 ST=0;
57 2 while(EOC==0);
58 2 OE=1;
59 2 getdata=P0;
60 2 OE=0;
61 2 getdata=tab[getdata];
62 2 R1=getdata%2;
63 2 getdata=getdata/2;
64 2 dispbuf[5]=getdata/10;
65 2 dispbuf[6]=(getdata%10);
66 2 if(R1==1)
67 2 dispbuf[7]=5;
68 2 else
69 2 dispbuf[7]=0;
70 2 }
71 1 }
72 void t0(void) interrupt 1 using 0
73 {
74 1 TH0=(65536-350)/256;
75 1 TL0=(65536-350)%256;
76 1 P2=0xff;
77 1 if(dispcount==5)
78 1 {P1=dispcode[dispbuf[dispcount]]|0x80;
79 2 P2=dispbitcode[dispcount]; }
80 1 else
81 1 {P1=dispcode[dispbuf[dispcount]];
82 2 P2=dispbitcode[dispcount]; }
83 1 dispcount++;
84 1 if(dispcount==8)
85 1 {
86 2 dispcount=0;
87 2 }
88 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 164 ----
CONSTANT SIZE = 278 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 13 ----
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 + -