#include<reg51.h>
#define uchar unsigned char
uchar time=0;
unsigned char code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
uchar period=250;
uchar high=50;
a() interrupt 1{
TH0=0xdf;
TL0=0x73;
if(++time==high) P2=0;\\在这之前time没有进行初始化,为什么能正常运行下去
else if(time==period)
{time=0;
P2=1;}
}
main(){
TMOD=0x01;
TH0=0xdf;
TL0=0x73;
EA=1;
ET0=1;TR0=1;
while(1){
P3=table[time];
}
}