locations 60400-607FF of the first oper­
and would have been filled with 1,024 copies of the padding byte X'FO', as
specified by the leftmost byte of regis­
ter 3. Bits 8-31 of registers 2 and 8
would have been incremented by 400{16}, and bits 0-7 of registers 2 and 8 set to
zeros. Bits 8-31 of registers 3 and 9
would still have been decremented to
zero. Condition code 2 would have been
set to indicate that the first operand
was longer than the second.
The technique for setting a field to
zeros that is illustrated in the second
example of MVC cannot be used with MVCl. If the registers were set up to attempt
such an operation with MVCl, no data
movement would take place and condition
code 3 would indicate destructive over­
lap.
Instead, MVCl may be used to clear a
storage area to zeros as follows.
Assume register 8 and 9 are set up as
before. Register 3 contains only zeros,
specifying zero length for the second
operand and a zero padding byte. Regis­
ter 2 is not used to access storage, and
its contents are not significant.
Executing the instruction MVCl 8,2 caus­
es locations 60000-607FF to be filled
with zeros. Bits 8-31 of register 8 are
incremented by 800{16}, and bits 0-7 of
registers 2 and 8 are set to zeros.
Bits 8-31 of register 9 are decremented
to zero, and condition code 2 is set to
indicate that the first operand is long­
er than the second. MOVE NUMERICS (MVN) Two related instructions, MOVE NUMERICS and MOVE ZONES, may be used with decimal
data in the zoned format to operate
separately on the rightmost four bits
(the numeric bits) and the leftmost four
bits (the zone bits) of each byte. Both
are similar to MOVE (MVC), except that MOVE NUMERICS moves only the numeric
bits and MOVE ZONES moves only the zone
bits.
To illustrate the operation of the MOVE NUMERICS instruction, assume that the
following two fields are in storage: 7090 7093 Field A IC61C71C81C91 7041 7046 Field B IFO/F1IF2IF3IF4IF51 Also assume:
Register 14 contains 00 00 70 90. Register 15 contains 00 00 70 40. After the instruction:
Machine Format Op Code l 01 03 F E 0001 Assembler Format MVN 1(4,15),0(14) is executed, field B becomes: 7041 7046 IF61F71F81F91F41F51 The numeric bits of the bytes at
locations 7090-7093 have been stored in
the numeric bits of the bytes at
locations 7041-7044. The contents of
locations 7090-7093 and 7045-7046 are
unchanged. MOVE WITH OFFSET (MVO) MOVE WITH OFFSET may be used to shift a
packed-decimal number an odd number of
digit positions or to concatenate a sign
to an unsigned packed-decimal number.
Assume that the three-byte
packed-decimal number in
locations 4500-4502 is to be
locations 5600-5603 and given
of the packed-decimal number
location 5603. Also assume:
unsigned
storage
moved to
the sign
ending at
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 4500-4502 contain 12 34 56.
After the instruction:
Machine Format Op Code F1 3 2 C 000 I F 0001 Assembler Format MVO 0(4,12),0(3,15) Appendix A. Number Representation and Instruction-Use Examples A-23
is executed, the storage locations 5600-5603 contain 01 23 45 6C. Note
that the second operand is extended on
the left with one zero to fill out the
first-operand field. MOVE ZONES (MVZ) The MOVE ZONES instruction can operate
on overlapping or nonoverlapping fields,
as can the instructions MOVE (MVC) and MOVE NUMERICS. When operating on nono­
verlapping fields, MOVE ZONES works like
the MOVE NUMERICS instruction (see its
example), except that MOVE ZONES moves
only the zone bits of each byte. To
illustrate the use of MOVE ZONES with
overlapping fields, assume that the
following data field is in storage: 800 805 IFI1C21F31
C4
lF51C61
Also assume that register 15 contains 00 00 08 00. The instruction:
Machine Format Op Code l 03 04 F 0011 F 0001 Assembler Format MVZ 1(5,15),0(15) propagates the zone bits from the byte
at address 800 through the entire field,
so that the field becomes: 800 805 IFI1F21F31F41F51F61 MULTIPLY (M, MR)
Assume that a number in register 5 is to
be multiplied by the contents of a
four-byte field at address 3750. Initially:
The contents of register 4 are not
significant.
Register 5 contains 00 00 00 9A = 154{10} = the multiplicand.
Register 11 contains 00 00 06 00. Register 12 contains 00 00 30 00. A-24 System/370 Principles of Operation Storage locations 3750-3753 contain 00 00 00 83 = 131{10} = the
multiplier.
The instruction required for performing
the multiplication is:
Machine Format Op Code R t X 2 B2 O 2 5C 4 B C 150
1
Assembler Format
M 4,X'150'(11,12)
After the instruction is executed, the
product is in the register pair 4 and 5:
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 01 00 05. The contents of register 6 are not
significant. The instruction:
Machine Format Op Code lC 6 7
Assembler Format Op Code R t ,R
2
MR 6,7
multiplies the number in register 7 by
itself and places the result in the pair
of registers 6 and 7:
Register 6 contains 00 00 00 01. Register 7 contains 00 OA 00 19.
MULTIPLY HAlFWORO (MH)
The MULTIPLY HAlFWORO instruction is
used to multiply the contents of a
register by a two-byte field in storage.
For example, assume that:
Register 11 contains 00 00 00 15 =21{10} = the multiplicand.
Register 14 contains 00 00 01 00.
Previous Page Next Page