5.8.27. DCW directive

The DCW directive allocates one or more halfwords of memory, aligned on 2-byte boundaries, and defines the initial runtime contents of the memory.

Syntax

The syntax of DCW is:

{label} DCW expression{,expression}...

where:

expression

is a numeric expression that evaluates to an integer in the range –32768 to 65535. See Numeric expressions.

Usage

You must use a DATA directive if you use DCW to define labeled data within Thumb code. Refer to DATA directive for more information.

If DCW is followed by an instruction, use an ALIGN directive to ensure that the instruction is word aligned. Refer to ALIGN directive for more information.

DCW inserts a byte of padding before the first defined halfword if necessary to achieve 2-byte alignment. Use DCWU if you do not require alignment.

See also:

Example

		AREA		MiscData, DATA, READWRITE
data		DCW		-225,2*number					; number must already be
		DCW		number+4					; defined
Copyright © 1997, 1998 ARM Limited. All rights reserved.ARM DUI 0041C
Non-Confidential