FIX: A2138 Error--Structure Member Span-Dependent EquateLast reviewed: September 16, 1997Article ID: Q94408 |
6.00 6.00a 6.00b 6.10 6.10a | 6.00 6.00a 6.00b
MS-DOS | OS/2kbtool kbfixlist kbbuglist The information in this article applies to:
SYMPTOMSThe process of assembling an application fails and the assembler generates an A2138 error message.
CAUSEA structure member is initialized with an equate value that is computed as the difference between the addresses of two labels in the code (a span-dependent value).
RESOLUTIONTo work around this problem, code an expression that evaluates to the difference between the addresses of the two labels. Initialize the structure using the expression.
STATUSMicrosoft has confirmed this to be a problem in MASM versions 6.0, 6.0a, 6.0b, 6.1, and 6.1a. This problem was corrected in MASM for MS-DOS version 6.11.
MORE INFORMATIONIn the code below, the structure member Member2 is initialized with the TableSize equate. The value of TableSize is generated by subtracting the value of label Table1 from value of label Table2. Assembling the following code causes the A2138 error.
Sample Code; Assemble options needed: /Fl data SEGMENT para public 'DATA' Table1 LABEL WORD DW 0, 1Table2 LABEL WORD
TableSize EQU Table2-Table1InStruc STRUC Member1 DW Table2-Table1 ; This works correctly Member2 DW TableSize ; This triggers the errorInStruc ENDS
Inside InStruc <> ; The error is generated here OutsideOK DW TableSize ; Using the equate outside ; the structure worksdata ENDS _text SEGMENT para public 'CODE' start: mov ax, 4C00h int 21h_text ENDS END start
|
Additional reference words: 6.00 6.00a 6.00b 6.10 6.10a buglist6.00a
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |