2 // Microsoft (R) .NET Framework IL Disassembler. Version 4.6.1055.0
3 // Copyright (c) Microsoft Corporation. All rights reserved.
7 // Metadata version: v4.0.30319
8 .assembly extern mscorlib
10 .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
15 .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 )
16 .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
17 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows.
19 // --- The following custom attribute is added automatically, do not uncomment -------
20 // .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 07 01 00 00 00 00 )
22 .hash algorithm 0x00008004
25 .module valuetypes.exe
26 // MVID: {E191F723-B724-4D70-B3A8-CEA89FD033D3}
28 .file alignment 0x00000200
29 .stackreserve 0x00100000
30 .subsystem 0x0003 // WINDOWS_CUI
31 .corflags 0x00000001 // ILONLY
32 // Image base: 0x01170000
35 // =============== CLASS MEMBERS DECLARATION ===================
37 .class interface private abstract auto ansi IValue
39 .method public hidebysig newslot abstract virtual
40 instance int32 GetValue() cil managed
42 } // end of method IValue::GetValue
44 .method public hidebysig newslot abstract virtual
45 instance void SetValue(int32 a) cil managed
47 } // end of method IValue::SetValue
49 .method public hidebysig newslot virtual
50 instance int32 Add(int32 a) cil managed
52 // Code size 26 (0x1a)
54 .locals init (int32 V_0,
58 IL_0002: call instance int32 IValue::GetValue()
66 IL_000e: call instance void IValue::SetValue(int32)
74 } // end of method IValue::Add
76 } // end of class IValue
78 .class private sequential ansi sealed beforefieldinit FooBarStruct
79 extends [mscorlib]System.ValueType
82 .field public int32 _val
83 .method public hidebysig newslot virtual final
84 instance int32 GetValue() cil managed
88 .locals init (int32 V_0)
91 IL_0002: ldfld int32 FooBarStruct::_val
97 } // end of method FooBarStruct::GetValue
99 .method public hidebysig newslot virtual final
100 instance void SetValue(int32 val) cil managed
107 IL_0003: stfld int32 FooBarStruct::_val
109 } // end of method FooBarStruct::SetValue
110 } // end of class FooBarStruct
112 .class private auto ansi beforefieldinit Program
113 extends [mscorlib]System.Object
115 .method public hidebysig static int32 Main() cil managed
119 .locals init (valuetype FooBarStruct V_0,
123 IL_0001: ldloca.s V_0
124 IL_0003: initobj FooBarStruct
125 IL_0009: ldloca.s V_0
127 IL_000d: stfld int32 FooBarStruct::_val
129 IL_0013: box FooBarStruct
131 IL_0019: ldstr "Calling IFoo.Foo on FooBarStruct"
132 IL_001e: call void [mscorlib]System.Console::WriteLine(string)
136 IL_0027: callvirt instance int32 IValue::Add(int32)
139 IL_0030: ldstr "Calling default method IValue.Add on FooBarStruct "
141 IL_0035: call void Test::Assert(bool,
145 callvirt instance int32 FooBarStruct::GetValue()
148 ldstr "FooBarStruct value should remain unchanged"
149 call void Test::Assert(bool,
152 call int32 Test::Ret()
154 } // end of method Program::Main
156 .method public hidebysig specialname rtspecialname
157 instance void .ctor() cil managed
162 IL_0001: call instance void [mscorlib]System.Object::.ctor()
165 } // end of method Program::.ctor
167 } // end of class Program
169 .class private auto ansi beforefieldinit Test
170 extends [mscorlib]System.Object
172 .field private static bool Pass
173 .method public hidebysig static int32 Ret() cil managed
175 // Code size 19 (0x13)
177 .locals init (int32 V_0)
179 IL_0001: ldsfld bool Test::Pass
180 IL_0006: brtrue.s IL_000c
182 IL_0008: ldc.i4.s 101
183 IL_000a: br.s IL_000e
187 IL_000f: br.s IL_0011
191 } // end of method Test::Ret
193 .method public hidebysig static void Assert(bool cond,
194 string msg) cil managed
196 // Code size 47 (0x2f)
198 .locals init (bool V_0)
203 IL_0004: brfalse.s IL_0015
206 IL_0007: ldstr "PASS"
207 IL_000c: call void [mscorlib]System.Console::WriteLine(string)
210 IL_0013: br.s IL_002e
213 IL_0016: ldstr "FAIL: "
215 IL_001c: call string [mscorlib]System.String::Concat(string,
217 IL_0021: call void [mscorlib]System.Console::WriteLine(string)
220 IL_0028: stsfld bool Test::Pass
223 } // end of method Test::Assert
225 .method public hidebysig specialname rtspecialname
226 instance void .ctor() cil managed
231 IL_0001: call instance void [mscorlib]System.Object::.ctor()
234 } // end of method Test::.ctor
236 .method private hidebysig specialname rtspecialname static
237 void .cctor() cil managed
242 IL_0001: stsfld bool Test::Pass
244 } // end of method Test::.cctor
246 } // end of class Test
249 // =============================================================
251 // *********** DISASSEMBLY COMPLETE ***********************
252 // WARNING: Created Win32 resource file valuetypes.res