/*****************************************************************
 *     P16R16DIO : Demo program                                    *
 *     Function: Digital Output / Input Demo                     *
 *                                                               *
 *     ICPDAS Co.                                                *
 *****************************************************************/

 #include <stdio.h>
 #include <conio.h>


 main()
 {



 int Base_adr=0x2a8;

 int i , inp_data_1, inp_data_2;


 clrscr();

 printf(" P16R16DIO Demo program \n");

 printf(" Press <q> to Quit \n");
 printf(" Press any key Countiune\n");



 for(i=0;i<=255 ; i++)
 {

 outportb(Base_adr,i);
 outportb(Base_adr+1,i);


 inp_data_1=inportb(Base_adr+2);
 inp_data_2=inportb(Base_adr+3);


 gotoxy(1,10);

 printf(" Output Data = %X \n",i);
 printf(" Channel 0-7  Input  Data = %X \n",inp_data_1);
 printf(" Channel 8-15 Input  Data = %X \n",inp_data_2);



 if( getche()=='q') exit();


 }
}
