flat assembler
Message board for the users of flat assembler.
Index
> DOS > Internal speaker problem in WinXP [SOLVED] |
Author |
|
revolution 14 Mar 2013, 15:42
You could also use the native Windows API for making sounds. AFAIK NTVDM emulates the hardware anyway so you are not gaining anything by using a DOS version.
|
|||
14 Mar 2013, 15:42 |
|
DimonSoft 14 Mar 2013, 16:16
revolution wrote: You could also use the native Windows API for making sounds. AFAIK NTVDM emulates the hardware anyway so you are not gaining anything by using a DOS version. The problem is that the students are currently assumed to know only real-mode DOS-programming. And the lecture is about using I/O-ports. Using PC speaker seems to be the most attractive way to show it in practice. P.S. Noted that even when run from cmd.exe the program doesn't produce sound for the first time. Starting from the second run everything works fine. |
|||
14 Mar 2013, 16:16 |
|
DimonSoft 14 Mar 2013, 17:37
Hope it helps someone.
To make the code work properly, you should connect the timer channel 2 to speaker (done by the piece of code marked «Sound») BEFORE setting up the timer (done by the piece of code marked «Setting up timer 2»). Could anyone, please, give some comments on this problem? Maybe links to some documentation where this fact is stated explicitly?[/b] |
|||
14 Mar 2013, 17:37 |
|
baldr 14 Mar 2013, 21:33
DimonSoft,
That's probably a quirk of 8253 emulation by NTVDM. DOSBox runs your original code fine, with beep each time. IIRC only modes 1 and 5 require trigger (i.e. rising GATE edge) to start counting. In mode 3 PIT is specified to operate similar in either case (whether GATE is asserted before or after CW/count programming). PIT output (i.e. OUT2 pin) is anded with bit 1 of port 61; GATE2 input is connected to bit 0 of that port. For a reference, you may read 82C54 datasheet. |
|||
14 Mar 2013, 21:33 |
|
DimonSoft 14 Mar 2013, 23:52
baldr wrote: DimonSoft, Thanks, I'll give it a look tomorrow. |
|||
14 Mar 2013, 23:52 |
|
DOS386 27 Mar 2013, 06:50
DimonSoft wrote: problem is that the students are currently assumed to know only real-mode DOS Please do your students a favor and tell them the truth. |
|||
27 Mar 2013, 06:50 |
|
DimonSoft 27 Mar 2013, 14:52
DOS386 wrote:
<OffTopic> Actually the problem is that starting with, say, Windows is a bit more difficult, 'cause you have to learn both assembler and WinAPI at the same time. It turns out that starting with DOS programming is much easier. Anyway, I currently teach them unofficially (until the next year), so I can't change the list of topics and can't make teachers who check their labs understand protected-mode programming (they're too old for that stuff). The only thing I can do is to give more practical examples than theory, and that's what I actually try to do. </OffTopic> |
|||
27 Mar 2013, 14:52 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.