<?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: Padding and alignment in CodeWarrior for MC1321x (HCS08) in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Padding-and-alignment-in-CodeWarrior-for-MC1321x-HCS08/m-p/209979#M8228</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the tip.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;drdr&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Aug 2009 06:58:43 GMT</pubDate>
    <dc:creator>drdr</dc:creator>
    <dc:date>2009-08-26T06:58:43Z</dc:date>
    <item>
      <title>Padding and alignment in CodeWarrior for MC1321x (HCS08)</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Padding-and-alignment-in-CodeWarrior-for-MC1321x-HCS08/m-p/209977#M8226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When creating an array of a bit field structure as in the example below, is it possible to fit two 4-bit array members into a single byte?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;typedef struct {&lt;BR /&gt;&amp;nbsp; unsigned int my_location : 2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; unsigned int my_WATCHDOG : 2;&lt;/P&gt;&lt;P&gt;} foo;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;foo my_array[1000] = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to have the above result in 500 bytes of 1000 elements, each addressed by my_array[i] or will CW pad every element such that 1000 bytes will be used by the array?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;drdr&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2009 04:30:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Padding-and-alignment-in-CodeWarrior-for-MC1321x-HCS08/m-p/209977#M8226</guid>
      <dc:creator>drdr</dc:creator>
      <dc:date>2009-08-25T04:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: Padding and alignment in CodeWarrior for MC1321x (HCS08)</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Padding-and-alignment-in-CodeWarrior-for-MC1321x-HCS08/m-p/209978#M8227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, not with a simple foo structure.&lt;/P&gt;&lt;P&gt;C requires that array elements have their own addresses, therefore in order to have such a array you will have to pack a single byte in C code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;typedef struct {&lt;BR /&gt;&amp;nbsp; unsigned char my_low_location : 2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; unsigned char my_low_WATCHDOG : 2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; unsigned char my_high_location : 2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; unsigned char my_high_WATCHDOG : 2;&lt;/P&gt;&lt;P&gt;} foo;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;foo my_array[500];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alternatively, and you can also use an array of bytes and then work with macros to implement the accesses to have a direct indexed access.&lt;/P&gt;&lt;BR /&gt;Daniel&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2009 09:14:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Padding-and-alignment-in-CodeWarrior-for-MC1321x-HCS08/m-p/209978#M8227</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2009-08-25T09:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Padding and alignment in CodeWarrior for MC1321x (HCS08)</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Padding-and-alignment-in-CodeWarrior-for-MC1321x-HCS08/m-p/209979#M8228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the tip.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;drdr&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2009 06:58:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Padding-and-alignment-in-CodeWarrior-for-MC1321x-HCS08/m-p/209979#M8228</guid>
      <dc:creator>drdr</dc:creator>
      <dc:date>2009-08-26T06:58:43Z</dc:date>
    </item>
  </channel>
</rss>

