#include "../ioaddr.c" int main(int argc, char *argv[]) { unsigned char val; if (iopl(3) != 0){ fprintf(stdout,"\r\nNo Permissions for special ports, start program as root, or with sudo\r\n"); exit(0); } val = read_port( 0x201 ); iopl(0); if(val == 0xf0){ fprintf(stdout,"\nreaded value: %x - port 0x201 seems to be a valid, and active joystickport\n",val); } else { fprintf(stdout,"\nreaded value: %x - port 0x201 seems to be not an active joystickport\n",val); } }