#include<reg51.h>
#define uchar unsigned char
#define uint unsigned int
uchar code TB[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
uchar code TA[]={0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, //空屏
 0xFD,0xFD,0xFD,0xFD,0xFD,0xFD,0xC1,0xFF, //L
 0xE3,0xDD,0xDD,0xDD,0xDD,0xDD,0xE3,0xFF, //O
 0xDD,0xDD,0xDD,0xDD,0xDD,0xEB,0xF7,0xFF, //V
 0xC1,0xFD,0xFD,0xC1,0xFD,0xFD,0xC1,0xFF, //E
 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, //空屏 
 };
 uchar idata Buffer[48]={0}; //缓存显示单元
 uchar i,t;
delay(uchar t)
{while (t--)
{;}}
void main(void)
{uchar N,T,m,n;
for(m=0;m<6;m++)//循环扫描一遍6帧(6帧能显示完整的6个字)
 for(n=0;n<8;n++)
  Buffer[8*m+n]=TA[7-n+m*8]; //将TAB数组中的数据重新排列 //使得下移字母顺序不变
  while(1)
   {for(N=0;N<40;N++)
    //循环扫描一遍6帧
	for(T=0;T<70;T++) //速度
	{  
	for(i=0;i<8;i++)//列方面的扫描
	{  
	  P2=~TB[7-i]; 
	  P1=~Buffer[i+N]; 
   delay(100);
	 //扫描起始行为第一行
	 } }}}