Hi,

isn't it possible to do some music with the pc-speakers like it was possible with the SOUND procedure in pascal? i mean, i'm sure that it is possible with dos assembly, but shouldn't it be possible with windows assembly, too, when i would use IN and OUT? you know, i couldn't find any documentation about that, don't you know anything about that?

nop
Posted on 2001-12-11 16:00:34 by NOP-erator
you can use in/out to play some funky tunes on win9x ;)
shouldn't work with nt/2k..., though.
Posted on 2001-12-11 16:55:38 by Tola
Sounds like real cheap surround sound. :)Posted on 2001-12-11 17:51:11 by bitRAKE
Hi,

Here's a Speaker C example dll showing the disassembled _inp and _outp routines. You can tap into the dll and run it yourself. I d/l it ages ago and don't know where I found it.

Kayaker
Posted on 2001-12-11 17:57:30 by Kayaker
Dunno how to do it in 9x except those ugly in/out. On NT kernels you
might want to check out Kernel32!Beep, it can do a lot more on NT
than 9x.
Posted on 2001-12-11 18:25:47 by f0dder
ok, created some code, works well on win9x, have to try it out on NT, still. i attached the program.....

nop
Posted on 2001-12-12 12:32:08 by NOP-erator
It didn`t worked here. I`m using WinNT 4 here at work.

Exception: privileged instruction (0xc0000096), Address: 0x00401050

I have no time to debug this now, but I think that you`re not allowed to use IN and OUT instructions directly on WinNT.
Posted on 2001-12-12 13:45:55 by eeprom
INs and OUTs are not allowed in NT. However with winio + asmio you can use ports in NT/win2k too.. In the attachment you will find your example but using winio. It works in win2k and should work in win9x/ME too (iirc it may even be faster than using in & out).

Thomas
Posted on 2001-12-12 13:48:10 by Thomas
hmm,

it seems that i always need the dll with the program, don't i? hmm, i don't like that, dunno why :rolleyes:

another possibility could be to check on which operating system the program is running, and in case of win nt, just call "Beep". does this function also work in win2k? it doesn't work on win9x.

"Windows 95:

The Beep function ignores the dwFreq and dwDuration parameters. On computers with a sound card, the function plays the default sound event. On computers without a sound card, the function plays the standard system beep."

nop
Posted on 2001-12-12 14:18:22 by NOP-erator
here's a very simple and small way to
check for NT(2K?????)



mov ecx,cs
xor cl,cl
jecxz _winNT
Posted on 2001-12-13 06:01:59 by mob
That's a bad way though. GetWindowsVersion or GetWindowsVersionEx
(I believe) is much better. It might take more code, but it's guaranteed
to work...
Posted on 2001-12-13 09:21:35 by f0dder