Microsoft KB Archive/75178

= FIX: ASSUME Using SEG on Communal Far Data Item =

Article ID: 75178

Article Last Modified on 10/29/2003

-

APPLIES TO


 * Microsoft Macro Assembler 6.0 Standard Edition

-



This article was previously published under Q75178



SYMPTOMS
When the ASSUME directive uses the SEG operator on a communal far data item in the Microsoft Macro Assembler (MASM) versions 5.1, 5.1a, and 6.0, it may generate an error incorrectly. The statement &quot;cmp dog, 0&quot; in the sample code below incorrectly generates the following message when assembled with MASM 5.1 or 5.1a:

A2068: Cannot address with segment register

MASM 6.0 incorrectly generates the following message:

A2074: cannot access label through segment registers



RESOLUTION
The following workarounds may be used to eliminate the error messages:


 * 1) Use the segment name instead of the SEG operator on a label, such as &quot;ASSUME ds:FAR_DATA&quot; instead of &quot;ASSUME ds:SEG dog&quot;.
 * 2) Specify the segment register along with the label, such as &quot;cmp ds:dog, 0&quot; instead of &quot;cmp dog, 0&quot;.
 * 3) With MASM 6.0, specify that the communal data is far, such as &quot;COMM FAR dog:BYTE instead of &quot;COMM dog:BYTE&quot;.



STATUS
Microsoft has confirmed this to be a problem in MASM versions 5.1, 5.1a, and 6.0. This problem was corrected in MASM version 6.0a.



MORE INFORMATION
The following sample code can be used to demonstrate the problem.

Sample Code
; Assemble options needed: none

.MODEL large, C

.FARDATA COMM dog:BYTE

.CODE cat PROC ASSUME ds:SEG dog mov ax, SEG dog mov ds, ax   cmp dog, 0 ret cat ENDP END

Additional query words: 5.10 5.10a 6.00 buglist5.10 buglist5.10a buglist6.00 fixlist6.00a

Keywords: kbfix KB75178

-

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

© Microsoft Corporation. All rights reserved.