Win32 inline assembly question
Wei Huang
weih@google.com
Wed Dec 14 17:53:00 GMT 2005
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
More information about the Gcc-help
mailing list