< previous page page_29 next page >

Page 29
Store (ST) and move (MOVE) instructions are, to a degree, synonymous. We use STORE when the source argument is a register and the destination is memory. Thus,
d87111c01013bcda00bb8640fdff6754.gif
ST A, R1
places the contents of (general register) R1 in memory location A, and
d87111c01013bcda00bb8640fdff6754.gif
ST.F A, R1
places the contents of floating register R1 in memory location A.
We use the MOVE construct in a more general way. Usually, MOVE implies that both source and destination operands are in memory, or both are in registers. Thus,
d87111c01013bcda00bb8640fdff6754.gif
MOVE A, B
would replace (the word at memory location) A with (the word at memory location) B. Commonly, MOVE is used for strings of characters or decimal numbers. Thus,
d87111c01013bcda00bb8640fdff6754.gif
MOVE.C A, B
moves the character string starting at memory location B to A. There is usually a length component associated with A and B, so that we probably should indicate
d87111c01013bcda00bb8640fdff6754.gif
MOVE.C (l1,l2) A, B,
where l1 and l2 are the byte lengths of A and B, respectively. For purposes of this text, we frequently do not need to make these specifications, so that in MOVE.C A, B, the lengths of A and B are assumed to be defined earlier and known.
There is a special type of move associated with decimal arithmetic, called ZMOVE:
d87111c01013bcda00bb8640fdff6754.gif
ZMOVE.P A, B.
This decimal move (packed format) operation requires that l1³ l2 and that all leading digits of l1 (the destination, or A in the above) be zeroed out. For strings, MOVE.C and ZMOVE.P are the two most frequently encountered operations.
MOVE can have a role for all register operands moving a value from one register to another, so that
d87111c01013bcda00bb8640fdff6754.gif
MOVE.F R1, R2
has the same effect as moving the value in floating-point register R2 to R1.

 
< previous page page_29 next page >