Share via


ARM Initialization and Layout Directives

The following table describes the ARM assembler directives that control initialization and store layout.

Directive Syntax Description
DCB
label DCB expression-list
Defines one or more bytes. Expression-list can include string expressions. Requires explicit trailing NULL. Also requires a DATA directive if used to define labeled data in Thumb code. Identical to = directive.
=
label = expression-list
Identical to DCB directive.
DCD
label DCD expression-list
Defines one or more words, aligned on a 4-byte boundary. Identical to & directive.
&
label & expression-list
Identical to DCD above.
DCDO
label DCDO expression-list
Defines one or more words, aligned on 4-byte boundaries, as an offset from the static base register, sb (r9).
DCDU
label DCDU expression-list
Defines one or more words, not necessarily aligned. Use ALIGN directive after if DCDU is followed by code.
DCFD
{label} DCFD fp-constant{
,fp-constant}
Defines double-precision floating-point values. Adds padding before first defined number to align to 4-byte boundary.
DCFDU
{label} DCFD fp-constant{
,fp-constant}
Defines arbitrarily aligned double-precision floating-point values.
DCFS
{label} DCFS fp-constant{ 
,fp-constant}
Defines single-precision floating-point values. Adds padding before first defined number to align to 4-byte boundary.
DCFSU
{label} DCFS fp-constant{ 
,fp-constant}
Defines arbitrarily aligned single-precision floating-point values.
DCI
label DCI expression-list
In ARM code: defines one or more words aligned on 4-byte boundaries. In Thumb code: defines one or more half words aligned on 2-byte boundaries.
DCW
label DCW expression-list
Defines one or more half words aligned on 2-byte boundaries. Expressions should evaluate to an integer between –32768 and 65535.
DCWU
label DCW expression-list
Defines one or more, not necessarily aligned, half words. Expressions should evaluate to an integer between –32768 and 65535. Use ALIGN directive afterward if DCWU followed by code.
FIELD
label FIELD expression
Reserves space within a storage map. Every time FIELD is used, label is given the value of the storage location counter @, and @ is then incremented by the number of bytes reserved. Identical to # directive.
#
label  # expression
Reserve space within a storage map. Every time # is used, label is given the value of the storage location counter @, and @ is then incremented by the number of bytes reserved. Identical to FIELD directive.
MAP
MAP expression{,base-register}
Sets the origin of a storage map at the address specified by expression. A storage-map location counter, @, is also set to the same address. Expression must be fully evaluative in the first pass of the assembly, but may be program-relative. If no ^ directive is used, the @ counter is set to 0; it can be reset any number of times using ^ to allow many storage maps to be established. Identical to ^ directive.
^
^ expression{,base-register}
Sets the origin of a storage map at the address specified by expression. A storage-map location counter, @, is also set to the same address. Expression must be fully evaluative in the first pass of the assembly, but may be program-relative. If no ^ directive is used, the @ counter is set to 0; it can be reset any number of times using ^ to allow many storage maps to be established. Identical to MAP directive.
SPACE
label SPACE numeric-expression
Reserves a zeroed area of store. Sets to 0 the number of bytes specified by numeric-expression. Identical to % directive.
%
label % numeric-expression
Identical to SPACE directive.

**Note   **If you use the DCD directive with a Thumb label within a code area, the value stored is that of the Thumb label plus 1. This is because bit 0 of the register used in a BX instruction must be set to one in order to change state from ARM to Thumb. To avoid this, use the DATA directive when decoding data in code. For more information about the DATA directive, see ARM-Thumb Interworking Directives.

See Also

ARM Assembler Directives | ARM Assembler | ARM Linking Directives | ARM Diagnostic Directives | ARM Directives for Conditional Assembly | ARM Dynamic Listing Directive Options | ARM-Thumb Interworking Directives | ARM Constant and Variable Declarations | ARM Assembler Directives for Macro Definition | Miscellaneous ARM Directives

 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.