Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Inline Assembly?

Hello,

we have similar issue with #pragma asm / endasm: https://bugs.eclipse.org/bugs/show_bug.cgi?id=277997


Am 16.01.2011 12:50, schrieb kesselhaus:
Hi folks,

We have some C files, which have Inline Assembly for ePPC.
Currently, I have lots of Syntax Errors there. I currently have undefined __asm in Project Settings so at least the function itself has not the syntax error set.

Which way is CDT handling Inline Assembly, if at all?

__asm void foo(void)
{
    lis     r0, 0x4000@ha
    ori     r0,r0, 0x1000@l
    mfspr   r3, SPR_XYZ
    stw     r3, 0(r1)
}

or rather

void foo(void)
{
    __asm {
            lis     r0, 0x4000@ha
            ori     r0,r0, 0x1000@l
            mfspr   r3, SPR_XYZ
            stw     r3, 0(r1)
    };
}

or gnu style like

void foo(void)
{
   asm(
    "lis     r0, 0x4000@ha"
    "ori     r0,r0, 0x1000@l"
    "mfspr   r3, SPR_XYZ"
    "stw     r3, 0(r1)"
    , /*in*/ : /*out*/: /*clobber*/ );
}

And how are the assembler instructtions setup?

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



Back to the top