<?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 Development Tools中的主题 CW7.1 port to CW10.5, general purpose registers</title>
    <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/CW7-1-port-to-CW10-5-general-purpose-registers/m-p/265177#M310</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Our team is in the process of porting a CW7.1 project to CW10.5, however we've not yet been able to successfully get the code up and running completely.&amp;nbsp; The issue we've encountered is that we continually run into exception errors.&amp;nbsp; Aside from the exception errors, I'm experiencing an issue which is making if difficult to get to root cause.&amp;nbsp; The problem is, when I step through the disassembly for a specific assembly function, "setintlevel" in this case, the "d1" register is not passed the value from "d0" on the initial instruction.&amp;nbsp; In this particular case "d0" contains the expected value.&amp;nbsp; This is a problem because "d1" is eventually used to update the "SR".&amp;nbsp; I have experimented with adding a line, just below the "move.l&amp;nbsp; d0,d1" where "d2" is passed the value from "d0" and that seems to work fine.&amp;nbsp; For other calls to this function however, I see that "d0" contains garbage on entry to this function.&amp;nbsp; &lt;STRONG&gt;The question I have is, has anyone seen situations where the general purpose registers are not updated as expected when viewing and stepping through the disassembly code in CW10.5?&amp;nbsp; When I view and step through disassembly in CW7.1, registers change/update as I expect. &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #7f0055; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;_setintlevel:&lt;BR /&gt;&amp;nbsp;&amp;nbsp; move.l&amp;nbsp; d0,d1&amp;nbsp;&amp;nbsp; ; fetch new level (0-7) passed&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; asl.l&amp;nbsp;&amp;nbsp; #8,d1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; shift level into place&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; .if (HAS_RTXCms&amp;amp;&amp;amp;HAS_GLOBALPPL)&lt;BR /&gt;;&lt;BR /&gt;;&amp;nbsp;&amp;nbsp; while switching globalppl level raise to kernel ceiling&lt;BR /&gt;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.l&amp;nbsp; pKWS,a0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; load address of kernel workspace&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.w&amp;nbsp; #SUPVMODE | (RTXC_LEVEL &amp;lt;&amp;lt; 8),sr&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.l&amp;nbsp; KWS_globalppl(a0),d0 ; get current priority level&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; asr.l&amp;nbsp;&amp;nbsp; #8,d0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; shift level into place in D0 for return&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.l&amp;nbsp; d1,KWS_globalppl(a0)&amp;nbsp;&amp;nbsp;&amp;nbsp; ; save new processor priority level&lt;BR /&gt; .else&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; set-up the return value. &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; read bits 9,10 &amp;amp; 11 from the status register&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; then shift down&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.w sr,d0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; asr.l&amp;nbsp; #8,d0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; andi.l #7,d0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; .endc ; HAS_RTXCms&amp;amp;&amp;amp;HAS_GLOBALPPL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ori.l&amp;nbsp;&amp;nbsp; #SUPVMODE,d1 ; set Supv bits&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.w&amp;nbsp; d1,sr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; set processor to new level&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rts&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; return&lt;/P&gt;&lt;P&gt;_setintlevel_end:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FUNCTION&amp;nbsp; "_setintlevel", _setintlevel, _setintlevel_end - _setintlevel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .end&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/STRONG&gt; &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Feb 2014 20:37:48 GMT</pubDate>
    <dc:creator>uCRFun</dc:creator>
    <dc:date>2014-02-27T20:37:48Z</dc:date>
    <item>
      <title>CW7.1 port to CW10.5, general purpose registers</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/CW7-1-port-to-CW10-5-general-purpose-registers/m-p/265177#M310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Our team is in the process of porting a CW7.1 project to CW10.5, however we've not yet been able to successfully get the code up and running completely.&amp;nbsp; The issue we've encountered is that we continually run into exception errors.&amp;nbsp; Aside from the exception errors, I'm experiencing an issue which is making if difficult to get to root cause.&amp;nbsp; The problem is, when I step through the disassembly for a specific assembly function, "setintlevel" in this case, the "d1" register is not passed the value from "d0" on the initial instruction.&amp;nbsp; In this particular case "d0" contains the expected value.&amp;nbsp; This is a problem because "d1" is eventually used to update the "SR".&amp;nbsp; I have experimented with adding a line, just below the "move.l&amp;nbsp; d0,d1" where "d2" is passed the value from "d0" and that seems to work fine.&amp;nbsp; For other calls to this function however, I see that "d0" contains garbage on entry to this function.&amp;nbsp; &lt;STRONG&gt;The question I have is, has anyone seen situations where the general purpose registers are not updated as expected when viewing and stepping through the disassembly code in CW10.5?&amp;nbsp; When I view and step through disassembly in CW7.1, registers change/update as I expect. &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #7f0055; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;_setintlevel:&lt;BR /&gt;&amp;nbsp;&amp;nbsp; move.l&amp;nbsp; d0,d1&amp;nbsp;&amp;nbsp; ; fetch new level (0-7) passed&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; asl.l&amp;nbsp;&amp;nbsp; #8,d1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; shift level into place&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; .if (HAS_RTXCms&amp;amp;&amp;amp;HAS_GLOBALPPL)&lt;BR /&gt;;&lt;BR /&gt;;&amp;nbsp;&amp;nbsp; while switching globalppl level raise to kernel ceiling&lt;BR /&gt;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.l&amp;nbsp; pKWS,a0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; load address of kernel workspace&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.w&amp;nbsp; #SUPVMODE | (RTXC_LEVEL &amp;lt;&amp;lt; 8),sr&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.l&amp;nbsp; KWS_globalppl(a0),d0 ; get current priority level&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; asr.l&amp;nbsp;&amp;nbsp; #8,d0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; shift level into place in D0 for return&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.l&amp;nbsp; d1,KWS_globalppl(a0)&amp;nbsp;&amp;nbsp;&amp;nbsp; ; save new processor priority level&lt;BR /&gt; .else&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; set-up the return value. &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; read bits 9,10 &amp;amp; 11 from the status register&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; then shift down&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.w sr,d0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; asr.l&amp;nbsp; #8,d0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; andi.l #7,d0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; .endc ; HAS_RTXCms&amp;amp;&amp;amp;HAS_GLOBALPPL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ori.l&amp;nbsp;&amp;nbsp; #SUPVMODE,d1 ; set Supv bits&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.w&amp;nbsp; d1,sr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; set processor to new level&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rts&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; return&lt;/P&gt;&lt;P&gt;_setintlevel_end:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FUNCTION&amp;nbsp; "_setintlevel", _setintlevel, _setintlevel_end - _setintlevel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .end&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/STRONG&gt; &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Feb 2014 20:37:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/CW7-1-port-to-CW10-5-general-purpose-registers/m-p/265177#M310</guid>
      <dc:creator>uCRFun</dc:creator>
      <dc:date>2014-02-27T20:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: CW7.1 port to CW10.5, general purpose registers</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/CW7-1-port-to-CW10-5-general-purpose-registers/m-p/265178#M311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN style="font-family: Calibri; color: black; font-size: 16pt;"&gt;Starting from &lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri; color: black; font-size: 16pt;"&gt;CW7.2 &lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri; color: black; font-size: 16pt;"&gt;the Compiler &lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri; color: black; font-size: 16pt;"&gt;Parameter passing convention and Library &lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri; color: black; font-size: 16pt;"&gt;Set have changed. &lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri; color: black; font-size: 16pt;"&gt;Please notice that CW7.2 and CW10.x use same compiler parameter passing convention and same Library Set even when the IDE in CW10.x changed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16pt; font-family: +mj-lt;"&gt;1.&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri; color: black; font-size: 16pt; font-weight: bold;"&gt;Compiler&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN style="font-family: Calibri; color: black; font-size: 16pt;"&gt;The parameter passing convention has been fixed to "Register ABI". "Standard ABI" and "Compact ABI" are no longer available, but you can use those parameter passing options by using a __declspec() directive. This is shown on the &lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri; color: red; font-size: 16pt; font-weight: bold;"&gt;TN268&lt;/SPAN&gt; &lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN style="font-family: Calibri; color: black; font-size: 16pt;"&gt;&lt;A href="http://www.freescale.com/files/soft_dev_tools/doc/app_note/TN268.pdf"&gt;http&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri; color: black; font-size: 16pt;"&gt;&lt;A href="http://www.freescale.com/files/soft_dev_tools/doc/app_note/TN268.pdf"&gt;://www.freescale.com/files/soft_dev_tools/doc/app_note/TN268.pdf&lt;/A&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN style="font-family: Calibri; color: black; font-size: 16pt;"&gt;If you use assembly functions in your code this may cause problems. The reason is that previous CW versions pass parameters through the stack. CW7.2 and CW10 do it by registers. In C language there is no problem as CW solves these differences, but assembly functions must be edited to work properly. You can find a useful video showing how to edit these functions in the next link:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="font-family: Calibri; color: black; font-size: 16pt;"&gt;&lt;A href="http://www.youtube.com/watch?v=SlHldoQWt_8"&gt;http://www.youtube.com/watch?v=SlHldoQWt_8&lt;/A&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16pt; font-family: +mj-lt;"&gt;2.&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri; color: black; font-size: 16pt; font-weight: bold;"&gt;Library Set&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN style="font-family: Calibri; color: black; font-size: 16pt;"&gt;The new Library set called "Embedded Warrior Libraries" or "EWL" has been created. This provides more flexibility to reduce memory footprint when using &lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri; color: black; font-size: 16pt;"&gt;stdio&lt;/SPAN&gt;&lt;SPAN style="font-family: Calibri; color: black; font-size: 16pt;"&gt; operations, since it can disable functionality from the I/O operation reducing its footprint.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt; &lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN style="font-family: Calibri; color: black; font-size: 16pt;"&gt;Hope this helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN style="font-family: Calibri; color: black; font-size: 16pt;"&gt;Carlos&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Mar 2014 21:26:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/CW7-1-port-to-CW10-5-general-purpose-registers/m-p/265178#M311</guid>
      <dc:creator>Carlos_Musich</dc:creator>
      <dc:date>2014-03-04T21:26:03Z</dc:date>
    </item>
  </channel>
</rss>

