On 04/12/11 04:42, Александр Хорошко wrote:
Hello!
I’m trying to assemble the .s file using “arm-none-eabi-gcc -x
assembler-with-cpp”, with options: -c –g
-Wa,-mcpu=cortex-m3,-mimplicit-it=always,-march=armv7-m.
I will try to help - but a better place to ask these questions will be
on the Binutils mailing list (binutils@xxxxxxxxxxxxxx) as they are
assembler specific, and not compiler specific. If you do ask your
questions there please provide a complete testcase (including a small
source-code example) as that will help identify your issues.
Supplying both -mcpu=cortex-m3 and -march=armv7-m is not necessary.
With these options, as far as I understand, I explicitly ask to accept
conditional constructs in any state (ARM / thumb/ thumb-2), but when I
try to assemble “ADDNE r3, r2, r0” in any variation, the result is
“Error: Thumb does not support conditional execution”. Same operation
doesn’t assemble inside IT block, example: “IT NE *new line here*
ADD r3, r0”, the result: “Error: instruction not allowed in IT block
-- `add r3,r0'”
You need to put the condition code on every instruction in the IT block.
So your example should read:
it ne
addne r3, r3, r0
-mimplicit-it=always means that the assembler will insert the
appropriate IT instruction before a conditional block of code
automatically. However, you always have to put the condition code on
any conditional instruction.
Also, I’m having troubles with TST instruction – the 32-bit variant
doesn’t want to assemble either – “tst r1, #(any constant here)”
result in “Error: unshifted register required -- `tst r1,#1”
You probably need to put the following directive somewhere near the
start of your assembly source:
.syntax unified
This turns on Unified Assembly Language which is required to get all the
features of Thumb-2.
The gas info pages should help explain this further.
Thanks,
Matt
--
Matthew Gretton-Dann
Principal Engineer, PD Software - Tools, ARM Ltd