12.22 DCW and DCWU

The DCW directive allocates one or more halfwords of memory, aligned on two-byte boundaries, and defines the initial runtime contents of the memory. DCWU is the same, except that the memory alignment is arbitrary.

Syntax

{label} DCW{U} expr{,expr}...
where:
expr
is a numeric expression that evaluates to an integer in the range –32768 to 65535.

Usage

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

Examples

data    DCW     -225,2*number   ; number must already be defined
        DCWU    number+4
Related concepts
7.14 Numeric expressions
Related reference
12.15 DCB
12.16 DCD and DCDU
12.21 DCQ and DCQU
12.64 SPACE or FILL
Non-ConfidentialPDF file icon PDF versionARM DUI0379G
Copyright © 2007, 2008, 2011, 2012, 2014, 2015 ARM. All rights reserved.