ARM Initialization and Layout Directives (Windows CE 5.0)
The following ARM assembler directives control initialization and store layout.
Directive | Syntax | Description |
---|---|---|
# |
|
Reserves 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 the FIELD directive. |
% |
|
Identical to the SPACE directive. |
& |
|
Identical to DCD, above. |
^ |
|
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 can 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 the MAP directive. |
= |
|
Identical to the DCB directive. |
AREA |
|
Marks a new code or data section, which is an independent, named, indivisible chunk manipulated by the linker. The AREA directive names the section and sets its attributes.
Use at least one AREA directive for an assembly. Use AREA directives to define the use of local labels. Use the AREA directive to subdivide a source file into sections. You can use the same name in more than one AREA directive. All areas with the same name are placed in the same section. Normally, you should use separate sections for code and data. |
DCB |
|
Defines one or more bytes.
Expression-list can include string expressions. Requires an explicit trailing NULL. Also requires a DATA directive if used to define labeled data in Thumb code. Identical to the = directive. |
DCD |
|
Defines one or more words, aligned on a 4-byte boundary.
Identical to the & directive. |
DCDO |
|
Defines one or more words, aligned on 4-byte boundaries, as an offset from the static base register, sb (r9). |
DCDU |
|
Defines one or more words, not necessarily aligned.
Use the ALIGN directive after if DCDU is followed by code. |
DCFD |
|
Defines double-precision floating-point values.
Adds padding before the first defined number to align to a 4-byte boundary. |
DCFDU |
|
Defines arbitrarily aligned double-precision floating-point values. |
DCFS |
|
Defines single-precision floating-point values.
Adds padding before the first defined number to align to a 4-byte boundary. |
DCFSU |
|
Defines arbitrarily aligned single-precision floating-point values. |
DCI |
|
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 |
|
Defines one or more half words aligned on 2-byte boundaries.
Expressions should evaluate to an integer between –32768 and 65535. |
DCWU |
|
Defines one or more half words, not necessarily aligned.
Expressions should evaluate to an integer between –32768 and 65535. Use the ALIGN directive afterward if DCWU is followed by code. |
FIELD |
|
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 the # directive. |
MAP |
|
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 can 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 the ^ directive. |
SPACE |
|
Reserves a zeroed area of the store.
Sets to 0 the number of bytes specified by numeric-expression. Identical to the % directive. |
**Note **For information about attributes for the AREA directive, see AREA Directive Attributes.
**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 1 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
Send Feedback on this topic to the authors