Table of Contents Previous topic Next topic
ASSEMBLER DIRECTIVES->Other Assembler Directives->SECTION
SECTION Define Relocatable Section (or Segment)
The SECTION directive causes the statements following it to be relocatably assembled into the named section. This directive remains in effect until another absolute or relocatable section is specified.
In this manual we refer to segments as well as sections. We mean exactly the same thing by both terms.
The formats for the directive are:
[label] | SECTION[.S] | <section name>[,type][,relocation type][,bank number] |
SECTION[.S] | <section number>[,type][,relocation type] [,bank number] |
'P' or 'POSTPONE' | This specifies that the section should be relocated to an address higher than all other sections in the same address space except section s with the relocation type HIGH. This type is only valid in data sections. Typically this should be used for the heap section which grows upwards during run time. |
'H' or 'HIGH' | This specifies that the section should be relocated as high as possible in the available address space. This type is only valid in data sections. Typically this should be used for the stack section which grows downwards during run time. |
'I' or 'INPAGE' | This specifies that the section should be relocated into a single page of memory. Sections must have this relocation type if they are to be addressed using the direct addressing mode. See section for an example of the use of this relocation type. |
BANK | This specifies that the section should be located in a separate bank. BANK must be followed the bank number as discussed in Using the Section Directive. This type is only valid for CODE and DATA segments. |