void main()
{
TMOD=0x20;
TH1=0xfd;
TH1=0xfd;
TR1=1;
REN=1;
SM0=0;
SM1=1;
EA=1;
ES=1;
while(1)
{
if(num==1)
{
switch(dat)
{
case 1:P2=0xfe;break;
case 2:P2=0xfd;break;
case 3:P2=0xfb;break;
case 4:P2=0xf7;break;
case 5:P2=0xef;break;
case 6:P2=0xdf;break;
case 7:P2=0xbf;break;
case 8:P2=0x7f;break;
case 0:P2=0xff;break;
case 1:P2=0xfe;break;
case 2:P2=0xfd;break;
case 3:P2=0xfb;break;
case 4:P2=0xf7;break;
case 5:P2=0xef;break;
case 6:P2=0xdf;break;
case 7:P2=0xbf;break;
case 8:P2=0x7f;break;
case 0:P2=0xff;break;
case 9:
{