<?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>8-bit Microcontrollers中的主题 Re: Difference between RTS and Branch in assembly</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Difference-between-RTS-and-Branch-in-assembly/m-p/209495#M17896</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can only use RTS when you've called a subroutine, because RTS pulls the return adress from the stack ang continues execution on that adress..&lt;/P&gt;&lt;P&gt;The only branch that calls a subroutine is BSR. Every other branch is just like a jump. So if you use RTS,without a JSR or BSR, you pull two bytes from the stack and return to that adress. This will make your program go crazy.&lt;/P&gt;&lt;P&gt;Of course you can branch and push a return adress on the stack and then use RTS but this is more a theoretical approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eckhard &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 16 Dec 2012 18:12:02 GMT</pubDate>
    <dc:creator>eckhard</dc:creator>
    <dc:date>2012-12-16T18:12:02Z</dc:date>
    <item>
      <title>Difference between RTS and Branch in assembly</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Difference-between-RTS-and-Branch-in-assembly/m-p/209494#M17895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am bit confused on when to use rts. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, when I jump to a subroutine - jsr, it is clear that rts has to be used.&lt;/P&gt;&lt;P&gt;But when I branch, say bra xxxx or bhi xxxx, can i still use rts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Dec 2012 10:52:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Difference-between-RTS-and-Branch-in-assembly/m-p/209494#M17895</guid>
      <dc:creator>hityou123</dc:creator>
      <dc:date>2012-12-16T10:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between RTS and Branch in assembly</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Difference-between-RTS-and-Branch-in-assembly/m-p/209495#M17896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can only use RTS when you've called a subroutine, because RTS pulls the return adress from the stack ang continues execution on that adress..&lt;/P&gt;&lt;P&gt;The only branch that calls a subroutine is BSR. Every other branch is just like a jump. So if you use RTS,without a JSR or BSR, you pull two bytes from the stack and return to that adress. This will make your program go crazy.&lt;/P&gt;&lt;P&gt;Of course you can branch and push a return adress on the stack and then use RTS but this is more a theoretical approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eckhard &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Dec 2012 18:12:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Difference-between-RTS-and-Branch-in-assembly/m-p/209495#M17896</guid>
      <dc:creator>eckhard</dc:creator>
      <dc:date>2012-12-16T18:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between RTS and Branch in assembly</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Difference-between-RTS-and-Branch-in-assembly/m-p/209496#M17897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hityou123, did this clarify your view on RTS?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Dec 2012 21:44:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Difference-between-RTS-and-Branch-in-assembly/m-p/209496#M17897</guid>
      <dc:creator>Monica</dc:creator>
      <dc:date>2012-12-17T21:44:22Z</dc:date>
    </item>
  </channel>
</rss>

