Discussion group dedicated to the Philips LPC2000 family of ARM MCUs
Crossstudio and asm functions - tomi - Sep 10 15:18:05 2009
In Crossstudio 1.7 this functions works correctly:
static inline cpu_t get_cpsr(void)
{
cpu_t val;
asm volatile ("mrs %[val], cpsr\n":[val]"=r"(val):);
return val;
}
static inline void set_cpsr(cpu_t val)
{
asm volatile ("msr cpsr, %[val]\n" ::[val]"r"(val) );
}
In Crossstudio 2.0 I have error:
'asm' undeclared (first use in this function)
when I remove volatile keyword, I have error
asm ("mrs %[val], cpsr\n":[val]"=r"(val):);
^ expected ')' before ':' token
What is wrong in this functons ?
[Non-text portions of this message have been removed]
------------------------------------
______________________________
controlSUITE software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )
RE: Crossstudio and asm functions - FreeRTOS Info - Sep 10 15:26:42 2009
> In Crossstudio 1.7 this functions works correctly:
> static inline cpu_t get_cpsr(void)
> {
> cpu_t val;
> asm volatile ("mrs %[val], cpsr\n":[val]"=3Dr"(val):);
> return val;
> }
>=20
> static inline void set_cpsr(cpu_t val)
> {
> asm volatile ("msr cpsr, %[val]\n" ::[val]"r"(val) );
> }
>=20
> In Crossstudio 2.0 I have error:
> 'asm' undeclared (first use in this function)
> when I remove volatile keyword, I have error
> asm ("mrs %[val], cpsr\n":[val]"=3Dr"(val):);
> ^ expected ')' before ':' token
> What is wrong in this functons ?
Either switch off the "force ANSI compliance" compiler option, or replace
asm with __asm.
Regards,
Richard.
+ http://www.FreeRTOS.org
Designed for Microcontrollers. More than 7000 downloads per month.
+ http://www.SafeRTOS.com
Certified by T=DCV as meeting the requirements for safety related systems.
------------------------------------
______________________________
controlSUITE software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )RE: Crossstudio and asm functions - Michael J Scott - Sep 10 16:07:38 2009
I had the same problem I used __asm which worked. I also found a define for
__asm__, but I have not tried it.
_____
From: tomi [mailto:f...@gmail.com]
Sent: Thursday, September 10, 2009 3:16 PM
To: l...@yahoogroups.com
Subject: [lpc2000] Crossstudio and asm functions
In Crossstudio 1.7 this functions works correctly:
static inline cpu_t get_cpsr(void)
{
cpu_t val;
asm volatile ("mrs %[val], cpsr\n":[val]"=r"(val):);
return val;
}
static inline void set_cpsr(cpu_t val)
{
asm volatile ("msr cpsr, %[val]\n" ::[val]"r"(val) );
}
In Crossstudio 2.0 I have error:
'asm' undeclared (first use in this function)
when I remove volatile keyword, I have error
asm ("mrs %[val], cpsr\n":[val]"=r"(val):);
^ expected ')' before ':' token
What is wrong in this functons ?
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
------------------------------------

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )
Re: Crossstudio and asm functions - tomi - Sep 11 3:46:28 2009