<?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>topic Re: Odd Calling Convention in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Odd-Calling-Convention/m-p/174428#M5582</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Nov 2012 19:07:43 GMT</pubDate>
    <dc:creator>jimfell</dc:creator>
    <dc:date>2012-11-13T19:07:43Z</dc:date>
    <item>
      <title>Odd Calling Convention</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Odd-Calling-Convention/m-p/174426#M5580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I working with an existing code base, and I came across this function that is called durning normal program execution to modify the Interrupt Priority Level (IPL) bits of the Status Register (SR):&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;__declspec&lt;SPAN style="font-size: 10pt;"&gt; (register_abi) &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: 10pt;"&gt;asm&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: 10pt;"&gt;unsigned&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: 10pt;"&gt;int&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; asm_set_ipl(&lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: 10pt;"&gt;unsigned&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: 10pt;"&gt;int&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; mask)&lt;/SPAN&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;I'm unfamiliar with this.&amp;nbsp; What is this convention suppose to be doing?&amp;nbsp; (Yes, all the code in this function is assembly.)&amp;nbsp; As nearly as I can tell, this is just stating that this is an assembly function.&amp;nbsp; Is that all this convention is doing?&amp;nbsp; I am using CodeWarrior 10.&amp;nbsp; Thanks.&lt;/SPAN&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;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 18:41:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Odd-Calling-Convention/m-p/174426#M5580</guid>
      <dc:creator>jimfell</dc:creator>
      <dc:date>2012-11-13T18:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: Odd Calling Convention</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Odd-Calling-Convention/m-p/174427#M5581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I have seen that in several places used. It is not CodeWarrior specific. I think 'ipl' stands for 'Interrupt Priority Level': using that (assembly) function you pass the new interrupt mask and on return you get the previously set interrupt level back. So you could use it like&lt;/P&gt;&lt;P&gt;oldLevel = asm_set_ipl(MASK_ALL_INTERRPTS); /* disable interrupts */&lt;/P&gt;&lt;P&gt;critical section here;&lt;/P&gt;&lt;P&gt;(void) asm_set_ipl(oldLevel); /* restore previous interrupt level */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the question is about what the __declspec(register) is about: this tells the compiler to use 'register' calling convention (instead of passing the parameters on the stack).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 18:46:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Odd-Calling-Convention/m-p/174427#M5581</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2012-11-13T18:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: Odd Calling Convention</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Odd-Calling-Convention/m-p/174428#M5582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 19:07:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Odd-Calling-Convention/m-p/174428#M5582</guid>
      <dc:creator>jimfell</dc:creator>
      <dc:date>2012-11-13T19:07:43Z</dc:date>
    </item>
  </channel>
</rss>

