<?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>CodeWarrior for MCU中的主题 Re: Byte or Bit Reference?</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Byte-or-Bit-Reference/m-p/604511#M13445</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jennie:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for clarifying that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am curious, though...&amp;nbsp; using your example where &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;"i"&lt;/SPAN&gt; is at location 0x100, wouldn't&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;"STA&amp;nbsp; i+5"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;also store the accumulator at address 0x105, which is the way I have always known how to store the Accumulator at a fixed offset from a given address location?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this "offset syntax" standard usage industry-wide, or only available on NXP/Freescale processors (used with CodeWarrior)?&amp;nbsp; I could not find any reference to this type of offset usage on the internet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Sep 2016 18:30:49 GMT</pubDate>
    <dc:creator>bpaehr</dc:creator>
    <dc:date>2016-09-13T18:30:49Z</dc:date>
    <item>
      <title>Byte or Bit Reference?</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Byte-or-Bit-Reference/m-p/604509#M13443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;start08.c&lt;/SPAN&gt; from my MC9S08SH8 Startup_Code folder, I found this code snippet (I've removed irrelevant comments and follow-on&amp;nbsp;code):&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&lt;SPAN style="font-size: small;"&gt;&lt;STRONG&gt;static&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; font-size: small;"&gt;void&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; &lt;STRONG&gt;Init&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;STRONG style=": ; font-size: small;"&gt;void&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt;) {&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&lt;STRONG style=": ; font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;int&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; i;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-size: small; font-family: courier new,courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&lt;SPAN style="font-size: small;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style=": ; font-size: small;"&gt;asm&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; {&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;ZeroOut:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&lt;SPAN style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LDA &amp;nbsp;&amp;nbsp;&amp;nbsp;_startupData.nofZeroOuts:1 ; &lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt;/* nofZeroOuts */&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;INCA&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&lt;SPAN style="font-size: small;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;STA &amp;nbsp;&amp;nbsp;&amp;nbsp;i:1 ; &lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt;/* i is counter for number of zero outs */&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&lt;SPAN style="font-size: small;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LDA &amp;nbsp;&amp;nbsp;&amp;nbsp;_startupData.nofZeroOuts:0 ; &lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt;/* nofZeroOuts */&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;INCA&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;STA&amp;nbsp;&amp;nbsp;&amp;nbsp;i:0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&lt;SPAN style="font-size: small;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LDHX&amp;nbsp;&amp;nbsp;&amp;nbsp;_startupData.pZeroOut ; &lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt;/* *pZeroOut */&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BRA&amp;nbsp;&amp;nbsp;&amp;nbsp;Zero_5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;Zero_3:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-family: courier new,courier,monospace;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What are the "&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;i:0&lt;/SPAN&gt;" and "&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;i:1&lt;/SPAN&gt;" references?&amp;nbsp; From the definition of &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;"i"&lt;/SPAN&gt; as an &lt;SPAN style="color: #993366;"&gt;&lt;STRONG style="font-family: courier new,courier,monospace;"&gt;int,&lt;/STRONG&gt;&lt;/SPAN&gt; (a 16-bit, 2-byte&amp;nbsp;value), they APPEAR to be low-&lt;SPAN style="color: #ff0000;"&gt;&lt;EM&gt;byte&lt;/EM&gt;&lt;/SPAN&gt; and high-&lt;EM style="color: #ff0000;"&gt;byte&lt;/EM&gt; references, especially since the "&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;STA&lt;/SPAN&gt;" opcode is dealing with the 8-bit&amp;nbsp;accumulator.&amp;nbsp; I can't see that there is any reference to a structure or bitfield since &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;"i"&lt;/SPAN&gt; is defined locally.&lt;/P&gt;&lt;P&gt;It appears that&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;"STA&amp;nbsp; i:1"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;means&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"store the entire 8-bit accumulator in the high byte of variable 'i' ".&lt;/P&gt;&lt;P&gt;It doesn't make any sense if I try to look at it from the individual bits.&amp;nbsp; Am I correct?&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Sep 2016 17:32:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Byte-or-Bit-Reference/m-p/604509#M13443</guid>
      <dc:creator>bpaehr</dc:creator>
      <dc:date>2016-09-09T17:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: Byte or Bit Reference?</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Byte-or-Bit-Reference/m-p/604510#M13444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regarding to &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;"STA&amp;nbsp; i:1"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here, "i" is a variable name. "1" is offset address of "i".&lt;/P&gt;&lt;P&gt;let's take example "i" is at address 0x100. thus &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;"STA&amp;nbsp; i:1"&lt;/SPAN&gt; means stores the contents of A in memory address 0x101(0x100+1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;other examples:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;"STA&amp;nbsp; i:2" : stores the contents of A in memory address 0x102&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;"STA&amp;nbsp; i:0" : stores the contents of A in memory address 0x100&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;"STA&amp;nbsp; i:5" : stores the contents of A in memory address 0x105&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jennie Zhang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Sep 2016 05:39:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Byte-or-Bit-Reference/m-p/604510#M13444</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2016-09-13T05:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: Byte or Bit Reference?</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Byte-or-Bit-Reference/m-p/604511#M13445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jennie:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for clarifying that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am curious, though...&amp;nbsp; using your example where &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;"i"&lt;/SPAN&gt; is at location 0x100, wouldn't&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;"STA&amp;nbsp; i+5"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;also store the accumulator at address 0x105, which is the way I have always known how to store the Accumulator at a fixed offset from a given address location?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this "offset syntax" standard usage industry-wide, or only available on NXP/Freescale processors (used with CodeWarrior)?&amp;nbsp; I could not find any reference to this type of offset usage on the internet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Sep 2016 18:30:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Byte-or-Bit-Reference/m-p/604511#M13445</guid>
      <dc:creator>bpaehr</dc:creator>
      <dc:date>2016-09-13T18:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Byte or Bit Reference?</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Byte-or-Bit-Reference/m-p/604512#M13446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;instruction STA doesn't support syntax &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;"STA&amp;nbsp; i+5"&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;I think the offset syntax is widely used in many MCU assembly code.&lt;/P&gt;&lt;P&gt;for more information about STA usage, see below. I extracted it from instruction set. see attached document.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/5995i04BEDF1660D7F1C3/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jennie Zhang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2016 04:06:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Byte-or-Bit-Reference/m-p/604512#M13446</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2016-11-03T04:06:13Z</dc:date>
    </item>
  </channel>
</rss>

