EmbDev.net

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


Author: Vinit Bidkar (vinitbidkar)
Posted on:

Rate this post
0 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?

Author: Giovanni Di sirio (gdisirio)
Posted on:

Rate this post
0 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

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.