The usage for ”.arm”(.code 32) of ARM Machine Directives
The usage for ”.arm”(.code 32) of ARM Machine Directives
Do you support RA series of Renesas microcomputers?
If you support it, I would like to know how to write “.arm” (or “.code 32”).
We used GNU ARM Embedded Toolchain in e2stuido.
Target Processor is “cortex-m4″.(Products name : RA6M1)
We writed ARM directives in the assembler file.
We wanted to execute the PUSH and POP instructions for the Hi register.
However, the error occurs on the parts of PUSH instruction.
( Error: selected processor does not support ARM opcodes)
Are we something missing before Arm directive(.arm) ?
—– The example of writting the source code —–
.section mycode,”x”
.arm
CPU_Test_General_High:
PUSH {R8-R10} // stack <– R8, R9, R10
MOVW R8, #0x5555 // MOV 0x55555555h -> R8
MOVT R8, #0x5555
MOVW R9, #0x5555 // MOV 0x55555555h -> R9
MOVT R9, #0x5555
CMP R8, R9
BNE Test_Failed
————————————————————-
Please answer the question.
Best Regards,
Hiroyuki Nakao
Hello,
Thank you for reaching out to us!
Your target device RA6M1 comes with an ARM cortex-m4 processor which is a Thumb-only processor.
Hence the directive you want to use is .thumb. Changing the .arm directive to .thumb should fix the issue.
Please let us know if we can be of further assistance,
__
Thank you,
The GNU Tools Team
Hello,
Thank you for your reply! When writing thumb instructions you also need to add the .syntax unified directive because the default, divided, uses the old style where ARM and THUMB instructions had their own, separate syntaxes.
I have tried with the following sample code:
.thumb
.syntax unified
PUSH {r8-r10}
POP {r0-r7}
The disassembly is shown bellow.
Disassembly of section .text:
00000000 <.text>:
0: e92d 0700 stmdb sp!, {r8, r9, sl} 4: bcff pop {r0, r1, r2, r3, r4, r5, r6, r7}
If this does still not work for you please let us know your compiler/assembler options and we will investigate further.
Please let us know if we can be of further assistance,
__
Thank you,
The GNU Tools Team
Hello,
Thank you for reaching out to us.
As we explained, these processors are thumb only, so using the .thumb directive is what you need.
Because you are using the unified syntax (the same syntax for ARM and Thumb) you also need the .syntax unified directive.
So to recognize this as ARM instruction set you need to use both directives.
.thumb
.syntax unified
If you are still having issues with these, please send us an example with the instructions and compiler options you are using.
__
Thank you,
The GNU Tools Team