| |||
| Home > Formal syntax of the scatter file > AlignExpr(expr, align) function | |||
This function returns:
(expr + (align-1)) & ~(align-1))
where:
expr is
a valid address expression
align is the alignment, and must
be a positive power of 2.
It increases expr until it is:
0 mod align
This example aligns the address of ER2 on
an 8-byte boundary:
ER +0
{
...
}
ER2 AlignExpr(+0x8000,8)
{
...
}
The following relationship exists between ALIGN and AlignExpr:
ALIGN keywordLoad and execution regions already have an ALIGN keyword:
for load regions the ALIGN keyword
aligns the base of the load region in load space and in the file
to the specified alignment
for execution regions the ALIGN keyword
aligns the base of the execution region in execution and load space
to the specified alignment.
AlignExprAligns the expression it operates on, but has no effect on the properties of the load or execution region.