🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #2378

MSC, interrupts & functions

#2378
From: LAUGHLIN, CHET
Date: Wed, 26 Sep 1990 06:28
31 lines
1417 bytes
I have successfully written a program that uses interrupt 1Ch to beep
the speaker every few seconds.  However, after trying to spruce it up
I have noticed that functions called by an interrupt (declared void
interrupt far) cannot call other functions declared simply void or int.
After reviewing the Microsoft manual I could find no clarification or
discussion of what limitations are placed on a function called by an
interrupt.  Can anyone enlighten me?? Possibly I'm not suppose to
call the C library also???

Below is a simplified code segment example.  In addition, the documents
on how to restore a vector after your finished with it are skimpy, I
assume I'm doing the right thing.

void beep()
{
   printf("beep\n");
}

void interrupt far count()
{
   if (cbeep_count > beep_count)
   {
      beep();                           /* beep ..crashes here */
      cbeep_count = 0;                  /* reset counter */
   }
   else
      ++cbeep_count;
}

-Chet Laughlin
  "I have no opinions as I do not exist - my lawyer told me so"
Technical Details
Message-ID: <8539@helios.TAMU.EDU>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!helios!rigel.tamu.edu

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!helios!rigel.tamu.edu
From: ctl8588@rigel.tamu.edu (LAUGHLIN, CHET)
Newsgroups: comp.os.msdos.programmer
Subject: MSC, interrupts & functions
Message-ID: <8539@helios.TAMU.EDU>
Date: 26 Sep 90 06:28:42 GMT
Sender: usenet@helios.TAMU.EDU
Reply-To: ctl8588@rigel.tamu.edu
Organization: TAMU
Lines: 31