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 16-Bit Integers
.half value1[, ... , valuen ]
.short value1[, ... , valuen ]
.uhalf value1[, ... , valuen ]
.ushort value1[, ... , valuen]
The .half and .short directives place one or more values into consecutive halfwords in the current section. A value can be either:
The assembler truncates values greater than 16 bits.
If you use a label with .half or .short, it points to the location where the assembler places the first byte.
These directives perform a halfword (16-bit) alignment before data is written to the section. This guarantees that data resides on a 16-bit boundary.
When you use .half or .short 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, .half is used to place 16-bit values (10, -1, abc, and a) into consecutive halfwords in memory; .short is used to place 16-bit values (8, -3, def, and b) into consecutive halfwords in memory. The label STRN has the value 100ch, which is the location of the first initialized halfword for .short.
1 00000000 .space 100h * 16
2 00001000 000A .half 10, -1, "abc", 'a'
00001002 FFFF
00001004 0061
00001006 0062
00001008 0063
0000100a 0061
3 0000100c 0008 STRN .short 8, -3, "def", 'b'
0000100e FFFD
00001010 0064
00001012 0065
00001014 0066
00001016 0062