<?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: S12XDP512 more efficient between char and int in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XDP512-more-efficient-between-char-and-int/m-p/126697#M571</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I'm not sure, but my feeling is that for the HC12, using unsigned char or unsigned int wont differ a lot in speed.&lt;BR /&gt;Some arithmetic operations (or, and,) are faster with unsigned char's but on the other side C rules often require int arithmetic so char's may have to be explicitly zero extended in other cases.&lt;BR /&gt;Probably you wont see a huge difference in speed (but in memory usage :smileyhappy:&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 17 Mar 2007 03:19:54 GMT</pubDate>
    <dc:creator>CompilerGuru</dc:creator>
    <dc:date>2007-03-17T03:19:54Z</dc:date>
    <item>
      <title>S12XDP512 more efficient between char and int</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XDP512-more-efficient-between-char-and-int/m-p/126696#M570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I use CW 4.5 for s12x&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;if i declare a function like it&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;void f(char i, char j)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;return(i+j)&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;and the same function like that&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;void f(int i,&amp;nbsp;int j)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;return(i+j)&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;What is the best déclaration&amp;nbsp;for the micro (for speed)? I don't really need 16 bit variables but i am&amp;nbsp;translating&amp;nbsp;old functions&amp;nbsp;to a new application for&amp;nbsp;9s12x and a lot of functions are declared with int for&amp;nbsp;char&amp;nbsp;really needed. If i change all my declarations functions, will my program will work faster?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Mar 2007 00:08:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XDP512-more-efficient-between-char-and-int/m-p/126696#M570</guid>
      <dc:creator>calou</dc:creator>
      <dc:date>2007-03-17T00:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: S12XDP512 more efficient between char and int</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XDP512-more-efficient-between-char-and-int/m-p/126697#M571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I'm not sure, but my feeling is that for the HC12, using unsigned char or unsigned int wont differ a lot in speed.&lt;BR /&gt;Some arithmetic operations (or, and,) are faster with unsigned char's but on the other side C rules often require int arithmetic so char's may have to be explicitly zero extended in other cases.&lt;BR /&gt;Probably you wont see a huge difference in speed (but in memory usage :smileyhappy:&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Mar 2007 03:19:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XDP512-more-efficient-between-char-and-int/m-p/126697#M571</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2007-03-17T03:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: S12XDP512 more efficient between char and int</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XDP512-more-efficient-between-char-and-int/m-p/126698#M572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;To know the exact speed, you need to refer to the assembly generated.&lt;BR /&gt;The number of instruction will depend on where your values are stored.&lt;BR /&gt;S12XCPUVx will give a decomposition of instructions used.&lt;BR /&gt;&lt;BR /&gt;With a char (byte), values can be stored in CPU registers A and B.&lt;BR /&gt;But int (word), values will not fit.&lt;BR /&gt;&lt;BR /&gt;As the Guru said, an int will take more memory space.&lt;BR /&gt;If it is practical, I advise you to .use the smallest side.&lt;BR /&gt;After all, an addition between two "int" can give a "long".&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Alban.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 Mar 2007 20:04:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XDP512-more-efficient-between-char-and-int/m-p/126698#M572</guid>
      <dc:creator>Alban</dc:creator>
      <dc:date>2007-03-17T20:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: S12XDP512 more efficient between char and int</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XDP512-more-efficient-between-char-and-int/m-p/126699#M573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Thank you for help&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 17:15:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XDP512-more-efficient-between-char-and-int/m-p/126699#M573</guid>
      <dc:creator>calou</dc:creator>
      <dc:date>2007-03-19T17:15:22Z</dc:date>
    </item>
  </channel>
</rss>

