Arm Community
Site
Search
User
Site
Search
User
Support forums
Arm Development Studio forum
Restoring Resister Values
Jump...
Cancel
Locked
Locked
Replies
3 replies
Subscribers
119 subscribers
Views
3040 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
Restoring Resister Values
Muhammad Ahsan
over 12 years ago
Note: This was originally posted on 17th March 2011 at
http://forums.arm.com
Hi,
I am working with Cortex M3 and I wrote a program in which I am calling a C function that is implemented in Assembly language. Four parameters are passed to the function, which are assigned to the Registers R0-R3. After performing some calculations on R0-R3 in the subroutine implemented in assembly language, when I return back to the C function the values of the R0-R3 are not the same as at the function's entry point rather R0-R3 contain results of the calculations performed in the subroutines. How can I get the same values back as they were at the starting point of the function call?
Looking forward for some useful hint.
Thanks and Regards
Parents
Etienne SOBOLE
over 12 years ago
Note: This was originally posted on 17th March 2011 at
http://forums.arm.com
PUSH {r4,lr} ;// Preserve return address (r4 also pushed to maintain SP alignment)
Interesting.
Is it really usefull.
I assume that the alignment is usefull to push double (for example) on the next call.
I'll have a look at what gcc do...
Cancel
Vote up
0
Vote down
Cancel
Reply
Etienne SOBOLE
over 12 years ago
Note: This was originally posted on 17th March 2011 at
http://forums.arm.com
PUSH {r4,lr} ;// Preserve return address (r4 also pushed to maintain SP alignment)
Interesting.
Is it really usefull.
I assume that the alignment is usefull to push double (for example) on the next call.
I'll have a look at what gcc do...
Cancel
Vote up
0
Vote down
Cancel
Children
No data