/*本程序实现p0口输出单向流水灯*/
#include"reg51.h"
#include"intrins.h"
/*1ms延时子程序*/
void mDelay(unsigned int i)
{
unsigned int j;
for(;i>0;i--)
for(j=0;j<125;j++);
}
/*main主程序*/
void main()
{
unsigned char ledctr=0xfe;
while(1)
{
P0=ledctr;
ledctr=_crol_(ledctr,1); /*左移库函数*/
mDelay(100);
}
}