Re: Calling Assembly Code Functions from a C Program in IAR

Started by old_cow_yellow December 23, 2007
What assembler are you using?

--- In m..., "Nafa3" wrote:
>
> Hi all
>
> This C function is calling an assembler function get_cpsr
>
> unsigned long get_cpsr(void);
> static inline unsigned asm_get_cpsr(void)
> {
> unsigned long retval;
> retval=get_cpsr();
>
> return retval;
> }
> The assembler function is in separate .S file it looks as follows
>
> PUBLIC get_cpsr
> RSEG CODE:CODE:NOROOT(2)
> get_cpsr:
>
> mrs r0, cpsr /* get CPSR */
> bx lr /* return to caller */
>
> END
>
> I get an error:
> Error: identifier "PUBLIC" is undefined
>
> please help me and thank you in advance
>

Beginning Microcontrollers with the MSP430