#include<8051.h>
void Delay(int Time);
void main()
{
     int a,b,c,p,q;
     int i;
repeat:
     a = P0;
     for (i = a; i <= 255;i++)
     {
     P3 = 0x01;
     b = i /100;
     c= i % 100;
     p = c / 10;
     q = p << 4;
     p = c % 10;
     P1 = q + p;
     P2 = b;
     Delay(50);
     P3 = 0x00;
     }
     goto repeat;
}

void Delay(int Time)
{
while (Time--);
}

