<?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: sections and pages in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/HC12-sections-and-pages/m-p/142016#M2783</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Note that you've got 32k of non-paged memory located at 4000-7FFF and from C000 to FFFF. When you try to access data from those addresses, the value in PPAGE is irrelevant. So unless you have more than 32k of constant data, you won't have to worry about PPAGE. Where the code using the constants is located doesn't matter.&lt;BR /&gt;&lt;BR /&gt;What you do need to be careful with though, is the use of JSR/CALL and RTS/RTC, but that's another topic.&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Jan 2007 20:13:12 GMT</pubDate>
    <dc:creator>Lundin</dc:creator>
    <dc:date>2007-01-05T20:13:12Z</dc:date>
    <item>
      <title>HC12 sections and pages</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/HC12-sections-and-pages/m-p/142015#M2782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;may be somebody can support me with flw. problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I' ve to convert old assembler code written for HC11, to support now&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;a 9S12XDP512 controller. The assembler code is more than 20kB large and so does not&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fit in one section for HCS12. I'm using relocatable model and build three sections, one for data, one for code and one for constants. I paged the code (&amp;gt;10kB) to Page FE and the constants (9kB) to Page FC. Now I've flw. problem, if I want to load an address from a constant like&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LDX #CONSTANT and then LDD 0,X the program crash, due to wrong address and wrong contents.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So I do some like that:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LDX #GLOBAL(CONSTANT)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LDAB #GLOBAL_PAGE(CONSTANT)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;STAB GPAGE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and then GLDD 0,X.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But this is not very practical, because I've to lookout every point there is an load to a constant and 10kB assembler code is a lot. Further sometimes in the code there are constructions like&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LDX #CONSTANT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;STX ADDRESSCONSTANT&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LDX ADDRESSCONSTANT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LDD 0,X&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;STD DATACONST&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;to calculate a field address inside macros from the constant section. And here I can't use above mentioned GLOBAL identifier.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So my question. Is there another way to handle code and constants if the size of both does not fit on one page? Thanks for the support.&lt;/SPAN&gt;&lt;P&gt;Message Edited by CrasyCat on &lt;SPAN class="date_text"&gt;2007-04-13&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;11:14 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jan 2007 17:50:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/HC12-sections-and-pages/m-p/142015#M2782</guid>
      <dc:creator>Ghibli</dc:creator>
      <dc:date>2007-01-05T17:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: sections and pages</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/HC12-sections-and-pages/m-p/142016#M2783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Note that you've got 32k of non-paged memory located at 4000-7FFF and from C000 to FFFF. When you try to access data from those addresses, the value in PPAGE is irrelevant. So unless you have more than 32k of constant data, you won't have to worry about PPAGE. Where the code using the constants is located doesn't matter.&lt;BR /&gt;&lt;BR /&gt;What you do need to be careful with though, is the use of JSR/CALL and RTS/RTC, but that's another topic.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jan 2007 20:13:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/HC12-sections-and-pages/m-p/142016#M2783</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2007-01-05T20:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: sections and pages</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/HC12-sections-and-pages/m-p/142017#M2784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Lundin,&lt;BR /&gt;thanks for your answer, this was a great help.&lt;BR /&gt;Sometimes it is like: You can't see the trees, while you're standing in the forest.&lt;BR /&gt;best regards Ghibli&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jan 2007 21:55:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/HC12-sections-and-pages/m-p/142017#M2784</guid>
      <dc:creator>Ghibli</dc:creator>
      <dc:date>2007-01-05T21:55:12Z</dc:date>
    </item>
  </channel>
</rss>

