<?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 BSR and JSR optimisations ? in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/BSR-and-JSR-optimisations/m-p/135924#M1784</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;Do you have any clue why this piece of code compiled as is:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;#pragma NO_ENTRY&lt;BR /&gt;#pragma NO_EXIT&lt;BR /&gt;#pragma NO_FRAME&lt;BR /&gt;#pragma NO_RETURN&lt;BR /&gt;#pragma OPTION ADD "-OnB=b"&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;DIV&gt;static void ISRHandler(void)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;#pragma NO_ENTRY&lt;BR /&gt;#pragma NO_EXIT&lt;BR /&gt;#pragma NO_FRAME&lt;BR /&gt;#pragma NO_RETURN&lt;BR /&gt;#pragma OPTION ADD "-OnB=b"&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;static void rejump_func(void)&lt;BR /&gt;{&lt;BR /&gt;__asm&amp;nbsp;bsr&amp;nbsp;&amp;nbsp;&amp;nbsp; ISRHandler&amp;nbsp;&amp;nbsp;&amp;nbsp; ; /* vector 63 */&lt;BR /&gt;}&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Meaning that relative addressing is used as desired.&lt;/DIV&gt;&lt;DIV&gt;And in case the ISRHandler goes below rejump_func the "bsr" is changed to "jsr" ?? I need to have my ISRHandler allocated below the rejump table and I need to use relative branch instructions!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Mark&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 13 May 2006 05:53:57 GMT</pubDate>
    <dc:creator>markiscarabas</dc:creator>
    <dc:date>2006-05-13T05:53:57Z</dc:date>
    <item>
      <title>BSR and JSR optimisations ?</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/BSR-and-JSR-optimisations/m-p/135924#M1784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;Do you have any clue why this piece of code compiled as is:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;#pragma NO_ENTRY&lt;BR /&gt;#pragma NO_EXIT&lt;BR /&gt;#pragma NO_FRAME&lt;BR /&gt;#pragma NO_RETURN&lt;BR /&gt;#pragma OPTION ADD "-OnB=b"&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;DIV&gt;static void ISRHandler(void)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;#pragma NO_ENTRY&lt;BR /&gt;#pragma NO_EXIT&lt;BR /&gt;#pragma NO_FRAME&lt;BR /&gt;#pragma NO_RETURN&lt;BR /&gt;#pragma OPTION ADD "-OnB=b"&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;static void rejump_func(void)&lt;BR /&gt;{&lt;BR /&gt;__asm&amp;nbsp;bsr&amp;nbsp;&amp;nbsp;&amp;nbsp; ISRHandler&amp;nbsp;&amp;nbsp;&amp;nbsp; ; /* vector 63 */&lt;BR /&gt;}&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Meaning that relative addressing is used as desired.&lt;/DIV&gt;&lt;DIV&gt;And in case the ISRHandler goes below rejump_func the "bsr" is changed to "jsr" ?? I need to have my ISRHandler allocated below the rejump table and I need to use relative branch instructions!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Mark&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 May 2006 05:53:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/BSR-and-JSR-optimisations/m-p/135924#M1784</guid>
      <dc:creator>markiscarabas</dc:creator>
      <dc:date>2006-05-13T05:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: BSR and JSR optimisations ?</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/BSR-and-JSR-optimisations/m-p/135925#M1785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;According to the HC12 back end documentation,&lt;/P&gt;&lt;P&gt;The "Branch JSR to BSR Optimization" uses a BSR instead of a JSR to call a function, if the offset is small enough and known at compilation time.&lt;/P&gt;&lt;P&gt;When the called function is implemented after the callee, the offset is not known and the HLI assembler is using a JSR (always). You cannot block that from happening.&lt;/P&gt;&lt;P&gt;Currently you have two ways of fixing that:&lt;/P&gt;&lt;P&gt;&amp;nbsp;1- implement the callee &amp;nbsp;after the called function&lt;BR /&gt;&amp;nbsp;2- User macro assembler to encode the two functions&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 May 2006 17:37:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/BSR-and-JSR-optimisations/m-p/135925#M1785</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2006-05-15T17:37:28Z</dc:date>
    </item>
  </channel>
</rss>

