delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/06/29/08:12:17

Date: Thu, 29 Jun 1995 14:58:28 +0300
To: djgpp AT sun DOT soe DOT clarkson DOT edu
From: ere AT sci DOT fi (Petri Ehonsalo)
Subject: Lost with interrupts

Hi! i've been desperately tryed to convert following source to
djgpp but i'm totally lost!

Can somebody help me?

#include <conio.h>
#include <dos.h>
#ifdef __cplusplus
    #define INTARG ...
#else
    #define INTARG void
#endif
volatile int counter1,counter2;
void interrupt (*old)(INTARG);
void interrupt my_own(INTARG)
{
    counter1++;
    old();
}
int main(void)
{
    counter1=counter2=0;
    old=getvect(0x1C);
    setvect(0x1C,my_own);
    cprintf("\r\nWaiting");
    while(counter1<50)
    {
        if (counter1!=counter)
        {
            counter2=counter1;
            cprintf(".");
        }
    }
    setvect(0x1C,old);
    return(0);
}


Thanks to all, Petri


- Raw text -


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