Arm Community
Site
Search
User
Site
Search
User
Support forums
Compilers and Libraries forum
Invalid assembly instruction MOV PC, R13 Cortex M3
Jump...
Cancel
State
Not Answered
Locked
Locked
Replies
3 replies
Subscribers
18 subscribers
Views
4675 views
Users
0 members are here
Toolchain
Cortex-M3
Cortex-M
GNU
Options
Share
More actions
Cancel
Related
How was your experience today?
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion
Invalid assembly instruction MOV PC, R13 Cortex M3
Umut Umut
over 12 years ago
Note: This was originally posted on 24th March 2009 at
http://forums.arm.com
Hi,
I am trying to compile linux kernel 2.27 with CodeSourcery GNU toolchain 4.3.2 and somehow I am getting assembler error for instruction
MOV PC, R13
Well, for some reason ARM Cortex M3 assembler is not happy with moving link register (LR a.k.a R13) to program counter.
I tried to find some documentation about this issue on arm site but no luck so far. I have a way to find a solution for this which is first moving R13 (LR) to a general purpose register and then moving general purpose register to program counter (PC).
MOV R0, R13
MOV PC, R0
Thanks for the comments.
Parents
0
Peter Harris
over 12 years ago
Note: This was originally posted on 24th March 2009 at
http://forums.arm.com
Thumb2 reduces the number of operations which can target the SP, LR and PC as they have become much more heavily architected to allow hardware stack support for example. That said - not sure why MOV PC, LR isn't working - it is still allowed as far as I can tell...
The recommended approach for modifying the PC is to use B lr or BX lr - that should still work and have the same effect.
Cancel
Vote up
0
Vote down
Cancel
Reply
0
Peter Harris
over 12 years ago
Note: This was originally posted on 24th March 2009 at
http://forums.arm.com
Thumb2 reduces the number of operations which can target the SP, LR and PC as they have become much more heavily architected to allow hardware stack support for example. That said - not sure why MOV PC, LR isn't working - it is still allowed as far as I can tell...
The recommended approach for modifying the PC is to use B lr or BX lr - that should still work and have the same effect.
Cancel
Vote up
0
Vote down
Cancel
Children
No data