Why the machine code stub?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Why do .net compilers build exe:s with a piece of machine code in the
beginning to launch clr/jit? That makes the program no longer cpu independent
but still slow because the app itself (msil) must be compiled... Are .net
DLLs the same, ie they have to be for the right cpu?
 
Wikoh,

Did you know that you could use in past not a floppydisk from computer
branch a on a computer from branche b.

Some things needs time.

Just my thought,

Cor
 
wikoh said:
Why do .net compilers build exe:s with a piece of machine code in the
beginning to launch clr/jit? That makes the program no longer cpu
independent
but still slow because the app itself (msil) must be compiled... Are .net
DLLs the same, ie they have to be for the right cpu?

That stub should just be used to launch the executables on non-CLR aware
platforms(win9x and 2k come to mind, I'm not sure about the others.) Mono
and other hosts detect that it is a managed executable(as memory serves
there is a flag in the PE header) and launches the CLR directly instead of
using the stub. I don't think it should cause you any platform independence
isuses.

I imagine Win64 does this as well, although I don't know for sure.
 
Back
Top