<?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: howto: HLI varible,x (inline assembly using varible,X offset to tables of varibles) in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/howto-HLI-varible-x-inline-assembly-using-varible-X-offset-to/m-p/197109#M15832</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply Bigmac,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I probably should have gone into more detail in my above example. Along with using __near, the varibles must be defined in zero page as you say (which i have)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#pragma DATA_SEG MY_ZEROPAGE&lt;/P&gt;&lt;P&gt;static uchar __near MyVar = 0;&lt;/P&gt;&lt;P&gt;#pragma DATA_SEG DEFAULT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I had to do to get&amp;nbsp;various similar commands to rol op,x to work, its just this one command. I am pretty sure that there is something wrong with the back end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately I cannot just do a work around in this case, I need this command is its critical to the 128bit NLF we have.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Jul 2009 05:55:12 GMT</pubDate>
    <dc:creator>CarlFST60L</dc:creator>
    <dc:date>2009-07-09T05:55:12Z</dc:date>
    <item>
      <title>howto: HLI varible,x (inline assembly using varible,X offset to tables of varibles)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/howto-HLI-varible-x-inline-assembly-using-varible-X-offset-to/m-p/197104#M15827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should be very easy, I searched around for ideas for half hour and have given up on this very simple problem. I cannot work out how to get inline assembly to compile the address of a varible for use with an ,X offset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- I know this code is useless here, but its important for our application as its doing 128 bit NLF's.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;uchar test[32]&amp;nbsp; = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;__asm{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; LDHX #$0005&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; LDA test:1,x&amp;nbsp; //&amp;lt; PROBLEM, will not compile "test" as an address using @ or &amp;amp; or a pointer to test.&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: Using Codewarrior 6.1 and a HCS08 processor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is clearly that test is not being replaced as an address, I have tried everything i can think of. Code works straight away in straight assembly.&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by CarlFST60L on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-07-08&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;04:00 AM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2009 09:55:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/howto-HLI-varible-x-inline-assembly-using-varible-X-offset-to/m-p/197104#M15827</guid>
      <dc:creator>CarlFST60L</dc:creator>
      <dc:date>2009-07-08T09:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: howto: HLI varible,x (inline assembly using varible,X offset to tables of varibles)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/howto-HLI-varible-x-inline-assembly-using-varible-X-offset-to/m-p/197105#M15828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear CarlFST60L,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tried the following 3 cases for a 9S08SH8 target:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;uchar test1[32] = {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 0&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; asm {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ldhx&amp;nbsp; #@test1&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lda&amp;nbsp;&amp;nbsp; 5000,x&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ldhx&amp;nbsp; #5&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lda&amp;nbsp;&amp;nbsp; @test1,x&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ldhx&amp;nbsp; #5&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lda&amp;nbsp;&amp;nbsp; @test1:2,x&lt;BR /&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;Produced&lt;/P&gt;&amp;nbsp;&amp;nbsp; 14:&amp;nbsp;&amp;nbsp;&amp;nbsp; asm {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 15:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ldhx&amp;nbsp; #@test1&lt;BR /&gt;&amp;nbsp; 0000 450000&amp;nbsp;&amp;nbsp; [3]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LDHX&amp;nbsp; @test1&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 16:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lda&amp;nbsp;&amp;nbsp; 5000,x&lt;BR /&gt;&amp;nbsp; 0003 d61388&amp;nbsp;&amp;nbsp; [4]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LDA&amp;nbsp;&amp;nbsp; 5000,X&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 17:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ldhx&amp;nbsp; #5&lt;BR /&gt;&amp;nbsp; 0006 450005&amp;nbsp;&amp;nbsp; [3]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LDHX&amp;nbsp; #5&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 18:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lda&amp;nbsp;&amp;nbsp; @test1,x&lt;BR /&gt;&amp;nbsp; 0009 d60000&amp;nbsp;&amp;nbsp; [4]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LDA&amp;nbsp;&amp;nbsp; @test1,X&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 19:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ldhx&amp;nbsp; #5&lt;BR /&gt;&amp;nbsp; 000c 450005&amp;nbsp;&amp;nbsp; [3]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LDHX&amp;nbsp; #5&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 20:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lda&amp;nbsp;&amp;nbsp; @test1:2,x&lt;BR /&gt;&amp;nbsp; 000f d60002&amp;nbsp;&amp;nbsp; [4]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LDA&amp;nbsp;&amp;nbsp; @test1:2,X&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 21:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 22:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 23:&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which looks OK. Simulation also looks correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using CW for microcontrollers V6.2. &amp;amp; whatever patches are current (6.2.2 I think!)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have I missed something?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;bye&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by pgo on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-07-08&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;01:55 PM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2009 10:49:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/howto-HLI-varible-x-inline-assembly-using-varible-X-offset-to/m-p/197105#M15828</guid>
      <dc:creator>pgo</dc:creator>
      <dc:date>2009-07-08T10:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: howto: HLI varible,x (inline assembly using varible,X offset to tables of varibles)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/howto-HLI-varible-x-inline-assembly-using-varible-X-offset-to/m-p/197106#M15829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your quick reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The solution was that you must define the varibles used in the&amp;nbsp;HLI as global. The reason I didnt realise this was the the error just says "C18107: Illegal Operands" which is what you also get when you put the incorrect syntax.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2009 11:34:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/howto-HLI-varible-x-inline-assembly-using-varible-X-offset-to/m-p/197106#M15829</guid>
      <dc:creator>CarlFST60L</dc:creator>
      <dc:date>2009-07-08T11:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: howto: HLI varible,x (inline assembly using varible,X offset to tables of varibles)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/howto-HLI-varible-x-inline-assembly-using-varible-X-offset-to/m-p/197107#M15830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, all went fine until I came across one thing that doesnt work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&lt;/P&gt;&lt;P&gt;static uchar _near MyVar = 0;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;void main(void){&lt;/P&gt;&lt;P&gt;&amp;nbsp;__asm{&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rol MyVar,x&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //This line just doesnt work, take off the ,x and it works 100%!&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&amp;nbsp;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also noticed that the global varibles need to be declared as _near for paged instructions for anyone that came across this that was having similar problems.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2009 17:52:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/howto-HLI-varible-x-inline-assembly-using-varible-X-offset-to/m-p/197107#M15830</guid>
      <dc:creator>CarlFST60L</dc:creator>
      <dc:date>2009-07-08T17:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: howto: HLI varible,x (inline assembly using varible,X offset to tables of varibles)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/howto-HLI-varible-x-inline-assembly-using-varible-X-offset-to/m-p/197108#M15831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;CarlFST60L wrote:&lt;BR /&gt;&lt;P&gt;Well, all went fine until I came across one thing that doesnt work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&lt;/P&gt;&lt;P&gt;static uchar _near MyVar = 0;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;void main(void){&lt;/P&gt;&lt;P&gt;&amp;nbsp;__asm{&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rol MyVar,x&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //This line just doesnt work, take off the ,x and it works 100%!&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&amp;nbsp;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also noticed that the global varibles need to be declared as _near for paged instructions for anyone that came across this that was having similar problems.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I suspect that the instruction might work if the static variable were to be placed within page zero RAM, although I haven't tried it.&amp;nbsp; Since 16-bit offset is not valid for this instruction, there would even be difficulty in writing normal assembly code.&amp;nbsp; Certainly the stack cannot be used with indexed addressing, but might be for non-indexed operation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2009 23:48:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/howto-HLI-varible-x-inline-assembly-using-varible-X-offset-to/m-p/197108#M15831</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2009-07-08T23:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: howto: HLI varible,x (inline assembly using varible,X offset to tables of varibles)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/howto-HLI-varible-x-inline-assembly-using-varible-X-offset-to/m-p/197109#M15832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply Bigmac,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I probably should have gone into more detail in my above example. Along with using __near, the varibles must be defined in zero page as you say (which i have)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#pragma DATA_SEG MY_ZEROPAGE&lt;/P&gt;&lt;P&gt;static uchar __near MyVar = 0;&lt;/P&gt;&lt;P&gt;#pragma DATA_SEG DEFAULT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I had to do to get&amp;nbsp;various similar commands to rol op,x to work, its just this one command. I am pretty sure that there is something wrong with the back end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately I cannot just do a work around in this case, I need this command is its critical to the 128bit NLF we have.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2009 05:55:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/howto-HLI-varible-x-inline-assembly-using-varible-X-offset-to/m-p/197109#M15832</guid>
      <dc:creator>CarlFST60L</dc:creator>
      <dc:date>2009-07-09T05:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: howto: HLI varible,x (inline assembly using varible,X offset to tables of varibles)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/howto-HLI-varible-x-inline-assembly-using-varible-X-offset-to/m-p/197110#M15833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you can't get the HLI code to meet your indexing requirements, another possibility would be to write your speed critical routine in "pure assembly", within a .asm file, and add this file to your project.&amp;nbsp; Your C function could now setup any parameters required, and then JSR to the assembly sub-routine using HLI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jul 2009 23:04:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/howto-HLI-varible-x-inline-assembly-using-varible-X-offset-to/m-p/197110#M15833</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2009-07-09T23:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: howto: HLI varible,x (inline assembly using varible,X offset to tables of varibles)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/howto-HLI-varible-x-inline-assembly-using-varible-X-offset-to/m-p/197111#M15834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I shortly wrote the small test below and I did not notice anything special with rol.&lt;/P&gt;&lt;P&gt;I wonder if you have a macro called rol? I would check the preprocessor output.&lt;/P&gt;&lt;P&gt;Otherwise please provide a full text example, best if including the project as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BTW: I recomment not to use the __near qualified but instead mark the section as __SHORT_SEG.&lt;/P&gt;&lt;P&gt;This way the allocation and the way the variable is accessed are both at one place, the pragma.&lt;/P&gt;&lt;P&gt;Otherwise it is up to the programmer to make sure the two match.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
#pragma DATA_SEG __SHORT_SEG MY_ZEROPAGEstatic unsigned char buf[2];#pragma DATA_SEG DEFAULTvoid main(void) {  buf[0] = 0x2;  buf[1] = 0x4;  for(;;) {    __asm LDHX #1;    __asm ROL @buf,X    __asm AIX #-1    __asm ROL @buf,X    }}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&amp;nbsp;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2009 09:49:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/howto-HLI-varible-x-inline-assembly-using-varible-X-offset-to/m-p/197111#M15834</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2009-07-10T09:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: howto: HLI varible,x (inline assembly using varible,X offset to tables of varibles)</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/howto-HLI-varible-x-inline-assembly-using-varible-X-offset-to/m-p/197112#M15835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Daniel,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the idea using __SHORT_SEG to, much nicer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see in my example I did not have the @ infront of the varible.&amp;nbsp;I guess I now understand what the compilier expects. I couldnt see any details of this in the help files, but it all makes sense now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Carl.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jul 2009 10:16:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/howto-HLI-varible-x-inline-assembly-using-varible-X-offset-to/m-p/197112#M15835</guid>
      <dc:creator>CarlFST60L</dc:creator>
      <dc:date>2009-07-10T10:16:57Z</dc:date>
    </item>
  </channel>
</rss>

