<?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: Help me to understand lines of code</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Help-me-to-understand-lines-of-code/m-p/153872#M8638</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp;&amp;nbsp;刘宇,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do not remove all three lines - at least one write is needed, otherwise the erase will not work.&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:20:47 GMT</pubDate>
    <dc:creator>bigmac</dc:creator>
    <dc:date>2010-10-10T10:20:47Z</dc:date>
    <item>
      <title>Help me to understand lines of code</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Help-me-to-understand-lines-of-code/m-p/153869#M8635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. I'm a beginner of Freescale 8-Bit MCU. Recent&amp;nbsp; I read the code below used to erase&amp;nbsp;the EEPROM&amp;nbsp;of DZ60.&amp;nbsp; I have&amp;nbsp;understood most of code means. But I cannot understand first three line of codes. Should someone like to explain these for me? Thanks!&lt;/P&gt;&lt;P&gt;E_EEPROM:&lt;/P&gt;&lt;P&gt;STA ,X ; H:X中是要擦出的EEPROM段的地址&lt;/P&gt;&lt;P&gt;&amp;nbsp;NOP&lt;/P&gt;&lt;P&gt;&amp;nbsp;STA ,X lda #(mFSTAT_FPVIOL + mFSTAT_FACCERR)&lt;/P&gt;&lt;P&gt;sta FSTAT sta 0, x ; H:X中保存着要擦出的EEPROM的地址&lt;/P&gt;&lt;P&gt;lda #mFSTAT_FCBEF&lt;/P&gt;&lt;P&gt;&amp;nbsp;sta FSTAT&lt;/P&gt;&lt;P&gt;&amp;nbsp;nop&lt;/P&gt;&lt;P&gt;&amp;nbsp;CheckDoneEErase:&lt;/P&gt;&lt;P&gt;lda FSTAT&lt;/P&gt;&lt;P&gt;lsla bpl CheckDoneEErase&lt;/P&gt;&lt;P&gt;aix #8&lt;/P&gt;&lt;P&gt;cphx #EEP_END&lt;/P&gt;&lt;P&gt;&amp;nbsp;blo E_EEPROM&lt;/P&gt;&lt;P&gt;jmp SUCC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Oct 2010 14:43:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Help-me-to-understand-lines-of-code/m-p/153869#M8635</guid>
      <dc:creator>Tianshu</dc:creator>
      <dc:date>2010-10-08T14:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: Help me to understand lines of code</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Help-me-to-understand-lines-of-code/m-p/153870#M8636</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 refer to the following lines -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;   STA   ,X   NOP   STA   ,X
&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This sequence writes the accumulator value directly to the address pointed to by the H:X register, twice.&amp;nbsp; I am unable to read the Chinese characters in the original comment, but would assume that H:X value represents an address within the flash sector to be erased.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The purpose of writing the value twice escapes me - this does not seem to be a specific requirement of the erase process.&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>Thu, 29 Oct 2020 08:57:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Help-me-to-understand-lines-of-code/m-p/153870#M8636</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2020-10-29T08:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: Help me to understand lines of code</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Help-me-to-understand-lines-of-code/m-p/153871#M8637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;SPAN&gt;&lt;SPAN style="color: #3a660f;"&gt;&lt;SPAN&gt;bigmac. Thanks for&amp;nbsp;your&amp;nbsp;replying. I'm sorry to say that my English is not good, and assembly language of HCS08 is little hard to me. Maybe I should remove these three lines of code to see if there is some effect to erase process.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN style="color: #3a660f;"&gt;&lt;SPAN&gt;祝好，&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN style="color: #3a660f;"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 刘宇&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Oct 2010 10:14:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Help-me-to-understand-lines-of-code/m-p/153871#M8637</guid>
      <dc:creator>Tianshu</dc:creator>
      <dc:date>2010-10-10T10:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: Help me to understand lines of code</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Help-me-to-understand-lines-of-code/m-p/153872#M8638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp;&amp;nbsp;刘宇,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do not remove all three lines - at least one write is needed, otherwise the erase will not work.&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:20:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Help-me-to-understand-lines-of-code/m-p/153872#M8638</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2010-10-10T10:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: Help me to understand lines of code</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Help-me-to-understand-lines-of-code/m-p/153873#M8639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Bigmac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thanks for your advise. I guess you mean that STA , X is necessary because we should write any byte to the address in the EEPROM where need to erase.&amp;nbsp;&amp;nbsp;But&amp;nbsp; I think the fifth line of code realize the purpose.&lt;/P&gt;&lt;PRE&gt;sta FSTAT sta 0, x ; H:X中保存着要擦出的EEPROM的地址&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Anyway, let me try to see the effect of removing those code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thanks Mac and a good weekend!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 刘宇&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:57:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Help-me-to-understand-lines-of-code/m-p/153873#M8639</guid>
      <dc:creator>Tianshu</dc:creator>
      <dc:date>2020-10-29T08:57:18Z</dc:date>
    </item>
  </channel>
</rss>

