Texas Instruments TMS320C54x User Manual page 166

Digital signal processors
Hide thumbs Also See for TMS320C54x:
Table of Contents

Advertisement

Syntax
Description
Example
.string " string
.pstring " string
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.
This example shows 8-bit values placed into words in the current section.
1 000000 0041
000001 0042
000002 0043
000003 0044
2 000004 0041
000005 0042
000006 0043
000007 0044
3 000008 4175
000009 7374
00000a 696E
00000b 486F
00000c 7573
00000d 746F
00000e 6E00
4 00000f 0030
" [, ... , " string
"]
1
n
" [, ... , " string
1
n
Str_Ptr:
.string
.string
.pstring "Austin", "Houston"
.string
.string/.pstring
Initialize Text
"]
"ABCD"
41h, 42h, 43h, 44h
36 + 12
Assembler Directives
4-83

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMS320C54x and is the answer not in the manual?

Table of Contents