Assembly (CLI) - Language of An Assembly

Language of An Assembly

The assembly is built up with the CIL code, which is an intermediate language. The framework internally converts the CIL into native assembly code. If we have a program that prints "Hello World", the equivalent CIL code for the method is:

.method private hidebysig static void Main(string args) cil managed { .entrypoint .custom instance void System.STAThreadAttribute::.ctor = ( 01 00 00 00 ) // Code size 11 (0xb) .maxstack 1 IL_0000: ldstr "Hello World" IL_0005: call void System.Console::WriteLine(string) IL_000a: ret } // end of method Class1::Main

So the CIL code loads the String onto the stack. Then it calls the WriteLine function and returns.

Read more about this topic:  Assembly (CLI)

Famous quotes containing the words language and/or assembly:

    There is no such thing as a language, not if a language is anything like what many philosophers and linguists have supposed. There is therefore no such thing to be learned, mastered, or born with. We must give up the idea of a clearly defined shared structure which language-users acquire and then apply to cases.
    Donald Davidson (b. 1917)

    There is a sacred horror about everything grand. It is easy to admire mediocrity and hills; but whatever is too lofty, a genius as well as a mountain, an assembly as well as a masterpiece, seen too near, is appalling.
    Victor Hugo (1802–1885)