kbhit() { char *KP = (char*)0xC000; char c; /* read the keyboard buffer */ /* and return 0 if no character is waiting */ c = KP[0]; if(c<128)return 0; return (int)c; }