简体   繁体   中英

Calling user-defined C functions in inline assembly

Let's say I have this:

extern "C" {
void foo1();
void foo2();
};
void foo1() 
{
__asm
    {
       ; some stuff

       ; some other 
    }
}

  void foo2() 
  {
    __asm 
        {
              ;some other stuff
              call __foo1

        }
  }

I know that in a regular .asm program you would be reuqired to say extrn __fucntionName, but this is inline assembly, can user defined functions can be called like this in inline assembly? and how? I use VS2008.

Calling a C function from assembler is possible. Syntax of this call depends on compiler you use. Usually there are diferences in how function names look in assembly and vice versa.

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