Re: C# and my indispensable inline assembly code

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: William Stacey [MVP] (staceywREMOVE_at_mvps.org)
Date: 04/21/04


Date: Wed, 21 Apr 2004 11:43:48 -0400

They could probably hide the steps with sugar, but the steps would be the
same. The unmanaged code would need to be compiled and linked and the
managed code would need a ref to it. They could package that all up and
include the unmanaged dll into the exe like ilmerge does or something to do
everything automatic. Not sure much call for that. I would like to see
simple include of managed dlls into the exe or master dll be really easy and
automatic however.

-- 
William Stacey, MVP
"Mark Broadbent" <no-spam-please@no-spam-please.com> wrote in message
news:e7FmNY7JEHA.3016@tk2msftngp13.phx.gbl...
> yeah your right, I personally thought it might be nice to be able to embed
> code like assembly that would be unmanaged and bypass the CLR (obviously
in
> the unsafe context) but I guess it is just as easy to import it via a dll
> like Bob suggested.
>
> -- 
>
> -- 
>
> Br,
> Mark Broadbent
> mcdba , mcse+i
> =============
> "Willy Denoyette [MVP]" <willy.denoyette@pandora.be> wrote in message
> news:epvvTY5JEHA.232@TK2MSFTNGP12.phx.gbl...
> > But Delphi is unmanaged code, while C# results in managed code (IL)
> running
> > in the CLR, where it's translated to machine code by the JITter. The IL
> > produced by the C# compiler is secure/verifiable code and this is
> essential
> > for the language, allowing to embed assembly (unverifiable) would render
> the
> > language unverifiable (you don't wan't your assembly code to be
translated
> > int IL do you?).
> >
> > Willy.
> >
> >
> > "Mark Broadbent" <no-spam-please@no-spam-please.com> wrote in message
> > news:OEGOt54JEHA.2756@TK2MSFTNGP10.phx.gbl...
> > > is this really true Bob? Seems odd that Anders would have left that
> > > ability
> > > out (cos I'm sure I remember this ability in Delphi -which of course
is
> > > part
> > > of Anders' background).
> > > Maybe he's done this for code safety/ seperation/ readability?
> > >
> > >
> > > -- 
> > >
> > > -- 
> > >
> > > Br,
> > > Mark Broadbent
> > > mcdba , mcse+i
> > > =============
> > > "Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
> > > news:eiA3z43JEHA.628@TK2MSFTNGP11.phx.gbl...
> > >> As far as I know this is not possible.  You could separate your
> assembly
> > >> code out into a DLL which you call from your C# code using p/invoke
but
> > >> of
> > >> course this won't be inlined.
> > >>
> > >> -- 
> > >> Bob Powell [MVP]
> > >> Visual C#, System.Drawing
> > >>
> > >> All you ever wanted to know about ListView custom drawing is in Well
> > > Formed.
> > >> http://www.bobpowell.net/currentissue.htm
> > >>
> > >> Answer those GDI+ questions with the GDI+ FAQ
> > >> http://www.bobpowell.net/gdiplus_faq.htm
> > >>
> > >> Read my Blog at http://bobpowelldotnet.blogspot.com
> > >>
> > >> "Teis Draiby" <teisREMOVE-THIS@draiby.com> wrote in message
> > >> news:%232A80d3JEHA.1264@TK2MSFTNGP12.phx.gbl...
> > >> > I am about to move my C++ application to C#. Parts of my previous
> > >> > application consisted of inline SSE2 assembly code optimized for
the
> P4
> > >> > processor. What options do I have to integrate that part into my C#
> > >> > application?
> > >> > There are no such things as intrinsics support in C#, right?
> > >> >
> > >> > Thank you very much!
> > >> > regards, Teis
> > >> >
> > >> >
> > >>
> > >>
> > >
> > >
> >
> >
>
>


Relevant Pages

  • Re: Managed code / unmanaged code?
    ... > if the unmanaged code in within a .DLL, you can pretty much do anything ... Does this mean it can use managed code within the SAME project as unmanaged ... > million loops of string manipulations to see 'some' difference. ...
    (microsoft.public.dotnet.languages.vc)
  • Proper Deployment
    ... which in turn interacts with my dll's the main dll the ... web-page calls for now is in Com+ unmanaged code, ... Create C# dll, since I want it to be in Com+ I reference System.Enterprise ... is called by unmanaged code, it works fine, but if its managed code & I ...
    (microsoft.public.dotnet.distributed_apps)
  • Re: Managed code / unmanaged code?
    ... /CLR will create 'by default' managed code only, ... if the unmanaged code in within a .DLL, you can pretty much do anything you ... if I want to use DllImport to call the DLL's ...
    (microsoft.public.dotnet.languages.vc)
  • Re: using unmanaged C++ dll in C#
    ... If unmanaged code and CLI ... of unmanaged dll to managed C++/CLI dll. ... namespace CLRWrapper ... _CppLib = new CCppLib; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Use unmanaged code in VS2008
    ... common function. ... of core code we wanted to keep for now in unmanaged code, ... We can use for hours the applications without any problem. ... I just added unmanaged dll to the references and started using them. ...
    (microsoft.public.dotnet.languages.csharp)