delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/04/04:20:36

From: "Denes Molnar" <dmolnar AT signatec DOT com>
Newsgroups: comp.os.msdos.4dos,comp.os.msdos.apps,comp.os.msdos.desqview,comp.os.msdos.djgpp,comp.os.msdos.mail-news,comp.os.msdos.misc,comp.os.msdos.pcgeos,comp.os.msdos.programmer,comp.os.msdos.programmer.turbovision
Subject: HELP:Interrupts
Date: 3 Oct 1996 22:51:22 GMT
Organization: Signatec, Inc.
Lines: 55
Distribution: inet
Message-ID: <01bbb17f$7bc21320$f7d968cf@Signatec1.snis.net>
NNTP-Posting-Host: 207.104.217.247
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi,

I am trying to convert Borland DOS interrupt functions to MSVC++ 1.52
interrupt functions to be used in the DOS environment as well.  This is how
I use the interrupt functions in Borland using IRQ 10, 11, 12.

installint(void interrupt (*intfunct)(),int irqnum)
{
  int currentIMR;

  if ((irqnum<10) || (irqnum>12) )
		return(0); 									 /* if not int 10,11,12 ret 0 */
  currentIMR=inportb(0xA1);
  disable();
  if (irqnum==10)
		outportb(0xA1,currentIMR & 251);     /* set IMR bit low to unmask */
  else if (irqnum==11) outportb(0xA1,currentIMR & 247);
  else outportb(0xA1,currentIMR & 239);
  setvect(0x68+irqnum,intfunct);						/* set interrupt vector */
  enable();
  return(1);
}

sendEOI(int irqnum)
{
  outportb(0x20,98);									  /* End Of Int to 8259 #1 */
  outportb(0xA0,88+irqnum);						  /* End Of Int to 8259 #2 */
}

uninstallint(int irqnum)
{
  int currentIMR;

  if ((irqnum<10) || (irqnum>12))
		return(0); 									 /* if not int 10,11,12 ret 0 */
  currentIMR=inport(0xA1);
  if (irqnum==10) outportb(0xA1,currentIMR | 4);  		/* mask interrupt */
  else if (irqnum==11) outportb(0xA1,currentIMR | 8); 		/* mask interrupt
*/
       else outportb(0xA1,currentIMR | 16);
  return(1);
}

This is what I have changed for the Microsoft functions:
disable();  changed to  _disable();
outportb(): changed to _outp();
setvect(); changed to _dos_setvect();
import(); changed to impw();
	However the Borland code is working correctly while the MSVC++ 1.52 code
is not.

	Does anybody have any ideas on how to make it work???

	Thanks!!!  
			dmolnar AT signatec DOT com

- Raw text -


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