Assembler Format OpCode 01 (L,B
1
),02(B2)
MVC 0(8,1) ,0(2) After the instruction is executed, field 1 becomes:
Field 1 2048 2052 F31 F4 I F51 F61 F71 F81 C9 I CA I Field 2 is unchanged.
As indicated in the programming note in the MOVE instruction descriptiort, MVC can be used to propagate one
character through a field by starting the first-operand field
one byte to the right of the second-operand field. For ex­ ample, suppose that an area in storage starting with address
358 contains the following data:
358 360 I 00 I F1 I F21 F31 F4 I Fsl F61 F71 F81 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 B1 01 B2 D2 Assembler Format OpCode 01 (L,a
1
),02(B
2
)
MVC 1 (8,11),0(11)
Because MVC handles one byte at a time, the above
instruction essentially 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 loca­ tion 358.
Notes:
1. Although the field occupying locations 358-360 contains
nine bytes, the length coded in the assembler format is
equa11to the number of moves (one less than the field
length).
2. The order of operands is important even though only
one field is involved.
Move Numerics (MVN)
To illustrate the operation of the MOVE NUMERICS instruction, assume that the following two fields are in
storage:
Field 1 moo I C1 I C2 I C3 I C4 I C5 I C61 C71 C81 300 Systemj370 Principles of Operation
Field 2 7041 7049 I FO I F1 I F21 F31 F41 F51 F61 F71 F81 Also assume:
Register 14 contains 00 00 70 90 Register 15 contains 00 00 70 40 After the instruction
Machine Format Op Code L B1
D1 I 03 I F 001 Assembler Format OpCode 01 (L,B
1
),02(B2)
MVN 1 (4,15),0(14)
is executed, field 2 becomes: 7041 7049 I F1 , F21 F3' F41 F4' F5' F6' F7' F81 000 The numeric portions of locations 7090-7093 have been
stored in the numeric portions oflocations 7041-7044. The
contents of locations 7090-7097 and 7045-7049 are un­ changed.
Move with Offset (MVO)
Assume that the unsigned three-byte field in storage loca­ tions 4500-4502 is to be moved to locations 5600-5603 and given the sign of the one-byte field located at 5603. Also assume.:
Register 12 contains 00 00 56 00 Register 15 contains 00 00 45 00 Storage locations 5600-5603 contain 77 88 99 OC Storage locations 45004502 contain 12 34 56
After the instruction
Machine Format Op Code L1 L2 B1 I F1 I 3 I 2 I C 000 Assembler Format Op Code 01 IL
1
,
B
1
), 02 (L
2
, B2) MVO 0(4,12),0(3,15) 000 is executed, storage locations 5600-5603 contain 01 23 45 6C. Note that the second operand was extended with one
high-order zero to fill out the first-operand field.
Move Zones (MVZ) The MOVE ZONES instruction, similarly to MVC and MVN,
can operate on overlapping or noiloverlapping fields. (See
the examples for MVC and MVN.) When operating on non­ overlapping fields, MVZ works similarly to the MVN instruc­ tion, except that MVZ moves the high-order four bits of
each byte. To illustrate the use of MVZ with overlapping assume that the following data field is in storage: 800 805 I F1 I C2 I F31 C41 F5 I C61 Also assume that register 15 contains 00 00 08 00. The
instruction:
Machine Format Op Code L B, 0,
03 04 001 F 000 Assembler Format Op Code 01 (L, B1), 02 (B2)
MVZ 1(5,15),0(15)
propagates the zone from the byte at address 800 through
data field, so that the field becomes: 800 805 I F1 I F21 F31 F41 F51 F6 I Multiply (M, MR)
Assume that a number in register 5 is to be multiplied by
the contents of a word at address 3750. Initially:
The contents of register 4 are not significant
Register 5 contains 00 00 00 9 A = 15410 = the multiplicand
Register 11 contains 00 00 30 00 Register 12 contains 00 00 06 00 Storage locations 3750-3753 contain 00 00 00 83 = 13110
= the multiplier
The instruction required for performing the multiplica­
tion is:
Machine Format Op Code R1 X
2
B2 150 Assembler Format Op Code R
1
, 02 (X2' B2)
M 4, X'150' (11,12)
After the instruction is executed, registers 4 and 5 con­ tain the product:
Register 4 contains 00 00 00 00 Register 5 contains 00 00 4E CE = 20,174
10
Storage locations 3750-3753 are unchanged.
The RR format of the instruction can be used to square
the number in a register. Assume that register 7 contains 00 00 00 10 = 16
1 o. The instruction
Machine Format Op Code R1 R2 1C 16 I 7
Assembler Format Op Code R
l
,
R2
MR 6,7 \< multiplies the number in register 7 by itself:
The product, 00 00 00 00 00 00 01 00 = 256
10
,
appears in registers 6 and 7. Multiply Halfword (MH)
The MULTIPLY HALFWORD instruction is used to multi­ ply the contents of a register by a halfword in storage. For
example, assume that:
Register 11 contains 00 00 00 15 = 21
1
0 = the multiplicand
Register 14 contains 000001 00 Register 15 contains 00002000 Storage locations 2102-2103 contain FF 09 = -39 = the multiplier
The instruction
Machine Format 002 Assembler Format Op Code R
1
, 02 (X
2
, B2)
MH 11,2(14,15)
multiplies the two numbers. The product, FF FF FC CD =
-819 1 0, replaces the original con tents of registe r 11. Only the low-order 32 bits of a product are stored in a
register; any high-order bits are lost. No program interrup­ tion occurs on overflow. OR (0, OR, 01, OC) When the Boolean operator OR is applied to two bits, the
result is one when either bit is one; otherwise, the result is
zero. When two bytes are ORed in System/370, each pair of
bits is handled separately; there is no connection from one
bit position to another. OR (01) A frequent use of the OR instruction is to set a particular
bit to one. For example, assume that storage location 4891
contains 0100 0010
2
To set the rightmost bit of this byte
to one without affecting the other bits, the following
instruction can be used (assume that register 8 contains 00 00 48 90): Machine Format Op Code 12 96 01 Assembler Format Op Code 01 (B
1
), 12 01 1 (8),X'01' 001 Appendix I. Number Representation and Instruction-Use Examples 301
Previous Page Next Page