www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/11/09/17:30:52

Date: Tue, 09 Nov 1999 20:06:48 +0200
From: Marius Myburg <iti06469 AT mweb DOT co DOT za>
Subject: Modifying Interrupt Vectors, and asm problem
To: djgpp AT delorie DOT com
Message-id: <0FKY001YCBJTB4@cpt-proxy1.mweb.co.za>
MIME-version: 1.0
X-Mailer: Microsoft Internet Mail 4.70.1154
X-MSMail-Priority: Normal
X-Priority: 3
Reply-To: djgpp AT delorie DOT com

Hi,

Can anybode please tell me how I can modify the interrupt handling
functions?  For instance, this is a Turbo C proggy which oes just that:

 /* DOS critical error handler proggy */
     
     #include <stdio.h>
     #include <dos.h>
     
     void interrupt new_int();      The first error is here
     void interrupt (*old_int)();
     
     char status;
     
     main()
     {
          FILE *fp;
     
          old_int = getvect(0x24);
     
          /* Set critical error handler to my function */
          setvect(0x24,new_int);
     
          /* Generate an error by not having a disc in drive A */
          fp = fopen("a:\\data.txt","w+");
     
          /* Display error status returned */
          printf("\nStatus ==  %d",status);
     
     }
     
     void interrupt new_int()
     {
          /* set global error code */
          status = _DI;
     
          /* ignore error and return */
          _AL = 0;
     }


It seems to me that DJGPP doesn't have the keyword "interrupt".  Can
someone please help me make this program compilable with gcc?


Also, in the DJGPP documents, there stans that inline assembly can be used
like for instance __asm__.  This doesn't work.  Am I missing something, or
am I maybe missing a installation file?

Thank you
Marius Myburg

- Raw text -


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