[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 3.3. General Protection Exceptions / Faults (GPEs / GPFs)
------------------------------------------------------------------------------

 General Protection Exceptions can occur when the program code currently
 executing attempts to perform an invalid operation, access an invalid
 segment or access beyond the end of a valid segment. These errors ARE NOT
 extender or linker errors, they are errors in the protected mode program.

 GPF dumps are written to the standard output file so can be redirected to a
 file by redirecting a program's output on the command line. E.g.

 TEST > TEST.GPF

 The SEGMENTS module definition command (see the Windows programming chapter
 in the manual) can also be used with the DOS extender for interrupt handlers
 etc to force individual segments to be kept separate and loaded in
 conventional memory by specifying them as FIXED.

 E.g.

 BLIINTHAN SEGMENT DWORD PUBLIC 'BLIINTHAN'

 BLIINTHAN ENDS

 To force it to be fixed :

 DEFBEGIN

 SEGMENTS 'BLIINTHAN' CLASS 'BLIINTHAN' FIXED

 DEFEND

 This can also be very useful to isolate the source of a GPF once you have
 found the segment it is in. Just do the above for the segment where the
 problem is occurring and it will be placed in a segment on its own, so the
 offset displayed by the dump will tie in with the offsets from your assembly
 source and listing files.

 When a Dual mode program has a GPE it may occur in an overlaid segment in
 which case the CS value will be relatively high and no segment number will
 be displayed. In this case relink the program as an Extended mode program to
 remove overlays and put the segments in the map where the dump function can
 identify them. Alternatively you can take the code segment limit from the
 dump and refer to the table of overlays in the MAP file to locate the most
 likely overlay.

This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson