MCF5213EVB and CodeWarrior, Problem with "inline Assembler"

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCF5213EVB and CodeWarrior, Problem with "inline Assembler"

2,414 Views
fiskom
Contributor I
Hi,

I've tried all possibilities of writing an "inline assembler" instruction into an C-function:
My trials:
asm(nope)
asm(nope:smileywink:
asm(nope);
asm{nope}
_asm
__asm
and so on. But I gained these error-messages while compiling:

if writing "asm" or "__asm" (equal what followed):
"ERROR: declaration syntax error
rfInterrupt.c line 21 asm(or __asm) "

and if writing "_asm":
"ERROR: undefined identifier '_asm'
rfInterrupt.c line 21 _asm"

I've made a lot of changes in the compiler settings, cause I didn't like when the compiler ignores Warnings. But why should the 'inline assembler'-option be affected from that?
I am a Newbie in embedded developement, a student.
I searched every Manual, which is delivered with CodeWarrior for the keywords "inline" and "assembler" but I did't find anything, what fits my problem. Then I searched with Google and in the Freescale Knowledgebase, because until now, I was able to solve every Problem with CodeWarrior on this way. But now I need your help.
What should I do?
Labels (1)
0 Kudos
3 Replies

613 Views
fiskom
Contributor I
Thank you for quick response, but that wasn't my problem.
I had marked "ANSI-Strict" under "Debug Settings->Language Settings-> C/C++ Language".
Without that mark, the compiler accept the noun "asm".

In spite of that, thank you, both.

Another Question:
How to create Listing (Assembler) "*.s" Files, to look what Metrowerks C-Compiler do.
Under "Edit->Preferences" or "Edit->M5213EVB UART Debug Settings", I don't find such an option.
0 Kudos

613 Views
Nouchi
Senior Contributor II
Hello,


You should write your inline assembler like this :
Code:
asm { NOP;    }
if you use directly in your C code

and like that if you use a #define macro
Code:
asm { NOP\    }
you need a backslash at the end of each line
 
regards,
Emmanuel


 

0 Kudos

613 Views
Alban
Senior Contributor II
Hello,
 
Have you tried:
 
Code:
asm NOP;

 
It works prefectly on all 8- and 16-Bit products.
NOP means NO Operation.
I don't know what "NOPE" means, except NO in slang.
 
Cheers,
Alban.
0 Kudos