.ALIGN


Aligns the value of the location counter.

[Syntax]

Symbol field
Mnemonic field
Operand field
Comment field
[label:]
.ALIGN 
alignment-condition
[; comment]

[Function]

-

Aligns the value of the location counter.

[Description]

-

Aligns the value of the location counter for the current section, specified by the previously specified section definition directive under the alignment condition specified by the operand. The area created to align the location counter value is filled with 0 (However, except the section with the relocation attribute includes BSS).

-

Specify an even number of 2 or more, but less than 231, as the alignment condition. Otherwise, the CC-RL outputs the error message.

-

This directive just aligns the value of the location counter for the current section within the module in which this directive is used. It does not align the address after sections are allocated through the optimizing linker.

[Example]

        .CSEG   TEXT
        .DS     1       ;OFFSET 0x0
        .ALIGN  2       ;OFFSET 0x2 ;1-byte padding
LABEL:                  ;OFFSET 0x2 ;If the beginning of the section is placed at an 
                        ;odd address during allocation through the optimizing linker,
                        ;the alignment condition value is not set to 2.
                        ;(When the start address is 0x1, this code is placed at 0x3.)
        .SECTION  D1, DATA
        .DB       1
        .ALIGN    4
        .DB       2
        .ALIGN    6
        .DB       3
        ; Since the alignment condition of a section is the least common multiple
        ; of the alignment conditions included in the section, the alignment condition
        ; of section D1 is 12.