#include<reg51.h>
#include<intrins.h>
#define uint unsigned int
#define uchar unsigned char
uchar temp,temp1,temp2;
uint i;
void delay(uint z)
void main()
{
while(1)
{
temp=0xfe
for(i=0;i<8;i++)
{
P2=temp;
temp=_crol_(temp,1);
delay(600);
}
temp=0x7f;
for(i=0;i<8;i++)
{
P2=temp;
temp=_cror_(temp,1);
delay(600);
}
temp=0xfe;
for(i=0;i<8;i++)
{
P2=temp;
temp<<=1;
delay(600);
}
temp=0x7f;
for(i=0;i<8;i++)
{
P2=~temp;
temp>>=1;
delay(600);
}
temp1=0xef;
temp2=0xf7;
for(i=0;i<4;i++)
{
P2=temp1&temp2;
temp1=_crol_(temp1,1);
temp2=_cror_(temp2,1);
delay(600);
}
temp1=0x7f;
temp2=0xfe;
for(i=0;i<4;i++)
{
P2=temp1&temp2;
temp1=_cror_(temp1,1);
temp2=_crol_(temp2,1);
delay(600);
}
temp=0x00;
P2=temp
delay(600);
temp=0xff;
P2=temp
delay(600);
}
}
void delay(uint z)
{
uint x,y;
for(x=100;x>0;x--)
for(y=z;y>0;y--);
}
#include<intrins.h>
#define uint unsigned int
#define uchar unsigned char
uchar temp,temp1,temp2;
uint i;
void delay(uint z)
void main()
{
while(1)
{
temp=0xfe
for(i=0;i<8;i++)
{
P2=temp;
temp=_crol_(temp,1);
delay(600);
}
temp=0x7f;
for(i=0;i<8;i++)
{
P2=temp;
temp=_cror_(temp,1);
delay(600);
}
temp=0xfe;
for(i=0;i<8;i++)
{
P2=temp;
temp<<=1;
delay(600);
}
temp=0x7f;
for(i=0;i<8;i++)
{
P2=~temp;
temp>>=1;
delay(600);
}
temp1=0xef;
temp2=0xf7;
for(i=0;i<4;i++)
{
P2=temp1&temp2;
temp1=_crol_(temp1,1);
temp2=_cror_(temp2,1);
delay(600);
}
temp1=0x7f;
temp2=0xfe;
for(i=0;i<4;i++)
{
P2=temp1&temp2;
temp1=_cror_(temp1,1);
temp2=_crol_(temp2,1);
delay(600);
}
temp=0x00;
P2=temp
delay(600);
temp=0xff;
P2=temp
delay(600);
}
}
void delay(uint z)
{
uint x,y;
for(x=100;x>0;x--)
for(y=z;y>0;y--);
}