Microsoft KB Archive/76945

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

Article ID: 76945

Article Last Modified on 10/22/2003

-

APPLIES TO


 * Microsoft Macro Assembler 6.0 Standard Edition

-



This article was previously published under Q76945



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: kbfix KB76945

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.