<?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>Kinetis Microcontrollers中的主题 Re: how to use CALL and RTC instructions?</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/how-to-use-CALL-and-RTC-instructions/m-p/552999#M33607</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First I am thinking that you should post this issue in 16 bit community but not here the Kinetis community. Anyway, I would like try to answer the question:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="&amp;amp;quothighlight&amp;quot;"&gt;Call&lt;/SPAN&gt; is similar to JSR; microcontrollers with expanded memory treat 16 Kbytes of addresses from $8000 to $BFFF as a memory window.&amp;nbsp; The &lt;SPAN class="&amp;amp;quothighlight&amp;quot;"&gt;PPAGE&lt;/SPAN&gt; register is the one that switches memory pages.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; In the case of the call, the two bytes of the return address are stacked, after stacking this two bytes, the microcontroller saves the actual &lt;SPAN class="&amp;amp;quothighlight&amp;quot;"&gt;PPAGE&lt;/SPAN&gt; register in the stack, then it writes in the &lt;SPAN class="&amp;amp;quothighlight&amp;quot;"&gt;PPAGE&lt;/SPAN&gt; register the value of the new page supplied by the&lt;STRONG&gt; &lt;/STRONG&gt;&lt;SPAN class="&amp;amp;quothighlight&amp;quot;"&gt;instruction&lt;/SPAN&gt; and then transfers to the PC the address of the subroutine. When the subroutine is terminated by the RTC instruction, the microcontroller is able to restore the address and the &lt;SPAN class="&amp;amp;quothighlight&amp;quot;"&gt;PPAGE&lt;/SPAN&gt; register from the stack.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; So if you are switching the code execution between pages, you have to use the &lt;SPAN class="&amp;amp;quothighlight&amp;quot;"&gt;CALL&lt;/SPAN&gt; instruction, remembering that expanded-memory subroutines must be terminated by an RTC. But, if you are jumping to places within the same memory page, it's not necessary to change all the JMP or JSR for CALL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the case of the JSR, it's very much like the call, but the difference is that this &lt;SPAN class="&amp;amp;quothighlight&amp;quot;"&gt;instruction&lt;/SPAN&gt; does not stack the value of the &lt;SPAN class="&amp;amp;quothighlight&amp;quot;"&gt;PPAGE&lt;/SPAN&gt; register, so again, if you want to jump to a subroutine that is in other memory page, you have to use the call. If they are on the same page, you can still use the JSR.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Jul 2016 08:31:07 GMT</pubDate>
    <dc:creator>miduo</dc:creator>
    <dc:date>2016-07-11T08:31:07Z</dc:date>
    <item>
      <title>how to use CALL and RTC instructions?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/how-to-use-CALL-and-RTC-instructions/m-p/552998#M33606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;The CPU of 9S12 Family has special access to read and write&amp;nbsp; PPAGE register directly during execution of CALL and RTC instructions. I refer&amp;nbsp; to some examples , some CPU write and read PPAGE directly, or some JSR and RTS instruction given by a array of mechine code. I'm not skilled at mechine codes, So&amp;nbsp; I hope&amp;nbsp; to get some guidance.&lt;/P&gt;&lt;P&gt;It's much better to give&amp;nbsp; examples&amp;nbsp; in writte PPAGE register by CALL and RTC instructions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jun 2016 01:44:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/how-to-use-CALL-and-RTC-instructions/m-p/552998#M33606</guid>
      <dc:creator>waltbill</dc:creator>
      <dc:date>2016-06-21T01:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to use CALL and RTC instructions?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/how-to-use-CALL-and-RTC-instructions/m-p/552999#M33607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First I am thinking that you should post this issue in 16 bit community but not here the Kinetis community. Anyway, I would like try to answer the question:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="&amp;amp;quothighlight&amp;quot;"&gt;Call&lt;/SPAN&gt; is similar to JSR; microcontrollers with expanded memory treat 16 Kbytes of addresses from $8000 to $BFFF as a memory window.&amp;nbsp; The &lt;SPAN class="&amp;amp;quothighlight&amp;quot;"&gt;PPAGE&lt;/SPAN&gt; register is the one that switches memory pages.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; In the case of the call, the two bytes of the return address are stacked, after stacking this two bytes, the microcontroller saves the actual &lt;SPAN class="&amp;amp;quothighlight&amp;quot;"&gt;PPAGE&lt;/SPAN&gt; register in the stack, then it writes in the &lt;SPAN class="&amp;amp;quothighlight&amp;quot;"&gt;PPAGE&lt;/SPAN&gt; register the value of the new page supplied by the&lt;STRONG&gt; &lt;/STRONG&gt;&lt;SPAN class="&amp;amp;quothighlight&amp;quot;"&gt;instruction&lt;/SPAN&gt; and then transfers to the PC the address of the subroutine. When the subroutine is terminated by the RTC instruction, the microcontroller is able to restore the address and the &lt;SPAN class="&amp;amp;quothighlight&amp;quot;"&gt;PPAGE&lt;/SPAN&gt; register from the stack.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; So if you are switching the code execution between pages, you have to use the &lt;SPAN class="&amp;amp;quothighlight&amp;quot;"&gt;CALL&lt;/SPAN&gt; instruction, remembering that expanded-memory subroutines must be terminated by an RTC. But, if you are jumping to places within the same memory page, it's not necessary to change all the JMP or JSR for CALL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the case of the JSR, it's very much like the call, but the difference is that this &lt;SPAN class="&amp;amp;quothighlight&amp;quot;"&gt;instruction&lt;/SPAN&gt; does not stack the value of the &lt;SPAN class="&amp;amp;quothighlight&amp;quot;"&gt;PPAGE&lt;/SPAN&gt; register, so again, if you want to jump to a subroutine that is in other memory page, you have to use the call. If they are on the same page, you can still use the JSR.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2016 08:31:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/how-to-use-CALL-and-RTC-instructions/m-p/552999#M33607</guid>
      <dc:creator>miduo</dc:creator>
      <dc:date>2016-07-11T08:31:07Z</dc:date>
    </item>
  </channel>
</rss>

