<?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>What C51 needs really bad is ...</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/14276/what-c51-needs-really-bad-is</link><description> Inline assembly! 
 
asm { 
;you assembly code goes here. 
} 
 
My version is so out of date, tho, it may already support it and I don&amp;#39;t even know. </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: What C51 needs really bad is ...</title><link>https://community.arm.com/thread/129680?ContentTypeID=1</link><pubDate>Mon, 18 Jun 2001 11:46:46 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2f9b0ff9-87c3-4775-9727-6585bb3d81c1</guid><dc:creator>Jon Ward</dc:creator><description>&lt;p&gt;&lt;i&gt;Can you say that this 2 ways always produce the same .OBJ:&lt;br /&gt;
1) .C --&amp;gt; .OBJ&lt;br /&gt;
2) .C --&amp;gt; .SRC --&amp;gt; .OBJ&lt;br /&gt;
in case of no using any #pragma asm/endasm ?&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
1 != 2.&lt;br /&gt;
&lt;br /&gt;
There are several reasons why.&lt;br /&gt;
&lt;br /&gt;
1. When you compile a C file and generate an OBJ file, the compiler injects debug information into the OBJ file.  Things like line number-address offsets are included.  When you compile a file with SRC and then assemble the SRC file, the object file has debug information from the assembler, and the line numbers refer to the SRC file (not the C file).&lt;br /&gt;
&lt;br /&gt;
2. When you compile a C file and generate an OBJ file, the C compiler includes references to the standard C library files (C51S, C51C, or C51L).  When you create a SRC file, these references are not included.  So, if you have a 1-file project that is compiled as a SRC file, you&amp;#39;ll have to include the C libraries manually.&lt;br /&gt;
&lt;br /&gt;
3. When you create a SRC file, most optimizations are disabled to about side-effects that interfere with your in-line assembly.  Additionally, the compiler attempts to color registers and doesn&amp;#39;t &amp;quot;know&amp;quot; about the in-line code that you enter.  That text is passed verbatim to the SRC file for assembly by the assembler.  Ergo, the compiler can&amp;#39;t make rational decisions about the in-line code you have.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Jon&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What C51 needs really bad is ...</title><link>https://community.arm.com/thread/129677?ContentTypeID=1</link><pubDate>Mon, 18 Jun 2001 03:03:17 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:34c71a29-e058-4fb6-990e-fa72023d879b</guid><dc:creator>Andrew Neil</dc:creator><description>&lt;p&gt;&lt;i&gt;&lt;pre&gt;Can you say that this 2 ways always produce the same .OBJ:
1) .C --&amp;gt; .OBJ
2) .C --&amp;gt; .SRC --&amp;gt; .OBJ
in case of no using any #pragma asm/endasm ?&lt;/pre&gt;&lt;/i&gt;
&lt;br /&gt;
Method (2) means that you have to call &lt;b&gt;both&lt;/b&gt; C51.exe &lt;b&gt;and&lt;/b&gt; A51.exe separately, so you&amp;#39;d have to ensure that &lt;b&gt;all&lt;/b&gt; your command-line options matched &lt;b&gt;precisely&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Also, I&amp;#39;m not sure whether C51 disables all optimisation when generating .SRC?&lt;br /&gt;
(this could make sense, given Jon&amp;#39;s earlier comments about &amp;quot;tweakability&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What C51 needs really bad is ...</title><link>https://community.arm.com/thread/121614?ContentTypeID=1</link><pubDate>Mon, 18 Jun 2001 01:07:01 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e1df6276-ba53-4252-8760-cb84599e0cda</guid><dc:creator>Sergey Dymchishin</dc:creator><description>&lt;p&gt;&amp;gt;The KEIL C compiler generates the .OBJ &lt;br /&gt;
&amp;gt;file without calling or running the assembler. &lt;br /&gt;
&amp;gt;Therefore, when you include in-line assembly statements, &lt;br /&gt;
&amp;gt;we chose to simply generate a .SRC file and let you assemble it. &lt;br /&gt;
&amp;gt;The rationale behind that is that if you are generating &lt;br /&gt;
&amp;gt;assembler code from the compiler, you are probably going &lt;br /&gt;
&amp;gt;to want to hand tweak it somewhat.&lt;br /&gt;
&lt;br /&gt;
Can you say that this 2 ways always produce the same .OBJ:&lt;br /&gt;
  1) .C --&amp;gt; .OBJ&lt;br /&gt;
  2) .C --&amp;gt; .SRC --&amp;gt; .OBJ&lt;br /&gt;
in case of no using any #pragma asm/endasm ?&lt;br /&gt;
&lt;br /&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What C51 needs really bad is ...</title><link>https://community.arm.com/thread/109813?ContentTypeID=1</link><pubDate>Sat, 16 Jun 2001 18:48:41 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:59ae92f2-9b0c-48c8-9673-be590ff5d2d1</guid><dc:creator>Jon Ward</dc:creator><description>&lt;p&gt;I guess the REAL questions is &amp;quot;How does the Keil C51 compiler generate an OBJ file?&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Many C compilers generate assembler output that must then be assembled with an assembler.  This is a 2-step process that requires running the C compiler and then the assembler.&lt;br /&gt;
&lt;br /&gt;
Many C compilers make this transparent and run the assembler for you (without you knowing it).&lt;br /&gt;
&lt;br /&gt;
The KEIL C compiler generates the .OBJ file without calling or running the assembler.  Therefore, when you include in-line assembly statements, we chose to simply generate a .SRC file and let you assemble it.  The rationale behind that is that if you are generating assembler code from the compiler, you are probably going to want to hand tweak it somewhat.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Jon&lt;/b&gt;&lt;br /&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What C51 needs really bad is ...</title><link>https://community.arm.com/thread/94796?ContentTypeID=1</link><pubDate>Fri, 15 Jun 2001 19:32:18 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4c7cbc12-4aab-4e19-9dde-a183e82c2e22</guid><dc:creator>Andrew Neil</dc:creator><description>&lt;p&gt;Not sure what you&amp;#39;re getting at there, Erik?&lt;br /&gt;
&lt;br /&gt;
Keil, in common with some other compiler writers, have chosen to implement inline assembler &lt;i&gt;via&lt;/i&gt; .SRC and the Assembler.&lt;br /&gt;
&lt;br /&gt;
But isn&amp;#39;t it fun, anyway!?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What C51 needs really bad is ...</title><link>https://community.arm.com/thread/53719?ContentTypeID=1</link><pubDate>Fri, 15 Jun 2001 16:43:29 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d889d9fb-07cc-4415-9e20-72c3dd97dfb4</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;The REAL method, not the .SRC workaround, where is it documented?, my manual document the .SRC.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What C51 needs really bad is ...</title><link>https://community.arm.com/thread/53718?ContentTypeID=1</link><pubDate>Fri, 15 Jun 2001 10:45:12 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b0b15bb7-b0bd-439a-ad64-b8a94aca51aa</guid><dc:creator>Jon Ward</dc:creator><description>&lt;p&gt;Actually, inline assembly has been available since before version 4.&lt;br /&gt;
&lt;br /&gt;
Take a look at #pragma asm, #pragma endasm, and #pragma src in the C51 user&amp;#39;s guilde.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Jon&lt;/b&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What C51 needs really bad is ...</title><link>https://community.arm.com/thread/37603?ContentTypeID=1</link><pubDate>Fri, 15 Jun 2001 03:07:22 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f67e2f46-2e71-42ef-9772-54a494747c31</guid><dc:creator>Andrew Neil</dc:creator><description>&lt;p&gt;What version do you have?&lt;br /&gt;
&lt;br /&gt;
It&amp;#39;s been available since at least v6.03!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>