ALIGN - Align Location Counter

Syntax
  ALIGN <n>
  
  
Synonym

None

Description

This directive forces the next instruction to a boundary that is a multiple of <n>, relative to the start of the section. The value of <n> must be a positive number between 1 and 32767. The ALIGN directive can force alignment to any size. The filling bytes inserted for alignment purpose are initialized with `\0'.

ALIGN can be used in code or data sections.

Example

The example shown in the following listing, aligns the HEX label to a location, which is a multiple of 16 (in this case, location 00010 (Hex))

Listing: Aligning the HEX Label to a Location

Assembler
Abs. Rel.   Loc    Obj. code   Source line

---- ----   ------ ---------   -----------

    1    1

    2    2   000000 6869 6768         DC.B  "high"

    3    3   000004 0000 0000         ALIGN 16

             000008 0000 0000

             00000C 0000 0000

    4    4

    5    5

    6    6   000010 7F          HEX:   DC.B 127 ; HEX is allocated

    7    7                                      ; on an address,

    8    8                                      ; which is a

    9    9                                      ; multiple of 16.