Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

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)  );
}

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.