#include <conio.h>
#include <stdio.h>

#define DATA 0x3bc

void wait(void)
{
	long i;
	for(i=0; i<50000000; i++) {
		//do nothing
	}
}

int main(void)
{
	outportb(DATA, 0x00); //all off
	
	while(!kbhit()) {
		outportb(DATA, 0x80); wait(); puts("1");
		outportb(DATA, 0x40); wait(); puts("2");
		outportb(DATA, 0x20); wait(); puts("3");
		outportb(DATA, 0x10); wait(); puts("4");
		outportb(DATA, 0x08); wait(); puts("5");
		outportb(DATA, 0x04); wait(); puts("6");
		outportb(DATA, 0x02); wait(); puts("7");
		outportb(DATA, 0x01); wait(); puts("8");
	}
	
	outportb(DATA, 0x00); //all off
	return 0;
}