SPRU513Y August 2001 – June 2022 SM320F28335-EP
Align SPC on the Next Boundary
.align [size in words]
The .align directive aligns the section program counter (SPC) on the next boundary, depending on the size in words parameter. The size can be any power of 2 , although only certain values are useful for alignment. An operand of 64 aligns the SPC on the next page boundary, and this is the default if no size in words is given. The assembler assembles words containing null values (0) up to the next size in words boundary:
1 | aligns SPC to word boundary |
2 | aligns SPC to long word/even boundary |
64 | aligns SPC to page boundary |
Using the .align directive has two effects:
This example shows several types of alignment, including .align 2, .align 4, and a default .align.
1 000000 0004 .byte 4
2 .align 2
3 000002 0045 .string "Errorcnt"
000003 0072
000004 0072
000005 006F
000006 0072
000007 0063
000008 006E
000009 0074
4 .align
5 000040 0003 .field 3,3
6 000040 002B .field 5,4
7 .align 2
8 000042 0003 .field 3,3
9 .align 8
10 000048 0005 .field 5,4
11 .align
12 000080 0004 .byte 4