Keil Logo

DCI

12.20 DCI

The DCI directive allocates two or four-byte aligned memory and defines the initial runtime contents of the memory.

Syntax

{label} DCI{.W} expr{,expr}
where:
expr
is a numeric expression.
.W
if present, indicates that four bytes must be inserted in Thumb code.

Usage

The DCI directive is very like the DCD or DCW directives, but the location is marked as code instead of data. Use DCI when writing macros for new instructions not supported by the version of the assembler you are using.
In ARM code, DCI allocates one or more words of memory, aligned on four-byte boundaries. It inserts up to three bytes of padding before the first defined word, if necessary, to achieve four-byte alignment.
In Thumb code, DCI allocates one or more halfwords of memory, aligned on two-byte boundaries. It inserts an initial byte of padding, if necessary, to achieve two-byte alignment.
You can use DCI to insert a bit pattern into the instruction stream. For example, use:
    DCI 0x46c0
to insert the Thumb operation MOV r8,r8.

Example macro

    MACRO           ; this macro translates newinstr Rd,Rm
                    ; to the appropriate machine code
    newinst     $Rd,$Rm
    DCI         0xe16f0f10 :OR: ($Rd:SHL:12) :OR: $Rm
    MEND

32-bit Thumb example

    DCI.W   0xf3af8000   ; inserts 32-bit NOP, 2-byte aligned.
Related concepts
Non-ConfidentialPDF file icon PDF versionARM DUI0379H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.