概要 †
関数の引数をスタックにpushします。
クラスの静的でないメンバ関数の中で呼ばれた場合、
0番目の引数( ldarg 0 )として this(カレントインスタンスへの参照) が挿入され、他の引数は1つずつシフトされます。
書式 †
ldarg <変数名>
ldarg <変数の番号>
ldarg.<変数の番号>
クラスの静的メンバ関数や、モジュールレベルの関数における引数のpush †
変数名を使用した引数のpush
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
-
|
|
|
|
|
|
|
!
-
|
|
|
!
|
.assembly test{}
.method static void main()
{
.entrypoint
ldstr "moo"
call void talk( string )
ret
}
.method static void talk( string message )
{
ldarg message call void class [mscorlib]System.Console::WriteLine(string) }
|
変数の番号を使用した引数のpush
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
-
|
|
|
|
|
|
|
!
-
|
|
|
!
|
.assembly test{}
.method static void main()
{
.entrypoint
ldstr "moo"
call void talk( string )
ret
}
.method static void talk( string message )
{
ldarg 0 call void class [mscorlib]System.Console::WriteLine(string) }
|
クラスのメンバ関数における引数のpush †
変数名を使用した引数のpush
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
-
|
-
|
|
|
!
|
|
|
-
|
!
!
|
.assembly test{}
.method static void main()
{
.entrypoint
.locals( class Bot b )
newobj instance void Bot::.ctor() stloc b
ldloc b ldstr "moo" call instance void Bot::talk( string )
ret
}
.class Bot
{
.method public void talk( string message )
{
ldarg message call void class [mscorlib]System.Console::WriteLine(string) }
.method public void .ctor()
{
ret
}
}
|
変数の番号を使用した引数のpush
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
-
|
-
|
|
|
|
|
|
!
|
|
|
-
|
!
!
|
.assembly test{}
.method static void main()
{
.entrypoint
.locals( class Bot b )
newobj instance void Bot::.ctor() stloc b
ldloc b ldstr "moo" call instance void Bot::talk( string )
ret
}
.class Bot
{
.method public void talk( string message )
{
ldarg 1 call void class [mscorlib]System.Console::WriteLine(string) }
.method public void .ctor()
{
ret
}
}
|
参照 †