<?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>Put assembler code into c code</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/16762/put-assembler-code-into-c-code</link><description> Hello, 
I am trying to put a assembler code into a c code, but it gives me errors. 
I would be pleased if someone explains me how to do it or gives me an example. 
Thank you very much </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Put assembler code into c code</title><link>https://community.arm.com/thread/122394?ContentTypeID=1</link><pubDate>Mon, 31 May 2004 07:05:04 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2101d5ae-fc99-40a6-9a12-8b1ef7bad87f</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;Write an assembler function that does it; call the funtion from &amp;#39;C&amp;#39;.&lt;br /&gt;
&lt;br /&gt;
As I keep saying, there is &lt;i&gt;&lt;b&gt;no&lt;/b&gt;&lt;/i&gt; single language that can be perfect for every conceivable application:&lt;br /&gt;
&lt;br /&gt;
Assembler gives you absolute control, and direct access to every aspect of the processor, but is extremely expensive in terms of programmer time &amp;amp; effort;&lt;br /&gt;
&lt;br /&gt;
&amp;#39;C&amp;#39; is far more economical pf programmer resources, but direct manipulation of individual bits is not its strong point.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;quot;I could use masks to know the top bit and the bottom bit at every pass but it increases the cpu load a lot.&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
You need to ask yourself this question: what is more important to you - writing in &amp;#39;C&amp;#39;, or minimising the &lt;i&gt;&amp;quot;CPU load?&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
The trouble with&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Put assembler code into c code</title><link>https://community.arm.com/thread/110901?ContentTypeID=1</link><pubDate>Mon, 31 May 2004 06:08:09 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2949d04e-fa64-46fe-9ffb-be22f4b8ce76</guid><dc:creator>jordi sangenis</dc:creator><description>&lt;p&gt;My problem: I have a table and I want to shift all the elements of the table. The bit that goes out from a byte have to entry to the next byte.&lt;br /&gt;
&lt;br /&gt;
I could use masks to know the top bit and the bottom bit at every pass but it increases the cpu load a lot.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Put assembler code into c code</title><link>https://community.arm.com/thread/96343?ContentTypeID=1</link><pubDate>Mon, 31 May 2004 05:10:48 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:05865626-0660-4117-ac9e-02e348298893</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;i&gt;&amp;quot;I only want to rotate a register throw the carry in c&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
You too, eh?&lt;br /&gt;
&lt;a href="http://www.8052.com/forum/read.phtml?id=71318" target="_blank"&gt;http://www.8052.com/forum/read.phtml?id=71318&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Same question, two different names, two different forums, but the same answer:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;DO NOT DO THIS!&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;quot;Could it be possible?&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Not with any sort of reliability, &lt;b&gt;NO!&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
You &lt;i&gt;&lt;b&gt;cannot&lt;/b&gt;&lt;/i&gt; assume this level of control over specific CPU registers &amp;amp; instructions when you program in &amp;#39;C&amp;#39;.&lt;br /&gt;
(yes, you &lt;i&gt;might&lt;/i&gt; come across a specifc instance where it appears to work, but you have &lt;i&gt;&lt;b&gt;no&lt;/b&gt;&lt;/i&gt; guarantee that it will continue to work with changes in surrounding code, changes to Project options, changes to newer compiler versions, etc, etc, etc,...)&lt;br /&gt;
&lt;br /&gt;
Anyway, the fundamental question is &lt;b&gt;WHY&lt;/b&gt; do you want to do this?&lt;br /&gt;
What exactly are you trying to &lt;i&gt;achieve?&lt;/i&gt;&lt;br /&gt;
&lt;a href="http://www.8052.com/forum/read.phtml?id=71320" target="_blank"&gt;http://www.8052.com/forum/read.phtml?id=71320&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Put assembler code into c code</title><link>https://community.arm.com/thread/72521?ContentTypeID=1</link><pubDate>Mon, 31 May 2004 02:29:10 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7fd96327-72d1-46ed-b11e-ff60d6d24951</guid><dc:creator>jordi sangenis</dc:creator><description>&lt;p&gt;I only want to rotate a register throw the carry in c but I can&amp;#39;t.&lt;br /&gt;
Could it be possible?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Put assembler code into c code</title><link>https://community.arm.com/thread/42284?ContentTypeID=1</link><pubDate>Fri, 28 May 2004 10:47:29 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:01bd325f-2c9f-4616-89af-e5bf2dfbc1e5</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;b&gt;DON&amp;#39;T DO IT!!&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
If you need assembly, write an assembly module - as I said only 2 hours ago, in this thread: &lt;a href="http://www.keil.com/forum/docs/thread4547.asp"&gt;http://www.keil.com/forum/docs/thread4547.asp&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>