📄 ex-08-07
字号:
//Example 08-07: MSIL code resulting from Example 8-6
// Note: Provided for illustration purposes - do not try to compile this
method private hidebysig static void Main() il managed
{
.entrypoint
// Code size 206 (0xce)
.maxstack 4
.locals ([0] value class myStruct theStruct,
[1] class IStorable isTemp,
[2] int32 V_2)
IL_0000: ldloca.s theStruct
IL_0002: initobj myStruct
IL_0008: ldloca.s theStruct
IL_000a: ldc.i4.m1
IL_000b: call instance void myStruct::set_status(int32)
IL_0010: ldstr "theStruct.Status: {0}"
IL_0015: ldloca.s theStruct
IL_0017: call instance int32 myStruct::get_status()
IL_001c: stloc.2
IL_001d: ldloca.s V_2
IL_001f: box [mscorlib]System.Int32
IL_0024: call void [mscorlib]System.Console::WriteLine
(class System.String,
class System.Object)
IL_0029: ldloca.s theStruct
IL_002b: ldc.i4.2
IL_002c: call instance void myStruct::set_status(int32)
IL_0031: ldstr "Changed object."
IL_0036: call void [mscorlib]System.Console::WriteLine
(class System.String)
IL_003b: ldstr "theStruct.Status: {0}"
IL_0040: ldloca.s theStruct
IL_0042: call instance int32 myStruct::get_status()
IL_0047: stloc.2
IL_0048: ldloca.s V_2
IL_004a: box [mscorlib]System.Int32
IL_004f: call void [mscorlib]System.Console::WriteLine
(class System.String,
class System.Object)
IL_0054: ldloca.s theStruct
IL_0056: box myStruct
IL_005b: stloc.1
IL_005c: ldloc.1
IL_005d: ldc.i4.4
IL_005e: callvirt instance void IStorable::set_status(int32)
IL_0063: ldstr "Changed interface."
IL_0068: call void [mscorlib]System.Console::WriteLine
(class System.String)
IL_006d: ldstr "theStruct.Status: {0}, isTemp: {1}"
IL_0072: ldloca.s theStruct
IL_0074: call instance int32 myStruct::get_status()
IL_0079: stloc.2
IL_007a: ldloca.s V_2
IL_007c: box [mscorlib]System.Int32
IL_0081: ldloc.1
IL_0082: callvirt instance int32 IStorable::get_status()
IL_0087: stloc.2
IL_0088: ldloca.s V_2
IL_008a: box [mscorlib]System.Int32
IL_008f: call void [mscorlib]System.Console::WriteLine
(class System.String,
class System.Object,
class System.Object)
IL_0094: ldloca.s theStruct
IL_0096: ldc.i4.6
IL_0097: call instance void myStruct::set_status(int32)
IL_009c: ldstr "Changed object."
IL_00a1: call void [mscorlib]System.Console::WriteLine
(class System.String)
IL_00a6: ldstr "theStruct.Status: {0}, isTemp: {1}"
IL_00ab: ldloca.s theStruct
IL_00ad: call instance int32 myStruct::get_status()
IL_00b2: stloc.2
IL_00b3: ldloca.s V_2
IL_00b5: box [mscorlib]System.Int32
IL_00ba: ldloc.1
IL_00bb: callvirt instance int32 IStorable::get_status()
IL_00c0: stloc.2
IL_00c1: ldloca.s V_2
IL_00c3: box [mscorlib]System.Int32
IL_00c8: call void [mscorlib]System.Console::WriteLine
(class System.String,
class System.Object,
class System.Object)
IL_00cd: ret
} // end of method Tester::Main
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -