home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l217 / 2.ddi / FOREIGN / MSC / READ.ME < prev   
Encoding:
Text File  |  1990-03-26  |  2.0 KB  |  47 lines

  1. This file contains important information not found in the manual, regarding
  2. linking with MicroSoft C.
  3.  
  4. CORRECTIONS AND ADDITIONS TO THE MANUAL
  5. =======================================
  6.  
  7. The manual incorrectly states that the file mscinit.obj should be the
  8. first one encountered by the linker. The correct file is mscmain.obj,
  9. which is reflected in the generic link.bat command file.
  10.  
  11. PDC Prolog requires all data structures to be aligned on byte boundaries.
  12. The compiler option -Zp1 is required to ensure this, and is reflected in the
  13. generic compile.bat command file.
  14.  
  15.  
  16. NULLCHECK
  17. =========
  18.  
  19. Compiled PDC Prolog code has no notion of a DGROUP, and uses the bottom
  20. of the stack segment to store a few frequently used runtime variables,
  21. including the DGROUP segment selector which is used to set DS when foreign
  22. language subroutines are called. However, due to MicroSoft C's memory setup,
  23. the bottom of the stack is equal to the bottom of the DGROUP, meaning that
  24. the MicroSoft nullcheck code incorrectly assumes there has been a null
  25. pointer assignment. This causes the
  26.  
  27. run-time error R6001
  28. - null pointer assignment
  29.  
  30. message to be displayed when the program terminates. Although totallly
  31. harmless, it's not a pretty sight, for which reason you may want to install
  32. your own nullcheck routine. MicroSoft suggests that you do this by defining
  33. a routine called '_nullcheck', doing nothing, in one of your C modules,
  34. preferably the main module. This, however, is not entirely correct: the
  35. _nullcheck routine MUST return 0, and it cannot come from any object file
  36. explicitly passed to the linker. It has to come from a library. Therefore,
  37. the recommended action is to remove the _nullcheck routine from the MicroSoft
  38. library, using the 'lib' utility as follows:
  39.  
  40. C:\LIB>lib llibce -chksum;
  41.  
  42. (the _nulllcheck routine is in the module called chksum), create your own
  43. nullcheck routine (see the file ncheck.c), and include this in either the
  44. Prolog or C library, again using lib:
  45.  
  46. C:\PROLOG>lib prolog +ncheck;
  47.