I don't think, the missing parenthesis are a problem here.

I general, you are right, Przemek.

In this case, the symbols with the trailing _ are only used within a
preprocessor macro which generates the c variable containing the asm
statement..
#define sfrb_(x,x_)         volatile unsigned char x asm(#x_)

So the c program will only use the c-variable without the trailing _
See mpy32.h and others for more examples.


The macro that will generate the buggy asm statement

Przemek Klosowski schrieb:
>
>
> On Fri, Mar 20, 2009 at 3:08 PM, Matthias Hartmann
> <[email protected] <mailto:[email protected]>> wrote:
>
>     Hi Roberto, hi Sergey,
>
>     the problem resides in msp430x54xx.h
>     and was introduced by the last change in CVS.
>     e.g. these linses
>     #define SFRRPCR_H_          (SFRRPCR_+1)
>     sfrb(SFRRPCR_H, SFRRPCR_H_);
>     are expanded by the preprocessor to:
>     volatile unsigned char SFRRPCR_H asm("(0x0104+1)");
>     which is invalid for the assembler.
>
>     The lines:
>     50: #define SFRIE1_H_           (SFRIE1_+1)
>     67: #define SFRIFG1_H_          (SFRIFG1_+1)
>     85: #define SFRRPCR_H_          (SFRRPCR_+1)
>     should be changed to
>     50: #define SFRIE1_H_           SFRIE1_ + 0x01
>     67: #define SFRIFG1_H_          SFRIFG1_ + 0x01
>     85: #define SFRRPCR_H_          SFRRPCR_ + 0x01
>
>
> I see how it becomes a problem, but enclosing the preprocessor expressions
> in parenteses is a standard practice, because otherwise you fall into
> SFRIE1_H * 6
> expanding into  SFRIE1_ + 0x01 * 6, which is not what one would intend.
> Is it possible to change the asm() directive so that it contains a
> fuller expression
> which allows parentesized subexpressions?
>
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> ------------------------------------------------------------------------
>
> _______________________________________________
> Mspgcc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>   

Reply via email to