Data - Create Numeric and Text Data

MPASM Assembler

Data - Create Numeric and Text Data

Syntax

[<label>] data <expr>,[,<expr>,...,<expr>]

[<label>] data "<text_string>"[,"<text_string>",...]

Description

Initialize one or more words of program memory with data. The data may be in the form of constants, relocatable or external labels, or expressions of any of the above. The data may also consist of ASCII character strings, <text_string>, enclosed in single quotes for one character or double quotes for strings. Single character items are placed into the low byte of the word, while strings are packed two to a word. If an odd number of characters are given in a string, the final byte is zero. On all families except the PIC18CXXX, the first character is in the most significant byte of the word. On the PIC18CXXX, the first character is in the least significant byte of the word.

When generating an object file, this directive can also be used to declare initialized data values. Refer to the idata directive for more information.

Example

data reloc_label+10 ; constants

data 1,2,ext_label ; constants, externals

data "testing 1,2,3" ; text string

data 'N' ; single character

data start_of_program ; relocatable label

See Also

DB DE DT DW IDATA


Microchip Technology Inc.
Microchip's Web Site
Voice: (480) 792-7200
Fax: (480) 899-9210
Microchip's E-mail Address
PreviousNext