Porting inline assembly gnu function to keil
2005-04-28 by javida13
The following code came from the download area, UT050418A, by Bill
Knigh. Currently, I'm looking at the Keil Tools and the two
functions below will not compile. If someone could help, I would
appreciate it.
static inline unsigned __get_cpsr(void)
{
unsigned long retval;
asm volatile (" mrs %0, cpsr" : "=r" (retval) : /* no inputs*/ );
return retval;
}
static inline void __set_cpsr(unsigned val)
{
asm volatile (" msr cpsr, %0" : /* no outputs */ : "r" (val) );
}