📄 jianjiekzh.lst
字号:
C51 COMPILER V7.01 JIANJIEKZH 03/13/2009 19:39:53 PAGE 1
C51 COMPILER V7.01, COMPILATION OF MODULE JIANJIEKZH
OBJECT MODULE PLACED IN jianjiekzh.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE jianjiekzh.c BROWSE DEBUG OBJECTEXTEND
stmt level source
1 #include <reg52.h>
2 #define uchar unsigned char
3 idata char flag0 ;
4 idata char flag1 ;
5 idata char flag2 ;
6 idata char flag3 ;
7 idata char flag4 ;
8 idata char flag5 ;
9 idata char flag6 ;
10 idata char flag7 ;
11 sbit RS=P1^2;
12 sbit RW=P1^1;
13 sbit LCDE=P1^0;
14 sbit big=P3^6;
15 sbit fd=P3^7;
16 unsigned char line1[16],line2[16];
17 unsigned char code cgram1[64]={0x00,0x1f,0x12,0x09,0x1f,0x11,0x01,0x0f,
18 0x1e,0x04,0x04,0x08,0x1f,0x01,0x00,0x1e,
19 0x02,0x03,0x06,0x05,0x04,0x09,0x09,0x12,
20 0x00,0x1c,0x04,0x08,0x10,0x18,0x04,0x07,
21 0x00,0x0f,0x09,0x09,0x0f,0x09,0x09,0x0f,0x00,0x1c,0x04,0x04,0x1c,0x04,0x04,0x1c,
22 0x00,0x04,0x14,0x14,0x14,0x04,0x04,0x03,0x00,0x12,0x13,0x11,0x01,0x04,0x04,0x1c};//
23
24
25 void delay5ms()
26 {
27 1 register int i;
28 1 for (i=0;i<1000;i++)
29 1 ;
30 1 }
31
32 void delay50us()
33 {
34 1 register int i;
35 1 for (i=0;i<20;i++)
36 1 ;
37 1 }
38
39 wr_com(unsigned char comm)
40 {
41 1 LCDE=0;
42 1 RS=0;
43 1 RW=0;
44 1 LCDE=1;
45 1 P0=comm;
46 1 RS=0;
47 1 RW=0;
48 1 LCDE=0;
49 1 }
50
51 wr_data(unsigned char dat)
52 {
53 1 LCDE=0;
54 1 RS=0;
55 1 RW=0;
C51 COMPILER V7.01 JIANJIEKZH 03/13/2009 19:39:53 PAGE 2
56 1 RS=1;
57 1 RW=0;
58 1 LCDE=1;
59 1 P0=dat;
60 1 LCDE=0;
61 1 RS=0;
62 1 RW=0;
63 1 }
64
65
66 unsigned char rd_bf()
67 {
68 1 unsigned char i;
69 1 P0=0xff;
70 1 LCDE=0;
71 1 RS=0;
72 1 RW=0;
73 1 RS=0;
74 1 RW=1;
75 1 LCDE=1;
76 1 i=P0;
77 1 LCDE=0;
78 1 return(i);
79 1 }
80
81 void init()
82 {
83 1 unsigned char in,i;
84 1 wr_com(0x30);
85 1 delay5ms();
86 1 wr_com(0x30);
87 1 delay5ms();
88 1 wr_com(0x30);
89 1 delay5ms();
90 1 in=rd_bf();
91 1 delay5ms();
92 1 wr_com(0x01);
93 1 delay5ms();
94 1 in=rd_bf();
95 1 delay5ms();
96 1 wr_com(0x06);
97 1 delay5ms();
98 1 in=rd_bf();
99 1 delay50us();
100 1 wr_com(0x38);
101 1 delay50us();
102 1 in=rd_bf();
103 1 delay50us();
104 1 wr_com(0x0c);
105 1 delay50us();
106 1 in=rd_bf();
107 1 delay50us();
108 1
109 1 wr_com(0x40); //set cgram address
110 1 delay50us();
111 1 in=rd_bf();
112 1 delay50us();
113 1 for(i=0;i<64;i++)
114 1 {
115 2 wr_data(cgram1[i]); //display "0"
116 2 delay50us();
117 2 in=rd_bf();
C51 COMPILER V7.01 JIANJIEKZH 03/13/2009 19:39:53 PAGE 3
118 2 }
119 1 }
120
121
122 display_162()
123 {
124 1 unsigned char in,i;
125 1 wr_com(0x80); //set ram address
126 1 delay50us();
127 1 in=rd_bf();
128 1 delay50us();
129 1 for(i=0;i<16;i++)
130 1 {
131 2 wr_data(line1[i]); //display "0"
132 2 delay50us();
133 2 in=rd_bf();
134 2 }
135 1 in=rd_bf();
136 1 delay50us();
137 1 wr_com(0xc0);
138 1 delay50us();
139 1 in=rd_bf();
140 1 delay50us();
141 1 for(i=0;i<16;i++)
142 1 {
143 2 wr_data(line2[i]); //display "0"
144 2 delay50us();
145 2 in=rd_bf();
146 2 }
147 1 }
148 main()
149 {
150 1 unsigned char in,i,da;
151 1 delay5ms();
152 1 delay5ms();
153 1 delay5ms();
154 1 delay5ms();
155 1
156 1
157 1 init();
158 1
159 1 while(1)
160 1 {
161 2 if(fd==0)
162 2 {
163 3 line1[0]=0x20;
164 3 line1[1]=0; //display "爱思"
165 3 line1[2]=1;
166 3 line1[3]=4;
167 3 line1[4]=5;
168 3 line1[5]=0x20;
169 3 line1[6]=0; //display "爱思"
170 3 line1[7]=1;
171 3 line1[8]=4;
172 3 line1[9]=5;
173 3 line1[10]=0x20;
174 3 line1[11]=0; //display "爱思"
175 3 line1[12]=1;
176 3 line1[13]=4;
177 3 line1[14]=5;
178 3 line1[15]=0x20;
179 3
C51 COMPILER V7.01 JIANJIEKZH 03/13/2009 19:39:53 PAGE 4
180 3 line2[0]=0x20;
181 3 line2[1]=2; //display "爱思"
182 3 line2[2]=3;
183 3 line2[3]=6;
184 3 line2[4]=7;
185 3 line2[5]=0x20;
186 3 line2[6]=2; //display "爱思"
187 3 line2[7]=3;
188 3 line2[8]=6;
189 3 line2[9]=7;
190 3 line2[10]=0x20;
191 3 line2[11]=2; //display "爱思"
192 3 line2[12]=3;
193 3 line2[13]=6;
194 3 line2[14]=7;
195 3 line2[15]=0x20;
196 3
197 3 }
198 2 else if(big==0)
199 2 {
200 3 da=0x41;
201 3 for(i=0;i<16;i++)
202 3 {
203 4 line1[i]=da;
204 4 da++;
205 4 }
206 3
207 3
208 3 da=0x51;
209 3 for(i=0;i<16;i++)
210 3 {
211 4 line2[i]=da;
212 4 da++;
213 4 }
214 3 }
215 2 else
216 2 {
217 3 da=0x61;
218 3 for(i=0;i<16;i++)
219 3 {
220 4 line1[i]=da;
221 4 da++;
222 4 }
223 3
224 3
225 3 da=0x71;
226 3 for(i=0;i<16;i++)
227 3 {
228 4 line2[i]=da;
229 4 da++;
230 4 }
231 3 }
232 2 display_162();
233 2 }
234 1 }
*** WARNING C280 IN LINE 150 OF JIANJIEKZH.C: 'in': unreferenced local variable
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 415 ----
CONSTANT SIZE = 64 ----
XDATA SIZE = ---- ----
C51 COMPILER V7.01 JIANJIEKZH 03/13/2009 19:39:53 PAGE 5
PDATA SIZE = ---- ----
DATA SIZE = 32 1
IDATA SIZE = 8 ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 1 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -