/*----------------------------------------------------------------------*/
/* filename=demo_01.c							*/
/*									*/
/* test the output port 						*/
/* IO BASE address = 0x200, all DIP switchs of SW1 in OFF position	*/
/*----------------------------------------------------------------------*/

#include <stdio.h>
#include <stdlib.h>

#define  BASE 0x200		/* IO BASE address = 0x200 */

void main( void )
{
int DO;

DO=0;
for (;;)
	{
	outportb(BASE+5,DO);	/* send a value to output port */
	printf("\nDEMO_01.EXE --> DO=%d, press any key to stop",DO);
	delay(300);		/* delay 0.3 second */
	if (kbhit()!=0) {getch(); return;}
	DO=DO+1;		/* UP counter */
	DO=DO&0xff;		/* 8 bit counter */
	}
}

