Win32 inline assembly question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

 I apologize if this is out of the scope of this mailing list, but it
was recommanded to me that I ask here.

 I am trying to convert an inline assembly function (on Win32)

  NT_Tib* GetTIB()
{
    NT_Tib* pTib;
    __asm
    {
        MOV EAX , FS:[18h]
        MOV pTib , EAX
    }
    return pTib;
}
  to use the gcc syntax. It would be something like

  NT_Tib* GetTIB()
{
    NT_Tib* pTib;

    __asm__("movl %FS:0x18, %EAX\n\t"
            "movl %EAX, pTib");
                        ^^^ (what should this be?)


    return pTib;
}
  how do I represent the variable "pTib" in the gcc assembly? I tried

      movl %EAX, pTib      or     movl %EAX, _pTib

  both I get the following linker error.

   > undefined reference to `pTib'    (or '_pTib')

  anyone knows the correct syntax for representing a C variable in gnu assembly?

  thanks!

  Wei


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux