SPRU513Z August 2001 – October 2023 SM320F28335-EP
Initialize 16-Bit Integers
.intvalue1[, ... , valuen ]
.uintvalue1[, ... , valuen ]
.wordvalue1[, ... , valuen ]
.uwordvalue1[, ... , valuen ]
The .int, .unint, .word, and .uword directives place one or more values into consecutive words in the current section. Each value is placed in a 16-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 000000 .space 73h
2 000000 PAGE .usect ".ebss", 128
3 000080 SUMPTR .usect ".ebss", 3
4 000008 FF20 INST: MOV ACC, #056h
000009 0056
5 00000a 000A .int 10, SYMPTR, -1, 35 + 'a', INST
00000b 0080-
00000c FFFF
00000d 0084
00000e 0008'
In this example, the .word directive is used to initialize words. The symbol WORDX points to the first word that is reserved.
1 000000 0C80 WORDX: .word 3200, 1 + 'AB', -0AFh, 'X'
000001 4242
000002 FF51
000003 0058