I'm trying to get some arm assembly code to work with macros. I'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:
[ "$var1" = "" LDR r0, =0x1234 | LDR $var1, =0x1234 ]
which is a syntax that works with the ARM compiler, but the keil download is giving me an error.
And the error message I get only points to the line that invokes the macro. Is there a way to get the keil free download to output what the code looks like AFTER all the macro substitution is done?
Maybe I should start with a more basic question: Does anyone here use ARM assembly?
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?
> Does anyone here use ARM assembly?
Indeed, but what you posted doesn't look like ARM assembler macro syntax. Has this code perhaps been written for the now obsolete Keil compiler?
See here for using assembler macros: infocenter.arm.com/.../armasm_cihchbbi.htm
-- Marcus
I was trying to do something like this:
infocenter.arm.com/.../index.jsp
7.4.4. IF, ELSE, ENDIF, and ELIF
...
IF :DEF:NEWVERSION ; first set of instructions/directives ELSE ; alternative set of instructions/directives ENDIF
I think I'm used to an even older version of the assembler that used square brackets [ instead of "IF", square bracket ] instead of "ENDIF" and a pipe | instead of "ELSE".
Since everything I'm used to apparently has been "superseded", do you have a URL to how to write conditional compiled assembly with the latest revs of tools?
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.
Method 1: Using a Macro
; Macro definition MACRO Test $var1 [ "$var1" = "" LDR r0, =0x1234 | LDR $var1, =0x1234 ] MEND ; Macro invocation Test Test r1
Method 2: Using a global symbol
GBLS var1 var1 SETS "r1" [ "$var1" = "" LDR r0, =0x1234 | LDR $var1, =0x1234 ]
Description of IF,ELSE,ENDIF and ELIF: infocenter.arm.com/.../index.jsp
Description of MACRO and MEND: infocenter.arm.com/.../index.jsp
> I think I'm used to an even older version of the > assembler
No, my bad. I wasn't aware of the synonyms.
> Method 1: Using a Macro
Hm, that's what I was trying to do. I must have a typo somewhere in my macro that I'm not seeing.
Is there a way to see the code that gets generated after all the macro replacement is finished? I'm using the free download tools.
It'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.
View all questions in Keil forum