Understanding the Section Directive
.SECTION is the section declaration assembler directive. A section is a part of a program, and the linkage editor regards it as a unit of processing. The following figure shows an example of a section declaration.
The following statement shows the syntax of a Section declaration assembler directive.
.SECTION?<section name> [,<section type> [,<section attributes>...]]
The following list shows descriptions of the elements of this statement.
Section name
The default value for section name is .text. A section name may be either an ordinary symbol with a period (.) as the leading character, or of the form,
<section name> { <COMDAT symbol> }.
The curly braces are part of the actual syntax. A section declared using this syntax is a COMDAT section in the object file. For more information about COMDAT, see the Microsoft COFF specification.Section type
The default value for section type is code section. The following table shows the possible values for section type.
Attribute Section Type CODE (default) Code section DATA Data section BSS BSS section DUMMY Dummy section Section attribute
The default value for section attribute is relative address with a boundary alignment value of four. The following table shows the possible values for the third operand, section attributes.
Specification Description SELECTION=<selection number> Specifies COMDAT selection type. The default is 5. Valid only for a COMDAT section. ASSOC=<section symbol> Links current section with specified section symbol. Causes COMDAT selection number to default to 5. ALIGN=<boundary alignment value> Starts a relative address section. The boundary alignment value must be an absolute value with no forward reference symbols.
See Also
SHASM Section and Location Directives
Last updated on Thursday, April 08, 2004
© 1992-2003 Microsoft Corporation. All rights reserved.