This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Win32 inline assembly question
- From: Wei Huang <weih at google dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 14 Dec 2005 09:52:41 -0800
- Subject: Win32 inline assembly question
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