You copied the Doc URL to your clipboard.

21.16 DCD and DCDU

The DCD directive allocates one or more words of memory, aligned on four-byte boundaries, and defines the initial runtime contents of the memory. DCDU is the same, except that the memory alignment is arbitrary.


{label} DCD{U} expr{,expr}



is either:

  • A numeric expression.

  • A PC-relative expression.


DCD inserts up to three bytes of paddingbefore the first defined word, if necessary, to achieve four-bytealignment.

Use DCDU if you do not require alignment.

& is a synonym for DCD.


data1   DCD     1,5,20      ; Defines 3 words containing                            ; decimal values 1, 5, and 20data2   DCD     mem06 + 4   ; Defines 1 word containing 4 +                            ; the address of the label mem06        AREA    MyData, DATA, READWRITE        DCB     255         ; Now misaligned ...data3   DCDU    1,5,20      ; Defines 3 words containing                            ; 1, 5 and 20, not word aligned

Related concepts

Was this page helpful? Yes No