<?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: program counter access - control? in Processor Expert Software</title>
    <link>https://community.nxp.com/t5/Processor-Expert-Software/program-counter-access-control/m-p/881517#M4298</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;instead of __asm__("e_bl FunctionNameText"); you can use following sequence:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load address to register r6. Two instructions must be used, if you want load 32-bit address. Sequence below loads address 0x01001000 into r6 register.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;asm("e_lis %r6, 0x100");&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;asm("e_or2i %r6, 0x1000");&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move address from r6 to link register. Link register is SPR8 register, so instruction mtspr is used.&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;asm("mtspr 8, %r6");&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Last step is branch to link register. If you want return back, use se_blrl or se_blr in case you do not want to branch back. &lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;asm("se_blrl");&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Mar 2019 08:47:49 GMT</pubDate>
    <dc:creator>martin_kovar</dc:creator>
    <dc:date>2019-03-27T08:47:49Z</dc:date>
    <item>
      <title>program counter access - control?</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/program-counter-access-control/m-p/881514#M4295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I'm using MPC5746C MCU with S2&amp;nbsp;S32 Design Studio&amp;nbsp;Version: 2017.R1 at my project.&lt;/P&gt;&lt;P&gt;I need to reach and&amp;nbsp;control the program counter but I've not found any way to reach register address or any function related it.&lt;/P&gt;&lt;P&gt;Is it possible to manage the program counter from outside command?&lt;/P&gt;&lt;P&gt;PC could be seen in Register editor and It could be controlled there. But I want&amp;nbsp;to control from the&amp;nbsp;program, what is the PC variable name or structure address of General Register?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/75321i6986C2CDE5AD0D65/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2019 07:48:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/program-counter-access-control/m-p/881514#M4295</guid>
      <dc:creator>eyupozer</dc:creator>
      <dc:date>2019-03-22T07:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: program counter access - control?</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/program-counter-access-control/m-p/881515#M4296</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;because Program Counter is neither memory mapped register nor special purpose register, it is not possible to access it from application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But you can use branch instruction instead of PC modification and this has the same effect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Mar 2019 09:20:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/program-counter-access-control/m-p/881515#M4296</guid>
      <dc:creator>martin_kovar</dc:creator>
      <dc:date>2019-03-25T09:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: program counter access - control?</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/program-counter-access-control/m-p/881516#M4297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Martin,&lt;/P&gt;&lt;P&gt;Thanks for your quick support,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used "e_bl" command set like that: __asm__("e_bl FunctionNameText");&lt;/P&gt;&lt;P&gt;this command is working properly but the e_bl command can be used only the function name text base.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to branch directly, a specific address in the memory and return again to the first branch point.&lt;/P&gt;&lt;P&gt;Is it possible? Which command set can be used for this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Mar 2019 05:14:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/program-counter-access-control/m-p/881516#M4297</guid>
      <dc:creator>eyupozer</dc:creator>
      <dc:date>2019-03-27T05:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: program counter access - control?</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/program-counter-access-control/m-p/881517#M4298</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;instead of __asm__("e_bl FunctionNameText"); you can use following sequence:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load address to register r6. Two instructions must be used, if you want load 32-bit address. Sequence below loads address 0x01001000 into r6 register.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;asm("e_lis %r6, 0x100");&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;asm("e_or2i %r6, 0x1000");&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move address from r6 to link register. Link register is SPR8 register, so instruction mtspr is used.&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;asm("mtspr 8, %r6");&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Last step is branch to link register. If you want return back, use se_blrl or se_blr in case you do not want to branch back. &lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;asm("se_blrl");&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Mar 2019 08:47:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/program-counter-access-control/m-p/881517#M4298</guid>
      <dc:creator>martin_kovar</dc:creator>
      <dc:date>2019-03-27T08:47:49Z</dc:date>
    </item>
  </channel>
</rss>

