各位。。求救:
   在windows2000下,怎样用_inp和outp函数向硬件口实现读写?求救见下程序:void sound(unsigned int freq)
{
unsigned i;
union{
long divisor;
unsigned char c[2];
}count;
unsigned char bits;
count.divisor=119328/freq;   //...
_outp(0x43,0xb6);//outportb(0x43,0xb6);?????
_outp(0x42,count.c[0]);//outportb(0x42,count.c[0]);????
_outp(0x42,count.c[1]);//outportb(0x42,count.c[1]);????
bits=_inp(0x61);//bits=inportb(0x61);?????
bits=_outp(0x61,bits|3);//outportb(0x61,bits|3);????
for(i=0;i<20000;i++)
{
_outp(0x61,bits&0xfc);//outportb(0x61,bits&0xfc);???
}}
main()
{
unsigned int freq;
do{
do{
freq = rand();
}while(freq>1000);
sound(freq);
}while(!kbhit());
return 1;
}