SPNU118Y September 1995 – 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 00000000 40000000 .field 2,3
2 00000000 4000000B .field 11, 21
3 .align 2
4 00000004 45 .string "Errcnt"
00000005 72
00000006 72
00000007 63
00000008 6E
00000009 74
5 .align
6 0000000c 04 .byte 4
Figure 5-4 shows how the .space and .bes directives work for the following assembled code:
1
2 00000000 00000100 .word 100h, 200h
00000004 00000200
3 00000008 Res_1: .space 17
4 0000001c 0000000F .word 15
5 00000033 Res_2: .bes 20
6 00000034 BA .byte 0BAh
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.