SPRU513Z August 2001 – October 2023 SM320F28335-EP
Initialize 32-Bit Integer
.longvalue1[, ... , valuen]
.ulongvalue1[, ... , valuen]
.xlongvalue1[, ... , valuen]
The .long, .ulong, and .xlong directives place one or more 32-bit values into consecutive words in the current section. The most significant word is stored first. The .long directive aligns the result on the long-word boundary, while .xlong does not.
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 .long in a .struct/.endstruct sequence, .long defines a member's size; it does not initialize memory. See the .struct/.endstruct/.tag topic.
This example shows how the .long and .xlong directives initialize double words.
1 000000 ABCD DAT1: .long 0ABCDh, 'A' + 100h, 'g', 'o'
000001 0000
000002 0141
000003 0000
000004 0067
000005 0000
000006 006F
000007 0000
2 000008 0000' .xlong DAT1, 0AABBCCDDh
000009 0000
00000a CCDD
00000b AABB
3 00000c DAT2: