Data allocation statements allocate space for data objects in the current section, and initialize the space by assigning it a value. Data objects can be integer numbers, floating-point numbers, or strings. Integer numbers and floating point numbers are aligned according to their size. A data allocation statement with a label, defines a symbol of @object type, and sets the size attribute for that symbol.
Data allocation statements have any of the following formats:
[label: ] data1 expression, ...
[label: ] data2 expression, ...
[label: ] data4 expression, ...
[label: ] data8 expression, ...
[label: ] data16 expression, ...
[label: ] real4 expression, ...
[label: ] real8 expression, ...
[label: ] real10 expression, ...
[label: ] real16 expression, ...
[label: ] string "string", ...
[label: ] stringz "string", ...
Where:
label |
Specifies the data allocation address of the first data object. |
expression |
Represents any of the valid expression types listed in the Data Allocation Statements table, see below. Data alocation statements can have more than one epression operand. |
string |
Represents any of the valid string expression type values listed in the Data Allocation Statements table, see below. |
The table below summarizes the data allocation mnemonics, and their expression type, memory format, data-object size, and alignment boundary for each.
Data Allocation Statements |
||||
Mnemonic |
Expression Type |
Memory Format |
Size (in bytes) |
Alignment |
data1 |
Integer |
Integer |
1 |
1 |
data2 |
Integer |
Integer |
2 |
2 |
data4 |
Integer |
Integer |
4 |
4 |
data8 |
Integer |
Integer |
8 |
8 |
data16 |
Integer |
Integer |
16 |
16 |
real4 |
Floating point or Integer |
IEEE single-precision floating point |
4 |
4 |
real8 |
Floating point or Integer |
IEEE double-precision floating point |
8 |
8 |
real10 |
Floating point or Integer |
IEEE extended- precision floating point (80-bit) |
10 |
10 |
real16 |
Floating point or Integer |
IEEE extended- precision floating point (80-bit) |
16 |
16 |
string |
String constant |
Array of ASCII characters |
Length of string |
1 |
stringz |
String constant |
Array of ASCII characters with null terminator |
Length of string + 1 |
1 |
To disable the automatic alignment of data objects in data allocation statements, add the .ua completer after the mnemonic, for example, data4.ua. These statements allocate unaligned data objects at the current location within the current section.
The default byte order for data allocation statements is platform dependent. To specify the byte order for data allocation statements, use the .msb, or .lsb directives described in the Byte Order Specification Directives section.