Initialize Text
.string/.pstring
4-83
Assembler Directives
Syntax
.string ”
string
1
” [,
... , ”string
n
”]
.pstring ”
string
1
” [,
... , ”string
n
”]
Description
The .string and .pstring directives place 8-bit characters from a character
string into the current section. With the .string directive, each 8-bit character
has its own 16-bit word, but with the .pstring directive, the data is packed so
that each word contains two 8-bit bytes. Each
string is either:
-
An expression that the assembler evaluates and treats as a 16-bit signed
number, or
-
A character string enclosed in double quotes. Each character in a string
represents a separate byte.
With .pstring, values are packed into words starting with the most significant
byte of the word. Any unused space is padded with null bytes.
The assembler truncates any values that are greater than 8 bits. You may have
up to 100 operands, but they must fit on a single source statement line.
If you use a label, it points to the location of the first word that is initialized.
Note that when you use .string in a .struct/.endstruct sequence, .string defines
a member’s size; it does not initialize memory. For more information about
.struct/.endstruct, see Section 4.9,
Assembly-Time Symbol Directives, on
page 4-21.
Example
This example shows 8-bit values placed into words in the current section.
1 000000 0041 Str_Ptr: .string ”ABCD”
000001 0042
000002 0043
000003 0044
2 000004 0041 .string 41h, 42h, 43h, 44h
000005 0042
000006 0043
000007 0044
3 000008 4175 .pstring ”Austin”, ”Houston”
000009 7374
00000a 696E
00000b 486F
00000c 7573
00000d 746F
00000e 6E00
4 00000f 0030 .string 36 + 12
Содержание TMS320C54x
Страница 38: ......
Страница 39: ......
Страница 40: ......
Страница 41: ......
Страница 42: ......
Страница 43: ......
Страница 44: ......
Страница 45: ......
Страница 46: ......
Страница 47: ......
Страница 48: ......
Страница 49: ......
Страница 50: ......
Страница 51: ......
Страница 52: ......
Страница 53: ......
Страница 54: ......
Страница 55: ......
Страница 56: ......
Страница 57: ......
Страница 58: ......
Страница 59: ......
Страница 60: ......
Страница 61: ......
Страница 62: ......
Страница 276: ......
Страница 277: ......
Страница 278: ......
Страница 279: ......
Страница 280: ......
Страница 281: ......
Страница 282: ......
Страница 283: ......
Страница 284: ......
Страница 285: ......
Страница 286: ......
Страница 287: ......
Страница 288: ......
Страница 289: ......
Страница 290: ......
Страница 291: ......
Страница 292: ......
Страница 293: ......
Страница 294: ......
Страница 295: ......
Страница 296: ......
Страница 297: ......
Страница 298: ......
Страница 299: ......
Страница 300: ......
Страница 301: ......
Страница 302: ......