📄 copy.lst
字号:
C51 COMPILER V7.06 COPY 03/04/2005 11:38:34 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE COPY
OBJECT MODULE PLACED IN COPY.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE COPY.C BROWSE DEBUG OBJECTEXTEND SRC(.\COPY.SRC)
stmt level source
1 #include "reg52.H"
2 #include "intrins.h"
3
4 #define uchar unsigned char
5 #define uint unsigned int
6 #define _Nop() _nop_()
7 sbit LED2=P1^7;
8 sbit SPEAKE=P1^5;
9 sbit CONTR=P1^4;
10 sbit SDA2=P1^3;
11 sbit SDA9=P1^2;
12 sbit SDA1=P1^1;
13 sbit SCL=P1^0;
14 sbit WORK=P3^7;
15 sbit CONTR1=P1^6;
16 uchar bb, feed_space;
17 bit ack,ALM;
18 extern bit work_start0;
19 bit work_start,start,ok;
20 uchar code SEG[19]={ 0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,0x88,0x83,0xC6,0xA1,0x86,0x8E,0xBF
-,0xff,0xF7};
21 uchar pal_hi_add,pal_lo_add,pal_leng;
22 uchar ntsc_hi_add,ntsc_lo_add,ntsc_leng;
23 uchar quxian_hi_add,quxian_lo_add,quxian_leng;
24 uchar satus1;
25 uchar MODE1,HIH,HIL,LOH,LOL,LENG_HI,LENG_LO;
26 uchar jiyi_buffer[13];
27 extern uchar scanf(void );
28 extern void disp_select(uchar);
29 extern bit JIYI_RS16K ( uchar sla, uchar suba, uchar *s, uchar no );
30 extern void set_select(uchar i);
31 extern bit JIYI_SendStr16K( uchar sla, uchar suba, uchar *s, uchar no );
32
33 /////////////////////////////////////////
34 /*bit delay1(uint dd)
35 {uchar m1=0xff,m2=0x02;
36 do{ m2=0x02;m1=0xff;
37 do{
38 do{ m1--;}while(m1!=0);
39 m2--;
40 }while(m2!=0);
41 dd--;
42 }while(dd!=0);
43 return(1);
44 }*/
45 /////////////////////bit delay1(uint dd)
46 bit delay2(uint dd)
47 {uchar m1=0x7f,m2=0x01;
48 1 do{ m2=0x01;m1=0x7f;
49 2 do{
50 3 do{ m1--;}while(m1!=0);
51 3 m2--;
52 3 }while(m2!=0);
53 2 dd--;
54 2 }while(dd!=0);
C51 COMPILER V7.06 COPY 03/04/2005 11:38:34 PAGE 2
55 1 return(1);
56 1 }
57 /////////////////////////////
58 void delay( dd)
59 {uchar m1=0xff,m2=0x02;
60 1 /*do{ m2=0x02;m1=0xff;
61 1 do{
62 1 do{ m1--;}while(m1!=0);
63 1 m2--;
64 1 }while(m2!=0);
65 1 dd--;
66 1 }while(dd!=0);*/
67 1 #pragma asm
68 1
69 1 //MOV R5,#0XF8
70 1 DELAY2: MOV R4,#0X02
71 1 DELAY1:mov r5,#0xf8
72 1 DELAY0:DJNZ R5,DELAY0
73 1 NOP
74 1 DJNZ R4,DELAY1
75 1 DJNZ R7,DELAY2
76 1 MOV R7,#0XFF
77 1 MOV A,R6
78 1 MOV 67H,A
79 1 JZ OUT
80 1 DEC R6
81 1 MOV A,R6
82 1 CJNE A,67H,DELAY2
83 1 OUT: RET
84 1 #pragma endasm
85 1
86 1
87 1 }
88 //uchar idata test _at_ 0x30;
89 void jubuStartI2c( )
90 {
91 1
92 1 SDA1 = 1;
93 1 _Nop();
94 1 _Nop();
95 1 _Nop();
96 1 SCL = 1;
97 1 _Nop(); // after stop must wait > 4.7 can to new start
98 1 _Nop();
99 1 _Nop();
100 1 _Nop();
101 1 _Nop();
102 1 _Nop();
103 1 _Nop();
104 1 SDA1 = 0;
105 1 _Nop(); // the start signal keep up to > 4.0
106 1 _Nop();
107 1 _Nop();
108 1 _Nop();
109 1 _Nop();
110 1 _Nop();
111 1 _Nop();
112 1 SCL = 0;
113 1 _Nop(); // T_low > 4.7
114 1 _Nop();
115 1 _Nop();
116 1 _Nop();
C51 COMPILER V7.06 COPY 03/04/2005 11:38:34 PAGE 3
117 1 _Nop();
118 1 _Nop();
119 1 _Nop();
120 1
121 1 }
122
123
124 void jubuStopI2c()
125 {
126 1 SDA1 = 0;
127 1 _Nop();
128 1 _Nop();
129 1 SCL = 1;
130 1 _Nop();
131 1 _Nop();
132 1 _Nop();
133 1 _Nop();
134 1 _Nop();
135 1 _Nop();
136 1 _Nop();
137 1 SDA1 = 1;
138 1 _Nop();
139 1 _Nop();
140 1 _Nop();
141 1 _Nop();
142 1 _Nop();
143 1 }
144
145 void jubuSend_byte( uchar c )
146 {
147 1 uchar BitCnt;
148 1 for( BitCnt = 0; BitCnt < 8; BitCnt ++ )
149 1 {
150 2 if((c << BitCnt) & 0x80) SDA1 = 1;
151 2 else SDA1 = 0;
152 2 _Nop();
153 2 _Nop();
154 2 _Nop();
155 2 SCL = 1;
156 2 _Nop();
157 2 _Nop();
158 2 _Nop();
159 2 _Nop();
160 2 _Nop();
161 2 _Nop();
162 2 _Nop();
163 2 SCL = 0;
164 2 _Nop();
165 2 _Nop();
166 2 _Nop();
167 2 }
168 1 _Nop();
169 1 _Nop();
170 1 _Nop();
171 1 SDA1 = 1;
172 1 _Nop();
173 1 _Nop();
174 1 _Nop();
175 1 SCL = 1;
176 1 _Nop();
177 1 _Nop();
178 1 _Nop();
C51 COMPILER V7.06 COPY 03/04/2005 11:38:34 PAGE 4
179 1 _Nop();
180 1 _Nop();
181 1 _Nop();
182 1 if (SDA1 == 1) ack =0;
183 1 else ack = 1;
184 1 SCL = 0;
185 1 _Nop();
186 1 _Nop();
187 1 _Nop();
188 1 _Nop();
189 1 }
190 ///////////////
191 uchar jubuRcv_byte()
192 {
193 1 uchar retc;
194 1 uchar BitCnt;
195 1
196 1 retc = 0;
197 1 SDA1 = 1;
198 1 for( BitCnt = 0 ; BitCnt < 8; BitCnt ++)
199 1 {
200 2 _Nop();
201 2 _Nop();
202 2 _Nop();
203 2 SCL = 0;
204 2 _Nop();
205 2 _Nop();
206 2 _Nop();
207 2 _Nop();
208 2 _Nop();
209 2 _Nop();
210 2 _Nop();
211 2 SCL = 1;
212 2 _Nop();
213 2 _Nop();
214 2 _Nop();
215 2 _Nop();
216 2 _Nop();
217 2 _Nop();
218 2 _Nop();
219 2 retc = retc << 1;
220 2 if (SDA1 == 1) retc= retc +1;
221 2 _Nop();
222 2 _Nop();
223 2 _Nop();
224 2 _Nop();
225 2 }
226 1 SCL = 0;
227 1 _Nop();
228 1 _Nop();
229 1 _Nop();
230 1 _Nop();
231 1 return(retc);
232 1 }
233 void jubuAckI2c( bit a )
234 {
235 1 if ( a == 0) SDA1 = 0;
236 1 else SDA1 = 1;
237 1 _Nop();
238 1 _Nop();
239 1 _Nop();
240 1 _Nop();
C51 COMPILER V7.06 COPY 03/04/2005 11:38:34 PAGE 5
241 1 _Nop();
242 1 SCL = 1;
243 1 _Nop();
244 1 _Nop();
245 1 _Nop();
246 1 _Nop();
247 1 _Nop();
248 1 _Nop();
249 1 SCL = 0;
250 1 _Nop();
251 1 _Nop();
252 1 _Nop();
253 1 }
254 ///////////////////////////////////
255 bit jubu_RS16K ( uchar sla, uchar suba, uchar *s, uchar no )
256 {
257 1 uchar i;
258 1 jubuStartI2c ();
259 1 jubuSend_byte (sla);
260 1 if( ack == 0 ) return (0);
261 1 jubuSend_byte (suba);
262 1 if (ack == 0 ) return (0);
263 1 jubuStartI2c();
264 1 jubuSend_byte(sla + 1);
265 1 if ( ack == 0) return ( 0 );
266 1 for(i =0;i< no -1; i++)
267 1 {
268 2 *s = jubuRcv_byte();
269 2 jubuAckI2c(0);
270 2 s++;
271 2 }
272 1 *s = jubuRcv_byte();
273 1 jubuAckI2c(1);
274 1 jubuStopI2c();
275 1 return(1);
276 1 }
277 bit jubu_RS32K ( uchar sla, uint suba, uchar *s, uchar no )
278 {
279 1 uchar i;
280 1 jubuStartI2c ();
281 1 jubuSend_byte (sla);
282 1 if( ack == 0 ) return (0);
283 1 jubuSend_byte (suba / 256); // the high byte address
284 1 if (ack == 0 ) return (0);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -