Assembler Significant Characters And Directives
Assembler Directives
MOTOROLA
DSP ASSEMBLER REFERENCE MANUAL
For More Information On This Product,
Go to: www.freescale.com
6-91
SECTION
Start Section
SECTION
.
.
<section source statements>
.
.
ENDSEC
<symbol>
[GLOBAL | STATIC | LOCAL]
The
SECTION
directive defines the start of a section. All symbols that are defined within
a section have the <symbol> associated with them as their section name. This serves to
protect them from like-named symbols elsewhere in the program. By default, a symbol
defined inside any given section is private to that section unless the
GLOBAL
or
LOCAL
qualifier accompanies the
SECTION
directive.
Any code or data inside a section is considered an indivisible block with respect to relo-
cation. Code or data associated with a section is independently relocatable within the
memory space to which it is bound, unless the
STATIC
qualifier follows the
SECTION
di-
rective on the instruction line.
Symbols within a section are generally distinct from other symbols used elsewhere in the
source program, even if the symbol name is the same. This is true as long as the section
name associated with each symbol is unique, the symbol is not declared public (
XDEF
/
GLOBAL
), and the
GLOBAL
or
LOCAL
qualifier is not used in the section declaration.
Symbols that are defined outside of a section are considered global symbols and have no
explicit section name associated with them. Global symbols may be referenced freely
from inside or outside of any section, as long as the global symbol name does not conflict
with another symbol by the same name in a given section.
If the
GLOBAL
qualifier follows the <section name> in the
SECTION
directive, then all
symbols defined in the section until the next
ENDSEC
directive are considered global.
The effect is as if every symbol in the section were declared with
GLOBAL
. This is useful
when a section needs to be independently relocatable, but data hiding is not desired.
If the
STATIC
qualifier follows the <section name> in the
SECTION
directive, then all code
and data defined in the section until the next
ENDSEC
directive are relocated in terms of
the immediately enclosing section. The effect with respect to relocation is as if all code
and data in the section were defined within the parent section. This is useful when a sec-
tion needs data hiding, but independent relocation is not required.
If the
LOCAL
qualifier follows the <section name> in the
SECTION
directive, then all sym-
bols defined in the section until the next
ENDSEC
directive are visible to the immediately
enclosing section. The effect is as if every symbol in the section were defined within the
parent section. This is useful when a section needs to be independently relocatable, but
data hiding within an enclosing section is not required.
F
Freescale Semiconductor, Inc.
n
.