<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>arm assembler macro help</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/27138/arm-assembler-macro-help</link><description> 
I&amp;#39;m trying to get some arm assembly code to work with macros. I&amp;#39;m
using free download version of keil tools. is the macro language the
same syntax for armasm arm tools and free download keil tools? 

 
I wanted to use conditional compile macros like</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: arm assembler macro help</title><link>https://community.arm.com/thread/126088?ContentTypeID=1</link><pubDate>Fri, 09 Apr 2010 06:53:02 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:960a76f9-499b-4c65-9e45-dfdd005eaba6</guid><dc:creator>Greg London</dc:creator><description>&lt;p&gt;&lt;p&gt;
So, it looks like the problem wasn&amp;#39;t my macro at all. It was that
my macro was in a file that I had created on Linux and pulled over to
Windows.&lt;/p&gt;

&lt;p&gt;
I created a new project and a new file that did nothing but get my
macro file and call the macro once. When I pulled the macro file into
the project, the tool said something about the file having bad
newline characters and that it would try to fix it. (I can&amp;#39;t remember
the exact message).&lt;/p&gt;

&lt;p&gt;
When I tried to assemble, I got the same error message which was
something about bad characters at end of line.&lt;/p&gt;

&lt;p&gt;
I thought &amp;quot;bad characters&amp;quot; meant that my macro had a typo in it
somewhere, like MACRO without MEND, or something like that. But this
was the first time it had complained about the newline cahracters
when I imported teh file, so I wondered if it was a Linux/Windows
issue.&lt;/p&gt;

&lt;p&gt;
So then I wiped out the project and created a new startup.s file,
and I retyped the macro from scratch (no cut and paste, nothing to
get some old newline characters) and then called the macro in a
simple bit of code.&lt;/p&gt;

&lt;p&gt;
It compiled just fine.&lt;/p&gt;

&lt;p&gt;
So, somehow the newlines from Linux totally confused the tool, and
the error message I got at first wasn&amp;#39;t clear that it was a problem
with &amp;quot;\n&amp;quot; rather than a problem with a typo in my macro text like a
missing MEND or END or ] or whatever.&lt;/p&gt;

&lt;p&gt;
Argh.&lt;/p&gt;

&lt;p&gt;
Anyway, thanks for the help, sorry for the false alarm.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: arm assembler macro help</title><link>https://community.arm.com/thread/126087?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2010 06:01:18 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:43acb1b5-f7d1-4f4a-8ba1-13be9c728145</guid><dc:creator>Greg London</dc:creator><description>&lt;p&gt;&lt;p&gt;
&amp;gt; Method 1: Using a Macro&lt;/p&gt;

&lt;p&gt;
Hm, that&amp;#39;s what I was trying to do. I must have a typo somewhere
in my macro that I&amp;#39;m not seeing.&lt;/p&gt;

&lt;p&gt;
Is there a way to see the code that gets generated after all the
macro replacement is finished? I&amp;#39;m using the free download tools.&lt;/p&gt;

&lt;p&gt;
It&amp;#39;s reporting an error on the line where the macro is called, but
not telling me what line in the macro itself is the problem.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: arm assembler macro help</title><link>https://community.arm.com/thread/115661?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2010 00:45:54 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:8746305b-2a21-4306-b2b4-6c8186afca86</guid><dc:creator>Marcus Harnisch</dc:creator><description>&lt;p&gt;&lt;p&gt;
&amp;gt; I think I&amp;#39;m used to an even older version of the&lt;br /&gt;
&amp;gt; assembler&lt;/p&gt;

&lt;p&gt;
No, my bad. I wasn&amp;#39;t aware of the synonyms.&lt;/p&gt;

&lt;p&gt;
--&lt;br /&gt;
Marcus&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: arm assembler macro help</title><link>https://community.arm.com/thread/115666?ContentTypeID=1</link><pubDate>Wed, 07 Apr 2010 23:58:14 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:46000a27-92c0-4e91-a57d-c35755ebabcd</guid><dc:creator>Robert &amp;#160;</dc:creator><description>&lt;p&gt;&lt;p&gt;
Method 1: Using a Macro&lt;/p&gt;

&lt;pre&gt;
; Macro definition
  MACRO
  Test $var1
    [ "$var1" = ""
    LDR r0, =0x1234
    |
    LDR $var1, =0x1234
    ]
  MEND

; Macro invocation
  Test
  Test r1
&lt;/pre&gt;

&lt;p&gt;
Method 2: Using a global symbol&lt;/p&gt;

&lt;pre&gt;
     GBLS var1
var1 SETS &amp;quot;r1&amp;quot;

  [ "$var1" = ""
  LDR r0, =0x1234
  |
  LDR $var1, =0x1234
  ]
&lt;/pre&gt;

&lt;p&gt;
Description of IF,ELSE,ENDIF and ELIF:&lt;br /&gt;

&lt;a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.kui0100a/armasm_cacbjgdb.htm"&gt;infocenter.arm.com/.../index.jsp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
Description of MACRO and MEND:&lt;br /&gt;

&lt;a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.kui0100a/armasm_cacdcgac.htm"&gt;infocenter.arm.com/.../index.jsp&lt;/a&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: arm assembler macro help</title><link>https://community.arm.com/thread/102125?ContentTypeID=1</link><pubDate>Wed, 07 Apr 2010 14:17:01 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ec073777-3885-4367-9080-89923ca644bf</guid><dc:creator>Greg London</dc:creator><description>&lt;p&gt;&lt;p&gt;
I was trying to do something like this:&lt;/p&gt;

&lt;p&gt;

&lt;a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0204h/index.html"&gt;infocenter.arm.com/.../index.jsp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
7.4.4. IF, ELSE, ENDIF, and ELIF&lt;/p&gt;

&lt;p&gt;
...&lt;/p&gt;

&lt;pre&gt;
 IF :DEF:NEWVERSION
            ; first set of instructions/directives
        ELSE
            ; alternative set of instructions/directives
        ENDIF
&lt;/pre&gt;

&lt;p&gt;
I think I&amp;#39;m used to an even older version of the assembler that
used square brackets [ instead of "IF", square bracket ] instead of
&amp;quot;ENDIF&amp;quot; and a pipe | instead of &amp;quot;ELSE&amp;quot;.&lt;/p&gt;

&lt;p&gt;
Since everything I&amp;#39;m used to apparently has been &amp;quot;superseded&amp;quot;, do
you have a URL to how to write conditional compiled assembly with the
latest revs of tools?&lt;/p&gt;

&lt;p&gt;
I wanted to make a macro that will take in a parameter and based
of the parameter may compile one of many instructions. It worked on
an older rev, but not on the latest.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: arm assembler macro help</title><link>https://community.arm.com/thread/90341?ContentTypeID=1</link><pubDate>Wed, 07 Apr 2010 13:13:35 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6a9af1d1-0612-4eb7-a8dc-d49a0f98723c</guid><dc:creator>Marcus Harnisch</dc:creator><description>&lt;p&gt;&lt;p&gt;
&amp;gt; Does anyone here use ARM assembly?&lt;/p&gt;

&lt;p&gt;
Indeed, but what you posted doesn&amp;#39;t look like ARM assembler macro
syntax. Has this code perhaps been written for the now obsolete Keil
compiler?&lt;/p&gt;

&lt;p&gt;
See here for using assembler macros:&lt;br /&gt;

&lt;a href="http://infocenter.arm.com/help/topic/com.arm.doc.kui0100a/armasm_cihchbbi.htm"&gt;infocenter.arm.com/.../armasm_cihchbbi.htm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
--&lt;br /&gt;
Marcus&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: arm assembler macro help</title><link>https://community.arm.com/thread/58023?ContentTypeID=1</link><pubDate>Wed, 07 Apr 2010 08:12:59 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ec4d9ae8-cd0b-4552-b7d6-26250668b4d7</guid><dc:creator>Greg London</dc:creator><description>&lt;p&gt;&lt;p&gt;
Maybe I should start with a more basic question: Does anyone here
use ARM assembly?&lt;/p&gt;

&lt;p&gt;
If so, then is there a way to get the demo tool to output the code
after the preprocessor is done with macro replacement so I can see
what went wrong?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>