copy

The copy command copies a specified number of bytes from one location in memory to another.

Format

The format of the copy command is:

copy [-f] from to size
where:

from declares the source address location.
to declares the target address location.
size is the size of the block of memory to be copied. This quantity is specified in bytes.
-f Specifies that the destination is flash memory.

Functional Description

The copy command replicates a specified number of bytes from one place in memory to another.

The -f option is used when copying to flash memory. This requires that the board supports writes to that address range, and that the flash memories support sector erase.

If to is less than from, copying is performed in ascending order starting at from. If from is less than to, copying is performed in descending order starting at from + size.

When moving a data block down, the source data is copied from the bottom of the block upwards: and when moving a data block up, the source data is copied from the top of the block downwards. By this technique, there is no risk of copying over data in overlapping block move operations; as the data in the overlapping area is copied first. However, if the -f option is specified, copying is always performed in ascending address order.

Examples

Files

The copy command is located in mon/copy.c.

See Also

compare command


Navigation: Document Home | Document Contents | Document Index