home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,551 of 2,978   
   =?ISO-8859-1?Q?Bj=F6rn_Felten?= to All   
   Re: how to make a 'beep sound' from the    
   01 May 05 22:27:05   
   
   From: abuse@telia.com   
      
   > the computer will produce a beep sound.   
      
       Beeps are boring. Why not try the following:   
      
   { The brute delay code 'asm hlt end', that simply waits for the next   
   interrupt (should be the timer IRQ) to occur, may not work on some   
   machines -- especially when running some multitaskers. If so it can be   
   changed to 'delay(50)' or something like that. }   
      
   program Ring;   
   uses crt;   
   var i:word;   
   begin   
      for i:=0 to 6 do   
        begin   
          sound(523); asm hlt end;   
        Delay(50);   
          sound(659); asm hlt end;   
        Delay(50);   
      end;   
      nosound   
   end.   
      
   { Or, for those of you that don't like the crt unit, here's the same   
   thing in BASM: }   
      
   program Ring;   
   begin   
      asm   
        mov   al,0B6h   
        out   43h,al   
        in    al,61h   
        or    al,3   
        out   61h,al   
        mov   cx,7   
        mov   dx,42h   
   @the_loop:   
        mov   al,0E9h   
        out   dx,al   
        mov   al,8   
        out   dx,al   
        hlt   
        mov   al,12h   
        out   dx,al   
        mov   al,7   
        out   dx,al   
        hlt   
        loop  @the_loop   
        in    al,61h   
        and   al,0FCh   
        out   61h,al   
      end;   
   end.   
      
      
      
   --   
     FidoNet in your news reader:    news://felten.yi.org   
     For full access, register at:   http://felten.yi.org/join.html   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca