<?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 Re: Using preprocessor #define in asm in Classic/Legacy CodeWarrior</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Using-preprocessor-define-in-asm/m-p/176085#M3776</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much! That was exactly what I need, now it goes fine just by changing the target!&lt;/P&gt;&lt;P&gt;I&amp;nbsp;have marked the post as Solved.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again, stanish&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rubén&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Apr 2009 21:19:12 GMT</pubDate>
    <dc:creator>RValls</dc:creator>
    <dc:date>2009-04-27T21:19:12Z</dc:date>
    <item>
      <title>Using preprocessor #define in asm</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Using-preprocessor-define-in-asm/m-p/176081#M3772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone!&lt;/P&gt;&lt;P&gt;I am using&amp;nbsp;project pannel "C/C++ Preprocessor" to #define global parameters of my project, and compile different code depending on them. It works fine in C files, but the problem is when I am using this parameter in an ASM source file, where I always get the error Unknown identifier.&lt;/P&gt;&lt;P&gt;I leave you an example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*In preprocessor pannel*/&lt;/P&gt;&lt;P&gt;#define MY_OPTION 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*In the *.s file*/&lt;/P&gt;&lt;P&gt;.extern MY_OPTION&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#if MY_OPTION==1&lt;/P&gt;&lt;P&gt;&amp;nbsp; //Some code&lt;/P&gt;&lt;P&gt;#else&lt;/P&gt;&lt;P&gt;&amp;nbsp; //Some other code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I include this parameter to the asm file so when I compile the project,&amp;nbsp;the compiler&amp;nbsp;recognizes it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Rubén&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2009 15:06:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Using-preprocessor-define-in-asm/m-p/176081#M3772</guid>
      <dc:creator>RValls</dc:creator>
      <dc:date>2009-04-27T15:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Using preprocessor #define in asm</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Using-preprocessor-define-in-asm/m-p/176082#M3773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello RValls,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try to create separate .h file and include this file in your .asm files. e.g:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* mydefs.h */&lt;/P&gt;&lt;P&gt;#define MY_OPTION 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* asm file */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#include "mydefs.h"&lt;/P&gt;&lt;P&gt;#if MY_OPTION==1&lt;/P&gt;&lt;P&gt;&amp;nbsp; //Some code&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;#endif&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2009 16:00:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Using-preprocessor-define-in-asm/m-p/176082#M3773</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2009-04-27T16:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using preprocessor #define in asm</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Using-preprocessor-define-in-asm/m-p/176083#M3774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again, and thanks for the fast reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That works fine, but I'm still having a problem: I am using different targets to use&amp;nbsp;one code or other code, or one processor or other, etc... and I want to mantein this easy way of changing from one to other,&amp;nbsp;so the solution of using an options.h file is not usefull, because if I change this file from MY_OPTION 1 to MY_OPTION 0, it will also be changed in the other targets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any other solution?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rubén&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2009 17:17:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Using-preprocessor-define-in-asm/m-p/176083#M3774</guid>
      <dc:creator>RValls</dc:creator>
      <dc:date>2009-04-27T17:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using preprocessor #define in asm</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Using-preprocessor-define-in-asm/m-p/176084#M3775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;RValls,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You may use "Prefix file" option: "Alt+F7" -&amp;gt; "EPPC Assembler" -&amp;gt; "Prefix file" edit box.&lt;/P&gt;&lt;P&gt;If you create separate file for each target and add macro definitions into the files you can pass&lt;/P&gt;&lt;P&gt;these defs. into you asm file based on selected target.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Stanish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2009 18:29:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Using-preprocessor-define-in-asm/m-p/176084#M3775</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2009-04-27T18:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using preprocessor #define in asm</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Using-preprocessor-define-in-asm/m-p/176085#M3776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much! That was exactly what I need, now it goes fine just by changing the target!&lt;/P&gt;&lt;P&gt;I&amp;nbsp;have marked the post as Solved.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again, stanish&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rubén&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2009 21:19:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Using-preprocessor-define-in-asm/m-p/176085#M3776</guid>
      <dc:creator>RValls</dc:creator>
      <dc:date>2009-04-27T21:19:12Z</dc:date>
    </item>
  </channel>
</rss>

