Звук через PC Speaker

procedure TForm1.mybeep(Tone: Word; Delay: Integer);
begin
asm

mov   al,  0b6H
out &nbsal
mov ax,Tone
out 42h,al
ror ax,8
out 42h,al
in    al,  61H
or    al,  03H
out   61H, al
end;
sleep(Delay);
asm
in    al,  61H
and   al,  0fcH
out   61H, al
end;
end;