简体   繁体   中英

ARM assembly DCD bad instruction

I am using yagarto's arm-none-eabi to compile the assembly code, but it gives the message

Error: bad instruction `a DCD 1,2,3'

When I am using the DCD instruction

Is it not legal to use? If not, how could I reserve memory spaces for data in ARM?

Thanks

The DCD directive is for RealView's assembler. If you're using the GNU assembler, try this instead:

a: .word 1,2,3

Note that you might have to take care of alignment yourself ( DCD automatically aligns the data on a word-boundary - I'm not sure that .word does that).

你试试这种方式 DCD 123 在这里 DCD 只取整数 32 位

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM