<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/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/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>inline assembler</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15819/inline-assembler</link><description>Good day, 
 I try to add inline assembler like this: 
 asm(&amp;quot;POP {R12,PC}&amp;quot;);
 
 but I have an error: 
 Error[Og006]: Error in inline assembly: &amp;quot;Error[401]: Operand syntax error&amp;quot;
 
 I have read that I should change the processor mode in code settings</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 18 Aug 2016 10:23:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15819/inline-assembler" /><item><title>RE: inline assembler</title><link>https://devzone.nordicsemi.com/thread/60397?ContentTypeID=1</link><pubDate>Thu, 18 Aug 2016 10:23:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78a8815b-9146-439f-91e5-0579d2eb4169</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;This is not a Nordic related question, This is purely ARM related.&lt;/p&gt;
&lt;p&gt;Please read the post about push and pop &lt;a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0497a/BABIAJHJ.html"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You cannot use registers after R7 in these operations&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;3.4.6. PUSH and POP&lt;br /&gt;
Restrictions In these instructions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;reglist must use only R0-R7.&lt;/li&gt;
&lt;li&gt;The exception is LR for a PUSH and PC for a POP.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;change your asm to &lt;code&gt;asm(&amp;quot;POP {R7,PC}&amp;quot;)&lt;/code&gt;; and it should work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>