?? yejing320240.lst
字號:
C51 COMPILER V7.06 YEJING320240 12/05/2005 18:17:14 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE YEJING320240
OBJECT MODULE PLACED IN yejing320240.OBJ
COMPILER INVOKED BY: D:\Keil\C51\BIN\C51.EXE yejing320240.c BROWSE DEBUG OBJECTEXTEND
stmt level source
1 #include <reg52.h>
2 #include "absacc.h"
3 #include <math.h>
4 #include<intrins.h>
5 #define mode 0x9b
6 #include "ziku.h"
7 #define uchar unsigned char
8 #define uint unsigned int
9 #define AP 0x2a
10 #define LENGTH 250 //波形區域寬度
11 #define WIDTH 200 //波形區域高度
12 sbit a0=P2^0;
13 xdata unsigned char PortA _at_ 0xc000;
14 xdata unsigned char PortB _at_ 0xc001;
15 xdata unsigned char PortC _at_ 0xc002;
16 xdata unsigned char CAddr _at_ 0xc003;
17 //sbit cs=P1^3;
18 sbit cs1=P2^5;
19 sbit cs2=P2^6;
20 sbit cs3=P2^7;
21 sbit rst=P1^4;
22 sbit wr=P3^6;
23 sbit rd=P3^7;
24 sbit alarm=P1^0;
25 /*****************************/
26 unsigned char bdata d[3];
27 uchar code sys[8]={0x30,0x87,0x07,0x27,0x7a,0xef,0x2a,0}; /*P1-P8*/
28 uchar code scr[10]={0,0,0xef,0x00,0x28,0xef,0x00,0x50,0,0}; /*P1-P10*/
29 uchar code arr[8]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};
30 uchar gprsflag=0;
31 uchar code at1[3]={'A','T',0X0D};
32 uchar code at2[10]={0};
33 uchar code at3[22]={0};
34 //函數定義
35 void outcode(uchar code_data);
36 void outdata(uchar data_data);
37 uchar indata(void);
38 void turnoff(void);
39 void turnon(void);
40 void initram(void);
41 void init(void);
42 void fixline(int y);
43 void fixline2(int x);
44 void WriteD(uchar x,uchar y);
45 void delay(uchar di);
46 void showchinese32(int addr,uchar *chin);
47 void drawtable();
48 void shownumber(int addr,uchar number);
49 void shownumber16(int addr,uchar number);
50 void warn0(uchar canghao[4],j);
51 void count(uchar canghao[],uchar*p);
52 void sendnum(void);
53 void xszc() ;
54 void warn3(uchar canghao[],uchar j);
55 void kaiji();
C51 COMPILER V7.06 YEJING320240 12/05/2005 18:17:14 PAGE 2
56 void outcode(uchar code_data)//輸出指令代碼
57 {// cs=0;
58 1 cs1=1;
59 1 cs2=0;
60 1 cs3=1;
61 1 a0=1;
62 1 rd=1;
63 1 P0=code_data;
64 1 wr=0;
65 1 wr=1;
66 1 //cs=1;
67 1 cs1=0;
68 1 cs2=0;
69 1 cs3=1;
70 1 }
71
72 void outdata(uchar data_data){//輸出指令參數
73 1 a0=0;
74 1 // cs=0;
75 1 cs1=1;
76 1 cs2=0;
77 1 cs3=1 ;
78 1 P0=data_data;
79 1 wr=0;
80 1 wr=1;
81 1 //cs=1;
82 1 cs1=0;
83 1 cs2=0;
84 1 cs3=1;
85 1 }
86
87 uchar indata(void){//輸出指令參數
88 1 uchar data_data;
89 1 a0=1;
90 1 // cs=0;
91 1 cs1=1;
92 1 cs2=0;
93 1 cs3=1 ;
94 1 P0=0xff;
95 1 wr=1;
96 1 rd=0;
97 1 data_data=P0;
98 1 rd=1;
99 1 // cs=1;
100 1 cs1=0;
101 1 cs2=0;
102 1 cs3=1;
103 1 return data_data;
104 1 }
105
106 void delay(uint di) //延時子程序
107 { uint k;
*** WARNING C235 IN LINE 107 OF YEJING320240.C: parameter 1: different types
108 1 for(;di!=0;di--)
109 1 {
110 2 for(k=0;k<1000;k++);
111 2 }
112 1 }
113
114 void WriteD(uchar x,uchar y) //write a dot on the 1nd layer
115 {
116 1 unsigned int address;
C51 COMPILER V7.06 YEJING320240 12/05/2005 18:17:14 PAGE 3
117 1 uchar addh,addl;
118 1 uchar m=0,n;
119 1 address=0x01f9+x/8+y*AP;
120 1 addh=address/256;
121 1 addl=address%256;
122 1 n=x%8;
123 1 outcode(0x46);
124 1 outdata(addl);
125 1 outdata(addh);
126 1 outcode(0x43);
127 1 m=indata();
128 1 m=m|arr[n];
129 1 outcode(0x46);
130 1 outdata(addl);
131 1 outdata(addh);
132 1 outcode(0x42);
133 1 outdata(m);
134 1 }
135
136 void turnoff(void){
137 1 outcode(0x58);//off screen
138 1 outdata(0x00);
139 1 }
140
141 void turnon(void){
142 1 outcode(0x59);//on screen
143 1 outdata(0x55);
144 1 }
145
146 void initram(void){//顯示存儲器清零
147 1 unsigned int i;
148 1 outcode(0x4c);
149 1 outcode(0x46);
150 1 outdata(0x00);
151 1 outdata(0x00);
152 1 outcode(0x42);//clear screen memory
153 1 for(i=0;i<=0x7800;i++){outdata(0x00);}//32767
154 1 }
155
156 void init(void){//初始化程序
157 1 int n;
158 1 outcode(0x40); /*SYSTEM SET 指令代碼*/
159 1 for(n=0;n<8;n++)outdata(sys[n]); /*將參數P1-P8 寫入*/
160 1 outcode(0x44); /*SCROLL 指令代碼*/
161 1 for(n=0;n<10;n++)outdata(scr[n]); /*將參數P1-P10 寫入*/
162 1 outcode(0x5a); /*HDOT SCR——P1 清零復位*/
163 1 outdata(0);
164 1 outcode(0x5b); /*OVLAY—*/
165 1 outdata(0x1c);
166 1 }
167
168 void fixline(int y) //在第二層畫水平直線 0-240)
169 {
170 1 unsigned int address;
171 1 uchar addh,addl;
172 1 uchar i;
173 1 address=y;
174 1 addh=address/256;
175 1 addl=address%256;
176 1 outcode(0x46);
177 1 outdata(addl);
178 1 outdata(addh);
C51 COMPILER V7.06 YEJING320240 12/05/2005 18:17:14 PAGE 4
179 1 outcode(0x4c);
180 1 outcode(0x42);
181 1 outdata(0x1f);
182 1 for(i=0;i<39;i++)outdata(0xff);
183 1 }
184
185 void fixline2(int x) //x(1-40)
186 {
187 1 unsigned int address;
188 1 uchar addh,addl;
189 1 uchar i;
190 1 address=x;
191 1 for(i=0;i<160;i++)
192 1 { addh=address/256;
193 2 addl=address%256;
194 2 outcode(0x46);
195 2 outdata(addl);
196 2 outdata(addh);
197 2 outcode(0x4c);
198 2 outcode(0x42);
199 2 outdata(0x18);
200 2 address+=42;
201 2
202 2 }
203 1 }
204
205 void initall(void){ //初始化
206 1 turnoff();
207 1 init();
208 1 turnon();
209 1 initram();
210 1 }
211
212 void showchinese32(int addr,uchar *chin)
213 //功能:在x,y位置處,顯示字符碼為chin
214 //x坐標寄存器(字節),y坐標寄存器(點行)
215 {
216 1 int temp1;
217 1
218 1 uchar hi,lo,*temp2;
219 1 uchar b,c=0;
220 1 //d=y;
221 1 temp2=chin;
222 1 temp1=addr;
223 1 outcode(0x4c);
224 1 for(b=0;b<32;b++){
225 2 //0x51f9,5218,2a18
226 2 hi=temp1/256;
227 2 lo=temp1%256;
228 2 outcode(0x46);
229 2 outdata(lo);
230 2 outdata(hi);
231 2 outcode(0x42);
232 2 outdata(temp2[c++]);
233 2 outdata(temp2[c++]);
234 2 outdata(temp2[c++]);
235 2 outdata(temp2[c++]);
236 2 temp1+=AP;// d=d+1;
237 2 }
238 1 }
239
240
C51 COMPILER V7.06 YEJING320240 12/05/2005 18:17:14 PAGE 5
241 void shownumber(int addr,uchar number)
242 //功能:在x,y位置處,顯示字符碼為chin
243 //x坐標寄存器(字節),y坐標寄存器(點行)
244 {
245 1 int temp1;
246 1
247 1 uchar hi,lo;
248 1 uchar b;
249 1 //d=y;
250 1 temp1=addr;
251 1 outcode(0x4c);
252 1 for(b=0;b<16;b++){
253 2 //0x51f9,5218,2a18
254 2 hi=temp1/256;
255 2 lo=temp1%256;
256 2 outcode(0x46);
257 2 outdata(lo);
258 2 outdata(hi);
259 2 outcode(0x42);
260 2 outdata(num[16*number+b]);
261 2
262 2 temp1+=AP;// d=d+1;
263 2 }
264 1 }
265
266 void shownumber16(int addr,uchar number16)
267 //功能:在x,y位置處,顯示字符碼為chin
268 //x坐標寄存器(字節),y坐標寄存器(點行)
269 {
270 1 int temp1,c=0;
271 1
272 1 uchar hi,lo;
273 1 uchar b;
274 1 //d=y;
275 1 c=64*number16;
276 1 temp1=addr;
277 1 outcode(0x4c);
278 1 for(b=0;b<32;b++){
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -