USB Driver for ARM7(LPC2148)

Status
Not open for further replies.

panther58

Newbie level 3
Joined
Jan 25, 2011
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,298
i m getting error in following code ;
error is -> expected a ";" on line denoted by ->


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




how to use inline assembly in keil compiler ,, plz send me some references.
 

It has to be used as __inline I think

Alex

---------- Post added at 19:33 ---------- Previous post was at 19:30 ----------

And asm as __asm {}

Alex

---------- Post added at 19:37 ---------- Previous post was at 19:33 ----------

This in an example

Code:
void my_strcpy (char *dst, const char *src) {
  int ch;

  __asm {
  loop: LDRB    ch, [src], #1
        STRB    ch, [dst], #1
        CMP     ch, #0
        BNE     loop
  }
}

Alex
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…