home *** CD-ROM | disk | FTP | other *** search
- This file contains important information not found in the manual, regarding
- linking with MicroSoft C.
-
- CORRECTIONS AND ADDITIONS TO THE MANUAL
- =======================================
-
- The manual incorrectly states that the file mscinit.obj should be the
- first one encountered by the linker. The correct file is mscmain.obj,
- which is reflected in the generic link.bat command file.
-
- PDC Prolog requires all data structures to be aligned on byte boundaries.
- The compiler option -Zp1 is required to ensure this, and is reflected in the
- generic compile.bat command file.
-
-
- NULLCHECK
- =========
-
- Compiled PDC Prolog code has no notion of a DGROUP, and uses the bottom
- of the stack segment to store a few frequently used runtime variables,
- including the DGROUP segment selector which is used to set DS when foreign
- language subroutines are called. However, due to MicroSoft C's memory setup,
- the bottom of the stack is equal to the bottom of the DGROUP, meaning that
- the MicroSoft nullcheck code incorrectly assumes there has been a null
- pointer assignment. This causes the
-
- run-time error R6001
- - null pointer assignment
-
- message to be displayed when the program terminates. Although totallly
- harmless, it's not a pretty sight, for which reason you may want to install
- your own nullcheck routine. MicroSoft suggests that you do this by defining
- a routine called '_nullcheck', doing nothing, in one of your C modules,
- preferably the main module. This, however, is not entirely correct: the
- _nullcheck routine MUST return 0, and it cannot come from any object file
- explicitly passed to the linker. It has to come from a library. Therefore,
- the recommended action is to remove the _nullcheck routine from the MicroSoft
- library, using the 'lib' utility as follows:
-
- C:\LIB>lib llibce -chksum;
-
- (the _nulllcheck routine is in the module called chksum), create your own
- nullcheck routine (see the file ncheck.c), and include this in either the
- Prolog or C library, again using lib:
-
- C:\PROLOG>lib prolog +ncheck;