Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

MSIL & it’s Advantages

Microsoft Intermediate Language (MSIL) is a language used as the output of a number of


compilers (C#, VB, .NET etc.).

A .NET programming language (C#, VB, J# etc.) does not compile into executable code;
instead it compiles into an intermediate code called Microsoft Intermediate Language
(MSIL). As a programmer one need not worry about the syntax of MSIL - since our
source code in automatically converted to MSIL. The MSIL code is then send to the CLR
(Common Language Runtime) that converts the code to machine language, which is, then
run on the host machine. MSIL is similar to Java Byte code. MSIL is the CPU-
independent instruction set into which .NET Framework programs are compiled. It
contains instructions <br>for loading, storing, initializing, and calling methods on
objects. Combined with metadata and the common type system, MSIL allows for true
cross- language integration Prior to execution, MSIL is converted to machine code.
It is also called Intermediate Language (IL) or Common Intermediate Language (CIL).
During the compile time, the compiler convert the source code into Microsoft
Intermediate Language (MSIL) .Microsoft Intermediate Language (MSIL) is a CPU-
independent set of instructions that can be efficiently converted to the native code.
During the runtime the Common Language Runtime (CLR)'s Just In Time (JIT) compiler
converts the Microsoft Intermediate Language (MSIL) code into native code to the
Operating System.

When a compiler produces Microsoft Intermediate Language (MSIL), it also


produces Metadata. The Microsoft Intermediate Language (MSIL) and Metadata are
contained in a portable executable (PE) file . Microsoft Intermediate Language (MSIL)
includes instructions for loading, storing, initializing, and calling methods on objects, as
well as instructions for arithmetic and logical operations, control flow, direct memory
access, exception handling, and other operations

Advantages -

 MSIL provide language interoperability as code in any .net language is


compiled on MSIL
 Same performance in all .net languages
 support for different runtime environments
 JIT compiler in CLR converts MSIL code into native machine code which is
executed by OS.

You might also like