title: How does the following code make PC beeps?
body: <pre><code>void Sound(int f)
  {  
      USHORT   B=1193180/f; 
  
      UCHAR temp = In_8(0x61);
      temp = temp | 3; 
      Out_8(0x61,temp);
  
      Out_8(0x43,0xB6);
      Out_8(0x42,B&amp;0xF);
      Out_8(0x42,(B&gt;&gt;8)&amp;0xF);
  }
  </code></pre>
  
  <p><code>In_8</code>/<code>Out_8</code> reads/writes 8 bit to/from a specified port(implementation details omitted).</p>
  
  <p>How does it make PC beep?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Why <code>&amp;0xF</code> is used here? Shouldn't it be <code>0xFF</code>?</p>