OpCodes.Cpblk 字段

定义

将指定数目的字节从源地址复制到目标地址。Copies a specified number bytes from a source address to a destination address.

public: static initonly System::Reflection::Emit::OpCode Cpblk;
public static readonly System.Reflection.Emit.OpCode Cpblk;
 staticval mutable Cpblk : System.Reflection.Emit.OpCode
Public Shared ReadOnly Cpblk 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
FE 17FE 17 cpblkcpblk 将数据从一个内存块复制到另一个内存块。Copy data from one memory block to another.

堆栈转换行为顺序如下:The stack transitional behavior, in sequential order, is:

  1. 目标地址被推送到堆栈上。The destination address is pushed onto the stack.

  2. 源地址被推送到堆栈上。The source address is pushed onto the stack.

  3. 要复制的字节数将被推送到堆栈上。The number of bytes to copy is pushed onto the stack.

  4. 从堆栈中弹出的字节数、源地址和目标地址;指定的字节数从源地址复制到目标地址。The number of bytes, the source address, and the destination address are popped from the stack; the specified number of bytes are copied from the source address to the destination address.

@No__t-0 指令将字节(类型 unsigned int32)从源地址(类型为 *native int&)复制到目标地址(类型为 @no__t、`native int&)。</span><span class="sxs-lookup"><span data-stu-id="afa64-1813">Thecpblkinstruction copies a number (typeunsigned int32) of bytes from a source address (of type,native int, or&) to a destination address (of type,native int, or&).</span></span> <span data-ttu-id="afa64-1814">如果源区域和目标区域重叠,则不指定 @no__t 的行为。</span><span class="sxs-lookup"><span data-stu-id="afa64-1814">The behavior ofcpblk` is unspecified if the source and destination areas overlap.

cpblk 假设源和目标均与计算机的自然大小对齐。cpblk assumes that both the source and destination addressed are aligned to the natural size of the machine. @No__t-0 指令前面可以紧跟 unaligned.<prefix> 指令,以指示源或目标是不对齐的。The cpblk instruction can be immediately preceded by the unaligned.<prefix> instruction to indicate that either the source or the destination is unaligned.

紧靠前 @no__t 或 Unaligned 前缀指令可以更改 cpblk 指令的操作。The operation of the cpblk instruction can be altered by an immediately preceding Volatile or Unaligned prefix instruction.

如果检测到无效地址,则可能会引发 NullReferenceExceptionNullReferenceException may be thrown if an invalid address is detected.

以下 @no__t 0 方法重载可以使用 @no__t 操作码:The following Emit method overload can use the cpblk opcode:

  • ILGenerator.Emit(OpCode)ILGenerator.Emit(OpCode)

适用于