delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/04/04/13:45:35

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
From: Chris Faylor <cgf AT cygnus DOT com>
Date: Tue, 4 Apr 2000 13:44:25 -0400
To: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: beeping internal speaker - asm in/out [OFF-TOPIC]
Message-ID: <20000404134425.A28702@cygnus.com>
Reply-To: cygwin AT sourceware DOT cygnus DOT com
Mail-Followup-To: cgf AT cygnus DOT com, cygwin AT sourceware DOT cygnus DOT com
References: <20000404093134 DOT 57992 DOT qmail AT hotmail DOT com>
Mime-Version: 1.0
User-Agent: Mutt/1.1.8i
In-Reply-To: <20000404093134.57992.qmail@hotmail.com>; from mliberi@hotmail.com on Tue, Apr 04, 2000 at 02:31:33AM -0700

I'm sorry.  This is off-topic for this mailing list.  Try one of
the general-purpose windows programming mailing lists or newsgroups.
You should be able to find information at www.deja.com.

On Tue, Apr 04, 2000 at 02:31:33AM -0700, Michele Liberi wrote:
>Windows has a system function that Beeps the internal speaker...
>
>... but it simply doesn't work!
>
>The two parameters, Pitch and Duration, are ignored and the same sound is 
>always produced.
>
>I found a little assembler code for beeping the speaker, but I don't succeed 
>to get it compiled with gcc 2.95.2.
>
>the code is:
>(turn internal speaker OFF)
>in   al,61
>and  al,252
>out  61,al
>
>(turn internal speaker ON)
>in   al,61
>or   al,3
>out  61,al
>
>I coded it as follows:
>
>asm("in       %al,61");
>asm("and      %al,252");
>asm("out      61,%al");
>
>asm(
>"in     %al,61\n"
>"or     %al,3\n"
>"out    61,%al\n"
>);
>
>but I obtain the following error:
>...: Assembler messages:
>...: Error: suffix or operands invalid for `in'
>...: Error: suffix or operands invalid for `out'
>...: Error: suffix or operands invalid for `in'
>...: Error: suffix or operands invalid for `out'
>
>and NOW the questions:
>1) What's wrong with the code I wrote? Why gcc complains?
>2) Is it possible to do the same work with C without using asm?
>3) Is there any way to link objects produced with other C compilers?
>  for example Borland C has embedded inp and outp functions
>
>Any link to information available on the internet is welcome.
>
>any help will be appreciated.

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019