<?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>Wrong code generation.</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/14463/wrong-code-generation</link><description> I&amp;#39;m using the Keil C251 Compiler 
Optimizing 80251 C Compiler 
Version 1.x 
(DLL 1.24) 
 
The following instruction is in a function called after an SIO Interrupt: 
 
byLength = abyRecBuf[0] 
 
And the generated code is 
7E7301D0 MOV R7,ABYRECBUF 
7E004D</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Wrong code generation.</title><link>https://community.arm.com/thread/37990?ContentTypeID=1</link><pubDate>Tue, 30 Oct 2001 08:15:09 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:89be389c-38bf-4a6d-828e-f724960203c2</guid><dc:creator>Thomas Mazowiesky</dc:creator><description>&lt;p&gt;We&amp;#39;ve been using the 251 compiler for a couple of years and haven&amp;#39;t seen a bug like this.  One thing to do is to turn off the optimization and see if this fixes the problem.  Have you checked with the simulator or an emulator to make sure that there is a real bug? Sometimes the compiled code is not...obvious, especially with the expanded 251 instruction set.  &lt;br /&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: Wrong code generation.</title><link>https://community.arm.com/thread/53929?ContentTypeID=1</link><pubDate>Tue, 30 Oct 2001 06:14:31 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:0236a560-73a1-41d8-84a1-e7cc095a68be</guid><dc:creator>KIENTZ Gabriel</dc:creator><description>&lt;p&gt;Yes the code is actally wrong, seeing that after the execution of the c-line :&lt;br /&gt;
&lt;br /&gt;
byLength = abyRecBuf[0];&lt;br /&gt;
&lt;br /&gt;
The value of byLength is wrong.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wrong code generation.</title><link>https://community.arm.com/thread/37988?ContentTypeID=1</link><pubDate>Tue, 30 Oct 2001 05:12:27 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:759cda75-323b-45f2-b38c-843f2c9edb36</guid><dc:creator>Graham Cole</dc:creator><description>&lt;p&gt;I am only familiar with the C51, but I suspect that the same points apply. When looking at code, the disassembler will attempt to find labels that match a value - but it&amp;#39;s not psychic and consequently may display an inappropriate label that just happens to have the right value. This can be very confusing.&lt;br /&gt;
&lt;br /&gt;
The important question is: is the code &lt;b&gt;actually&lt;/b&gt; wrong?&lt;br /&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>