The information in this article applies to:
- Microsoft Macro Assembler for MS-DOS, versions 5.0, 5.1, 6.0, 6.0a,
and 6.0b
- Microsoft Macro Assembler for OS/2, versions 5.1, 6.0, 6.0a, and
6.0b
The following are the rules for declaring externals in MASM:
- NEAR code labels must be declared in the code segment
from which they are accessed.
- 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.
- 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.
- 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 "Microsoft Macro
Assembler Programmer's Guide" for Versions 5.x.
|