Mail Archives: djgpp/1999/11/09/17:30:52
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 -