This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
beeping internal speaker - asm in/out
- To: cygwin at sourceware dot cygnus dot com
- Subject: beeping internal speaker - asm in/out
- From: "Michele Liberi" <mliberi at hotmail dot com>
- Date: Tue, 04 Apr 2000 02:31:33 PDT
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.
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com