<?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>8-bit Microcontrollers中的主题 Re: How to define local various using HCS08 Assembly language</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-define-local-various-using-HCS08-Assembly-language/m-p/153612#M8607</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No you cannot use another assembler within CodeWarrior,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Dec 2010 16:41:23 GMT</pubDate>
    <dc:creator>CrasyCat</dc:creator>
    <dc:date>2010-12-20T16:41:23Z</dc:date>
    <item>
      <title>How to define local various using HCS08 Assembly language</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-define-local-various-using-HCS08-Assembly-language/m-p/153606#M8601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I'm a beginner of Freescale MCU. I'm confusing how to define local various and use it using HCS08 assembly language. Can someone give me some examples? Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Oct 2010 11:46:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-define-local-various-using-HCS08-Assembly-language/m-p/153606#M8601</guid>
      <dc:creator>Tianshu</dc:creator>
      <dc:date>2010-10-08T11:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to define local various using HCS08 Assembly language</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-define-local-various-using-HCS08-Assembly-language/m-p/153607#M8602</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;I assume that you wish to define some variables within RAM.&amp;nbsp; I do not know what you actually&amp;nbsp;mean by "local" - the stack can be used for temporary storage of intermediate values within a sub-routine, but I will assume this is not what you want to do in this case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To define a number of bytes of RAM storage at a specific location, you will need to make use of the DS directive.&amp;nbsp; Other variations are DS.B, DS.W and DS.L to explicitly define byte, word (16-bit)&amp;nbsp;or long (32-bit) variable size.&amp;nbsp; Some examples are given in the Assembler manual.&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Oct 2010 10:01:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-define-local-various-using-HCS08-Assembly-language/m-p/153607#M8602</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2010-10-10T10:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to define local various using HCS08 Assembly language</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-define-local-various-using-HCS08-Assembly-language/m-p/153608#M8603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know what you mean - local scope such as within a subroutine.&amp;nbsp; Some assemblers use a special prefix to the label and delimit the scope by a double&amp;nbsp; ** at the beginning of a line (like a subroutine header has).&amp;nbsp;&amp;nbsp; That way you can use ?loop as a label any number of times in your program.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I looked around quite a bit - seems their assembler doesn't support it. (or they have it confused with the scope of a macro.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;It would be nice if someone at freescale commented on this issue.&amp;nbsp; There is still a lot of work that belongs in assembly language and local labels are not something we should have to live without. (the assembler X68C11.EXE had them)..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The other thing I miss is a block comment macro in codewarrior 10.0..&amp;nbsp; The docs imply it is there - but I can't get it to work.&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, 15 Dec 2010 12:29:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-define-local-various-using-HCS08-Assembly-language/m-p/153608#M8603</guid>
      <dc:creator>xtronics</dc:creator>
      <dc:date>2010-12-15T12:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to define local various using HCS08 Assembly language</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-define-local-various-using-HCS08-Assembly-language/m-p/153609#M8604</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;Assuming you have a relocatable assembly project, all labels are limited to file scope anyway.&amp;nbsp; To increase beyond this requires specific use of the directives XDEF to export a label name from a file, and XREF to import a label name into a file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A label occurring within a macro will be local to each use of the macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I guess you already know this.&amp;nbsp; Having never used an assembler that provided local variables with sub-routine scope (the P&amp;amp;E assemblers I have used also did not have this facility), I have never felt the specific&amp;nbsp;need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Perhaps &lt;A __default_attr="57347" class="jive_macro jive_macro_thread default_title" href="https://community.freescale.com/thread/57347" jivemacro="thread" title="this assembler"&gt;this assembler&lt;/A&gt;&amp;nbsp;might have the extra bells and whistles that you require.&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Dec 2010 20:58:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-define-local-various-using-HCS08-Assembly-language/m-p/153609#M8604</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2010-12-15T20:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to define local various using HCS08 Assembly language</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-define-local-various-using-HCS08-Assembly-language/m-p/153610#M8605</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;What are you trying to achieve here exactly?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the question is how to make sure the assembler generates unique labels inside of macros, refer to HC08 assembler manual chapter &lt;EM&gt;&lt;STRONG&gt;Macro&lt;/STRONG&gt;&lt;/EM&gt; &amp;gt;&lt;STRONG&gt;&lt;EM&gt;Labels inside macros&lt;/EM&gt;&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are using CW V10.x the manual is located in {Install}\MCU\\Help\PDF and is called &lt;EM&gt;HCS08-RS08_Assembler_MCU_Eclipse.pdf&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;If you are using V6.x or earlier, the manual is located in {Install}\Help\PDF and is called &lt;EM&gt;Assembler_HC08.pdf&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to simulate local variables on the stack this is not directly supported by the assembler, but you can modify stack pointer using instruction AIS and then use the OFFSET assembler directive to&amp;nbsp;associate symbolic names to stack&amp;nbsp;location.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can get an example of OFFSET directive in the assembler manual specified above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Dec 2010 17:52:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-define-local-various-using-HCS08-Assembly-language/m-p/153610#M8605</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2010-12-16T17:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to define local various using HCS08 Assembly language</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-define-local-various-using-HCS08-Assembly-language/m-p/153611#M8606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It isn't about within macros.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm wondering if there is any problem using a different assembler from within codewarrior?&amp;nbsp; ASM8 supports local labels.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an example of what we are talking about:&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;** header line that starts with two splats limits the scope?loop   inca        bne ?loop** next subroutine?loop incx bne ?loop&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reuse of ?loop is not a problem for most assembler and makes the code more readable than trying to invent hundreds of labels.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The choice of&amp;nbsp; **&amp;nbsp; and ? is sometimes configurable.&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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:56:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-define-local-various-using-HCS08-Assembly-language/m-p/153611#M8606</guid>
      <dc:creator>xtronics</dc:creator>
      <dc:date>2020-10-29T08:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to define local various using HCS08 Assembly language</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-define-local-various-using-HCS08-Assembly-language/m-p/153612#M8607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No you cannot use another assembler within CodeWarrior,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Dec 2010 16:41:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-define-local-various-using-HCS08-Assembly-language/m-p/153612#M8607</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2010-12-20T16:41:23Z</dc:date>
    </item>
  </channel>
</rss>

