I want to write an inline assembly code, where I want to put some constant data, after the end of the code. This data is referenced from the code. If I am using DCD instruction or DCW instruction, compiler gives error as error: #3061: unrecognized instruction opcode . I am unable to figure out the possible problem of this error. I have checked the instruction in disassembly and written it in the same way. Also tried some more combinations but in each case it is giving me the same error. The approaches are listed below,
DCD 20000000 DCD 0x20000000 DCD #20000000 DCD &h20000000
I also tried to check in the documentation but I didn't found any example for inline assembly with this instruction. Can anyone please tell me to use the instruction? For pure assembly it works fine.
It is not technically an instruction Perhaps you can define an array with the data, or use the form LDR R0,=0x12345678
I personally try to avoid in-line assembler because it is extremely difficult to port. Consider placing routines in your startup.s file, and calling them.
Inline assembly does not allow the use of assembler directives.
www.keil.com/.../armcc_chr1359124258478.htm
Here is a list of assembler directives.
www.keil.com/.../armasm_dom1361290000455.htm
Why?
What do you wish to achieve that can't be achieved in 'C', and can't be achieved in a separate assembler module?
www.catb.org/.../smart-questions.html