You copied the Doc URL to your clipboard.

AlignExpr(expr, align) function

Aligns an address expression to a specified boundary.

This function returns:

(expr + (align-1)) & ~(align-1))


  • 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)


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.


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