Using Assembly Language with C#

Hi,

I need to use assembly language within my C# code for a software controlled hardware kind of application. Should I do it with C++ and save it as DLL which I can later inport and use with my C# code or is there a way to use assembly directly from my C# code




Answer this question

Using Assembly Language with C#

  • MReinhardt

    Thanks friend.



  • Attu

    C# code is compiled to MSIL (Microsoft Intermediate Language)... something completely unrelated to run of the mill assembly and because of that you would not be able to define a __asm block in C# the way you can with some C/C++ compilers.

    Instead your best bet would be to do what you suggested, make an unmanaged C/C++ dll that contains your assembly code and that you P/Invoke against.



  • Using Assembly Language with C#