Machine Format Op Code R, 48 6 o E 0001 Assembler Format
lH 6,0(0,14) After the instruction is executed,
register 6 contains 00 00 00 20. If
locations 1803-1804 had contained a
negative number, for example, A7 B6, a
minus sign would have been propagated to
the left, giving FF FF A7 B6 as the
final result in register 6. MOVE (MVC, MVI) MVC Example
The MOVE (MVC) instruction can be used
to move data from one storage location
to another. For example, assume that
the following two fields are in storage: 2048 2052 Fii
ld \ C1 IC2IC3IC4IC5IC6IC7IC8IC9ICAICBI 3840 3848 IFI1F21F31F41F51F61F71F81F91 Also assume:
Register 1 contains 00 00 20 48.
Register 2 contains 00 00 38 40. With the following instruction, the
first eight bytes of field 2 replace the
first eight bytes of field 1:
Machine Format Op Code l
02 07 1 000 I 2 0001 Assembler Format MVC 0(8,1),0(2) After the instruction is executed, field
1 becomes: 2048 2052 Fii
ld I F1 IF21F31F41F51F61F71F81C91CAICBI Field 2 is unchanged. MVC can also be used to propagate a byte
through a field by starting the firstĀ­
operand field one byte location to the
right of the second-operand field. For
example, suppose that an area in storage
starting with address 358 contains the
following data:
358 360 100lFI1F21F31F41F51F61F71F81 With the following MVC instruction, the
zeros in location 358 can be propagated
throughout the entire field (assume that
register 11 contains 00 00 03 58):
Machine Format Op Code l
02 07 B 0011 B 0001 Assembler Format MVC 1(8,11),0(11)
Because MVC is executed as if one byte
were processed at a time, the above
instruction, in effect, takes the byte
at address 358 and stores it at 359 (359
now contains 00), takes the byte at 359
and stores it at 35A, and so on, until
the entire field is filled with zeros. Note that an MVI instruction could have
been used originally to place the byte
of zeros in location 358.
Notes:
1. Although the field occupying
locations 358-360 contains nine
bytes, the length coded in the
assembler format is equal to the
number of moves (one less than the
field length).
2. The order of operands is important
even though only one field is
involved.
MVI Example
The MOVE (MVI) instruction places one
byte of information from the instruction
Appendix A. Number Representation and Instruction-Use Examples A-21
stream into storage. For example, the
instruction:
Machine Format Op Code 12 92 SB 1 0001 Assembler Format Op Code D
t (B
t ),I
2
MVI 0(1),C'$' may be used, in conjunction with the
instruction EDIT AND MARK, to insert the
EBCDIC code for a do!!ar symbo! at the
storage address contained 1n genera!
register 1 (see a!so the examp!e for
EDIT AND MARK). MOVE INVERSE (MVCIN)
The MOVE INVERSE (MVCIN) instruction can
be used to move data from one storage
location to another while reversing the
order of the bytes within the fie!d.
For examp!e, assume that the following
two fields are in storage: 2048 20S2 IC11C21C31C41csIC61C71C81C91CAICBI 3840 3848 IF11F21F31F41FsIF61F71F81F91 Also assume:
Register 1 contains 00 00 20 48.
Register 2 contains 00 00 38 40. With the following instruction, the
first eight bytes of field 2 replace the
first eight bytes of field 1:
Machine Format Op Code L
E8 07 1 0001 2
Assembler Format Op Code D
t (L,B
t ),D
2
(B
2
)
MVCIN 0(8,1),7(2) A-22 System/370 Principles of Operation
After the instruction is executed, field
1 becomes: 2048 20S2 IF81F71F61FsIF41F31F21F11C91CAICBI Field 2 is unchanged.
Note: This example uses the same generĀ­
al registers, storage locations, and
original values as the first example for
MVC. For MVCIN, the second-operand
address must designate the rightmost
byte of the field to be moved, in this
case location 3847. This is accomĀ­
plished by means of the 7 in the D2
field of the instruction. MOVE LONG (MVCL)
The MOVE LONG (MVCL) instruction can be
used for moving data in storage as in
the first example of the MVC
instruction, provided that the two operĀ­
ands do not overlap. MVCL differs from
MVC in that the address and length of
each operand are specified in an evenĀ­
odd pair of general registers.
Consequently, MVCL can be used to move
more than 2S6 bytes of data with one
instruction. As an examp!e, assume:
Register 2 contains 00 OA 00 00. Register 3 contains 00 00 08 00. Register 8 contains 00 06 00 00. Register 9 contains 00 00 08 00. Execution of the instruction:
Machine Format Op Code R, R2 DE 8 2
Assembler Format
MVCL 8,2
moves 2,048{10} bytes from locations AOOOO-A07FF to locations 60000-607FF. Bits 8-31 of registers 2 and 8 are
incremented by 800{16}, and bits 0-7 of
registers 2 and 8 are set to zeros.
Bits 8-31 of registers 3 and 9 are
decremented to zero. Condition code 0 is set to indicate that the operand
lengths are equal.
If register 3 had contained FO 00 04 00, only the 1,024{10} bytes from locations AOOOO-A03FF would have been moved to
locations 60000-603FF. The remaining
Previous Page Next Page