<?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>CodeWarrior for MCU中的主题 Re: __NEAR_SEG or not ?</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/HC12-NEAR-SEG-or-not/m-p/138572#M2176</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;To start with the summary, add the __NEAR_SEG where it is missing. Don't remove it from where you already have it :smileyhappy:&lt;BR /&gt;&lt;BR /&gt;The __NEAR_SEG tells the compiler that functions declared/defined in this section can be called with the near calling convention (with JSR/BSR).&lt;BR /&gt;If you drop it, the compiler will default to the banked calling convention (CALL) instead.&lt;BR /&gt;So using the __NEAR_SEG provides the opportunity to place some often used functions into the non banked area.&lt;BR /&gt;For interrupt functions only, as they are not called by a normal function call, the __NEAR_SEG does indeed have no effect.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Dec 2006 04:13:23 GMT</pubDate>
    <dc:creator>CompilerGuru</dc:creator>
    <dc:date>2006-12-01T04:13:23Z</dc:date>
    <item>
      <title>HC12: __NEAR_SEG or not ?</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/HC12-NEAR-SEG-or-not/m-p/138571#M2175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using CW for S12X.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My code uses the banked memory model.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In that code I have some (non XGATE) interrupt handlers that look like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#pragma CODE_SEG __NEAR_SEG NON_BANKED&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;__interrupt void Isr (void)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#pragma CODE_SEG DEFAULT&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sometimes the compiler shows a warning message "Segment already used with different attributes".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When I remove the modifier '__NEAR_SEG', the warning disappears...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, the program works fine, regardless of __NEAR_SEG or not.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is the __NEAR_SEG modifier really necessary?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I think NON_BANKED is quite enough to force the code into non-paged flash, or am I wrong?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-&amp;gt; pittbull&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:36 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Dec 2006 02:36:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/HC12-NEAR-SEG-or-not/m-p/138571#M2175</guid>
      <dc:creator>pittbull</dc:creator>
      <dc:date>2006-12-01T02:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: __NEAR_SEG or not ?</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/HC12-NEAR-SEG-or-not/m-p/138572#M2176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;To start with the summary, add the __NEAR_SEG where it is missing. Don't remove it from where you already have it :smileyhappy:&lt;BR /&gt;&lt;BR /&gt;The __NEAR_SEG tells the compiler that functions declared/defined in this section can be called with the near calling convention (with JSR/BSR).&lt;BR /&gt;If you drop it, the compiler will default to the banked calling convention (CALL) instead.&lt;BR /&gt;So using the __NEAR_SEG provides the opportunity to place some often used functions into the non banked area.&lt;BR /&gt;For interrupt functions only, as they are not called by a normal function call, the __NEAR_SEG does indeed have no effect.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Dec 2006 04:13:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/HC12-NEAR-SEG-or-not/m-p/138572#M2176</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2006-12-01T04:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: __NEAR_SEG or not ?</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/HC12-NEAR-SEG-or-not/m-p/138573#M2177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Thank you, CompilerGuru &lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Dec 2006 04:32:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/HC12-NEAR-SEG-or-not/m-p/138573#M2177</guid>
      <dc:creator>pittbull</dc:creator>
      <dc:date>2006-12-01T04:32:00Z</dc:date>
    </item>
  </channel>
</rss>

