www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/03/22:30:33

From: "Matt Barker" <matt DOT b AT clear DOT net DOT nz>
Newsgroups: comp.os.msdos.djgpp
Subject: Timer interrupt
Date: 4 Jul 1998 02:19:16 GMT
Organization: CLEAR Net, http://www.clear.net.nz/
Lines: 34
Message-ID: <01bda6f1$8ceb4540$LocalHost@SPOCK>
NNTP-Posting-Host: d1-u11.nels.clear.net.nz
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hello everybody

I am in the process of porting some code from Borland C++ 3.1 to DJGPP. 
Now I'm up to a timer interrupt handler. My Borland C one looks something
like:

int Factor;
void interrupt (* OldTimerHandler)(void);
.
.
void interrupt TimerHandler(void)
{
   static int Counter = 1;
   if (Counter == Factor) {
      Counter = 1;
      OldTimerHandler();
   }
   else {
      Counter++;
      asm int 0x1C;
   }
   asm push ax;
   asm mov al,0x20;
   asm out 0x20,al;
   asm pop ax
}

In converting the function the only line I'm having trouble with is when I
call OldTimerHandler().  At the moment OldTimerHandler is now in a
_go32_dpmi_seginfo structure.  What is the most efficient way to perform a
far jmp to OldTimerHandler in DJGPP ie. what function should I use??

Any help much appreciated...
Matt

- Raw text -


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