Skip to content

Latest commit

 

History

History
29 lines (16 loc) · 1.38 KB

iii.3.30-cpblk.md

File metadata and controls

29 lines (16 loc) · 1.38 KB

III.3.30 cpblk – copy data from memory to memory

Format Instruction Description
FE 17 cpblk Copy data from memory to memory.

Stack Transition:

…, destaddr, srcaddr, size → …

Description:

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]

Exceptions:

System.NullReferenceException can be thrown if an invalid address is detected.

Correctness:

CIL ensures the conditions specified above.

Verifiability:

The cpblk instruction is never verifiable.