Keil Logo

ALIGN Assembler Statement

Arguments
ALIGN expression
Description

The ALIGN statement sets the location counter to the next address modulo 2^expression. This may be used to ensure that the next statement is aligned on a 2^n boundary. For example, to align code or data in cache lines. The assembler creates a gap if necessary. The content of the gap byte differs for the various sections:

  • undefined in data.
  • 0 in const.
  • NOP in code.

The segment needs to be declared at least with the same alignment as used in the ALIGN statement.

See Also

EVEN, SEGMENT

Example
Example MYDATA: SEGMENT EDATA ALIGN(6)
        RSEG    MYDATA
var1:   DSB     1
        ALIGN   5       ; align to 32 byte boundary
var2:   DSW     1
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.