#include <stdio.h>
#include <unistd.h>
#include <asm/io.h>

#define BASE 0x278

int main()
{
	int input = 0;
	
	if (ioperm(BASE,3,1))
	{
		printf("Problem!\n");
	}

	for (input = 0; input < 256; input++)
	{
		usleep(100);
		outb(input,BASE);
	}

	for (input = 1; input < 255; input = input*2)
	{
		getchar();
		outb(input,BASE);
	}

	input = 0;
	while (input >= 0)
	{
		outb(input,BASE);
		printf("Data Input: ");
		scanf("%d", &input);
		printf("Data Outputed: %d\n",input);
	}
}
