SLAU131Y October 2004 – June 2021
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.
In this example, the .int and .word directives are used to initialize words. The symbol WORDX points to the first word that is reserved by .word.
1 0000 .space 73h
2 0000 .bss PAGE, 128
3 0080 .bss SYMPTR, 4
4 0074 403B INST: MOV #056h, R11
0076 0056
5 0078 000A .int 10, SYMPTR, -1, 35 + 'a', INST, "abc"
007a 0080!
007c FFFF
007e 0084
0080 0074!
0082 0061
0084 0062
0086 0063
6 0000 0C80 WORDX: .word 3200, 1 + 'AB', -0AFh, 'X'
0002 4242
0004 FF51
0006 0058