sleep or beep

R

Roedy Green

This is not actually a Java question but there are no more DOS people
active. How do you do a sleep or a beep (duration, frequency) in DOS
at the assembler level?

Think of it as a JNI question.

--
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
 
G

Gordon Beaton

This is not actually a Java question but there are no more DOS
people active.

Your question is not only off topic, it's a FAQ. Try Google.

alt.msdos and comp.os.msdos.programmer are still active groups.

/gordon
 
R

Roedy Green

Your question is not only off topic, it's a FAQ. Try Google


I spent all day trying to solve this scouring google, Ralf Brown's
list etc. I finally did solve it by finding a old copy of the Norton
utilty DOS beep and dissassembled to see how they did it. The trick is
so simple. They monitor location 40:6C directly where BIOS maintains
its tick count. There is no official int to access that value or do a
sleep. There are hundreds if interrupts to handle sound an delay, but
only implemented in specialised systems, not generally available.

Solving getting at the PC speaker for Java is easier since Windows
presumably has a beep function accessible from C.
--
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
 
T

Tor Iver Wilhelmsen

Roedy Green said:
This is not actually a Java question but there are no more DOS people
active. How do you do a sleep or a beep (duration, frequency) in DOS
at the assembler level?

Send magic values to the correct ports on the timer chip:

http://www-soem.ecu.edu.au/units/ens1242/lectures/ens_Notes_08.pdf

Basically you use the ports 0x43 (timer circuit "instructions"), 0x42
(timer "data") and 0x61 (PPI controller).

Your Google-Fu is weak, grasshopper.

For some really fun stuff, try setting channel 1 to a value that in
effect disables RAM refresh and look at the screen as its memory
fades. Do not expect to hear "I am afraid, Dave".
 
J

Joan

Roedy Green said:
This is not actually a Java question but there are no more DOS people
active. How do you do a sleep or a beep (duration, frequency) in DOS
at the assembler level?

Think of it as a JNI question.

If you use beep you will soon find your neighbors hating you
and offering to physically fix your computer for you.
 
C

Chris Smith

Roedy Green said:
Solving getting at the PC speaker for Java is easier since Windows
presumably has a beep function accessible from C.

Getting at the PC speaker is not just harder from Java; it's actually
impossible to do in any kind of a reliable way.

Furthermore, it's actually rather difficult to produce a constant tone
of a given frequency and duration. I've posted code to one of the
comp.lang.java.* newsgroups to do so at some point this year, around
March or April probably. It involves producing sampling data from a
wave function and sending it to an open port via the JavaSound API.
Probably not much easier than assembly code in DOS, or harder if DOS has
an interrupt call or other system call for this purpose.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
C

Chris Smith

Andrew Thompson said:

I remembered that being more recent than it really was. Actually, this
follow-up contains simpler code, although either will work:

I guess what I did in March/April was just to dress up that code and add
a user interface to it, plus a FFT bit to go the other way by recording
a sound from a microphone and determining its pitch. I confused myself
and thought I'd written the original code at the same time.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
A

Andrew Thompson

Andrew Thompson <[email protected]> wrote:
...Actually, this
follow-up contains simpler code, although either will work:


I guess what I did in March/April was just to dress up that code and add
a user interface to it, ...

With a volume control? I scare the crap out of myself
*every* time I run those various codes!
 
C

Chris Smith

Andrew Thompson said:
With a volume control? I scare the crap out of myself
*every* time I run those various codes!

Actually, no. I guess I should add that eventually. :)

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top