8.6.6 AlignExpr(expr, align) function

Aligns an address expression to a specified boundary.

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:

expr ≡ 0 (mod align)

Example

This example aligns the address of ER2 on an 8-byte boundary:

ER +0
{
    …
}
ER2 AlignExpr(+0x8000,8)
{
    …
}

Relationship with the ALIGN keyword

The following relationship exists between ALIGN and AlignExpr:

ALIGN keyword

Load 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.

AlignExpr

Aligns the expression it operates on, but has no effect on the properties of the load or execution region.

Non-ConfidentialPDF file icon PDF versionARM DUI0474M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.