SPRU513Y August 2001 – June 2022 SM320F28335-EP
Initialize Byte
.bytevalue1[, ... , valuen ]
.ubytevalue1[, ... , valuen ]
.charvalue1[, ... , valuen ]
.ucharvalue1[, ... , valuen ]
The .byte, .ubyte, .char, and .uchar directives place one or more values into consecutive words of the current section. Each byte is placed in a word by itself; the eight MSBs are filled with 0s. A value can be one of the following:
Values are not packed or sign-extended; each byte occupies the eight least significant bits of a full 16-bit word. The assembler truncates values greater than eight bits.
If you use a label, it points to the location of the first byte that is initialized.
When you use these directives in a .struct/.endstruct sequence, they define a member's size; they do not initialize memory. For more information, see the .struct/.endstruct/.tag topic.
In this example, 8-bit values (10, -1, abc, and a) are placed into consecutive words in memory. The label STRX has the value 100h, which is the location of the first initialized word.
1 000000 .space 100h * 16
2 000100 000A STRX .byte 10, -1, "abc", 'a'
000101 00FF
000102 0061
000103 0062
000104 0063
000105 0061
3 000106 000A .char 10, -1, "abc", 'a'
000107 00FF
000108 0061
000109 0062
00010a 0063
00010b 0061