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 Byte
.bytevalue1[, ... , valuen ]
.ubytevalue1[, ... , valuen ]
.charvalue1[, ... , valuen ]
.ucharvalue1[, ... , valuen ]
The .byte, .ubyte, .char, and .uchar directives place one or more values into consecutive bytes of the current section. A value can be one of the following:
The first byte occupies the eight least significant bits of a full 32-bit word. The second byte occupies bits eight through 15 while the third byte occupies bits 16 through 23. 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 bytes in memory with .byte. Also, 8-bit values (8, -3, def, and b) are placed into consecutive bytes in memory with .char. The label STRX has the value 0h, which is the location of the first initialized byte. The label STRY has the value 6h, which is the first byte initialized by the .char directive.
1 00000000 .space 100h
2 00000100 0A STRX .byte 10, -1, "abc", 'a'
00000101 FF
00000102 61
00000103 62
00000104 63
00000105 61
3 00000106 08 STRY .char 8, -3, "def", 'b'
00000107 FD
00000108 64
00000109 65
0000010a 66
0000010b 62