FIX: MASM Local Variables Unavailable in CodeView 4.0xLast reviewed: September 16, 1997Article ID: Q100426 |
4.00 4.01
MS-DOS
kbtool kbcode kbbuglist kbfixlist
The information in this article applies to:
SYMPTOMSAn attempt to display the local variables of an assembly language module created in Microsoft Macro Assembler (MASM) version 6.1 may fail. MASM displays one of the following messages when you attempt to display a local variable either in the command window or in the locals window:
CAN0030: Error: expression cannot be evaluated -or- CXX0030: Error: expression cannot be evaluatedThe actual error message depends on the expression evaluator (C or C++) CodeView is using at the time.
CAUSEApparently, this problem is caused by CodeView incorrectly initializing memory. It occurs only after certain programs run, particularly those that use extended memory. Because MASM 6.1 is a DOS-extended application, the error occurs when CodeView runs after the assembler.
RESOLUTIONAt present, there are two methods to work around this problem.
STATUSMicrosoft has confirmed this to be a problem in CodeView versions 4.0 and 4.01 for MS-DOS. This problem was corrected in CodeView version 4.1 distributed with Microsoft Visual C++ version 1.0 for Windows.
MORE INFORMATIONIf you have Visual C++, use LINK version 5.5 and CVPACK version 4.1 from the Visual C++ package with CodeView version 4.1 to debug applications developed in MASM version 6.1. You can use the Watch window to view global variables without any difficulties. The following code example illustrates the problem with local variables and allows you to experiment with the Memory window to watch the local variable. If you use CodeView to debug this application immediately after you start your computer or immediately after opening an MS-DOS window in Windows, the error does not occur. If you run CodeView after running MASM 6.1, it will not evaluate the local variable.
Sample Code; Assembly options needed: /Zi .model small .stack .data a WORD ? .code mainproc PROC NEAR .STARTUP mov ax,30h mov a, ax mov ax, 0 call myproc mov ax, a .EXITmainproc ENDP myproc PROC NEAR LOCAL loc:WORD mov ax, 60h mov loc, ax mov dx, loc mov a, dx retmyproc ENDP END
|
Additional reference words: 4.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |