Mail Archives: djgpp/1996/07/15/12:35:28
I am having a problem understanding why the following program fails.
I have read section 18 of the DJGPPFAQ a number of times & still it eludes me.
#include <stdio.h>
#include <dos.h>
int main(int argc, char *argv[])
    {
    union REGS b_regs;                                  /* define registers */
    struct SREGS b_sregs;                       /* define segment registers */
    b_regs.x.ax = 0x3000;                              /* check dos version */
    printf("Checking DOS version.\n");
    int86x (0x21, &b_regs, &b_regs, &b_sregs);
    printf("after int86x call.\n");
    return(0);
    }
It is compiled with :-
gcc -Wall -g -O fubar.c -o bin\fubar.exe
under CWSDPMI(ie raw DOS)
and it produces :-
Checking DOS version.
Exiting due to signal SIGSEGV
General Protection Fault at eip=00001f3f, error=504c
eax=00003000 ebx=414c574e ecx=453d4547 edx=4155474e esi=00414756 edi=433d5544
ebp=3d545250 esp=0004b630 cs=00e7 ds=00ef es=00ef fs=00cf gs=00ff ss=00ef
Call frame traceback EIPs:
  0x00001f3f
I do know that there are other ways of checking DOS version but I particularly
want to use int86x as I am attempting to convert a function that uses multiple
int86x calls to DJGPP, if possible.
	Regards,
	Alf		stockton AT fast DOT co DOT za
- Raw text -