<?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: S12ZVM12 Memory model and pointer size in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVM12-Memory-model-and-pointer-size/m-p/464985#M11740</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amey,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've contacted the compiler team and got more information. &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif; color: #1f497d;"&gt;The size of the pointer within the program (i.e. sizeof(&amp;lt;pointer type&amp;gt;) is always 24-bit (i.e. 3-byte).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif; color: #1f497d;"&gt;The table below (from the compiler manual) refers to the size of the addresses that are stored in the pointer types:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif; color: #1f497d;"&gt;for &lt;EM&gt;small&lt;/EM&gt; and &lt;EM&gt;medium&lt;/EM&gt; memory models the addresses used for non-constant global data (RAM) are smaller (due to the encoding of the instructions using RAM addresses, resulting in smaller encoding size, if the application data fits in 14 / 18 – bits RAM addresses)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif; color: #1f497d;"&gt;the other types of data (constant data or code) are placed in ROM, which require 24-bit addresses&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;BR /&gt;Have a great day,&lt;BR /&gt;Pascal&lt;BR /&gt;NXP Technical Support&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Feb 2016 08:44:42 GMT</pubDate>
    <dc:creator>trytohelp</dc:creator>
    <dc:date>2016-02-23T08:44:42Z</dc:date>
    <item>
      <title>S12ZVM12 Memory model and pointer size</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVM12-Memory-model-and-pointer-size/m-p/464982#M11737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;As I understand, the memory model are defined to set the accesses to global non-constant data,&lt;/P&gt;&lt;P&gt;i.e. small model has 14 bit access, medium model has 18 bit and large model has 24bit access.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;According these memory model, the size of pointer to non-constant data (int *) must be like,&lt;/P&gt;&lt;P&gt;Small = 2 byte(14bit), Medium= 3byte(18bit) , Large = 3byte (24bit).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I observed that this is the not right scenario considering the small memory model. In the case of small memory model it is also of size 3byte.&lt;/P&gt;&lt;P&gt;This I confirmed as follows -&lt;/P&gt;&lt;P&gt;Created the project with &lt;STRONG&gt;Small memory model&lt;/STRONG&gt; in Code warrior 10.6.4&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;int data = 0xff;&lt;/P&gt;&lt;P&gt;int *ptr1;&lt;/P&gt;&lt;P&gt;int sizePtr;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void main(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ptr1 = &amp;amp;data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sizePtr = sizeof(ptr1);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(;;)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Here the size of pointer 'ptr1' getting in sizePtr as 3.&lt;/P&gt;&lt;P&gt;Also I have confirmed the size of memory allocated for the pointer ptr1by looking into map file and here also it taking as 3 byte.&lt;/P&gt;&lt;P&gt;Please clarify/correct me. Is it a wrong scenario? or compiler is not taking care properly.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 05:26:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVM12-Memory-model-and-pointer-size/m-p/464982#M11737</guid>
      <dc:creator>ameykhatavkar</dc:creator>
      <dc:date>2016-02-17T05:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: S12ZVM12 Memory model and pointer size</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVM12-Memory-model-and-pointer-size/m-p/464983#M11738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;Anybody have seen this?&lt;/P&gt;&lt;P&gt;please reply. I am waiting&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2016 08:20:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVM12-Memory-model-and-pointer-size/m-p/464983#M11738</guid>
      <dc:creator>ameykhatavkar</dc:creator>
      <dc:date>2016-02-22T08:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: S12ZVM12 Memory model and pointer size</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVM12-Memory-model-and-pointer-size/m-p/464984#M11739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amey,&lt;/P&gt;&lt;P&gt;It seems you refer to the pointer description at MCU_S12Z_Compiler.pdf compiler page 163:&lt;/P&gt;&lt;P&gt;++++++++++++++++++++++++++++++++++++++&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/53481i0A526D418C0E096D/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;++++++++++++++++++++++++++++++++++++++&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following the rule for the code:&lt;/P&gt;&lt;P&gt;++++++++++++++++++++++++++++++++++++++&lt;/P&gt;&lt;P&gt;int data = 0xff;&lt;/P&gt;&lt;P&gt;int *ptr1;&lt;/P&gt;&lt;P&gt;int sizePtr;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void main(void) {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; EnableInterrupts;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* include your code here */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ptr1 = &amp;amp;data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sizePtr = sizeof(ptr1);&lt;/P&gt;&lt;P&gt;++++++++++++++++++++++++++++++++++++++&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sizeptr returns the value 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've reproduced the problem on my side.&lt;/P&gt;&lt;P&gt;I need to investigate it and keep you informed&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Pascal&lt;BR /&gt;NXP Technical Support&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2016 15:31:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVM12-Memory-model-and-pointer-size/m-p/464984#M11739</guid>
      <dc:creator>trytohelp</dc:creator>
      <dc:date>2016-02-22T15:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: S12ZVM12 Memory model and pointer size</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVM12-Memory-model-and-pointer-size/m-p/464985#M11740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amey,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've contacted the compiler team and got more information. &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif; color: #1f497d;"&gt;The size of the pointer within the program (i.e. sizeof(&amp;lt;pointer type&amp;gt;) is always 24-bit (i.e. 3-byte).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif; color: #1f497d;"&gt;The table below (from the compiler manual) refers to the size of the addresses that are stored in the pointer types:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif; color: #1f497d;"&gt;for &lt;EM&gt;small&lt;/EM&gt; and &lt;EM&gt;medium&lt;/EM&gt; memory models the addresses used for non-constant global data (RAM) are smaller (due to the encoding of the instructions using RAM addresses, resulting in smaller encoding size, if the application data fits in 14 / 18 – bits RAM addresses)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif; color: #1f497d;"&gt;the other types of data (constant data or code) are placed in ROM, which require 24-bit addresses&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;BR /&gt;Have a great day,&lt;BR /&gt;Pascal&lt;BR /&gt;NXP Technical Support&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Feb 2016 08:44:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12ZVM12-Memory-model-and-pointer-size/m-p/464985#M11740</guid>
      <dc:creator>trytohelp</dc:creator>
      <dc:date>2016-02-23T08:44:42Z</dc:date>
    </item>
  </channel>
</rss>

