EmbDev.net

Forum: ARM programming with GCC/GNU tools asm ("MRS %0, CPSR" : "=r" (irq) : ); error in IAR


von Vinit B. (vinitbidkar)


Rate this post
useful
not useful
Device: AT91SAM7X256
Compiler: IAR EWARM v 5.20

Code snippet:

1) void function_1 (void)
2) {
3)     char irq_status;
4)     asm ("MRS %0, CPSR" : "=r" (irq_status) : );
5) }

Error given by compiler:
AT line 4, expected ")" after the first :

Is there a different format to be followed for IAR?

von Giovanni D. (gdisirio)


Rate this post
useful
not useful
Vinit Bidkar wrote:
> Device: AT91SAM7X256
> Compiler: IAR EWARM v 5.20
>
> Code snippet:
>
> 1) void function_1 (void)
> 2) {
> 3)     char irq_status;
> 4)     asm ("MRS %0, CPSR" : "=r" (irq_status) : );
> 5) }
>
> Error given by compiler:
> AT line 4, expected ")" after the first :
>
> Is there a different format to be followed for IAR?

That syntax for inline assembler is a GCC-specific extension. IAR should
have something similar.

regards,
Giovanni
---
ChibiOS/RT http://chibios.sourceforge.net

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.