Skip to content

Latest commit

 

History

History
30 lines (17 loc) · 1.51 KB

iii.3.39-ldarga-length.md

File metadata and controls

30 lines (17 loc) · 1.51 KB

III.3.39 ldarga.<length> – load an argument address

Format Assembly Format Description
FE 0A <unsigned int16> ldarga argNum Fetch the address of argument argNum.
0F <unsigned int8> ldarga.s argNum Fetch the address of argument argNum, short form.

Stack Transition:

…, → …, address of argument number argNum

Description:

The ldarga instruction fetches the address (of type &, i.e., managed pointer) of the argNum'th argument, where arguments are numbered 0 onwards. The address will always be aligned to a natural boundary on the target machine (cf. cpblk and initblk). The short form (ldarga.s) should be used for argument numbers 0–255. The result is a managed pointer (type &).

For procedures that take a variable-length argument list, the ldarga instructions can be used only for the initial fixed arguments, not those in the variable part of the signature.

[Rationale: ldarga is used for byref parameter passing (see Partition I). In other cases, ldarg and starg should be used. end rationale]

Exceptions:

None.

Correctness:

Correct CIL ensures that argNum is a valid argument index.

Verifiability:

Verification (§III.1.8) tracks the type of the value loaded onto the stack as a managed pointer to the verification typeI.8.7) of the method's declared argument type.