-1

Today I read on the MSDN website, that inline assembly is not supported on ARM and x64 processors. Since I'm not good at C, C++ or ASM, I couldn't test it out myself, but it sparked my interest.

I wondered if it is not possible to do this in Visual Studio, since its on the MSDN website.

Regardless of the answer to my first question, my second question remains: is it possible to compile a DLL with inline ASM, which is then called via a x64 C/C++ program to execute the inline ASM. If so, why, and if not: why not.

Thanks in advance!

3
  • 1
    Wouldn't MSDN be the correct addressee for this question? We are not the Microsoft support forum. Mar 15, 2017 at 16:07
  • I have not experience with the MSDN forums and I do here. Secondly I don't know if this 'issue' is related to MS or if it is not possible in general. Mar 15, 2017 at 16:11
  • Inline-assmbly is not part of the C language. So, of course it is MS-specific. Wrt you not knowing the MSDN-forum: non sequitur. That's not an argument. Mar 15, 2017 at 16:21

1 Answer 1

2

As specified by the MSDN, the VC++ compiler doesn't support inline assembly on those platforms. Of course it's not an intrinsic limitation of those platforms - it's just a feature not implemented in those versions of VC++, other compilers (e.g. gcc) support it just fine. Nothing so strange, it's not a standard feature (as in: a feature required by the C or C++ standard), it's just a common extension.

Still, even with VC++ you don't need to go as far as making a dll - you can just assemble your asm file into an object module, and link it together with the other ones (generated e.g. by the C or C++ compiler) into a single executable. This is in fact the procedure they recommend to mix C/C++ and assembly - the Microsoft assembler itself is shipped along with VC++ as always.

7
  • Thanks for the answer! Mar 15, 2017 at 16:19
  • 1
    ...because size_t is unsigned... ? ;)
    – LPs
    Mar 15, 2017 at 16:20
  • The assembler is distinct from the C/C++ compiler proper, but it ships with Visual Studio. Mar 15, 2017 at 16:20
  • Inline assembly is a compiler extension, thus not standardised at all. Just because two compilers support it does not mean youj can use the same construct/syntax for it on both implementations. Mar 15, 2017 at 16:22
  • 1
    @LPs: exactly =) Mar 15, 2017 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.