📄 wl001.lst
字号:
C51 COMPILER V6.12 WL001 09/16/2006 22:31:22 PAGE 1
C51 COMPILER V6.12, COMPILATION OF MODULE WL001
OBJECT MODULE PLACED IN .\wl001.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE .\wl001.c BROWSE DEBUG OBJECTEXTEND
stmt level source
1 #include <led.h>
2 #define uint unsigned int
3 #define uchar unsigned char
4
5 void delayms(unsigned int ms);
6 void alldie(unsigned int ms);
7 void alllight(unsigned int ms);
8 void dotlight(unsigned char pp0, unsigned char pp1);
9 void MatrixDisplay(struct Character *ptr, unsigned char size, unsigned char rev);
10 void worddisplay(unsigned char word,unsigned int ms, unsigned char rev);
11 void decode(struct Character *ptr, unsigned char size);
12 void sendbyte(unsigned char byte);
13 void out595(void);
14
15 unsigned int ledup,leddown;
16
17 //------------------------------------------------------------------------
18 main()
19 {
20 1 uchar temp=0x00;
21 1 uchar alphabet = 'A';
22 1 uint i;
23 1
24 1 alllight(2000);
25 1 alldie(2000);
26 1 alllight(2000);
27 1 alldie(2000);
28 1
29 1 while(1)
30 1 {
31 2 for(i=0; i<24; i++)
32 2 {
33 3 ledup = 6 ; leddown = 0 ;
34 3
35 3 while( ledup )
36 3 {
37 4 ledup--;
38 4 for(leddown=0; leddown<6; leddown++) worddisplay(alphabet,20,1);
39 4 }
40 3
41 3 ledup = 0 ; leddown = 6 ;
42 3
43 3 while( leddown )
44 3 {
45 4 leddown--;
46 4 for(ledup=0; ledup<6; ledup++) worddisplay(alphabet,20,1);
47 4 }
48 3
49 3
50 3 alphabet++;
51 3 //worddisplay(alphabet,100,0);
52 3
53 3 }
54 2
55 2 worddisplay(temp,200,0);
C51 COMPILER V6.12 WL001 09/16/2006 22:31:22 PAGE 2
56 2 temp++;
57 2 if(temp==0x0a)temp=0x00;
58 2
59 2 }
60 1
61 1 }
62
63 //--------------------------
64
65
66 //-----------------------------------
67
68 void delayms(unsigned int ms)
69 {
70 1 uint i;
71 1 while(ms--)
72 1 {
73 2 for(i = 0; i < 5; i++);
74 2 }
75 1
76 1 }
77 //-----------------------
78 //------------------------------------------------
79 void sendbyte(uchar byte)
80 {
81 1 uchar c;
82 1
83 1 for(c=0;c<8;c++)
84 1 {
85 2 CLK=0;
86 2 DAT=byte&0x80;
87 2 byte=byte<<1;
88 2 CLK=1;
89 2 }
90 1
91 1 }
92 //----------------------------------------------
93 void out595(void)
94 {
95 1 RCLK=0;
96 1 nop();
97 1 RCLK=1;
98 1 }
99 //-----------------------------------------------
100 void alldie(uint ms)
101 {
102 1 P1=0xFF;
103 1 sendbyte(0xFF);
104 1 out595();
105 1 delayms(ms);
106 1 }
107 //--------------------------
108 void alllight(uint ms)
109 {
110 1
111 1 P1=0x00;
112 1 Red=0;
113 1 sendbyte(0x00);
114 1 out595();
115 1 delayms(ms);
116 1
117 1 }
C51 COMPILER V6.12 WL001 09/16/2006 22:31:22 PAGE 3
118 //-------------------------------
119 void dotlight(uchar pp0, uchar pp1)
120 {
121 1
122 1 P1=pp1;
123 1 sendbyte(pp0);
124 1 out595();
125 1
126 1 }
127 //-----------------------------------------------
128
129
130 //----------------------------------------------------
131 void decode(struct Character *ptr, unsigned char size)
132 {
133 1
134 1 unsigned short int i,j;
135 1 unsigned char tempstart, tempqty;
136 1
137 1 tempstart=0; tempqty=0;
138 1
139 1 for(i=0; i<64; i++) LED[i]=0;
140 1
141 1 for(j=0; j<size; j++)
142 1 {
143 2
144 2 if(ptr[j].line=='H'){ tempqty = ptr[j].qty; tempstart=ptr[j].start;
145 3 while(tempqty--)
146 3 {
147 4 LED[tempstart - 1] = 1 ;
148 4 tempstart++ ;
149 4 }
150 3 }
151 2
152 2 if(ptr[j].line=='V'){tempqty = ptr[j].qty; tempstart=ptr[j].start;
153 3 while(tempqty--)
154 3 {
155 4 LED[tempstart - 1] = 1 ;
156 4 tempstart = tempstart + 8 ;
157 4 }
158 3 }
159 2
160 2 if(ptr[j].line=='L'){tempqty = ptr[j].qty; tempstart=ptr[j].start;
161 3 while(tempqty--)
162 3 {
163 4 LED[tempstart - 1] = 1 ;
164 4 tempstart = tempstart + 7 ;
165 4 }
166 3 }
167 2
168 2 if(ptr[j].line=='R'){tempqty = ptr[j].qty; tempstart=ptr[j].start;
169 3 while(tempqty--)
170 3 {
171 4 LED[tempstart - 1] = 1 ;
172 4 tempstart = tempstart + 9 ;
173 4 }
174 3 }
175 2
176 2 if(ptr[j].line=='D'){
177 3
178 3 LED[ptr[j].start - 1] = 1 ;
179 3
C51 COMPILER V6.12 WL001 09/16/2006 22:31:22 PAGE 4
180 3 }
181 2
182 2 }
183 1
184 1 }
185 //-------------------------------------------------
186
187 //------------------------------------------------
188 void MatrixDisplay(struct Character *ptr, unsigned char size, unsigned char rev)
189 {
190 1
191 1 uint i,j;
192 1 uchar pp0,pp1;
193 1 unsigned char *tempLED;
194 1 pp0=0xef;pp1=0x7f;
195 1
196 1 decode(ptr,size);
197 1
198 1 tempLED=&LED[0];
199 1
200 1 for(i=0; i<8; i++)
201 1 {
202 2 pp1=_crol_(pp1,1);
203 2 for(j=0; j<8; j++)
204 2 {
205 3 pp0=_crol_(pp0,1);
206 3 tempLED++;
207 3 if(*tempLED==1) { dotlight(pp0,pp1); delayms(ledup); alldie(leddown); }
208 3 }
209 2 }
210 1
211 1 }
*** WARNING C280 IN LINE 188 OF .\WL001.C: 'rev': unreferenced local variable
212 //------------------------------------------------
213
214
215
216 //------------------------------------------------
217 void worddisplay(uchar word,uint ms,uchar rev)
218 {
219 1
220 1 while(ms--)
221 1 {
222 2 if(word==0x01) MatrixDisplay(one,2,rev);
223 2 if(word==0x02) MatrixDisplay(two,5,rev);
224 2 if(word==0x03) MatrixDisplay(thr,7,rev);
225 2 if(word==0x04) MatrixDisplay(fou,3,rev);
226 2 if(word==0x05) MatrixDisplay(fiv,6,rev);
227 2 if(word==0x06) MatrixDisplay(six,5,rev);
228 2 if(word==0x07) MatrixDisplay(sev,3,rev);
229 2 if(word==0x08) MatrixDisplay(eig,7,rev);
230 2 if(word==0x09) MatrixDisplay(nin,5,rev);
231 2 if(word==0x00) MatrixDisplay(zer,4,rev);
232 2 // if(word==0xff){MatrixDisplay(test);}
233 2 if(word=='A') MatrixDisplay(A,5,rev);
234 2 if(word=='B') MatrixDisplay(BB,6,rev);
235 2 if(word=='C') MatrixDisplay(C,5,rev);
236 2 if(word=='D') MatrixDisplay(D,4,rev);
237 2 if(word=='E') MatrixDisplay(E,4,rev);
238 2 if(word=='F') MatrixDisplay(F,3,rev);
239 2 if(word=='G') MatrixDisplay(G,6,rev);
240 2 if(word=='H') MatrixDisplay(H,3,rev);
C51 COMPILER V6.12 WL001 09/16/2006 22:31:22 PAGE 5
241 2 if(word=='I') MatrixDisplay(I,3,rev);
242 2 if(word=='J') MatrixDisplay(J,3,rev);
243 2 if(word=='K') MatrixDisplay(K,3,rev);
244 2 if(word=='L') MatrixDisplay(L,2,rev);
245 2 if(word=='M') MatrixDisplay(M,4,rev);
246 2 if(word=='N') MatrixDisplay(N,3,rev);
247 2 if(word=='O') MatrixDisplay(O,4,rev);
248 2 if(word=='P') MatrixDisplay(PP,4,rev);
249 2 if(word=='Q') MatrixDisplay(Q,5,rev);
250 2 if(word=='R') MatrixDisplay(R,5,rev);
251 2 if(word=='S') MatrixDisplay(S,7,rev);
252 2 if(word=='T') MatrixDisplay(T,2,rev);
253 2 if(word=='U') MatrixDisplay(U,3,rev);
254 2 if(word=='V') MatrixDisplay(V,4,rev);
255 2 if(word=='W') MatrixDisplay(W,5,rev);
256 2 if(word=='X') MatrixDisplay(X,2,rev);
257 2 if(word=='Y') MatrixDisplay(Y,3,rev);
258 2 if(word=='Z') MatrixDisplay(Z,3,rev);
259 2
260 2 }
261 1 }
262 //---------------------------------------------------------
263
264
265
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 1513 ----
CONSTANT SIZE = 444 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 68 30
IDATA SIZE = ---- ----
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 + -