<?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: Assembler question -- # in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Assembler-question/m-p/134988#M1643</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello Curt,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Actually, the instruction format is well defined - in the context you are using, the hash symbol always represents "immediate" addressing mode, where the value to be loaded will follow the instruction byte.&amp;nbsp; The value may be either a byte value, or in some cases a word value (but not for the RS08).&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 May 2007 12:01:46 GMT</pubDate>
    <dc:creator>bigmac</dc:creator>
    <dc:date>2007-05-29T12:01:46Z</dc:date>
    <item>
      <title>Assembler question -- #</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Assembler-question/m-p/134982#M1637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Can anyone tell me where, in the 'HSO8 assembler docs., I will find the usage of the&lt;/DIV&gt;&lt;DIV&gt;"#" symbol defined?&amp;nbsp; I've been through the .pdf assembler docs several times -- but&lt;/DIV&gt;&lt;DIV&gt;darned if I can find it!&amp;nbsp; For example:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Stuff&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DS.B&amp;nbsp; 1&lt;/DIV&gt;&lt;DIV&gt;...&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; LDA&amp;nbsp;&amp;nbsp; Stuff&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&amp;nbsp; move the current content of the address&amp;nbsp;"Stuff" into A&lt;/DIV&gt;&lt;DIV&gt;...&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; LDA&amp;nbsp;&amp;nbsp;#Stuff&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&amp;nbsp; move the address of "Stuff" into A&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I think I understand how # is supposed to work -- but where is it in the docs?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 May 2007 20:36:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Assembler-question/m-p/134982#M1637</guid>
      <dc:creator>Curt</dc:creator>
      <dc:date>2007-05-27T20:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: Assembler question -- #</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Assembler-question/m-p/134983#M1638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Which version do you use?&lt;BR /&gt;In&lt;BR /&gt;CodeWarrior for HC08 V5.1\Help\PDF\Assembler_HC08.pdf&lt;BR /&gt;all addressing modes are described in the chapter&lt;BR /&gt;Operand field: Addressing modes (HC08 /&lt;BR /&gt;HCS08) from page (HC08 V5.1 version) 265 up to 276.&lt;BR /&gt;&lt;BR /&gt;But what you probably should have a look first is the &lt;SPAN&gt;HCS08 Family Reference Manual. The assembler just uses the same syntax, and this manual contains the description of all instructions and their behavior.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 May 2007 21:24:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Assembler-question/m-p/134983#M1638</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2007-05-27T21:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: Assembler question -- #</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Assembler-question/m-p/134984#M1639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi Daniel,&lt;/DIV&gt;&lt;DIV&gt;Thanks for the quick reply!&amp;nbsp; This isn't an important issue -- just one that causes&lt;/DIV&gt;&lt;DIV&gt;a little disquiet, since you feel better if you can find a usage in the&amp;nbsp;docs.&amp;nbsp; I'm using the 'RS08 and observe the following (for example):&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;data:&amp;nbsp;&amp;nbsp; DS.B&amp;nbsp; 1&lt;/DIV&gt;&lt;DIV&gt;...&lt;/DIV&gt;&lt;DIV&gt;lda #Low(data)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; places the low byte of the address of data in a -- documented&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;lda #High(data)&amp;nbsp;&amp;nbsp;&amp;nbsp; ; places the high byte of the address of data in a -- documented&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;lda #data&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&amp;nbsp; ??&amp;nbsp; -- not documented (that I can see), but seems to the same&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&amp;nbsp; as lda #Low(data)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;In #data, the # is acting as an operator, rather than just an immediate operand signal to the assembler -- which is very handy, if a bona fide, supported use of the syntax.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I don't think I have a copy of the Family Reference Manual, but will see about downloading one today.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks again,&lt;/DIV&gt;&lt;DIV&gt;Curt&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 May 2007 00:57:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Assembler-question/m-p/134984#M1639</guid>
      <dc:creator>Curt</dc:creator>
      <dc:date>2007-05-28T00:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Assembler question -- #</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Assembler-question/m-p/134985#M1640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I've found that when I couldn't figure out what something did in an example, or wasn't sure even of my own code, I just look at the op codes and go back to the chip specs.&lt;BR /&gt;&lt;BR /&gt;I know, pretty tedious.&lt;BR /&gt;&lt;BR /&gt;But years ago (about 1988) I did a project using an Hitachi 63701. (A variant of the 6801) I had 100 of these things, and I couldn't get the program to work. For some reason I noticed that a 'call' to a subroutine was to the wrong address. It was off my 1. In fact, all the addresses at the end of the program were off by 1, but were fine at the start. Working back from both ends, I finally tracked it down to one spot in the program and I looked at the op-codes it generated. Turned out there was a bug in the assembler. If I generated a certain type of jump it used the opcode for a 16 bit offset to jump to, but only put the lower 8-bits in the next byte and threw away the high byte which was zero. That meant that EVERY single reference in the source after that point was 'offset' by 1 from where the program was trying to jump and call too. What a mess. I ended up making a 'db' sequence to do what I needed and everything worked.&lt;BR /&gt;&lt;BR /&gt;Anyway, while that little story doesn't really apply to your case, what I'm getting at is going in and looking at the opcode bytes your program generates isn't a bad skill to have. Start doing it when it's not critical so that you understand things and it will be a lot easy to do when it is critical.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 May 2007 20:28:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Assembler-question/m-p/134985#M1640</guid>
      <dc:creator>mke_et</dc:creator>
      <dc:date>2007-05-28T20:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: Assembler question -- #</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Assembler-question/m-p/134986#M1641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello Curt,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp; lda #(data%256)&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;should give the same result as&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp; lda #Low(data)&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;and&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp; lda #(data/256)&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;the same result as&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp; lda #High(data)&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;lda #data&lt;/FONT&gt;&amp;nbsp; is potentially problematic if &lt;FONT face="Courier New"&gt;data&lt;/FONT&gt; is located at other than page zero, and should be avoided when referring to an address (rather than an immediate byte value).&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2007 01:55:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Assembler-question/m-p/134986#M1641</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-05-29T01:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: Assembler question -- #</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Assembler-question/m-p/134987#M1642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi mke_et and bigmac.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks for the inputs.&amp;nbsp; I guess the answer to my question is that #&amp;nbsp; alone is not defined in the assembler docs -- on purpose&lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2007 06:08:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Assembler-question/m-p/134987#M1642</guid>
      <dc:creator>Curt</dc:creator>
      <dc:date>2007-05-29T06:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: Assembler question -- #</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Assembler-question/m-p/134988#M1643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello Curt,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Actually, the instruction format is well defined - in the context you are using, the hash symbol always represents "immediate" addressing mode, where the value to be loaded will follow the instruction byte.&amp;nbsp; The value may be either a byte value, or in some cases a word value (but not for the RS08).&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2007 12:01:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Assembler-question/m-p/134988#M1643</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-05-29T12:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Assembler question -- #</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Assembler-question/m-p/134989#M1644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Enough said bigmac.&amp;nbsp; Its not that important&lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2007 23:53:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Assembler-question/m-p/134989#M1644</guid>
      <dc:creator>Curt</dc:creator>
      <dc:date>2007-05-29T23:53:24Z</dc:date>
    </item>
  </channel>
</rss>

