Microsoft KB Archive/84734

= Why Code Segment Contents May Begin at Offset 16 =

Article ID: 84734

Article Last Modified on 10/23/2003

-

APPLIES TO


 * Microsoft LINK for MS-DOS 3.x
 * Microsoft LINK for MS-DOS 5.0x
 * Microsoft LINK for MS-DOS 5.1x
 * Microsoft LINK for MS-DOS 5.2
 * Microsoft LINK for MS-DOS 5.3x
 * Microsoft LINK for MS-DOS 5.5
 * Microsoft LINK for MS-DOS 5.6
 * Microsoft LINK for OS/2 5.0x
 * Microsoft LINK for OS/2 5.1
 * Microsoft LINK for OS/2 5.11
 * Microsoft LINK for OS/2 5.13
 * Microsoft LINK for OS/2 5.15

-



This article was previously published under Q84734



SUMMARY
Microsoft LINK inserts 16 null bytes at the beginning of the _TEXT segment if the following conditions are true:
 * DOSSEG ordering is specified
 * the LINK command line does not specify /NON[ULLSDOSSEG]
 * the _TEXT segment exists



MORE INFORMATION
LINK inserts 16 null bytes at the beginning of the _TEXT segment to provide support for the signal function; 16 bytes provide space for its flags.

In DOSSEG ordering, segments appear in the file in the following order:

 All segments that have a class name that ends in &quot;CODE&quot; Data segments other than those in DGROUP DGROUP data segments, in the following order:

 Any data segments of class 'BEGDATA' Any data segments not of class 'BEGDATA,' 'BSS,' or 'STACK' Data segments of class 'BSS' Data segments of class 'STACK'</li></ol> </li></ol>

The run-time libraries distributed with Microsoft language products contain a special object module record that enables DOSSEG segment ordering. To specify DOSSEG ordering from the LINK command line, specify the /DOSSEG option.

In an application developed with the Microsoft Macro Assembler (MASM), the .MODEL directive requests DOSSEG statement ordering. However, LINK places 16 null bytes at the beginning of the _TEXT segment only if either the source code contains the .DOSSEG directive or if the LINK command line includes the /DOSSEG option.

The /NONULLSDOSSEG option instructs LINK to place segments into the DOSSEG ordering and to suppress generating the 16 null bytes at the beginning of the _TEXT segment.

Additional query words: kbinf 3.65 3.69 4.06 4.10 5.01.20 5.01.21 5.02 5.03 5.05 5.10 5.11 5.13 5.15 5.20 5.30 5.31.009 5.50 5.60

Keywords: kb16bitonly KB84734

-

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

© Microsoft Corporation. All rights reserved.