Microsoft KB Archive/39523

= How to Declare Externals in MASM =

Article ID: 39523

Article Last Modified on 10/17/2003

-

APPLIES TO


 * Microsoft Macro Assembler 5.0
 * Microsoft Macro Assembler 5.1 Standard Edition
 * Microsoft Macro Assembler 6.0 Standard Edition
 * Microsoft Macro Assembler 6.0a
 * Microsoft Macro Assembler 6.0b

-



This article was previously published under Q39523



SUMMARY
The following are the rules for declaring externals in MASM:


 * 1) NEAR code labels must be declared in the code segment from which they are accessed.
 * 2) Although FAR code labels can be declared anywhere in the source code, it is recommended they be declared outside of any segments. You may declare them at the top of your program after the .MODEL directive.
 * 3) Any external data in the DGROUP data segment, must be declared in the segment in which it is defined. You may need to create a dummy data segment for the external declaration.
 * 4) Data items declared in .FARDATA segment, that need to be referenced as externals, should be declared out of any segments. Otherwise, fixup-overflow errors may occur during linking. Note: This conflicts with the rules indicated on Page 162 of &quot;Microsoft Macro Assembler Programmer's Guide&quot; for Versions 5.x.

Additional query words: kbinf 5.00 5.10 6.00 6.00a 6.00b

Keywords: KB39523

-

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

© Microsoft Corporation. All rights reserved.