以下、ローカル変数への代入。

  .locals init ([0] int32 a)
  IL_0000:  nop
  // int a = 30
  IL_0001:  ldc.i4.s   30
  IL_0003:  stloc.0
  // Console.WriteLine(a)
  IL_0004:  ldloc.0
  IL_0005:  call       void [mscorlib]System.Console::WriteLine(int32)

以下静的クラス変数への代入。

  // CILTest.a = 30
  IL_0001:  ldc.i4.s   30
  IL_0003:  stsfld     int32 CILTest.Program::a
  // Console.WriteLine(a);
  IL_0008:  ldsfld     int32 CILTest.Program::a
  IL_000d:  call       void [mscorlib]System.Console::WriteLine(int32)

以下配列変数への代入。

  .locals init ([0] int32[] a)
  IL_0000:  nop
  // a = new int[3];
  IL_0001:  ldc.i4.3
  IL_0002:  newarr     [mscorlib]System.Int32
  IL_0007:  stloc.0
  // a[2] = 30
  IL_0008:  ldloc.0
  IL_0009:  ldc.i4.2
  IL_000a:  ldc.i4.s   30
  IL_000c:  stelem.i4
  // Console.WriteLine(a[4])
  IL_000d:  ldloc.0
  IL_000e:  ldc.i4.2
  IL_000f:  ldelem.i4
  IL_0010:  call       void [mscorlib]System.Console::WriteLine(int32)

コメント †

コメント:
お名前:

 


作成:2010-07-16 14:41:11/更新:2010-07-16 14:53:06
くじらぶろぐD by kujirahand RSS
konawiki 0.31