/* Example program to read and print the state of Port A on */
/* the Flashlite 386Ex. */

#include <stdio.h>
#include <dos.h>

#define PORT_A          0x60 
   /* address of Port A */
#define PORT_DIR        0x63 
   /* address of port direction register */
#define PORT_A_DIR_MASK 0x10 
   /* dir bit is bit 4 (00010000) = 0x10 */

main()
{
 unsigned char portA;

 portA = inportb(PORT_DIR); 
   /* get current value of direction reg */
 portA |= PORT_A_DIR_MASK;  
   /* set direction bit for input /*
 outportb(PORT_DIR,portA);  
   /* write value to direction reg */
    
 while ( 1 )     /* do it forever */              
   printf("PORT A: %X\n",(int)inportb(PORT_A));
     /*read and print port A value*/

return 0;
}