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

📄 main8.lst

📁 64x32led单元板的89s51显示控制程序,可以完成静太显示,向上平移,向右平移的动态显示.
💻 LST
📖 第 1 页 / 共 2 页
字号:
C51 COMPILER V7.06   MAIN8                                                                 05/22/2008 21:14:08 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE MAIN8
OBJECT MODULE PLACED IN main8.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE main8.c BROWSE DEBUG OBJECTEXTEND

stmt level    source

   1          #include<reg51.h>
   2          #include<intrins.h>
   3          #define uchar unsigned char
   4          #define uint unsigned int
   5          #define staticdis  0x01
   6          #define up 0x02
   7          #define left 0x03
   8          
   9          typedef struct typFNT_GB16                      // 汉字字模显示数据结构
  10          {
  11                  char Index[2];
  12                  char Msk[32];
  13          };
  14          struct typFNT_GB16 code GB_16[] = {         // 显示为16*16
  15          "中",0x01,0x00,0x01,0x00,0x21,0x08,0x3F,0xFC,0x21,0x08,0x21,0x08,0x21,0x08,0x21,0x08,0x21,0x08,0x3F,0xF8,0
             -x21,0x08,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,
  16          "文",0x02,0x00,0x01,0x00,0x01,0x00,0xFF,0xFE,0x08,0x20,0x08,0x20,0x08,0x20,0x04,0x40,0x04,0x40,0x02,0x80,0
             -x01,0x00,0x02,0x80,0x04,0x60,0x18,0x1E,0xE0,0x08,0x00,0x00,
  17          "测",0x40,0x02,0x27,0xC2,0x24,0x42,0x84,0x52,0x45,0x52,0x55,0x52,0x15,0x52,0x25,0x52,0x25,0x52,0x25,0x52,0
             -xC5,0x52,0x41,0x02,0x42,0x82,0x42,0x42,0x44,0x4A,0x48,0x04,
  18          "试",0x00,0x20,0x40,0x28,0x20,0x24,0x30,0x24,0x27,0xFE,0x00,0x20,0xE0,0x20,0x27,0xE0,0x21,0x20,0x21,0x10,0
             -x21,0x10,0x21,0x0A,0x29,0xCA,0x36,0x06,0x20,0x02,0x00,0x00,
  19          "衡",0x22,0x00,0x33,0xDE,0x44,0x40,0x58,0x80,0x97,0xC0,0x25,0x5E,0x67,0xC4,0xA5,0x44,0x27,0xC4,0x21,0x04,0
             -x2F,0xE4,0x21,0x04,0x22,0x84,0x24,0x54,0x28,0x28,0x20,0x00,
  20          "阳",0x00,0x00,0x7D,0xFC,0x45,0x04,0x49,0x04,0x49,0x04,0x51,0x04,0x49,0xFC,0x45,0x04,0x45,0x04,0x45,0x04,0
             -x69,0x04,0x51,0x04,0x41,0xFC,0x41,0x04,0x40,0x00,0x40,0x00,
  21          "师",0x08,0x00,0x0B,0xFE,0x48,0x20,0x48,0x20,0x4B,0xFE,0x4A,0x22,0x4A,0x22,0x4A,0x22,0x4A,0x22,0x52,0x22,0
             -x52,0x2A,0x12,0x24,0x20,0x20,0x40,0x20,0x80,0x20,0x00,0x20,
  22          "范",0x04,0x20,0x04,0x20,0xFF,0xFE,0x04,0x60,0x40,0x00,0x31,0xF8,0x91,0x08,0x61,0x08,0x49,0x08,0x09,0x38,0
             -x11,0x10,0xE1,0x00,0x21,0x04,0x21,0x04,0x20,0xFC,0x20,0x00,
  23          "学",0x01,0x08,0x10,0x8C,0x0C,0xC8,0x08,0x90,0x7F,0xFE,0x40,0x04,0x8F,0xE8,0x00,0x40,0x00,0x80,0x7F,0xFE,0
             -x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x02,0x80,0x01,0x00,
  24          "院",0x00,0x80,0xF8,0x40,0x8F,0xFE,0x94,0x04,0xA0,0x00,0xA3,0xF8,0x90,0x00,0x88,0x00,0x8F,0xFE,0xA9,0x20,0
             -x91,0x20,0x81,0x20,0x82,0x22,0x82,0x22,0x84,0x22,0x88,0x1E,
  25          "物",0x10,0x80,0x10,0x80,0x50,0x80,0x51,0xFC,0x7D,0x54,0x52,0x54,0x94,0x94,0x14,0x94,0x19,0x24,0x32,0x24,0
             -xD4,0x44,0x10,0x84,0x11,0x04,0x12,0x04,0x14,0x28,0x00,0x10,
  26          "理",0x00,0x00,0x03,0xFC,0xFA,0x44,0x22,0x44,0x23,0xFC,0x22,0x44,0xFA,0x44,0x23,0xFC,0x22,0x44,0x20,0x40,0
             -x23,0xFC,0x38,0x40,0xC0,0x40,0x00,0x40,0x0F,0xFE,0x00,0x00,
  27          "与",0x00,0x00,0x08,0x00,0x08,0x04,0x0F,0xFE,0x08,0x00,0x08,0x00,0x0F,0xFC,0x00,0x04,0x00,0x04,0x00,0x24,0
             -x7F,0xF4,0x00,0x04,0x00,0x04,0x00,0x48,0x00,0x30,0x00,0x00,
  28          "电",0x01,0x00,0x01,0x00,0x01,0x00,0x3F,0xF8,0x21,0x08,0x21,0x08,0x3F,0xF8,0x21,0x08,0x21,0x08,0x21,0x08,0
             -x3F,0xF8,0x21,0x08,0x01,0x02,0x01,0x02,0x00,0xFE,0x00,0x00,
  29          "子",0x00,0x00,0x3F,0xF0,0x00,0x20,0x00,0x40,0x00,0x80,0x01,0x00,0x01,0x00,0x01,0x04,0xFF,0xFE,0x01,0x00,0
             -x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x05,0x00,0x02,0x00,
  30          "信",0x08,0x80,0x0C,0x60,0x18,0x40,0x17,0xFE,0x30,0x00,0x33,0xF8,0x50,0x00,0x93,0xF8,0x10,0x00,0x13,0xF8,0
             -x12,0x08,0x12,0x08,0x12,0x08,0x13,0xF8,0x12,0x08,0x00,0x00,
  31          "息",0x01,0x00,0x02,0x00,0x1F,0xF0,0x10,0x10,0x1F,0xF0,0x10,0x10,0x1F,0xF0,0x10,0x10,0x1F,0xF0,0x00,0x00,0
             -x09,0x00,0x28,0x84,0x28,0x92,0x68,0x12,0x07,0xF0,0x00,0x00,
  32          "科",0x06,0x08,0x78,0x88,0x08,0x48,0x08,0x48,0xFE,0x08,0x18,0x88,0x1C,0x48,0x2A,0x48,0x28,0x0E,0x48,0x78,0
             -x8B,0x88,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
  33          "学",0x01,0x08,0x10,0x8C,0x0C,0xC8,0x08,0x90,0x7F,0xFE,0x40,0x04,0x8F,0xE8,0x00,0x40,0x00,0x80,0x7F,0xFE,0
             -x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x02,0x80,0x01,0x00,
  34          "系",0x00,0x7C,0x3F,0x80,0x02,0x20,0x04,0x20,0x08,0x40,0x1F,0x80,0x03,0x20,0x0C,0x10,0x3F,0xF8,0x10,0x8C,0
             -x04,0xA0,0x08,0x90,0x10,0x88,0x20,0x84,0x42,0x84,0x01,0x00,
  35          };
C51 COMPILER V7.06   MAIN8                                                                 05/22/2008 21:14:08 PAGE 2   

  36          uchar code str1[]={"衡阳师范学院"};
  37          uchar code str2[]={"衡阳师范学院物理与电子信息科学系"};
  38          //      void timerinit(void);
  39          void sioinit(void);
  40          void initial(void);
  41          void clrscree(void);
  42          void clrindex(void);
  43          void senddata(uchar i);
  44          void row_dis(void);
  45          void full_index(uchar *prt,uchar space);
  46          
  47          void static_full_databuf(void);
  48          void l_databuf(uchar i);
  49          void up_full_databuf(void);
  50          
  51          void static_display(uchar *a,int sta_time);
  52          void up_display(uchar *a,uint shift_speed,char space);
  53          void left_display(uchar *a,uint shift_speed,char space);
  54          
  55          void timeIRQ(void);
  56          uchar str_longth(uchar *a);
  57          
  58          uchar databuf[18];
  59          uchar code *dataindex[12];      
  60          bit  disen;
  61          uchar row_count,shift_add;      //,shift_count
  62          
  63          main()
  64          {
  65   1              initial();
  66   1              while(1)
  67   1              {
  68   2                      static_display(str1,6000);      
  69   2                      up_display(str2,50,10);
  70   2                      left_display(str2,50,9);        
  71   2              }
  72   1      }
  73          /*
  74          void timerinit(void)//3ms timer
  75          {
  76                  TMOD=0x01;
  77                  TH0=(65535-600)/256;
  78                  TL0=(65535-600)%256;
  79                  IE=0x82;
  80          }
  81          */
  82          void sioinit(void)// 方式0
  83          {
  84   1              SCON=0x00;
  85   1              TI=0;
  86   1      }
  87          void initial(void)
  88          {
  89   1      //      timerinit();
  90   1              sioinit();
  91   1      //      shift_count=shift_speed;
  92   1      //      TR0=1;
  93   1      }
  94          
  95          /*********application function*******
  96           静态显示、左移、右移
  97          ************************************/
C51 COMPILER V7.06   MAIN8                                                                 05/22/2008 21:14:08 PAGE 3   

  98          void senddata(uchar j)  //sio 口发送数据
  99          {
 100   1              j=~j;
 101   1              SBUF=j;
 102   1              while(TI==0);
 103   1              TI=0;
 104   1      }
 105          void row_dis(void)   //p1.0-a,p1.1-b,p1.2-c,p1.3-d st-p1.4 p1.5-en
 106          {
 107   1              uchar i=0,j=0,k;
 108   1              for(i=0;i<16;i++)
 109   1              {
 110   2                      j=databuf[15-i];
 111   2                      senddata(j);
 112   2              }
 113   1              k=~row_count&0x0f;
 114   1              P1=k+0x20+0x10; 
 115   1              _nop_();
 116   1              _nop_();
 117   1              P1=k+0x20;
 118   1              row_count++;
 119   1              if(row_count==16)row_count=0;
 120   1      }
 121          //*************************databuf 更新
 122          void clrscree(void)
 123          {       
 124   1              int i;
 125   1              for(i=0;i<18;i+=2)
 126   1              {
 127   2                      databuf[i]=0;
 128   2                      databuf[i+1]=0;
 129   2              }       
 130   1      }
 131          void clrindex(void)
 132          {       
 133   1              int i;
 134   1              for(i=0;i<12;i++)
 135   1              {
 136   2                      dataindex[i]=0;
 137   2              }       
 138   1      }
 139          //*****************************
 140          //      databuf refurbish
 141          //*****************************
 142          void static_full_databuf(void)
 143          {       
 144   1              uchar i;
 145   1              uchar code *ptr;
 146   1              clrscree();     
 147   1              for(i=0;i<18;i+=2)
 148   1              {
 149   2                      ptr=dataindex[i/2];
 150   2                      if(ptr==0)continue;
 151   2                      databuf[i]=*(ptr+row_count*2);
 152   2                      databuf[i+1]=*(ptr+row_count*2+1);
 153   2              }
 154   1      }
 155          void up_full_databuf(void)
 156          {
 157   1              uchar data i;
 158   1              uchar code *ptr;
 159   1              clrscree();     
C51 COMPILER V7.06   MAIN8                                                                 05/22/2008 21:14:08 PAGE 4   

 160   1              for(i=0;i<18;i+=2)
 161   1              {
 162   2                      ptr=dataindex[i/2];
 163   2                      if(ptr==0)continue;
 164   2                      if((shift_add+row_count)>15)
 165   2                      {
 166   3                      databuf[i]=*(ptr+134+(shift_add+row_count-15)*2);
 167   3                      databuf[i+1]=*(ptr+134+(shift_add+row_count-15)*2+1);           
 168   3                      }
 169   2                      else
 170   2                      {
 171   3                      databuf[i]=*(ptr+(shift_add+row_count)*2);
 172   3                      databuf[i+1]=*(ptr+(shift_add+row_count)*2+1);
 173   3                      }
 174   2              }       
 175   1      }
 176          void l_databuf(uchar i)//左移时数据BUF处理
 177          {
 178   1              uchar h;
 179   1              int j,k;
 180   1              if(i>=8)
 181   1              {
 182   2                      for(h=0;h<17;h++)
 183   2                      databuf[h]=databuf[h+1];
 184   2                      i-=8;
 185   2              }
 186   1              for(h=0;h<16;h++)
 187   1              {
 188   2                      j=databuf[h];
 189   2                      k=databuf[h+1];

⌨️ 快捷键说明

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