Alternative to mixing c code with naked function

Viewed 334

So currently clang, msvc and the new llvm backed intel compiler do not support mixing c in a naked function.

Example

__declspec(naked) void func()
{
     int j;
     _asm(add j, 1) 
}

The compiler i've been using supports this, but it's been deprecated for a couple years now in favor a LLVM alternative. And I would like to swap to a newer version before compatibility issues arise.

Is there an alternative way to mix in c code with assembly, without an auto generated prolog/epilog? As my libraries I use are to large/complex to fully rewrite in pure assembly.

Edit: this relates to a naked function(one with no prolog or epilog) and compilers(MSVC, Clang, New Intel) no longer supporting c code mixed with asm IN the naked function. As the example above shows. This has nothing to do with adding assembly to a project as was suggested.

0 Answers
Related