#include<stdio.h>
#include<bios.h>
main()
{
union key
{ char j[2];
unsigned int i;
} bkey;
printf(" ------noticed------/n");
printf("the exe is tell you the key's scancode./n");
printf("each key just a 16-bit digit number./n");
printf("if the key is defined by the standard ASCII/n");
printf("the high 8-bit is 0,or yhe low 8-bit is 0");
while(1)
{ printf("/nplease hit your keyborad/n/n");
bkey.i = bioskey(0);
if(bkey.j[0])
{ printf("the key's scancode is %d 0x%x /n",bkey.j[0],bkey.j[0]);
printf("and the scancode equal to it's ascii code/n/n");
}
else
{ printf("the key's scancode is %d ox%x /n",bkey.j[1],bkey.j[1]);
printf("and it have no ascii code/n/n");
}
printf(" 0x%x /n",bkey.i);
printf("try again y/n/n");
do { bkey.i = bioskey(0); } while(bkey.i!=0x316e&&bkey.i!=0x1579);
if(bkey.i==0x316e) break;
}
}