// experi9a.c

#include <stdio.h>
#include <conio.h>
#include <malloc.h>
#include <time.h>
#include <dos.h>
#include <stdlib.h>
#include <string.h>

extern unsigned get_port(void);

main()
{
  unsigned port;
  int x;

  port = get_port();

  if(port == 0)
  {
    printf("no hardware found\n");
    return;
  }

  printf("port after get_port = %X\n",port);

  while(!kbhit())
  {
    outp(port, 0); // start channel 0 conversion
    while(!(inp(port+0x18) & 0x80)); // wait for ready
    x = inp(port);
    printf("%4d",x);
  }
}

// experi9a.c

