procedure sound(mhz: integer);
{mhz = the frequency of the pc speaker
PC喇叭发声,只适用于Win9X/2000,NT无效}
var
count : word;
begin
try
count := 1193280 div mhz;
asm
mov al,$b6
out $43,al
mov ax,count
out $42,al
mov al,ah
out $42,al
mov al,3
out $61,al
end;
except
end;
end;
procedure nosound;
{turn off the pc speaker
关闭PC喇叭,只适用于Win9X/2000,NT无效}
begin
asm
mov al,0
out $61,al
end;
end;