OpCodes.Ldsflda 字段
定义
将静态字段的地址推送到计算堆栈上。Pushes the address of a static field onto the evaluation stack.
public: static initonly System::Reflection::Emit::OpCode Ldsflda;
public static readonly System.Reflection.Emit.OpCode Ldsflda;
staticval mutable Ldsflda : System.Reflection.Emit.OpCode
Public Shared ReadOnly Ldsflda As OpCode
字段值
注解
下表列出了指令的十六进制和 Microsoft 中间语言 (MSIL) 程序集格式,以及简短的参考摘要:The following table lists the instruction's hexadecimal and Microsoft Intermediate Language (MSIL) assembly format, along with a brief reference summary:
| 格式Format | 程序集格式Assembly Format | 说明Description |
|---|---|---|
7F < T >7F < T > |
ldsflda fieldldsflda field |
推送 field 堆栈上的地址Push the address of field on the stack |
堆栈转换行为顺序如下:The stack transitional behavior, in sequential order, is:
- 将特定字段的地址推送到堆栈上。The address of a specific field is pushed onto the stack.
指令将在 ldsflda 类的所有实例中共享的静态 (的地址推送) 堆栈上的字段。The ldsflda instruction pushes the address of a static (shared among all instances of a class) field on the stack. *如果元数据标记指的是 field 其内存被管理的类型,则该地址可以表示为暂时性指针 (类型) 。The address may be represented as a transient pointer (type *) if the metadata token field refers to a type whose memory is managed. 否则,它对应于非托管指针 (类型 native int) 。Otherwise, it corresponds to an unmanaged pointer (type native int). 请注意, field 可以是使用分配的相对虚拟地址的静态全局地址 (字段相对于基址中的偏移量,其中包含的 PE 文件加载到内存中的内存) (其中内存不受管理)。Note that field may be a static global with an assigned relative virtual address (the offset of the field from the base address at which its containing PE file is loaded into memory) where the memory is unmanaged.
ldsflda指令可以有 Volatile 前缀。The ldsflda instruction can have a Volatile prefix.
MissingFieldException 如果在元数据中找不到字段,则会引发。MissingFieldException is thrown if field is not found in the metadata. 这通常在以下情况下检查: Microsoft 中间语言 (MSIL) 指令转换为本机代码,而不是在运行时。This is typically checked when Microsoft Intermediate Language (MSIL) instructions are converted to native code, not at runtime.
以下 Emit 方法重载可以使用 ldsflda 操作码:The following Emit method overload can use the ldsflda opcode: