<?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 Having trouble accessing C variable from asm section in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Having-trouble-accessing-C-variable-from-asm-section/m-p/633348#M13682</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey. I'm implementing a simple fifo in a project of mine, and am getting both a&amp;nbsp;"C18125 Invalid opcode or ':' expected" and a "C18000 Label not set" errors on&amp;nbsp;third line of the following section of code:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;unsigned char SaveCCR; //preserve CCR&lt;BR /&gt; asm tpa &lt;BR /&gt; asm staa SaveCCR&lt;BR /&gt; asm sei // make atomic by disabling interrupts&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tried adding the ':' at the front of the variable name, but I just get another error and I have no idea what Im doing. Other asm instructions work fine, it seems the syntax is incorrect for accessing variables. I couldn't find why this syntax is wrong anywhere.&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is very appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Jan 2017 16:10:35 GMT</pubDate>
    <dc:creator>gonzaloalcaraz</dc:creator>
    <dc:date>2017-01-20T16:10:35Z</dc:date>
    <item>
      <title>Having trouble accessing C variable from asm section</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Having-trouble-accessing-C-variable-from-asm-section/m-p/633348#M13682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey. I'm implementing a simple fifo in a project of mine, and am getting both a&amp;nbsp;"C18125 Invalid opcode or ':' expected" and a "C18000 Label not set" errors on&amp;nbsp;third line of the following section of code:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;unsigned char SaveCCR; //preserve CCR&lt;BR /&gt; asm tpa &lt;BR /&gt; asm staa SaveCCR&lt;BR /&gt; asm sei // make atomic by disabling interrupts&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tried adding the ':' at the front of the variable name, but I just get another error and I have no idea what Im doing. Other asm instructions work fine, it seems the syntax is incorrect for accessing variables. I couldn't find why this syntax is wrong anywhere.&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is very appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jan 2017 16:10:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Having-trouble-accessing-C-variable-from-asm-section/m-p/633348#M13682</guid>
      <dc:creator>gonzaloalcaraz</dc:creator>
      <dc:date>2017-01-20T16:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble accessing C variable from asm section</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Having-trouble-accessing-C-variable-from-asm-section/m-p/633349#M13683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gonzalo,&lt;/P&gt;&lt;P&gt;I ever made a small sample code to you. see attached “mix_C_Assembly_HCS12X”&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;XDEF specifies labels defined in the current module but can be referenced by other modules.&lt;/P&gt;&lt;P&gt;XREF specifies symbols referenced in the current module but defined in another module&lt;/P&gt;&lt;P&gt;variable "my_C_variable" is accessed by assembly code in this demo.&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>Sun, 22 Jan 2017 02:45:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Having-trouble-accessing-C-variable-from-asm-section/m-p/633349#M13683</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2017-01-22T02:45:10Z</dc:date>
    </item>
  </channel>
</rss>

