5.2.2 Section definition directives

A section is a block of routines or data of the same type. A "section definition directive" is a directive that declares the start or end of a section.

Sections are the unit of allocation in the optimizing linker.

Example

  .cseg  
    :
  .dseg  
    :

 

Two sections with the same section name must have the same relocation attribute. Consequently, multiple sections with differing relocation attributes cannot be given the same section name. If two sections with the same section name have different relocation attributes, an error will occur.

Sections can be broken up. In other words, sections in a single source program file with the same relocation attribute and section name will be processed as a single continuous section in the assembler.

If the sections are broken into separate source program files, then they will be processed by the optimizing linker.

Section names cannot be referenced as symbols.

 

The following section definition directives are available.

Table 5.7

Section Definition Directives

Directive

Overview

.cseg

Indicates to the assembler the starting of a code section

.dseg

Indicates to the assembler the start of a data section

.section

Indicates to the assembler the start of a section

.org

Indicates to the assembler the start of a section at an absolute address

.offset

Specifies an offset from the first address of a section