#include <REGX51.H>
#include "intrins.h"
#define uchar unsigned char
#define uint unsigned int
uchar i,j=0,z=0;
uchar code table[]={0,0x03,0xc3,0xff,0xff,0xc3,0x03,0,0,0x30,0x78,0x7c,0x3e,0x3e,0x7c,0x78,0x30,0,0,
0x20,0x1c,0x28,0x14,0x08,0x1c,0x04,0x1c,0,0,0x30,0x48,0x44,0x22,0x22,0x44,0x48,0x30,0,0,};
uchar a=0x7f; //0111 1111
void delay()
{uint x,y;
for(x=0;x<50;x++);
for(y=0;y<50;y++);
}
void main()
{ P2_0 =1;
P2_1 =0;
SCON=0X00;
while(1)
{
for(z=0;z<80;z++)
{for(i=0;i<8;i++)
{ P0=a;
SBUF=table[i+j];
while(TI==0)
{
} //完整程序和Proteus仿真看附件
|