#include <reg51.h> #include <intrins.h> #define uint unsigned int #define uchar unsigned char sfr P0M0 = 0x94; sfr P0M1 = 0x93; void delay(uint ms){ uint i,j; for(i = 0 ;i < ms ; i++) for (j = 0;j < 121;j++); } void display(){ uint i,j; for(i = 0;i < 7;i++){ P0 = _crol_(P0,1); delay(500); } for(j = 0;j < 7;j++){ P0 = _cror_(P0,1); delay(500); } } void main(){ P0M0 = 0x00; P0M1 = 0x00; P0 = 0xfe; while(1){ display(); } }