<?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>S12 / MagniV MicrocontrollersのトピックRe: Assembly directives</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Assembly-directives/m-p/203374#M8237</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume you are using the C startup code to initialize the variable. Without the C startup code, the assembly code to initialize the variables has to be provided.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When using the C startup code, the dc.b will work. The key is to place the dc.b's into a section which ends up in the prm file in a READ_WRITE placement.&lt;/P&gt;&lt;P&gt;E.g.&lt;/P&gt;&lt;P&gt;MY_VAR_SEG: SECTION&lt;/P&gt;&lt;P&gt;variableName:&amp;nbsp;&amp;nbsp;&amp;nbsp; dc.b&amp;nbsp; $ab&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And in the prm file, explicitly list&amp;nbsp;MY_VAR_SEG in a READ_WRITE placement. Without the explicit placement in the prm file, the dc.b will end up in flash.&lt;/P&gt;&lt;P&gt;Note that the same works for C objects too. When C consts are placed in a READ_WRITE placement they are initialized by the startup code. On the other side, when (initialized) C variables are placed in a READ_ONLY placement they are defined at download time (say&amp;nbsp;typically&amp;nbsp;end up in flash).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 May 2010 09:04:32 GMT</pubDate>
    <dc:creator>CompilerGuru</dc:creator>
    <dc:date>2010-05-27T09:04:32Z</dc:date>
    <item>
      <title>Assembly directives</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Assembly-directives/m-p/203373#M8236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to declare variables and intialize them in assembly.&lt;/P&gt;&lt;P&gt;here's what I have tested so far:&lt;/P&gt;&lt;P&gt;variableName:&amp;nbsp;&amp;nbsp;&amp;nbsp; dc.b&amp;nbsp; $xx&amp;nbsp; ; This declares a named constant. So my code in theory cannot change it&lt;/P&gt;&lt;P&gt;variableName:&amp;nbsp;&amp;nbsp;&amp;nbsp; ds.b 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; This creates a variable but it's uninitialized&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I create an initialized variable?&lt;/P&gt;&lt;P&gt;I know I could write a code fragment that initializes my uninitialized variables, but there should be an easier way.&lt;/P&gt;&lt;P&gt;I used to do:&lt;/P&gt;&lt;P&gt;variableName:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; db&amp;nbsp;&amp;nbsp; $xx&amp;nbsp;&amp;nbsp;&amp;nbsp; ; This declares a variable and initializes it with $xx&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 May 2010 08:08:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Assembly-directives/m-p/203373#M8236</guid>
      <dc:creator>mouka</dc:creator>
      <dc:date>2010-05-27T08:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Assembly directives</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Assembly-directives/m-p/203374#M8237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume you are using the C startup code to initialize the variable. Without the C startup code, the assembly code to initialize the variables has to be provided.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When using the C startup code, the dc.b will work. The key is to place the dc.b's into a section which ends up in the prm file in a READ_WRITE placement.&lt;/P&gt;&lt;P&gt;E.g.&lt;/P&gt;&lt;P&gt;MY_VAR_SEG: SECTION&lt;/P&gt;&lt;P&gt;variableName:&amp;nbsp;&amp;nbsp;&amp;nbsp; dc.b&amp;nbsp; $ab&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And in the prm file, explicitly list&amp;nbsp;MY_VAR_SEG in a READ_WRITE placement. Without the explicit placement in the prm file, the dc.b will end up in flash.&lt;/P&gt;&lt;P&gt;Note that the same works for C objects too. When C consts are placed in a READ_WRITE placement they are initialized by the startup code. On the other side, when (initialized) C variables are placed in a READ_ONLY placement they are defined at download time (say&amp;nbsp;typically&amp;nbsp;end up in flash).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 May 2010 09:04:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Assembly-directives/m-p/203374#M8237</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2010-05-27T09:04:32Z</dc:date>
    </item>
  </channel>
</rss>

