<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Simple asm question</title><link>https://community.arm.com/developer/tools-software/tools/f/armds-forum/643/simple-asm-question</link><description> </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Simple asm question</title><link>https://community.arm.com/thread/1614?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2013 10:59:07 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b1024058-c319-44a6-a395-4d4578031529</guid><dc:creator>Bhaveet Shah</dc:creator><description>&lt;div&gt;&lt;i&gt;Note: This was originally posted on 25th July 2009 at &lt;a href="http://forums.arm.com"&gt;http://forums.arm.com&lt;/a&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Why does LR holds 0x42 ?&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;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.&amp;#160; After registers R0 to R3 are used, generally, other arguments are passed on the stack...&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple asm question</title><link>https://community.arm.com/thread/1615?ContentTypeID=1</link><pubDate>Wed, 11 Sep 2013 10:59:07 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e8f0df55-1876-47aa-b602-82632253a76c</guid><dc:creator>Simon Craske</dc:creator><description>&lt;div&gt;&lt;i&gt;Note: This was originally posted on 24th July 2009 at &lt;a href="http://forums.arm.com"&gt;http://forums.arm.com&lt;/a&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;forumer,&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;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.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;Thus, the parameters for:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;[font=&amp;quot;Courier New&amp;quot;]printf(&amp;quot;Foo %d %f %d\n&amp;quot;, 34, (12.0), 67);[/font]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;are passed as:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;[font=&amp;quot;Courier New&amp;quot;]r0 = char * = &amp;quot;Foo %d %f %d\n&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;r1 = int = 0x22 = 34&lt;/span&gt;&lt;br /&gt;&lt;span&gt;{r2,r3} = double = 0x40280...00 = 12.0&lt;/span&gt;&lt;br /&gt;&lt;span&gt;sp[0] = int = 0x43 = 67[/font]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;hth&lt;/span&gt;&lt;br /&gt;&lt;span&gt;s.&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>