Using Sections

A section is bounded by a SECTION directive and an ENDSEC directive. For example:

  SECTION 
  sectionname [GLOBAL | STATIC | LOCAL]
  .
  ;Section source statements
  .
  ENDSEC

All symbols that are defined within a section have the sectionname associated with them. 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 qualifiers accompany the SECTION directive. More information on the GLOBAL and LOCAL qualifiers can be found in Data Hiding.

Any code or data inside a section is considered an indivisible block with respect to relocation. 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 directive on the instruction line. More information on the STATIC qualifier is available in Relocation.