Demo entry 6624151

243

   

Submitted by anonymous on Jun 13, 2017 at 15:26
Language: C. Code size: 507 Bytes.

#include<reg51.h>
#include<absacc.h>
#define uchar unsigned char
#define add XBYTE[0xOOOO]
#define my8255_a &add+0x7cff
#define my8255_b &add+0x7dff
#define my8255_mode &add+0x7fff
void delay(uchar c)
{
	uchar a,b;
	for(;c>0;c--)
		for(b=142;b>0;b--)
			for(a=2;a>0;a--)
			;
}

main()
{
	uchar la,lb;
		la=0x01;
		lb=0x80;
		
		*(my8255_mode)=0x80;
		while(1)
			{
				*(my8255_a)=la;
				*(my8255_b)=lb;
				la=(la<<1)|(la>>7);
				lb=(lb>>1)|(lb<<7);
				delay(200);
			}
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).