RedBoot User's Guide
Prev |  | Next

# mcopy

## Name

mcopy -- Copy memory

## Synopsis

mcopy {-s `source`} {-d `destination`} {-l `length`} [-1 | -2 | -4]

## Arguments

Name | Type | Description | Default
--- | --- | --- | ---
-s `location1` | Memory address | Location of data to copy. | none
-d `location2` | Memory address | Destination for copied data. | none
-l `length` | Number | Length of data | none
-1 |  | Copy one byte (8 bits) at a time. | -4
-2 |  | Copy two bytes (16 bits) at a time. | -4
-4 |  | Copy one word (32 bits) at a time. | -4

## Description

Copies memory (RAM, ROM, FLASH, etc) from one area to another.

## Examples

Copy 16 bits at a time.

    RedBoot> mfill -b 0x100000 -l 0x20 -2 -p 0xDEAD
    RedBoot> mfill -b 0x200000 -l 0x20 -2 -p 0x0
    RedBoot> dump  -b 0x200000 -l 0x20 -2
    00200000: 0000 0000 0000 0000  0000 0000 0000 0000
    00200010: 0000 0000 0000 0000  0000 0000 0000 0000
    RedBoot> mcopy -s 0x100000 -d 0x200000 -2 -l 0x20
    RedBoot> dump  -b 0x200000 -l 0x20 -2
    00200000: DEAD DEAD DEAD DEAD  DEAD DEAD DEAD DEAD
    00200010: DEAD DEAD DEAD DEAD  DEAD DEAD DEAD DEAD

Prev | Home | Next
mcmp | Up | mfill