📄 cj.lst
字号:
C51 COMPILER V8.05a CJ 09/04/2008 14:18:24 PAGE 1
C51 COMPILER V8.05a, COMPILATION OF MODULE CJ
OBJECT MODULE PLACED IN cj.OBJ
COMPILER INVOKED BY: c:\Keil\C51\BIN\C51.EXE cj.c DEBUG OBJECTEXTEND
line level source
1 #include "at89x51.h"
2 #include "intrins.h" /*用NOP() */
3 #define tfs_rfs P1_0
4 #define dout P1_1
5 #define din P1_2
6 #define sclk P1_3
7 #define convst P1_4
8 volatile unsigned int ad7812_res;
9 void initad7812();
10 void commad7812(unsigned int cmd);
11 void start_ad();
12
13 void delay(unsigned int t)
14 {
15 1 for(;t>0;t--);
16 1 }
17
18 void main()
19 {
20 1 unsigned int ad_result;
21 1 initad7812();
22 1 delay(50);
23 1 while(1)
24 1 {
25 2 start_ad();
26 2 delay(100);
27 2 commad7812(0x4040);
28 2 ad_result=ad7812_res>>6;
29 2 }
30 1 }
31
32 void initad7812()
33 {
34 1 convst=1;
35 1 commad7812(0x6040);
36 1 }
37
38 void commad7812( unsigned int cmd)
39 {
40 1 unsigned char ip;
41 1 unsigned int pbit;
42 1 unsigned char tempres;
43 1 ad7812_res=0;
44 1 pbit=0x8000;
45 1 tfs_rfs=0;
46 1 _nop_();
47 1 tfs_rfs=1;
48 1 sclk=1;
49 1 tfs_rfs=0;
50 1 for(ip=0;ip<16;ip++)
51 1 {
52 2 ad7812_res<<=1;
53 2 dout=1;
54 2 din=(cmd & pbit)?1:0;
55 2 _nop_();
C51 COMPILER V8.05a CJ 09/04/2008 14:18:24 PAGE 2
56 2 _nop_();
57 2 sclk=0;
58 2 tempres=dout;
59 2 ad7812_res+=tempres;
60 2 _nop_();
61 2 _nop_();
62 2 sclk=1;
63 2 pbit>>=1;
64 2
65 2 }
66 1 }
67
68 void start_ad()
69 {
70 1 convst=0;
71 1 _nop_();
72 1 convst=1;
73 1 }
74
75
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 163 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 2 4
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 + -