?? 8.4.lst
字號:
297 0,0,0,0,0,254,204,24,48,96,198,254,0,0,0,0,
298 0,0,14,24,24,24,112,24,24,24,24,14,0,0,0,0,
299 0,0,24,24,24,24,0,24,24,24,24,24,0,0,0,0,
300 0,0,112,24,24,24,14,24,24,24,24,112,0,0,0,0,
301 0,0,118,220,0,0,0,0,0,0,0,0,0,0,0,0,
302 0,0,0,0,16,56,108,198,198,198,254,0,0,0,0,0
303 };
C51 COMPILER V7.09 8_4 08/24/2005 08:49:15 PAGE 6
304
305 /* 顯示8*16點陣英文字母,反白 */
306 void da(unsigned char n,bit un) {
307 1 unsigned char i;
308 1 unsigned int k=n;
309 1 for (i=0;i<16;i++) {
310 2 ag(x,y*8+i);
311 2 if (un==0) disp(asc16[k*16+i]); else disp(255-asc16[k*16+i]);
312 2 }
313 1 if ((++x)>=16) {
314 2 x=0;
315 2 y+=2;
316 2 if (y>=8) y=0;
317 2 }
318 1 }
319 /* 反白文本/取消 */
320 void da8(unsigned char n,bit un) {
321 1 unsigned char i,j;
322 1 for (j=0;j<n;j++) {
323 2 for (i=0;i<8;i++) {
324 3 ag(x,y*8+i);
325 3 if (un==0) disp(0xff); else disp(0x0);
326 3 }
327 2 if ((++x)>=16) {
328 3 x=0;
329 3 y+=1;
330 3 if (y>=8) y=0;
331 3 }
332 2 }
333 1
334 1 }
335
336 unsigned char code fot[]={
337 /*0時*/0x0,0x8,0x4,0x8,0x7e,0x8,0x44,0x8,0x47,0xfe,0x44,0x8,0x44,0x8,0x7c,0x88,0x44,0x48,
338 0x44,0x48,0x44,0x8,0x44,0x8,0x7c,0x8,0x44,0x48,0x0,0x28,0x0,0x10,
339 /*1間*/0x20,0x4,0x1b,0xfe,0x8,0x4,0x40,0x24,0x4f,0xf4,0x48,0x24,0x48,0x24,0x48,0x24,
340 0x4f,0xe4,0x48,0x24,0x48,0x24,0x48,0x24,0x4f,0xe4,0x48,0x24,0x40,0x14,0x40,0x8,
341 /*2日*/0x0,0x10,0x1f,0xf8,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1f,0xf0,
342 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x1f,0xf0,0x10,0x10,0x0,0x0,
343 /*3期*/0x22,0x4,0x22,0x7e,0x22,0x44,0x7f,0x44,0x22,0x44,0x3e,0x7c,0x22,0x44,0x3e,0x44,
344 0x22,0x44,0x22,0x7c,0xff,0xc4,0x0,0x44,0x24,0x44,0x22,0x84,0x41,0x14,0x82,0x8,
345 /*4鬧*/0x40,0x4,0x37,0xfe,0x10,0x4,0x42,0x4,0x41,0x24,0x5f,0xf4,0x41,0x4,0x41,0x24,
346 0x4f,0xf4,0x49,0x24,0x49,0x24,0x49,0x24,0x49,0x64,0x41,0x4,0x41,0x14,0x40,0x8,
347 /*5鐘*/0x10,0x20,0x10,0x20,0x10,0x20,0x1c,0x24,0x21,0xfe,0x21,0x24,0x7d,0x24,0x91,0x24,
348 0x11,0x24,0xfd,0xfc,0x11,0x24,0x10,0x20,0x14,0x20,0x18,0x20,0x10,0x20,0x0,0x20,
349 /*6設*/0x1,0xf0,0x21,0x10,0x11,0x10,0x11,0x10,0x1,0x10,0x2,0xe,0xf4,0x0,0x13,0xf8,
350 0x11,0x8,0x11,0x10,0x10,0x90,0x10,0xa0,0x14,0x40,0x18,0xb0,0x13,0xe,0xc,0x4,
351 /*7定*/0x2,0x0,0x1,0x0,0x7f,0xfe,0x40,0x2,0x80,0x24,0x1f,0xf0,0x1,0x0,0x1,0x0,
352 0x11,0x20,0x11,0xf0,0x11,0x0,0x11,0x0,0x11,0x0,0x29,0x6,0x47,0xfc,0x80,0x0,
353 /*8開*/0x0,0x8,0x7f,0xfc,0x8,0x20,0x8,0x20,0x8,0x20,0x8,0x20,0x8,0x24,0xff,0xfe,
354 0x8,0x20,0x8,0x20,0x8,0x20,0x8,0x20,0x10,0x20,0x10,0x20,0x20,0x20,0x40,0x20,
355 /*9關*/0x10,0x10,0x8,0x18,0x4,0x20,0x4,0x48,0x7f,0xfc,0x1,0x0,0x1,0x0,0x1,0x4,
356 0xff,0xfe,0x1,0x0,0x2,0x80,0x2,0x80,0x4,0x40,0x8,0x30,0x30,0xe,0xc0,0x4,
357 /*10星*/0x0,0x8,0x3f,0xfc,0x20,0x8,0x3f,0xf8,0x20,0x8,0x3f,0xf8,0x1,0x0,0x21,0x8,
358 0x3f,0xfc,0x21,0x0,0x41,0x10,0xbf,0xf8,0x1,0x0,0x1,0x4,0xff,0xfe,0x0,0x0,
359 /*11溫*/0x0,0x8,0x43,0xfc,0x32,0x8,0x12,0x8,0x83,0xf8,0x62,0x8,0x22,0x8,0xb,0xf8,
360 0x10,0x0,0x27,0xfc,0xe4,0xa4,0x24,0xa4,0x24,0xa4,0x24,0xa4,0x2f,0xfe,0x20,0x0,
361 /*12度*/0x1,0x0,0x0,0x84,0x3f,0xfe,0x22,0x20,0x22,0x28,0x3f,0xfc,0x22,0x20,0x23,0xe0,
362 0x20,0x0,0x2f,0xf0,0x22,0x20,0x21,0x40,0x20,0x80,0x43,0x60,0x8c,0x1e,0x30,0x4,
363 /*13亮*/0x1,0x8,0x7f,0xfc,0x0,0x10,0x1f,0xf8,0x10,0x10,0x10,0x10,0x1f,0xf0,0x0,0x0,
364 0x7f,0xfe,0x40,0x22,0x8f,0xf4,0x8,0x20,0x8,0x20,0x8,0x22,0x10,0x22,0x60,0x1e,
365 /*14濕*/0x0,0x8,0x47,0xfc,0x34,0x8,0x14,0x8,0x87,0xf8,0x64,0x8,0x24,0x8,0xf,0xf8,
C51 COMPILER V7.09 8_4 08/24/2005 08:49:15 PAGE 7
366 0x11,0x20,0x21,0x20,0xe9,0x24,0x25,0x28,0x23,0x30,0x21,0x24,0x3f,0xfe,0x20,0x0,
367 /*15報*/0x10,0x8,0x11,0xfc,0x11,0x8,0x11,0x8,0xfd,0x28,0x11,0x10,0x15,0x0,0x19,0xf8,
368 0x31,0x8,0xd1,0x90,0x11,0x50,0x11,0x20,0x11,0x50,0x11,0x8e,0x51,0x4,0x21,0x0,
369 /*16警*/0x14,0x40,0x7f,0x7c,0x10,0xc8,0x3f,0x28,0x55,0x10,0x1d,0x6e,0x3,0x4,0xff,0xfe,
370 0x0,0x0,0x1f,0xf0,0x0,0x0,0x1f,0xf0,0x0,0x0,0x1f,0xf0,0x10,0x10,0x1f,0xf0,
371 /*17火*/0x1,0x0,0x1,0x0,0x1,0x0,0x1,0x0,0x11,0x8,0x11,0x18,0x11,0x20,0x21,0x40,
372 0x42,0x80,0x2,0x80,0x4,0x40,0x4,0x40,0x8,0x20,0x10,0x10,0x20,0xe,0x40,0x4,
373 /*18盜*/0x1,0x0,0x41,0x8,0x33,0xfc,0x12,0x48,0x4,0x40,0x10,0xa0,0x21,0x10,0xc6,0xe,
374 0x40,0x4,0x1f,0xf0,0x12,0x90,0x12,0x90,0x12,0x90,0x12,0x94,0xff,0xfe,0x0,0x0,
375 /*19煤*/0x21,0x10,0x21,0x10,0x21,0x10,0x27,0xfc,0xf9,0x10,0x49,0xf0,0x49,0x10,0x49,0xf0,
376 0x48,0x44,0x8f,0xfe,0x50,0x40,0x20,0xe0,0x51,0x50,0x4a,0x4e,0x84,0x44,0x0,0x40,
377 /*20氣*/0x10,0x0,0x10,0x8,0x1f,0xfc,0x20,0x0,0x2f,0xf0,0x40,0x0,0xbf,0xe0,0x0,0x20,
378 0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x22,0x0,0x12,0x0,0xa,0x0,0x53,
379 /*21緊*/0x4,0x0,0x25,0xf8,0x25,0x10,0x24,0xa0,0x24,0x40,0x24,0xb0,0x7,0xe,0x4,0x24,
380 0x1f,0xc0,0x1,0x0,0x2,0x10,0x7f,0xf8,0x1,0x8,0x9,0x20,0x11,0x18,0x63,0x8,
381 /*22急*/0x4,0x0,0x4,0x0,0xf,0xe0,0x8,0x40,0x10,0x88,0x3f,0xfc,0x40,0x8,0x1f,0xf8,
382 0x0,0x8,0x3f,0xf8,0x2,0x0,0x51,0x84,0x50,0x92,0x90,0x12,0xf,0xf0,0x0,0x0,
383 /*23電*/0x2,0x0,0x2,0x0,0x2,0x10,0x7f,0xf8,0x42,0x10,0x42,0x10,0x7f,0xf0,0x42,0x10,
384 0x42,0x10,0x7f,0xf0,0x42,0x10,0x2,0x0,0x2,0x4,0x2,0x4,0x1,0xfc,0x0,0x0,
385 /*24話*/0x0,0x10,0x40,0x38,0x33,0xc0,0x10,0x40,0x0,0x40,0x0,0x44,0xf7,0xfe,0x10,0x40,
386 0x10,0x48,0x13,0xfc,0x12,0x8,0x12,0x8,0x16,0x8,0x1a,0x8,0x13,0xf8,0x2,0x8};
387
388 /* 顯示16*16點陣漢字,反白 */
389 void dh(unsigned char n,bit un) {
390 1 unsigned char i,j;
391 1 unsigned int k=n;
392 1 for (i=0;i<16;i++) {
393 2 for (j=0;j<2;j++) {
394 3 ag(j+x,y*8+i);
395 3 if (un==0) disp(fot[k*32+i*2+j]); else disp(255-fot[k*32+i*2+j]);
396 3 }
397 2 }
398 1 x+=2;
399 1 if (x>=16) {
400 2 x=0;
401 2 y+=2;
402 2 if (y>=8) y=0;
403 2 }
404 1 }
405
406 /* 劃線 */
407 void line(unsigned char x0,unsigned char y0,unsigned char x1,unsigned char y1) {
408 1 unsigned char x=x1-x0,y=y1-y0,xx;
409 1 float yy;
410 1 if (x>y) {
411 2 yy=y0;
412 2 for (xx=x0;xx<x1;xx++) {
413 3 yy+=(float)y/x;
414 3 ag((xx/8),yy);
415 3 setb((7-xx&7));
416 3 }
417 2 } else {
418 2 yy=x0;
419 2 for (xx=y0;xx<y1;xx++) {
420 3 yy+=(float)x/y;
421 3 ag(yy/8,xx);
422 3 setb((7-(char)yy&7));
423 3 }
424 2 }
425 1 }
426
427
C51 COMPILER V7.09 8_4 08/24/2005 08:49:15 PAGE 8
428
429 //==============================================
430 unsigned char kpush;
431 unsigned char code key[]={0,237,221,189,125,231,215,183,119,
432 238,222,190,126,235,219,187,123};
433
434 void scankey(void) {
435 1 unsigned char lie,knew=0;
436 1 P1=0xf;
437 1 if ((P1&0xf)!=0xf) {
438 2 wait10();
439 2 if ((lie=P1&0xf)!=0xf) {
440 3 P1=0xf0;
441 3 knew=P1&0xf0|lie;
442 3 }
443 2 }
444 1 for (lie=0;lie<17;lie++) {
445 2 if (knew==key[lie]) break;
446 2 }
447 1 kpush=lie;
448 1 }
449
450
451 /* 定時器0中斷 */
452 unsigned char s,m,h;
453 unsigned int s001;
454 void int_t0(void) interrupt 1 {
455 1 TL0+=48;TH0=0xf8;
456 1 time++;
457 1 if ((++s001)>=1000) {
458 2 s001=0;
459 2 if ((++s)>59) {
460 3 s=0;
461 3 if ((++m)>59) {
462 4 m=0;
463 4 if ((++h)>23) h=0;
464 4 }
465 3 }
466 2 }
467 1 }
468
469 /* 定時器1中斷,現用于lcd負壓 */
470 /* 該部分線路圖整理中*/
471 void int_t1(void) interrupt 3 {
472 1 P3=P3^0xc0;
473 1 }
474
475
476
477
478 void main(void) {
479 1 // unsigned char i,j;
480 1 TMOD=0x21;
481 1 TH1=0;PT0=1;
482 1 P3=0x7f;
483 1 EA=1;
484 1 ET0=1;TR0=1;
485 1 ET1=1;TR1=1;
486 1 init();
487 1
488 1
489 1 dh(10,0);
C51 COMPILER V7.09 8_4 08/24/2005 08:49:15 PAGE 9
490 1 dh(3,0);
491 1 da(' ',0);
492 1 da('1',0);
493 1
494 1 at(7,0);
495 1 disp('1'-0x20);
496 1 disp('2'-0x20);
497 1 disp(':'-0x20);
498 1 disp('5'-0x20);
499 1 disp('9'-0x20);
500 1 disp(' '-0x20);
501 1 disp('o'-0x20);
502 1 disp('n'-0x20);
503 1
504 1 at(7,1);
505 1 disp('1'-0x20);
506 1 disp('2'-0x20);
507 1 disp(':'-0x20);
508 1 disp('5'-0x20);
509 1 disp('9'-0x20);
510 1 disp(' '-0x20);
511 1 disp('o'-0x20);
512 1 disp('f'-0x20);
513 1 disp('f'-0x20);
514 1
515 1 line(53,0,53,18);
516 1 line(0,18,128,18);
517 1
518 1
519 1 x=0;y=3;
520 1 dh(0,0);
521 1 dh(1,0);
522 1
523 1 x=0;y=6;
524 1 dh(2,0);
525 1 dh(3,0);
526 1 da(' ',0);
527 1 da('1',0);
528 1 da('9',0);
529 1 da('9',0);
530 1 da('8',0);
531 1 da('-',0);
532 1 da('1',0);
533 1 da('2',0);
534 1 da('-',0);
535 1 da('2',0);
536 1 da('9',0);
537 1
538 1 // for (i=0;i<128;i++) {
539 1 // da(i,i%16,i/16*2);
540 1 // }
541 1
542 1 // while (1) {}
543 1
544 1 // at(0,2);
545 1 // for (i=0;i<16;i++) disp('='-0x20);
546 1
547 1
548 1 // for (i=0;i<8;i++) {
549 1 // dh(i,i*2,0);
550 1 // dh(i+8,i*2,2);
551 1 // dh(i+16,i*2,4);
C51 COMPILER V7.09 8_4 08/24/2005 08:49:15 PAGE 10
552 1 // dh(i+24,i*2,6);
553 1 // }
554 1
555 1 // while (1) {}
556 1
557 1 x=13;
558 1 y=1;
559 1 da8(3,0);
560 1
561 1 while (1) {
562 2 scankey();
563 2 if (kpush==1) {
564 3 x=0;y=0;
565 3 dh(10,1);
566 3 dh(3,1);
567 3 } else if (kpush==2) {
568 3 x=0;y=3;
569 3 dh(0,1);
570 3 dh(1,1);
571 3 }
572 2 x=6;y=3;
573 2 da(h/10+0x30,0);
574 2 da(h%10+0x30,0);
575 2 da(':',0);
576 2 da(m/10+0x30,0);
577 2 da(m%10+0x30,0);
578 2 da(':',0);
579 2 da(s/10+0x30,0);
580 2 da(s%10+0x30,0);
581 2 }
582 1
583 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 1740 ----
CONSTANT SIZE = 2865 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 11 18
IDATA SIZE = ---- ----
BIT SIZE = ---- 3
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -