Format | Instruction | Description |
---|---|---|
FE 17 | cpblk |
Copy data from memory to memory. |
…, destaddr, srcaddr, size → …
The cpblk
instruction copies size (of type unsigned int32
) bytes from address srcaddr (of type native int
, or &
) to address destaddr (of type native int
, or &
). The behavior of cpblk
is unspecified if the source and destination areas overlap.
cpblk
assumes that both destaddr and srcaddr are aligned to the natural size of the machine (but see the unaligned.
prefix instruction). The operation of the cpblk
instruction can be altered by an immediately preceding volatile.
or unaligned.
prefix instruction.
[Rationale: cpblk
is intended for copying structures (rather than arbitrary byte-runs). All such structures, allocated by the CLI, are naturally aligned for the current platform. Therefore, there is no need for the compiler that generates cpblk
instructions to be aware of whether the code will eventually execute on a 32-bit or 64-bit platform. end rationale]
System.NullReferenceException
can be thrown if an invalid address is detected.
CIL ensures the conditions specified above.
The cpblk
instruction is never verifiable.