<?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: Move.l question in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Move-l-question/m-p/165118#M5643</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I understand correctly your intention, you want to load the constant to address&lt;/P&gt;&lt;P&gt;"content of register a0 plus content of index register i" .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below are some clarifications to &lt;A href="http://forums.freescale.com/freescale/view_profile?user.id=5188" target="_blank"&gt;&lt;SPAN&gt;Paolo Renzo&lt;/SPAN&gt;&lt;/A&gt; answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. The source must be listed first. The destination must be listed second.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. The document "ColdFire Family Programmer's Reference Manual" mentions for &lt;SPAN&gt;MOVE&lt;/SPAN&gt; instruction, that, for the addressing mode of the source is the constant &lt;SPAN&gt;#xxx&lt;/SPAN&gt;,&amp;nbsp; destination mode of index &lt;SPAN&gt;(d8,Ax,Xi)&lt;/SPAN&gt; is impossible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. You need to split the intended operation into two instructions, using one more register to store the related temporary value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4. The following two workarounds are compiled with GNU compiler. The constant here is &lt;SPAN&gt;#800&lt;/SPAN&gt;, and the index register is &lt;SPAN&gt;%a1&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first workaround uses additional register &lt;SPAN&gt;%d0&lt;/SPAN&gt; to store temporarily the value of the source constant.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.l&amp;nbsp;&amp;nbsp; #800, %d0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.l&amp;nbsp;&amp;nbsp; %d0, (0,%a0,%a1.l*1)&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second workaround uses additional register &lt;SPAN&gt;%a2&lt;/SPAN&gt; to store temporarily the effective destination address after the indexing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lea.l&amp;nbsp;&amp;nbsp;&amp;nbsp; (0,%a0,%a1.l*1), %a2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.l&amp;nbsp;&amp;nbsp; #800, (%a2)&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by yevgenit on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2010-01-06&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;10:37 AM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Jan 2010 16:33:53 GMT</pubDate>
    <dc:creator>admin</dc:creator>
    <dc:date>2010-01-06T16:33:53Z</dc:date>
    <item>
      <title>Move.l question</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Move-l-question/m-p/165115#M5640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. I have the following line in my code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;asm&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&lt;/P&gt;&lt;P&gt;move.l i(a0), value; &lt;SPAN class="Apple-tab-span"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;where "i" is defined as short. When making the project I get the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error: ',' expected&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;move.l i&lt;SPAN class="Apple-style-span"&gt;(&lt;/SPAN&gt;a0), value; &amp;nbsp; &amp;nbsp;(the symbol "(" is underlined)...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where is the problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Marco.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2010 02:32:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Move-l-question/m-p/165115#M5640</guid>
      <dc:creator>LordMark</dc:creator>
      <dc:date>2010-01-05T02:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: Move.l question</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Move-l-question/m-p/165116#M5641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That kind of addressing is not allowed in CW, note i should be inside a register, then cannot use indirect with displacement mode&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try to look for more info about "Address Register Indirect with Scaled Index and 8-Bit Displacement&lt;BR /&gt;Mode" as a workaround or use the move in a different way&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2010 03:03:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Move-l-question/m-p/165116#M5641</guid>
      <dc:creator>PaoloRenzo</dc:creator>
      <dc:date>2010-01-05T03:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: Move.l question</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Move-l-question/m-p/165117#M5642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I tried also what you suggested, but as soon as I introduce "i" in the statement I get the same error...&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jan 2010 22:00:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Move-l-question/m-p/165117#M5642</guid>
      <dc:creator>LordMark</dc:creator>
      <dc:date>2010-01-05T22:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: Move.l question</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Move-l-question/m-p/165118#M5643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I understand correctly your intention, you want to load the constant to address&lt;/P&gt;&lt;P&gt;"content of register a0 plus content of index register i" .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below are some clarifications to &lt;A href="http://forums.freescale.com/freescale/view_profile?user.id=5188" target="_blank"&gt;&lt;SPAN&gt;Paolo Renzo&lt;/SPAN&gt;&lt;/A&gt; answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. The source must be listed first. The destination must be listed second.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. The document "ColdFire Family Programmer's Reference Manual" mentions for &lt;SPAN&gt;MOVE&lt;/SPAN&gt; instruction, that, for the addressing mode of the source is the constant &lt;SPAN&gt;#xxx&lt;/SPAN&gt;,&amp;nbsp; destination mode of index &lt;SPAN&gt;(d8,Ax,Xi)&lt;/SPAN&gt; is impossible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. You need to split the intended operation into two instructions, using one more register to store the related temporary value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4. The following two workarounds are compiled with GNU compiler. The constant here is &lt;SPAN&gt;#800&lt;/SPAN&gt;, and the index register is &lt;SPAN&gt;%a1&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first workaround uses additional register &lt;SPAN&gt;%d0&lt;/SPAN&gt; to store temporarily the value of the source constant.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.l&amp;nbsp;&amp;nbsp; #800, %d0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.l&amp;nbsp;&amp;nbsp; %d0, (0,%a0,%a1.l*1)&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second workaround uses additional register &lt;SPAN&gt;%a2&lt;/SPAN&gt; to store temporarily the effective destination address after the indexing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lea.l&amp;nbsp;&amp;nbsp;&amp;nbsp; (0,%a0,%a1.l*1), %a2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; move.l&amp;nbsp;&amp;nbsp; #800, (%a2)&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by yevgenit on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2010-01-06&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;10:37 AM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jan 2010 16:33:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Move-l-question/m-p/165118#M5643</guid>
      <dc:creator>admin</dc:creator>
      <dc:date>2010-01-06T16:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Move.l question</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Move-l-question/m-p/165119#M5644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Thanks for suggestions &lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jan 2010 17:29:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Move-l-question/m-p/165119#M5644</guid>
      <dc:creator>LordMark</dc:creator>
      <dc:date>2010-01-06T17:29:21Z</dc:date>
    </item>
  </channel>
</rss>

