Format | Assembly Format | Description |
---|---|---|
7E <T> | ldsfld field |
Push the value of field on the stack. |
…, → …, value
The ldsfld
instruction pushes the value of a static (shared among all instances of a class) field on the stack. field is a metadata token (a fieldref
or fielddef
; see Partition II) referring to a static field member. The return type is that associated with field.
The ldsfld
instruction can have a volatile.
prefix. If required field values are converted to the representation of their intermediate type (§I.8.7) when loaded onto the stack (§III.1.1.1).
[Note: That is field values that are smaller than 4 bytes, a boolean or a character are converted to 4 bytes by sign or zero-extension as appropriate. Floating-point values are converted to their native size (type F
). end note]
System.FieldAccessException
is thrown if field is not accessible.
System.MissingFieldException
is thrown if field is not found in the metadata. This is typically checked when CIL is converted to native code, not at runtime.
Correct CIL ensures that field is a valid metadata token referring to a static field member.
Verification tracks the type of the value on the stack as the intermediate type (§I.8.7) of the field type.