大家帮我看一下下面一段代码有什么问题?谢谢#include "reg51.h"
#define char unsigned char
//
char code dis_7[11]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,0xFF};
/*共阳LED段码表“0”“1”“2”“3”“4”“5”“6”“7”“8”“9”“不亮”*/
char code scan_con[8]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};//列扫描控制字
char data timedata[6]={0x00,0x00,0x00,0x00,0x00,0x00}; //计时单元数据初值,共6个
char data dis[8]={0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00};//显示单元数据,共6个数据
char data con1s=0x00,con04s=0x00,con=0x00; //秒定时用
sbit key0=P1^0;
sbit key1=P1^1;
sbit key2=P2^2;
//
/***********************/
//1ms 延时//
/***********************/
delay1ms(int t)
{
int i,j;
for(i=0;i <t;i++)
for(j=0;j <120;j++)
;
}
/***********************/
//键盘扫描子//
/***********************/
keyscan()
{
EA=0;
if(key0==0)
{
delay1ms(10);
while(key0==0);
if(dis[con]==10)
{dis[7]=dis[con];dis[con]=dis[6];dis[6]=dis[7];}
con++;TR0=0;ET0=0;TR1=1;ET1=1;
if(con> =6)
{con=0;TR1=0;ET1=0;TR0=1;ET1=1;}
//
if(con!=0)
{
if(key1==0)
{
delay1ms(10);
while(key1==0);
timedata[con]++;
if(timedata[con]> =10)
{timedata[con]=0;}
dis[con]=timedata[con];dis[6]=0x0a;
}
}
//
if(con!=0)
{
if(key2==0)
{
delay1ms(10);
while(key2==0);
if(timedata[con]==0)
{timedata[con]=0x09;}
else{timedata[con]--;}
dis[con]=timedata[con];dis[6]=0x0a;
}
}
EA=1;
}
//
/****************/
//显示//
/****************/
scan()
{
char k;
for(k=0;k <6;k++)
{
P0=dis_7[dis[k]];P2=scan_con[k];delay1ms(1);P2=0xff;
}
}
/******************/
//初始化//
/******************/
clearmen();
{
int i;
for(i=0;i <6;i++)
{
dis[i]=timedata[i];}
TH0=0x3C;TL0=0xB0; //50ms定时初值(T0计时用)
TH1=0x3C;TL1=0xB0; //50ms定时初值(T1计时用)
TMOD=0x11;ET0=1;ET1=1;TR1=0;TR0=1;EA=1;
}
/******************/
//主函数//
/******************/
main()
{
clearmen();
while(1)
{
scan();
keyscan();
}
}
/*******************/
//1s中断//
/*******************/
void time_intt0(void) interrupt 1
{
ET0=0;TR0=0;TH0=0x3c;TL0=0xB0;TR0=1;
con1s++;
if(con1s==20)
{
con1s=0x00;
timedata[0]++;
if(timedata[0]> =10)
{
timedata[0]=0;timedata[1]++;
if(timedata[1]> =6)
{
timedata[1]=0;timedata[2]++;
if(timedata[2]> =10)
{
timedata[2]=0;timedata[3]++;
if(timedata[3]> =6)
{
timedata[3]=0;timedata[4]++;
if(timedata[4]> =10)
{
timedata[4]=0;timedata[5]++;
}
if(timedata[5]==2)
{
if(timedata[4]==4)
{
timedata[4]=0;timedata[5]=0;
}
}
}
}
}
}
dis[0]=timedata[0];dis[1]=timedata[1];dis[2]=timedata[2];
dis[3]=timedata[3]:dis[4]=timedata[4];dis[5]=timedata[5];
}
ET0=1;
}
/*********************/
//0.4S 闪光中//
/*********************/
void time_intt1(void )interrupt 3
{
EA=0;TR1=0;TH1=0x3C;TL1=0xB0;TR1=1;
con04s++;
if(con04s==8)
{
con04s=0x00;
dis[7]=dis[con];dis[con]=dis[6];dis[6]=dis[7];
}
EA=1;
}
编译有n个错误,我是新手,请解释一下,谢谢