After the instruction is executed, register 10 contains 00 00 AB CD.
Load Address (LA)
The LOAD ADDRESS instruction provides a convenient
way to place a nonnegative number 4095
1
0 in a register
without first defining the number as a constant and then
using it as an operand. For example, assume that the num­
ber 2048
10
is to be placed in register 1. One instruction
that will do this is:
Machine Format
41 11 1 0 1 0 800 Assembler Format Op Code R
1
02 (X
2
8
2
)
LA 1,2048(0,0) As indicated in the programming note in the instruction
description, the LOAD ADDRESS instruction can also be
used to increment a register by an amount 4095 1 0 speci­
fied in the D2 field. For example, assume that register 5
contains 00 12 34 56.
The instruction:
Machine Format Op Code R1 X
2
8
2
. OOA Assembler Format Op Code R
1
, 02 (X
2
, 8
2
)
LA 5,10(0,5)
adds 10 (decimal) to the contents of register 5 as follows:
Register 5 (old):
D2 field:
Register 5 (new): 00 12 34 56 00 00 00 OA 00 12 34 60 Load Halfword (LH)
The LOAD HALFWORD instruction places unchanged the
contents of a halfword in storage into the right half of a
register. The left half of the register is replaced by zeros or
ones to reflect the sign (leftmost bit) of the halfword.
For example, assume that the two bytes in storage loca­
tions 1802-1803 are to be loaded into register 6. Also
assume:
Register 6 contains 7F 12 34 56
Register 14 contains 00 00 18 02 Locations 1802-1803 contain 00 20 The instruction required to load the register is:
Machine Format Op Code R1 X
2
82
48 I 6 I 0 I E I 000 Assembler Format Op Code R
1
, 02 (X
2
, 8
2
)
LH 6,0(0,14)
After the instruction is executed, register 6 contains 00 00 00 20. If 1802-1803 contained a negative number,
for example, A 7 B6, the sign bit would again be propagated
to the left, giving FF FF A 7 B6 as the final result in regis­
ter 6.
Move (MVI) The MOVE (immediate) instruction can place one byte of
information from the instruction stream into any designated
location. For example, if the instruction
Machine Format Op Code 12 92 FA o 055 Assembler Format Op Code ° 1 (8
1
), 12 MVI 85(O),X'FA'
is executed, bits 8-15 of the instruction (1111 1010
2
)
are
copied in storage location 85
10
.
Move (MVC)
The MVC instruction can be used to move a data field from
one location to another. For example, assume that the fol­
lowing two fields are in storage:
Field 1 2048 2052 1 C1 I C2 I C3 I C4 I C5 I C61 C71 C81 C9 I CA I C8 I Field 2 3840 3848 I F1 I F21 F31 F41 F51 F61 F71 F81 F91 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 8
1
02 07 I I 000 000 Appendix I. Number Representation and Instruction-Use Examples 299
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
Previous Page Next Page