For DATA sections, the byte address is in one byte units (8 bits/byte). BYTE aligns the section at
any byte address, WORD aligns the section at any even address, PARA aligns the section at
any address which is a multiple of 16, and PAGE aligns the section at any address which is a
multiple of 256.
The optional combine type defines the way of combining sections having the same complete
name (section and class name). It can be any one of the following:
-
COMMON
Creates overlapping sections by placing the start of all sections with the same complete name
at the same address. The length of the resulting area is the length of the longest section.
-
AT address
Causes all label and variable addresses defined in a section to be relative to the given ad
-
dress. The address can be any valid expression except a forward reference. It is an absolute
address in a specified ROM/RAM bank and must be within the ROM/RAM range.
If no combine type is given, the section is combinative, i.e., this section can be concatenated
with all sections having the same complete name to form a single, contiguous section.
The class type defines the sections that are to be loaded in the contiguous memory. Sections
with the same class name are loaded into the memory one after another. The class name CODE
is used for sections stored in ROM, and the class name DATA is used for sections stored in
RAM. The complete name of a section consists of a section name and a class name. The named
section includes all codes and data below (after) it until the next section is defined.
Syntax
ROMBANK banknum section-name [,section-name,...]
·
Description
This directive declares which sections are allocated to the specified ROM bank. The banknum
specifies the ROM bank, ranging from 0 to the maximum bank number of the destination MCU.
The section-name is the name of the section defined previously in the program. More than
one section can be declared in a bank as long as the total size of the sections does not exceed
the bank size of 8K words. If this directive is not declared, bank 0 is assumed and all CODE sec-
tions defined in this program will be in bank 0. If a CODE section is not declared in any ROM
bank, then bank 0 is assumed.
Syntax
RAMBANK banknum section-name [,section-name,...]
·
Description
This directive is similar to ROMBANK except that it specifies the RAM bank, the size of RAM bank
is 256 bytes.
Syntax
END
·
Description
This directive marks the end of a program. Adding this directive to any included file should be
avoided.
70
Cost-Effective I/O Type MCU