<?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>i.MX ProcessorsのトピックRe: IMX53 inline assembler with use of module/global variables</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/IMX53-inline-assembler-with-use-of-module-global-variables/m-p/485820#M77660</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also, I really only have two variables.&amp;nbsp; One that is holding an address that I need to load into a register, and another that I simply need to set to 1 based on test conditions.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Feb 2016 17:27:02 GMT</pubDate>
    <dc:creator>davidgolke</dc:creator>
    <dc:date>2016-02-25T17:27:02Z</dc:date>
    <item>
      <title>IMX53 inline assembler with use of module/global variables</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IMX53-inline-assembler-with-use-of-module-global-variables/m-p/485817#M77657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am wondering if there is a way to make use of the __asm() or asm() with global or module variables.&amp;nbsp; Say for example, I have myModuleVariable and I wish to variable inside of the __asm() or asm() inline assembler functions, is this possible?&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say for example, I want to set a global variable to 1 by doing something like this:&lt;/P&gt;&lt;P&gt;__asm(&lt;/P&gt;&lt;P&gt;"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MOV&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; R0,#+1\n"&lt;/P&gt;&lt;P&gt;"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LDR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; R3,myModuleVariable\n"&lt;/P&gt;&lt;P&gt;"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STRB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; R0,[R3, #+0]\n"&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is giving me the following error:&lt;BR /&gt;Error[Lp002]: relocation failed: value out of range or illegal: (someAddress)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I notice that the other disassembled functions that make use of this do so through means of the data table such&amp;nbsp; as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LDR R3, ??DataTable1_1 when disassembled to a .s file.&amp;nbsp; However because of the risk of the data table changing throughout compilations I cannot use this ??DataTableX_X, unless I were to double check and update with every build.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Feb 2016 19:38:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IMX53-inline-assembler-with-use-of-module-global-variables/m-p/485817#M77657</guid>
      <dc:creator>davidgolke</dc:creator>
      <dc:date>2016-02-24T19:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: IMX53 inline assembler with use of module/global variables</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IMX53-inline-assembler-with-use-of-module-global-variables/m-p/485818#M77658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LDR,STR instructions have limit on branch, details are prvided for example in arm&lt;/P&gt;&lt;P&gt;documentation Table 3-2 Offsets and architectures, LDR/STR DUI0489C_arm_assembler_reference.pdf&lt;/P&gt;&lt;P&gt;One can add additional table with long branches in visibility of problematic instruction&lt;/P&gt;&lt;P&gt;or use other ways, depending on linker capabilities. This should be described in linker&lt;/P&gt;&lt;P&gt;documentation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;igor&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Feb 2016 02:09:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IMX53-inline-assembler-with-use-of-module-global-variables/m-p/485818#M77658</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2016-02-25T02:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: IMX53 inline assembler with use of module/global variables</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IMX53-inline-assembler-with-use-of-module-global-variables/m-p/485819#M77659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Igor,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm wondering if it is possible to make use of global/module variables at all with the inline assembler functionality (__asm/asm()) and any instructions.&amp;nbsp; Not necessarily the LDR, but that is one I was going to use.&amp;nbsp; I can look into the &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;DUI0489C_arm_assembler_reference.pdf but if it is not possible to use these variables at all with __asm then I will likely have to find a new solution.&amp;nbsp; &lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Feb 2016 15:54:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IMX53-inline-assembler-with-use-of-module-global-variables/m-p/485819#M77659</guid>
      <dc:creator>davidgolke</dc:creator>
      <dc:date>2016-02-25T15:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: IMX53 inline assembler with use of module/global variables</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IMX53-inline-assembler-with-use-of-module-global-variables/m-p/485820#M77660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also, I really only have two variables.&amp;nbsp; One that is holding an address that I need to load into a register, and another that I simply need to set to 1 based on test conditions.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Feb 2016 17:27:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IMX53-inline-assembler-with-use-of-module-global-variables/m-p/485820#M77660</guid>
      <dc:creator>davidgolke</dc:creator>
      <dc:date>2016-02-25T17:27:02Z</dc:date>
    </item>
  </channel>
</rss>

