BX lr on ARMv7 in asasm
Tristan M. (2946) 1039 posts |
This seems like the best place to ask. While messing around with my GCC, gas, asasm and DDE HAL nightmare I came across something. asasm is less than happy about me using BX on ARMv7. It throws a warning. I changed it to use PUSH {lr} and POP {pc}. Is that the best way? I couldn’t find another solution for ARMv7. I know BX works, but asasm doesn’t seem happy about it. |
Jeffrey Lee (213) 6048 posts |
Are you specifying the right CPU/architecture?
MOV PC,LR On ARMv7+ all ALU instructions which write to the PC perform interworking branches, so MOV PC,Rxx is functionally equivalent to BX Rxx. Although for RISC OS this doesn’t really matter since we don’t use/support Thumb mode. |
Tristan M. (2946) 1039 posts |
It is?
Definitely maybe!
|
Jeffrey Lee (213) 6048 posts |
The tooloptions file sets up aliases that specify the CPU type for both the C compiler and assembler (I’m not quite sure why it’s done this way – I have a feeling it predates the shared makefiles). So if you compare an objasm command line to an asasm command line then you might think that they’re the same, when in reality there’s some extra options hidden away in the alias. For a GCC HAL it would probably make sense to just explicitly specify the right CPU options within your makefile. |