Arm Community
Site
Search
User
Site
Search
User
Support forums
Arm Development Studio forum
Concept of Scratch and Preserved Registers
Jump...
Cancel
Locked
Locked
Replies
4 replies
Subscribers
119 subscribers
Views
18333 views
Users
0 members are here
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
Concept of Scratch and Preserved Registers
Muhammad Ahsan
over 12 years ago
Hi,
I am confused in understanding the difference between scratch and preserved registers. I have read the development guide of IAR Embedded Workbench but the topic was written in such a way that I could not get the real sence of it.
Any help or if possible some example that can help me differenciating between the both will be regarded.
Thanks in advance
Top replies
Martin Weidmann
over 12 years ago
+1
Note: This was originally posted on 5th April 2011 at http://forums.arm.com I've not used IAR's tools, but I'm assuming it follows the AAPCS (Procedure Call Standard for the ARM Architecture). The AAPCS...
Parents
Alexei Toumantsev
over 12 years ago
Note: This was originally posted on 5th April 2011 at
http://forums.arm.com
r4-r11 - protected
And r13, r14 too, of course. To the OP - AAPCS is what you need to google for.
Note that the rules stated above are not any sort of 'restrictions' imposed by ARM CPU, some people get confused by this.
All registers in ARM (except for r14 (lr) and r15 (pc)) are mutually interchangeable ("equal in rights").
But most compilers follow the AAPCS rules to avoid compatibility problems (otherwise, it would be difficult to link together libraries produced with different compilers, for example).
Cancel
Vote up
0
Vote down
Cancel
Reply
Alexei Toumantsev
over 12 years ago
Note: This was originally posted on 5th April 2011 at
http://forums.arm.com
r4-r11 - protected
And r13, r14 too, of course. To the OP - AAPCS is what you need to google for.
Note that the rules stated above are not any sort of 'restrictions' imposed by ARM CPU, some people get confused by this.
All registers in ARM (except for r14 (lr) and r15 (pc)) are mutually interchangeable ("equal in rights").
But most compilers follow the AAPCS rules to avoid compatibility problems (otherwise, it would be difficult to link together libraries produced with different compilers, for example).
Cancel
Vote up
0
Vote down
Cancel
Children
No data