Topic: DMD0009 MOVER - Move Range of Values |
|
The Move Range of Values (MOVER) instruction is used to move the values from one range of memory locations to a second range of memory locations.
If the Source range and Destination range are different block types, any data conversion that is required will automatically be performed during the copy operation. For example, if the source range is D0 to D9 and the Destination range is R0 to R9, each value will be converted to a floating point number as it is copied.
If the size of the elements in the Destination range are smaller than the elements in the Source range, the values will be truncated during the copy operation. For example, if the source range is D0 to D7 and the Destination Range is V0 to V7, only the low Word of each D (32-bit) location will be moved to the corresponding V (16-bit) location.
The source and destination ranges can overlap which allows implementation of things like value shifting and LIFO / FIFO queues or stacks; see the FIFO example below of using MOVER to implement a shift register that shifts entire DWords.
The Move Range of Values instruction cannot move structures - the Copy Memory Range (MEMCOPY) instruction is the proper instruction to do this work.
|
|
Parameters:Note: Use the F9 key or click the 'three dot box' at the right edge of the parameter field to open the Default Element Selection Tool (the Element Picker or the Element Browser) or use the Down-Arrow key (Auto-Complete) on any parameter field to see a complete list of the memory locations that are valid for that parameter of the instruction.
Start of Source specifies the first numeric memory location of the data to copy. This can be any readable, non-structure numeric location.
Range specifies the extent
of the range of values to copy, this can be specified in one of the following
two ways:
Start of Destination specifies the first memory location of the where the data is to be copied. This can be any readable, non-structure numeric location.
|
|
See Also:FIFOLOAD - Load First In / First Out
LIFOLOAD - Load Last In / First Out
MOVER - Move Range of Values
REFWRITE - Write Value Indirectly
STRCOPYR - Copy a Range of Strings
|
|
Rung Examples:
|
|
FIFO Example Shifting DWord Values
|
|