// experi9a.c #include #include #include #include #include #include #include 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