Arm Community
Site
Search
User
Site
Search
User
Support forums
Arm Development Studio forum
Simple asm question
Jump...
Cancel
Locked
Locked
Replies
2 replies
Subscribers
119 subscribers
Views
2561 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
Simple asm question
Vincent R
over 12 years ago
Simon Craske
over 12 years ago
Note: This was originally posted on 24th July 2009 at
http://forums.arm.com
forumer,
The simple piece of information you appear to be missing is that the double representation of 12.0 requires two ARM registers (in this case r2 and r3), and has the hexidecimal equivalent of 0x4028000000000000.
Thus, the parameters for:
[font="Courier New"]printf("Foo %d %f %d\n", 34, (12.0), 67);[/font]
are passed as:
[font="Courier New"]r0 = char * = "Foo %d %f %d\n"
r1 = int = 0x22 = 34
{r2,r3} = double = 0x40280...00 = 12.0
sp[0] = int = 0x43 = 67[/font]
hth
s.
Cancel
Vote up
0
Vote down
Cancel
Bhaveet Shah
over 12 years ago
Note: This was originally posted on 25th July 2009 at
http://forums.arm.com
Why does LR holds 0x42 ?
LR actually holds 0x43 and is used as a temporary register to store the 4th argument (3rd variadic one) on the stack - at offset 0x11020. After registers R0 to R3 are used, generally, other arguments are passed on the stack...
Cancel
Vote up
0
Vote down
Cancel