⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lcd.lst

📁 CLOCK 网上看到的电子钟 源码 附图
💻 LST
字号:
C51 COMPILER V7.06   LCD                                                                   04/15/2006 22:22:49 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE LCD
OBJECT MODULE PLACED IN E:\PZSHAN\临时文件\414LCD\LCD.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE E:\PZSHAN\临时文件\414LCD\LCD.C DB SB OE

stmt level    source

   1          #include<stdio.h>
   2          //#include<absacc.h>
   3          #include<reg51.h>
   4          sbit rs=P1^7;
   5          sbit rw=P1^6;
   6          sbit en=P1^5;
   7          int i,k=0;
   8          int s=0,ts=0,m=0,tm=0,h=0,th=0;
   9          unsigned char inst[]={0x38,0x01,0x06,0x0c};
  10          unsigned char coded[]={0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39};
  11          void delay(int i)
  12          { while(i>0)i--;}
  13          void writeinstruction(unsigned char instructiondata)
  14          { rs=0;
  15   1        rw=0;
  16   1        en=1;
  17   1        P0=instructiondata;
  18   1        delay(2);
  19   1        en=0;
  20   1      }
  21          void initlcd()
  22          {   writeinstruction(inst[0]);
  23   1          writeinstruction(inst[1]);
  24   1          writeinstruction(inst[2]);
  25   1          writeinstruction(inst[3]);
  26   1      }
  27          void readdata(unsigned char readdata)
  28          { rs=1;
  29   1        rw=0;
  30   1        en=1;
  31   1        P0=readdata;
  32   1        delay(2);
  33   1        en=0;
  34   1      }
  35          void display()
  36          {  writeinstruction(0x0C);
  37   1         writeinstruction(0x8B);
  38   1         readdata(coded[s]);
  39   1         s++;
  40   1        
  41   1         writeinstruction(0x0C);
  42   1         writeinstruction(0x8A);
  43   1         readdata(coded[ts]);
  44   1        if(s==10)
  45   1         {s=0;ts++;}
  46   1         writeinstruction(0x0C);
  47   1         writeinstruction(0x89);
  48   1         readdata(0x3A);
  49   1         writeinstruction(0x0C);
  50   1         writeinstruction(0x88);
  51   1         readdata(coded[m]);
  52   1         if(ts==6)
  53   1         {ts=0;m++;}
  54   1         writeinstruction(0x0C);
  55   1         writeinstruction(0x87);
C51 COMPILER V7.06   LCD                                                                   04/15/2006 22:22:49 PAGE 2   

  56   1         readdata(coded[tm]);
  57   1         if(m==10)
  58   1         {m=0;tm++;}
  59   1          writeinstruction(0x0C);
  60   1         writeinstruction(0x86);
  61   1         readdata(0x3A);
  62   1         writeinstruction(0x0C);
  63   1         writeinstruction(0x85);
  64   1         readdata(coded[h]);
  65   1         if(tm==6)
  66   1         {tm=0;h++;}
  67   1         writeinstruction(0x0C);
  68   1         writeinstruction(0x84);
  69   1         readdata(coded[th]);
  70   1         if(h==10)
  71   1         {h=0;th++;}
  72   1         if(th==2)
  73   1         {if(h==4)
  74   2          {s=ts=m=tm=h=th=0;  }
  75   2         }
  76   1         writeinstruction(0x0C);
  77   1         writeinstruction(0xC6);
  78   1         readdata(0x54);
  79   1         writeinstruction(0x0C);
  80   1         writeinstruction(0xC7);
  81   1         readdata(0x69);
  82   1         writeinstruction(0x0C);
  83   1         writeinstruction(0xC8);
  84   1         readdata(0x6D);
  85   1         writeinstruction(0x0C);
  86   1         writeinstruction(0xC9);
  87   1         readdata(0x65);
  88   1      }
  89          void main()
  90          { delay(100);
  91   1        initlcd();
  92   1        IE=0x88;
  93   1        TCON=0x00;
  94   1        TMOD=0x10;
  95   1        TH1=(65536-50000)/256;
  96   1        TL1=(65536-50000)%256;
  97   1        TR1=1;
  98   1        while(1);
  99   1      }
 100          void timer1(void)interrupt 4 using 1
 101          { k++;
 102   1        if(k==14)
 103   1        {k=0;display();}
 104   1      }
 105          
 106          
C51 COMPILER V7.06   LCD                                                                   04/15/2006 22:22:49 PAGE 3   

NAME                                    CLASS   MSPACE  TYPE    OFFSET  SIZE
====                                    =====   ======  ====    ======  ====


P0 . . . . . . . . . . . . . . . . . .  SFR      DATA   U_CHAR   0080H  1
P1 . . . . . . . . . . . . . . . . . .  SFR      DATA   U_CHAR   0090H  1
coded. . . . . . . . . . . . . . . . .  PUBLIC   DATA   ARRAY    0000H  10
IE . . . . . . . . . . . . . . . . . .  SFR      DATA   U_CHAR   00A8H  1
size_t . . . . . . . . . . . . . . . .  TYPEDEF  -----  U_INT    -----  2
_readdata. . . . . . . . . . . . . . .  PUBLIC   CODE   PROC     0003H  -----
  readdata . . . . . . . . . . . . . .  * REG *  DATA   U_CHAR   0007H  1
main . . . . . . . . . . . . . . . . .  PUBLIC   CODE   PROC     0000H  -----
TMOD . . . . . . . . . . . . . . . . .  SFR      DATA   U_CHAR   0089H  1
TCON . . . . . . . . . . . . . . . . .  SFR      DATA   U_CHAR   0088H  1
inst . . . . . . . . . . . . . . . . .  PUBLIC   DATA   ARRAY    000AH  4
TH1. . . . . . . . . . . . . . . . . .  SFR      DATA   U_CHAR   008DH  1
TL1. . . . . . . . . . . . . . . . . .  SFR      DATA   U_CHAR   008BH  1
en . . . . . . . . . . . . . . . . . .  ABSBIT   -----  BIT      0095H  1
timer1 . . . . . . . . . . . . . . . .  PUBLIC   CODE   PROC     0000H  -----
TR1. . . . . . . . . . . . . . . . . .  ABSBIT   -----  BIT      008EH  1
_writeinstruction. . . . . . . . . . .  PUBLIC   CODE   PROC     000AH  -----
  instructiondata. . . . . . . . . . .  * REG *  DATA   U_CHAR   0007H  1
th . . . . . . . . . . . . . . . . . .  PUBLIC   DATA   INT      000EH  2
tm . . . . . . . . . . . . . . . . . .  PUBLIC   DATA   INT      0010H  2
rs . . . . . . . . . . . . . . . . . .  ABSBIT   -----  BIT      0097H  1
h. . . . . . . . . . . . . . . . . . .  PUBLIC   DATA   INT      0012H  2
ts . . . . . . . . . . . . . . . . . .  PUBLIC   DATA   INT      0014H  2
i. . . . . . . . . . . . . . . . . . .  PUBLIC   DATA   INT      0016H  2
rw . . . . . . . . . . . . . . . . . .  ABSBIT   -----  BIT      0096H  1
k. . . . . . . . . . . . . . . . . . .  PUBLIC   DATA   INT      0018H  2
initlcd. . . . . . . . . . . . . . . .  PUBLIC   CODE   PROC     0000H  -----
m. . . . . . . . . . . . . . . . . . .  PUBLIC   DATA   INT      001AH  2
_delay . . . . . . . . . . . . . . . .  PUBLIC   CODE   PROC     000AH  -----
  i. . . . . . . . . . . . . . . . . .  * REG *  DATA   INT      0006H  2
s. . . . . . . . . . . . . . . . . . .  PUBLIC   DATA   INT      001CH  2
display. . . . . . . . . . . . . . . .  PUBLIC   CODE   PROC     0000H  -----


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    457    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =     30    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -