#include #include //------------------------------------------------------------------------------void sound(int freq);//------------------------------------------------------------------------------main(){ int freq; do { printf("Enter sound: "); scanf("%d",&freq); if(freq) sound(freq); } while(freq); return 0;}//------------------------------------------------------------------------------void sound(int freq){ unsigned i; union { long divisor; unsigned char c[2]; } count; unsigned char p; count.divisor=1193280/freq; outportb(67,182); outportb(66,count.c[0]); outportb(66,count.c[1]); p=inportb(97); outportb(97,p|3); for(i=0;i
|