简体   繁体   中英

Convert Inline C Assembler (Intel syntax to AT&T)

I am trying to convert this function from MSVC++ to MINGW (this is the original MSVC function)

    VOID __declspec(naked) BNSTUB()
{
   __asm
   {
      pushad;
      call OnChatPacketReceived;
      TEST EAX,EAX;

      popad;
      jnz oldCall;

        MOV EAX,0;
      MOV DWORD PTR DS:[EBX+0x6FF3EBA0],1
      ret;
oldCall:
        CALL eax;
        MOV DWORD PTR DS:[EBX+0x6FF3EBA0],1
        ret;

   }
}

But I have problems with pushad and popad. they give me a "undeclared identifier"

pusha popa(无d)

在Mingw中,它可能被称为“ pushall”而不是“ pusha”:所以请尝试“ pushalld”和“ popalld”。

You can compile something in C and also keep the assembler listing with -S parameter. That should display the AT&T syntax in all its glory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM