Location counter alignment directive Format .ALIGN integer [,fill-specifier] .ALIGN keyword [,fill-specifier]
1 – Parameters
integer An integer in the range 0 to 9. The location counter is aligned at an address that is the value of 2 raised to the power of the integer. keyword One of five keywords that specify the alignment boundary. The location counter is aligned to an address that is the next multiple of the following values: Keyword Size (in Bytes) BYTE 20= 1 WORD 21= 2 LONG 22= 4 QUAD 23= 8 OCTA 24= 16 [,fill-specifier] Any expression that resolves to an assembly-time integer value containing no forward references. The filling is done per byte, regardless of the alignment. If the value you specify is not in the range of 0 to 255, the assembler issues a diagnostic message and truncates the value.
2 – Description
.ALIGN aligns the location counter to the boundary specified by either an integer or a keyword.
3 – Notes
o If .ALIGN is specified in a psect with the EXE and NOMIX attributes, the fill-specifier is ignored. The assembler aligns the psect to the requested boundary padding with NOP or FNOP instructions. o If .ALIGN is specified in a psect that does not have the EXE attribute and a fill-specifier is specified, the assembler aligns the psect to the requested boundary padding, with byte locations using the fill-specifier as the initial value for the generated byte padding. o If the fill-specifier expression encounters a value that is too large to fit in a boundary specified by the keyword, the data is truncated and an informational message is displayed. o The alignment that you specify in .ALIGN cannot exceed the alignment of the psect in which the alignment is attempted (see the description of .PSECT). For example, if you are using the BYTE psect alignment and you specify .ALIGN with a word or larger alignment, the assembler displays an error message.
4 – Examples
Example 1 .PSECT A,QUAD ; Begin at quadword B::.BYTE 4 ; Data is byte .ALIGN QUAD ; Next data is C::.WORD 6 ; also quadword aligned Example 2 .PSECT A,EXE,NOMIX,OCTA L1::TRAPB: ; offset 0 .ALIGN OCTA ; NOP padding bytes 4..15 TRAPB: ; offset 16 Example 3 .PSECT A,NOEXE,NOMIX,OCTA L1:.WORD 5 ; byte offset 0..1 .ALIGN QUAD,2 ; fill specifier initial value ; of 2 for bytes 2..7 .WORD 6 ; byte offsets 8..9