Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
C# is compiled into IL, and IL is what the CLR processes. The IL specification is contained in the CLI standard. You can see what IL looks like by loading the "Hello World!" application (from Chapter 1) into the Intermediate Language Disassembler (ILDASM) provided with the .NET SDK.[] ILDASM shows you a tree view of the type data from the assembly, and you can open up individual methods and see the IL code that the C# compiler generated for them. As shown in Listing 2-1, IL looks similar to assembly language. In essence, it's the assembly language of the CLR. It's called IL because it acts as an intermediate step between a specific language and a specific platform.
[] If you have Visual Studio 2010 installed, you can easily launch ILDASM.exe from a Visual Studio 2010 command prompt.
.method private hidebysig static void Main() cil managed
{
.entrypoint
// Code size 13 (0xd)
.maxstack 8
IL_0000: nop
IL_0001: ldstr "Hello World! "
IL_0006: call void [mscorlib]System.Console::WriteLine(string)
IL_000b: nop
IL_000c: ret
} // end of method EntryPoint::Main |