typedef unsigned short word;
typedef unsigned char byte;

void wait() {
	volatile word i;
	for (i=0; i<10000; ++i) 
		/*empty*/;
}

int main() {
	void wait();
	byte c1, c2;
	volatile byte* p=(byte*)0x1004;
	byte i;
	while (1) {
		c1=0x80;
		c2=0x01;
		for (i=0;i<4;i++) {
			wait();
			*p=c1|c2;
			c1>>=1;
			c2<<=1;
		}
	}
	return 0;		
}
