delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/17/13:06:23

From: Diamond <diamondt AT videotron DOT ca>
Newsgroups: comp.os.msdos.djgpp
Subject: Interrupt handler problems
Date: Mon, 16 Jun 1997 01:35:47 -0700
Organization: VTL
Lines: 51
Message-ID: <33A4FAE3.1147@videotron.ca>
Reply-To: diamondt AT videotron DOT ca
NNTP-Posting-Host: ppp055.82.mque.videotron.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi all..

I'm working on my first project with djgpp; I'm writing a mod player for
soundblaster [I actually wrote one in real mode asm before, and i'm
converting it to djgpp to use it in my future programs].

The mod loading stuff is working well, but I got some real problems with
the Irq and Timer handlers. :]

My low level code for handling and seting those interrupts are in asm
(nasm). My first question is: should I set, like I'm doing now,
interrupt handlers with asm call to dpmi host (int 0x31) or should I use
C func __dpmi_XXXXX (that would probably complicate things) ?

Also, I get exception errors in my handler and I can't find what I am
doing wrong:

IrqHandler:
     push xxxxx
    
     cs inc dword [IrqCount]    <-- error there

     ...
     pop xxxxxx
     sti
     iret

I also tried:

IrqHandler:
     push xxxxx
  
     cs mov ax, [DataSel]
     mov ds, ax                 

     ....
     pop xxxxxx
     sti
     iret

And got errors too. Anyone can help me on this ?

Finally, I want to know if messing with malloc and with
asm-call-to-dpmi-dos-allocate-memory is actually good programming ?
Should I avoid mixing asm and C memory managements ?

btw, s'cuse the pretty english. :]

Merci a l'avance :]

Frederic Poulin <fpou AT videotron DOT ca>

- Raw text -


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