WORDMOVE

Command: Copy words from one region to another in main memory.

((PUBPRI))
  WORDMOVE (DestAddress, SrcAddress, Count )

  • DestAddress is an expression specifying the main memory location to copy the first word of source to.
  • SrcAddress is an expression specifying the main memory location of the first word of source to copy.
  • Count is an expression indicating the number of words of the source to copy to the destination.

Explanation

WORDMOVE is one of three commands (BYTEMOVE, WORDMOVE, and LONGMOVE) used to copy blocks of main memory from one area to another. WORDMOVE copies Count words of main memory starting from SrcAddress to main memory starting at DestAddress.

Using WORDMOVE

WORDMOVE is a great way to copy large blocks of word-sized memory. For example:

VAR
  word Buff1[100]
  word Buff2[100]

PUB Main
  wordmove(@Buff2, @Buff1, 100)  'Copy Buff1 to Buff2 

The first line of the Main method, above, copies the entire 100-word (200-byte) Buff1 array to the Buff2 array. WORDMOVE is faster at this task than a dedicated REPEAT loop.

Unless otherwise noted, content on this site is licensed under the
Creative Commons Attribution-ShareAlike 4.0 International License.