#include
void delay(void);
void xsh(void);
unsigned char tab[11]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
unsigned char time[2]={0,0};
unsigned char u=0;
void main(void)
{
TMOD=0x01;
TH0=0x14;
TL0=0x31;
EA=1;
ET0=1;
TR0=1;
for(;;)
{
xsh();
}
}
void delay(void)
{
unsigned char i=4;
unsigned char j;
while(i--)
{
for(j=0;j<125;j++)
{;}
}
}
void time_0() interrupt 1 using 1
{
TH0=0x14;
TL0=0x31;
++u;
while(u==15)
{
u=0;
++time[0];
while(time[0]==10)
{
time[0]=0;
++time[1];
}
while((time[1]==6)&(time[0]==1))
{
time[1]=0;
time[0]=9;
}
}
}
void xsh(void)
{
unsigned char a,b,h,g;
h=0;
b=0xbf;
for(a=0;a<2;a++)
{
g=time[h];
P0=tab[g];
P2=b;
delay();
b=b<<1|0x01;
h++;
}
}