<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>CodeWarrior for MCUのトピックRe: C code not generating correct assembly</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/C-code-not-generating-correct-assembly/m-p/133489#M1428</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;Basically the compiler is optimizing access to global variables. If you have something like&lt;/P&gt;&lt;P&gt;var = 4;&lt;/P&gt;&lt;P&gt;var = 5;&lt;/P&gt;&lt;P&gt;the compiler will only generate code to assign 5&amp;nbsp;to var.&lt;/P&gt;&lt;P&gt;To make sure the compiler does not optimize access to&amp;nbsp;a variable, define it as volatile.&amp;nbsp;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Apr 2006 16:22:26 GMT</pubDate>
    <dc:creator>CrasyCat</dc:creator>
    <dc:date>2006-04-25T16:22:26Z</dc:date>
    <item>
      <title>C code not generating correct assembly</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/C-code-not-generating-correct-assembly/m-p/133486#M1425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;I am using CW and noticed code that I wrote to set a variable is being ignored, sometimes.&amp;nbsp; I looked at the assemly listing.&amp;nbsp; '08ap32&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Any ideas?&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Apr 2006 23:04:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/C-code-not-generating-correct-assembly/m-p/133486#M1425</guid>
      <dc:creator>ScottC</dc:creator>
      <dc:date>2006-04-24T23:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: C code not generating correct assembly</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/C-code-not-generating-correct-assembly/m-p/133487#M1426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;It would help to have a look at your code and know what optimization level you're using with the compiler. When generating highly optimized code, the compiler may interpret some code is being run once and can be optimized out of existence.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2006 02:11:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/C-code-not-generating-correct-assembly/m-p/133487#M1426</guid>
      <dc:creator>J2MEJediMaster</dc:creator>
      <dc:date>2006-04-25T02:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: C code not generating correct assembly</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/C-code-not-generating-correct-assembly/m-p/133488#M1427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I am just setting a global variable.&amp;nbsp; In one section of the code it is ignored.&amp;nbsp; In another, the code in the listing file is as it should be.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;It happens to be ignored in the same in the same routine when set at different times.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;How do I check optimization settings?&lt;/DIV&gt;&lt;P&gt;Message Edited by Scott C on &lt;SPAN class="date_text"&gt;04-24-2006&lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;04:47 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Message Edited by Scott C on &lt;SPAN class="date_text"&gt;04-24-2006&lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;04:53 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Message Edited by Scott C on &lt;SPAN class="date_text"&gt;04-24-2006&lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;04:54 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2006 04:46:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/C-code-not-generating-correct-assembly/m-p/133488#M1427</guid>
      <dc:creator>ScottC</dc:creator>
      <dc:date>2006-04-25T04:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: C code not generating correct assembly</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/C-code-not-generating-correct-assembly/m-p/133489#M1428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;Basically the compiler is optimizing access to global variables. If you have something like&lt;/P&gt;&lt;P&gt;var = 4;&lt;/P&gt;&lt;P&gt;var = 5;&lt;/P&gt;&lt;P&gt;the compiler will only generate code to assign 5&amp;nbsp;to var.&lt;/P&gt;&lt;P&gt;To make sure the compiler does not optimize access to&amp;nbsp;a variable, define it as volatile.&amp;nbsp;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2006 16:22:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/C-code-not-generating-correct-assembly/m-p/133489#M1428</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2006-04-25T16:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: C code not generating correct assembly</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/C-code-not-generating-correct-assembly/m-p/133490#M1429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I just define it to pass to another routine, but I will give it a try.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2006 20:01:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/C-code-not-generating-correct-assembly/m-p/133490#M1429</guid>
      <dc:creator>ScottC</dc:creator>
      <dc:date>2006-04-25T20:01:27Z</dc:date>
    </item>
  </channel>
</rss>

