// Microsoft (R) .NET Framework IL Disassembler. Version 3.5.30729.1 // Metadata version: v2.0.50727 .assembly extern mscorlib { .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. .ver 2:0:0:0 } .assembly '3' { // --- Следующий настраиваемый атрибут добавлен автоматически, не следует отменять преобразование в комментарий ------- // .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 03 00 00 00 00 00 ) .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) .custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows. .hash algorithm 0x00008004 .ver 0:0:0:0 } .module '3.exe' // MVID: {E0623409-7333-4F92-AB86-6EA399C9D82B} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY // Image base: 0x002C0000 // =============== CLASS MEMBERS DECLARATION =================== .class public auto ansi beforefieldinit Program extends [mscorlib]System.Object { .method public hidebysig static void Main() cil managed { .entrypoint // Размер кода: 72 (0x48) .maxstack 2 .locals init ([0] int32 a, [1] int32 b, [2] int32 c) .language '{3F5162F8-07C6-11D3-9053-00C04FA302A1}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' // Source File 'l:\Лекции\4 Курс\Теория компиляторов\Samples\MSIL\copy\3.cs' //000008: a = new Random().Next(2); IL_0000: newobj instance void [mscorlib]System.Random::.ctor() IL_0005: ldc.i4.2 IL_0006: callvirt instance int32 [mscorlib]System.Random::Next(int32) IL_000b: stloc.0 //000009: b = new Random().Next(1) + 1; IL_000c: newobj instance void [mscorlib]System.Random::.ctor() IL_0011: ldc.i4.1 IL_0012: callvirt instance int32 [mscorlib]System.Random::Next(int32) IL_0017: ldc.i4.1 IL_0018: add IL_0019: stloc.1 //000010: c = new Random().Next(1); IL_001a: newobj instance void [mscorlib]System.Random::.ctor() IL_001f: ldc.i4.1 IL_0020: callvirt instance int32 [mscorlib]System.Random::Next(int32) IL_0025: stloc.2 //000011: //000012: if (a != 0) IL_0026: ldloc.0 IL_0027: brfalse.s IL_0031 //000013: Console.WriteLine(b); IL_0029: ldloc.1 IL_002a: call void [mscorlib]System.Console::WriteLine(int32) IL_002f: br.s IL_0037 //000014: else //000015: Console.WriteLine(c); IL_0031: ldloc.2 IL_0032: call void [mscorlib]System.Console::WriteLine(int32) //000016: //000017: if (a == 0) IL_0037: ldloc.0 IL_0038: brtrue.s IL_0041 //000018: Console.WriteLine(b); IL_003a: ldloc.1 IL_003b: call void [mscorlib]System.Console::WriteLine(int32) IL_0040: ret //000019: else //000020: Console.WriteLine(c); IL_0041: ldloc.2 IL_0042: call void [mscorlib]System.Console::WriteLine(int32) //000021: } IL_0047: ret } // end of method Program::Main .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Размер кода: 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } // end of method Program::.ctor } // end of class Program // ============================================================= // *********** ДИЗАССЕМБЛИРОВАНИЕ ЗАВЕРШЕНО *********************** // ВНИМАНИЕ: создан файл ресурсов Win32 3.ilasm.res