<?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>LPC Microcontrollers中的主题 Re: constants in assembler</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/constants-in-assembler/m-p/854710#M33997</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The location of the file is irrelevant. You can tell the editor that a .inc file is an assembler file by following the instructions in Erichs post.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Jan 2019 09:04:04 GMT</pubDate>
    <dc:creator>converse</dc:creator>
    <dc:date>2019-01-24T09:04:04Z</dc:date>
    <item>
      <title>constants in assembler</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/constants-in-assembler/m-p/854706#M33993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to define a constant called "mains_on" to be equal to 208, so I write&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;.equ mains_on,208 @ mains on at 208 Volts&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;and MUCXpresso underlines it in orange and tells me it is a syntax error. (It is part of a large table of constants that have their own file)&lt;/P&gt;&lt;P&gt;It does this regardless of whether I put it in a file called .h or .inc, but the resulting file works&lt;/P&gt;&lt;P&gt;If I type&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;#define mains_on 208 // mains on at 208 Volts&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;like it would be in C, it&amp;nbsp;no longer tells me that it is a syntax error, but it doesn't work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I put the file in the src directory instead of the inc directory, then it likes neither .equ nor #define, one gives "syntax error" and the other says "no whitespace after macro definition"&lt;/P&gt;&lt;P&gt;.This isn't a major problem, but it is annoying to have every line of my table of constants underlined in orange and labelled as a syntax error - could someone please tell me which format MCUXpresso is happy with, and where it would prefer the file to be stored.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2019 14:16:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/constants-in-assembler/m-p/854706#M33993</guid>
      <dc:creator>ianbenton</dc:creator>
      <dc:date>2019-01-23T14:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: constants in assembler</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/constants-in-assembler/m-p/854707#M33994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to place assembler in a file with a .s file extension. While the compiler can detect that it is 'compiling' C or assembler, the IDE cannot - it works on file extensions. So, if you have assembler in .c/.h the IDE will try to parse as C and hence you will get the error you are seeing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2019 17:23:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/constants-in-assembler/m-p/854707#M33994</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2019-01-23T17:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: constants in assembler</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/constants-in-assembler/m-p/854708#M33995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in addition to that, see &lt;A class="link-titled" href="https://mcuoneclipse.com/2016/05/05/assembly-files-in-eclipse-cdt-projects/" title="https://mcuoneclipse.com/2016/05/05/assembly-files-in-eclipse-cdt-projects/"&gt;Assembly Files in Eclipse CDT Projects | MCU on Eclipse&lt;/A&gt;&amp;nbsp; how this is configured. as Con Verse said: you need to put assembly code into *.s files (keep in mind with above article that this is case sensitive).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2019 17:48:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/constants-in-assembler/m-p/854708#M33995</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2019-01-23T17:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: constants in assembler</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/constants-in-assembler/m-p/854709#M33996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, all the assembly is in a .s file, but I have a separate file of constant definitions that upsets the editor (i.e. it if were C it would be the .h file full of #define statements). I would have normally expected it to be called .inc, but the editor doesn't like that. You are correct that it prefers it to be called .s and the editor is happy with that, even with it in the "inc" directory&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2019 08:55:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/constants-in-assembler/m-p/854709#M33996</guid>
      <dc:creator>ianbenton</dc:creator>
      <dc:date>2019-01-24T08:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: constants in assembler</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/constants-in-assembler/m-p/854710#M33997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The location of the file is irrelevant. You can tell the editor that a .inc file is an assembler file by following the instructions in Erichs post.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2019 09:04:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/constants-in-assembler/m-p/854710#M33997</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2019-01-24T09:04:04Z</dc:date>
    </item>
  </channel>
</rss>

