EmbeddedRelated.com
Forums

Assembly instructions in the C code

Started by Bruce November 12, 2009
I have some code in a project that uses assembly language. I am using CrossWorks and it doesn't like this. Here is the code:

static inline unsigned __get_cpsr(void)
{
unsigned long retval;
asm volatile (" mrs %0, cpsr" : "=r" (retval) : /* no inputs */ );
return retval;
}

Here is the error:

`asm' undeclared (first use in this function)

Anyone know how to use assembly in CrossWorks?

An Engineer's Guide to the LPC2100 Series

On Fri, 13 Nov 2009 00:13:17 -0000, Bruce wrote:

> I have some code in a project that uses assembly language. I am using
> CrossWorks and it doesn't like this. Here is the code:
>
> static inline unsigned __get_cpsr(void)
> {
> unsigned long retval;
> asm volatile (" mrs %0, cpsr" : "=r" (retval) : /* no inputs */ );
> return retval;
> }
>
> Here is the error:
>
> `asm' undeclared (first use in this function)
>
> Anyone know how to use assembly in CrossWorks?

Best advice: read the FAQs.

http://rowley.zendesk.com/forums/51134/entries/46164

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks V2 is out for LPC1700, LPC3100, LPC3200, SAM9, and more!