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

📄 main8.lst

📁 64x32led单元板的89s51显示控制程序,可以完成静太显示,向上平移,向右平移的动态显示.
💻 LST
📖 第 1 页 / 共 2 页
字号:
 190   2                      j=j<<i;
 191   2                      k=k>>(8-i);
 192   2                      databuf[h]=j|k;
 193   2              }       
 194   1      }
 195          //*************************************************
 196          // display program  (static)
 197          // description:   *a inderict to string[]
 198          //                                sta_time inderict to display time
 199          //*************************************************
 200          void static_display(uchar *a,int sta_time)
 201          {
 202   1              bit time_end=0;
 203   1              uchar code *indexprt;
 204   1              indexprt=a;
 205   1              full_index(indexprt,0);
 206   1              while(!time_end)
 207   1              {       
 208   2                      static_full_databuf();
 209   2                      sta_time--;
 210   2                      if(sta_time==0)time_end=1;
 211   2              }
 212   1      }
 213          //*************************************************
 214          void left_display(uchar *a,uint speed,char space)
 215          {
 216   1              char data speed_count,j;
 217   1              bit end_flag;
 218   1              uchar code *indexprt;
 219   1              char longth;
 220   1              shift_add=0;
 221   1              end_flag=0;
C51 COMPILER V7.06   MAIN8                                                                 05/22/2008 21:14:08 PAGE 5   

 222   1              indexprt=a;     
 223   1              disen=0;
 224   1              speed_count=speed;
 225   1              longth=str_longth(indexprt);
 226   1              while(!end_flag)
 227   1              {
 228   2                      static_full_databuf();
 229   2                      l_databuf(shift_add);
 230   2                      row_dis();
 231   2                      speed_count--;
 232   2                      if(speed_count==0)
 233   2                      {
 234   3                              speed_count=speed;
 235   3                              shift_add++;
 236   3                              if(shift_add==16)
 237   3                              {
 238   4                                      shift_add=0;
 239   4                                      if(!disen)
 240   4                                      {
 241   5                                              full_index(indexprt,space);
 242   5                                              if(space>0)
 243   5                                              space--;
 244   5                                              else
 245   5                                              {
 246   6                                              indexprt+=2;
 247   6                                              longth--;
 248   6                                              }
 249   5                                      }
 250   4                                      else
 251   4                                      {
 252   5                                              if(longth>0)
 253   5                                              {
 254   6                                                      for(j=0;j<11;j++)
 255   6                                                      {
 256   7                                                              dataindex[j]=dataindex[j+1];    
 257   7                                                      }
 258   6                                                      dataindex[11]=0;        
 259   6                                                      longth--;
 260   6                                              }       
 261   5                                              else
 262   5                                              end_flag=1;
 263   5                                      }
 264   4                              }
 265   3                      }                       
 266   2              }
 267   1      }
 268          //********************************
 269          void up_display(uchar *a,uint speed,char space)
 270          {
 271   1              char data speed_count,j;
 272   1              bit end_flag;
 273   1              uchar code *indexprt;
 274   1              char longth;
 275   1              shift_add=0;
 276   1              end_flag=0;
 277   1              indexprt=a;     
 278   1              disen=0;
 279   1              speed_count=speed;
 280   1              longth=str_longth(indexprt);
 281   1              clrindex();
 282   1              while(!end_flag)
 283   1              {
C51 COMPILER V7.06   MAIN8                                                                 05/22/2008 21:14:08 PAGE 6   

 284   2                      
 285   2                      up_full_databuf();
 286   2                      row_dis();
 287   2                      speed_count--;
 288   2                      if(speed_count==0)
 289   2                      {
 290   3                              speed_count=speed;
 291   3                              shift_add++;
 292   3                              if(shift_add==16)
 293   3                              {
 294   4                                      shift_add=0;
 295   4                                      if(!disen)
 296   4                                      {
 297   5                                              full_index(indexprt,space);
 298   5                                              if(space>4)
 299   5                                              space-=4;
 300   5                                              else
 301   5                                              {
 302   6                                                      if(space!=0){indexprt=indexprt+((4-space)<<1);longth=longth-4+space;space=0;}
 303   6                                                      else
 304   6                                                      {
 305   7                                                              indexprt+=8;
 306   7                                                              longth-=4;
 307   7                                                      }
 308   6                                              }
 309   5                                      }
 310   4                                      else
 311   4                                      {
 312   5                                              if(longth>0)
 313   5                                              {
 314   6                                                      for(j=0;j<8;j++)
 315   6                                                      {
 316   7                                                              dataindex[j]=dataindex[j+4];    
 317   7                                                      }
 318   6                                                      if(dataindex[8]!=0)
 319   6                                                      {
 320   7                                                              dataindex[11]=0;        
 321   7                                                              dataindex[10]=0;
 322   7                                                              dataindex[9]=0;
 323   7                                                              dataindex[8]=0;
 324   7                                                      }
 325   6                                                      longth-=4;
 326   6                                              }       
 327   5                                              else
 328   5                                              end_flag=1;
 329   5                                      }
 330   4                              }                       
 331   3                      }                       
 332   2              
 333   2              }
 334   1      }
 335          //********************************
 336          uchar str_longth(uchar *a)
 337          {
 338   1              uchar i,str1;
 339   1              for(i=0;;i++,a+=2)
 340   1              {
 341   2              str1=*a;
 342   2              if(str1=='\0') return (i);
 343   2              }
 344   1      }
 345          //*********************************
C51 COMPILER V7.06   MAIN8                                                                 05/22/2008 21:14:08 PAGE 7   

 346          void full_index(uchar *prt,uchar space)
 347          {
 348   1              uchar str1,str2;
 349   1              int i,j;
 350   1              clrindex();
 351   1              for(i=space;i<12;i++,prt=prt+2)
 352   1              {
 353   2                      str1=*prt;
 354   2                      str2=*(prt+1);
 355   2                      if(str1=='\0') 
 356   2                      {
 357   3                              disen=1;
 358   3                              break;
 359   3                      }
 360   2                      for(j=0;j<sizeof(GB_16)/sizeof(GB_16[0]);j++)
 361   2                      {
 362   3                              if(str1 == GB_16[j].Index[0]&&str2 == GB_16[j].Index[1])
 363   3                              break;
 364   3                      }
 365   2                      dataindex[i]=GB_16[j].Msk;
 366   2              }       
 367   1      }
 368          
 369          
 370          /************************
 371          void timeIRQ(void) interrupt 1
 372          {
 373                  TH0=(65535-1000)/256;
 374                  TL0=(65535-1000)%256;
 375                  if(!fulldata_flag)
 376                  {
 377                          row_dis();
 378                          fulldata_flag=1;
 379                          shift_count--;
 380                          if(shift_count==0)
 381                          {
 382                                  shift_count=shift_speed;
 383                                  shift_add++;
 384                                  if(shift_add==16)
 385                                  {
 386                                          shift_add=0;
 387                                          fullindex_flag=1;               
 388                                  }                       
 389                          }
 390                  }
 391          }
 392          */


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =   1159    ----
   CONSTANT SIZE    =    726    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =     44      28
   IDATA SIZE       =   ----    ----
   BIT SIZE         =      1       3
END OF MODULE INFORMATION.


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

⌨️ 快捷键说明

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