#include<reg52.h>
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
sbit S1 = P3^7;
void delayms(uint xms)
{
uint i,j;
for(i = xms;i > 0;i--)
for(j = 110;j > 0;j--);
}
void main()
{
uchar a;
a = 0xfe;
P2 = a;
while(1)
{
if(S1 == 0)
{
delayms(10);
if(S1 == 0)
{
a = _crol_(a,1);
P2 = a;
}
while(!S1);
}
}
}