SPNU118Z September 1995 – March 2023 66AK2E05 , 66AK2H06 , 66AK2H12 , 66AK2H14 , AM1705 , AM1707 , AM1802 , AM1806 , AM1808 , AM1810 , AM5K2E04 , OMAP-L132 , OMAP-L137 , OMAP-L138 , SM470R1B1M-HT , TMS470R1A288 , TMS470R1A384 , TMS470R1A64 , TMS470R1B1M , TMS470R1B512 , TMS470R1B768
Initialize 32-Bit Integers
.intvalue1[, ... , valuen ]
.uintvalue1[, ... , valuen ]
.long value1[, ... ,valuen ]
.ulong value1[, ... ,valuen ]
.wordvalue1[, ... , valuen ]
.uwordvalue1[, ... , valuen ]
The .int, .unint, .long, .ulong, .word, and .uword directives place one or more values into consecutive words in the current section. Each value is placed in a 32-bit word by itself and is aligned on a word boundary. A value can be either:
A value can be either an absolute or a relocatable expression. If an expression is relocatable, the assembler generates a relocation entry that refers to the appropriate symbol; the linker can then correctly patch (relocate) the reference. This allows you to initialize memory with pointers to variables or labels.
If you use a label with these directives, it points to the first word that is initialized.
When you use these directives in a .struct/.endstruct sequence, they define a member's size; they do not initialize memory. See the .struct/.endstruct/.tag topic.
This example uses the .int directive to initialize words.
1 00000000 .space 73h
2 00000000 .bss PAGE, 128
3 00000080 .bss SYMPTR, 4
4 00000074 E3A00056 INST: MOV R0, #056h
5 00000078 0000000A .int 10, SYMPTR, -1, 35 + 'a', INST, "abc"
0000007c 00000080-
00000080 FFFFFFFF
00000084 00000084
00000088 00000074'
0000008c 00000061
00000090 00000062
00000094 00000063
This example shows how the .long directive initializes words. The symbol DAT1 points to the first word that is reserved.
1 00000000 0000ABCD DAT1: .long 0ABCDh, 'A' + 100h, 'g', 'o'
00000004 00000141
00000008 00000067
0000000c 0000006F
2 00000010 00000000' .long DAT1, 0AABBCCDDh
00000014 AABBCCDD
3 00000018 DAT2:
In this example, the .word directive is used to initialize words. The symbol WORDX points to the first word that is reserved.
1 00000000 00000C80 WORDX: .word 3200, 1 + 'AB', -0AFh, 'X'
00000004 00004242
00000008 FFFFFF51
0000000c 00000058