Arm Community
Site
Search
User
Site
Search
User
Groups
Education Hub
Distinguished Ambassadors
Open Source Software and Platforms
Research Collaboration and Enablement
Forums
AI and ML forum
Architectures and Processors forum
Arm Development Platforms forum
Arm Development Studio forum
Arm Virtual Hardware forum
Automotive forum
Compilers and Libraries forum
Graphics, Gaming, and VR forum
High Performance Computing (HPC) forum
Infrastructure Solutions forum
Internet of Things (IoT) forum
Keil forum
Morello forum
Operating Systems forum
SoC Design and Simulation forum
SystemReady Forum
Blogs
AI and ML blog
Announcements
Architectures and Processors blog
Automotive blog
Graphics, Gaming, and VR blog
High Performance Computing (HPC) blog
Infrastructure Solutions blog
Internet of Things (IoT) blog
Operating Systems blog
SoC Design and Simulation blog
Tools, Software and IDEs blog
Support
Arm Support Services
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
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
19 subscribers
Views
4453 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 11 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 11 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
Up
0
Down
Cancel
Reply
0
Peter Harris
over 11 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
Up
0
Down
Cancel
Children
No data