Crossware

Table of Contents        Previous topic       Next topic       

ASSEMBLER DIRECTIVES->Other Assembler Directives->SEGMENT

SEGMENT              Define Relocatable Segment

The SEGMENT directive allows named relocatable segments to be defined.

Format:

<segment name>     SEGMENT              <segment type> <relocation type>

<segment name> can be any legal symbol and is subsequently used by the RSEG directive.

<segment type> is one of CODE, XDATA, DATA, IDATA or BIT.

<relocation type> is one of the following:
    
PAGEThis specifies that the segment must start on a 256 byte page boundary.  This type is only valid for CODE and XDATA segments
INPAGEThis specifies that the segment must be contained within a 256 byte page.  This type is only valid for CODE and XDATA segments
INBLOCKThis specifies that the segment must be contained within a 2048 byte page.  This type is only valid for CODE segments
BITADDRESSABLE This specifies that the segment must be relocated within the bit addressable space starting on a byte boundary.  This type is only valid for DATA segments.
UNITThis specifies that the segment must be aligned on a unit bounday. This is a byte boundary for CODE, XDATA, DATA and IDATA segments and a bit boundary for BIT segments.  This is the default relocation type.
POSTPONEThis specifies that the segment should be relocated to an address higher than all other segments in the same address space except segments with the relocation type HIGH.  This type is only valid in IDATA and XDATA segments.  Typically this should be used for the stack segment in IDATA space and for XDATA space that grows upwards during run time.
HIGHThis specifies that the segment should be relocated as high as possible in the available address space.  This type is only valid in IDATA and XDATA segments.  Typically this should be used for data space that grows downwards during run time.
BANKThis specifies that the segment should be located in a separate bank. BANK must be followed by a comma separated list as discussed in bankable segments.  This type is only valid for CODE and XDATA segments.