User manual

ST assembler ST Assembler-Linker
28/89 Doc ID 11392 Rev 4
Combine
The <combine> argument tells the assembler and linker how to treat the segment. There
are three types to handle it:
The at-type <combine> must be used at the introduction of a class, only once.
The at-type <combine> must have one argument: the start address of the class, and may
optionally be given the end address (or limit) of the class too. If given, the linker checks that
no items in the class have gone over the limit address; if this does occur, a warning is issued
at link time. The hexadecimal numbers X and Y should not have radix specifiers.
All common-type <combine> segments that have the same class name will start at the
same address. The linker keeps track of the longest segment. common segments can be
used for sharing data across different applications.
For example:
st7/
dat1 segment byte at: 10 'DATA'
ds.w
com1 segment common 'DATA'
.lab1 ds.w 4
com1 segment common 'DATA'
.lab2 ds.w 2
com2 segment common 'DATA'
.lab3 ds.w
com2 segment common 'DATA'
.lab4 ds.w 2
dat2 segment 'DATA'
.lab5 ds.w 2
end
The values for labels lab1, lab2, lab3, lab4, and lab5 are 12, 12, 1A, 1A and 1E,
respectively.
Note: Since you cannot specify both
at and common combines simultaneously, the only way to
specify the exact location of commons is to insert an empty
at combine segment before the
first
common declaration.
For example:
com1 segment byte at: 10 'DATA'
com1 segment common 'DATA'
...
com1 segment common 'DATA'
...
Table 11. Combine types
Type Description
at:X[-Y] Starts a new class from address X [to address Y]
common
All common segments that have the same class name will start at the
same address. This address is determined by the linker.
<none> Follows on from end of last segment of this class.