www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/20/17:55:28

Message-ID: <3744A978.6C1EED3F@rocketmail.com>
From: Denis Lamarche <brainwav AT rocketmail DOT com>
Organization: @Home Network
X-Mailer: Mozilla 4.05 [en]C-AtHome0404 (Win95; U)
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: newbie interrupt programmer
References: <Pine DOT GSO DOT 3 DOT 96 DOT 990520155027 DOT 16539A-100000 AT gold DOT cs DOT umanitoba DOT ca>
Lines: 42
Date: Thu, 20 May 1999 21:34:45 GMT
NNTP-Posting-Host: 24.112.228.171
X-Complaints-To: abuse AT home DOT net
X-Trace: news2.rdc1.on.home.com 927236085 24.112.228.171 (Thu, 20 May 1999 14:34:45 PDT)
NNTP-Posting-Date: Thu, 20 May 1999 14:34:45 PDT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

while ( !donePlaying ) {}

for this to exit the loop, donePlaying has to go TRUE.


Mark Phillips wrote:
> 
> i've never done anything with interrupts before, let alone worrying about
> protected mode and all that other garbage, so forgive me if i completely
> fail to know what i'm talking about.  i'm trying to write a program that
> will play a buffer of data to the soundblaster, and then quit when it's
> done.  it works fine, except that it doesn't quit when it's done.  here's
> the loop it gets stuck in:
> 
> while ( !donePlaying ) {}
> 
> donePlaying is a global bool.  my interrupt function looks like this:
> 
> static void interrupt_handler()
> {
>    inportb(interptAcknowlg8);   // sb acknowledge
>    donePlaying = true;
>    outportb(0x20,0x20);         // acknowledge interrupt
>    outportb(0xA0,0x20);
> }
> 
> i would have expected that when the buffer is played, donePlaying gets
> assigned false, and the program would quit.  i set up the interrupt like
> this:
> 
> newInterrupt.selector = _my_cs();
> newInterrupt.offset32 = (int)interrupt_handler;
> __dpmi_set_protected_mode_interrupt_vector(endOfIRQVector, &newInterrupt);
> 
> so if someone could solve my problem for me or wants me to give them more
> code that would be cool.
> 
> and endOfIRQVector is set to 15 (which is what it should be for IRQ 7,
> right?).  i saw one example where the guy multiplied it by 4 for some
> reason so i tried that and it didn't work either. thanks a lot.
> 
> mark phillips.

- Raw text -


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