SLAU131V October 2004 – February 2020
These directives align the section program counter (SPC) or reserve space in a section:
Figure 5-3 demonstrates the .align directive. Using the following assembled code:
1 0000 0002 .field 2,3
2 0000 005A .field 11,5
3 .align 2
4 0002 0045 .string "Err"
0003 0072
0004 0072
5 .align
6 0006 0004 .byte 4
Figure 5-4 shows how the .space and .bes directives work for the following assembled code:
1 0000 0100 .word 0x100,0x200
0002 0200
2 0004 Res_1 .space 17
3 0016 000F .word 15
4 002b Res_2 .bes 20
5 002c 00BA .byte 0xBA
Res_1 points to the first byte in the space reserved by .space. Res_2 points to the last byte in the space reserved by .bes.