#include <reg51.h>
#define uchar unsigned char 
#define uint unsigned int  
sbit SER=P2^1;
sbit CLR=P2^2;
sbit SCLR=P2^0; 
HC595(uint da)
{
uint i;
uint gbit=0x80;
CLR=0;
SCLR=0;
for(i=0;i<8;i++)
{
   if(da&gbit)
  	SER=1;
	else
	 SER=0;
	SCLR=1;
	gbit>>=1;
	SCLR=0;
}
CLR=1;
}
delay(uint t)
{
  while(t--);
}
main()
{
 uint i,abs[10]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
 while(1)
 {
 for(i=0;i<10;i++)
{
     HC595(abs[i]);
	delay(40000);
}
} }