.align Directive

Syntax

.align expression

Description

The .align directive sets low-order bits in the location counter to zero. The value of expression establishes the number of bits to be zeroed. The maximum value for expression is 6 (64-byte alignment). Windows NT default alignment is .align 4 (octaword alignment).

If the .align directive advances the location counter, the assembler fills the skipped bytes with zeros in data sections or nop instructions in text sections.

Normally, the following directives automatically allign their data appropriately: .word, .long, .quad, .float, .double, .d_floating, .f_floating, .g_floating, .s_floating, and .t_floating. For example, .word does an implicit .align 1, and .double does an implicit .align 3.

The automatic alignment feature can be disabled with .align 0. The assembler reinstates automatic alignment at the next .text, .data, .rdata, or .sdata directive that it encounters.

Labels immediately preceding an automatic or explicit alignment are also realigned. For example:

foo: .align 3
.word 0

is the same as

.align 3
foo: .word 0