KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q76945: FIX: Sample Program BELL.C Causes R6001 Error

Article: Q76945
Product(s): Microsoft Macro Assembler
Version(s): MS-DOS:6.0
Operating System(s): 
Keyword(s): 
Last Modified: 04-MAY-2001

-------------------------------------------------------------------------------
The information in this article applies to:

- Microsoft Macro Assembler (MASM), version 6.0 
-------------------------------------------------------------------------------

SYMPTOMS
========

The sample program BELL.C, which is shipped with the Microsoft Macro Assembler
(MASM) version 6.0, generates the following error when compiled and run:

  run-time error R6001
  - null pointer assignment

CAUSE
=====

The run-time error R6001 occurs because the error-checking routine _nullcheck()
is being invoked after the program has terminated to determine whether the
contents of the NULL segment have been changed. Because this is a mixed C and
assembly language program, the _nullcheck() routine is expecting to see the
Microsoft C run-time library message in the NULL segment.

However, because of the segment ordering that is done in the assembly code, this
is not what is actually in the NULL segment. Although the code in the NULL
segment is correct, it is not in the order that _nullcheck() is expecting.

RESOLUTION
==========

As stated in the online help, the null pointer check can be suppressed by
defining your own routine named _nullcheck() that does nothing. To prevent the
above error, place the following _nullcheck() definition in the file BELL.C.

     void _nullcheck (void)
      {
      }

The /NOE link option must also be used to avoid multiple symbol definitions. The
call to _nullcheck() will be satisfied by your definition of _nullcheck(), and
the library version will not be loaded.

STATUS
======

Microsoft has confirmed this to be a problem in MASM version 6.0. This problem
was corrected in MASM version 6.0a.

Additional query words: BELL.MAK buglist6.00 fixlist6.00a

======================================================================
Keywords          :  
Technology        : kbMASMsearch kbAudDeveloper kbMASM600
Version           : MS-DOS:6.0
Solution Type     : kbfix

=============================================================================

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.