Register 6 does not contain all zeros
The initial contents of register 7 are not significant
Register 8 contains00 00 35 50 The following assembly language statements load the reg isters properly and perform the divide operation:
Statement Comments
L 6,0(0,8)Places 00 00 08 07 into register 6 SROA 6,32(0) Shifts 00 00 08 07 into register 7
Register 6 isfilled with zeros (sign bits)
° 6,4(0,8) Performs the division
The machine format of the preceding DIVIDE instruction
is:
Machine Format004 After the foregoing instructions are executed:
Register 6 contains00 00 00 14 = 20 1 0 = the remainder
Register 7 contains00 00 00 2D = 4510 == the quotient
Note that if the dividend had not been first placed inregis ter 6 and shifted into register 7, register 6 would not have
been filled with the proper sign bits (zeros in this example),
and the DIVIDE instruction would not have given the
expected results.Exclusive OR (X, XR, XI, XC)
When the Boolean operationEXCLUSIVE OR is applied to
two bits, the result is one when one, and only one, of the
two bits is one; otherwise, the result is zero. When two
bytes areEXCLUSIVE ORed in System/370, each pair of
bits is handled separately; there is no connection from one
bit position to another.
ExclusiveOR (XI) A frequent use of the EXCLUSIVE OR (XI) instruction is
to invert a bit (change a zero bit to a one or a one bit to a
zero). For example, assume that storage location8082 contains 0110 1001
2
, To set the leftmost bit to one and
the rightmost bit to zero without affecting any of the other
bits, the following instruction can be used (assume that
register 9 contains00 00 80 80): Machine Format Op Code 12 B1
97 81 9002 Assembler Format Op Code 01 (81)' 12 XI 2(9),X'81'
When the instruction is executed, the byte in storage isEXCLUSIVE ORed with the immediate byte:
Location8082: 0110 1001 2 Immediate byte: 1000 00012 Result: 1110 10002 The resulting byte with the leftmost and rightmost bits
inverted is stored in location8082. Condition code 1 is
set.
ExclusiveOR (XC)
TheEXCLUSIVE OR (XC) instruction can be used to
change the contents of two areas in storage without the use
of an intermediate storage area. For example, assume that
two words are in storage:
Word 1 Word 2
358 35B360 363 I 00 I 00 1
17
1
90 I 1 00 1 00 1141 01 I Execution of the instruction (assume that register 7 con tains 00 00 03 58):
Machine FormatOp Code L
0703 000 008 Assembler Format Op Code 01 (L, B
1
), 02 (B
2
)
XC0(4,7) ,8(7) EXCLUSIVE ORs word 1 with word 2 as follows:
Word 1:0000 0000 0000 0000 0001 0111 1001 00002 = 00 00 17 90 Word 2: 0000 0000 0000 0000 0001 0100 0000 00012 = 00 00 14 01 ResuU: 0000 0000 0000 0000 0000 0011 1001 00012 = 00 00 03 91
The result replaces the former contents of word 1.
Now, execution of the instruction
Machine FormatOp Code L B1
°1
B2 °2
0703 I 7 008 I 7 I 000 Assembler Format Op Code 01 (L,B
1
),02(B
2
)
XC 8(4,7),0(7) produces the following result:
Word 1:0000 0000 0000 0000 0000 0011 1001 00012 = 00 00 03 91
Word 2:0000 0000 0000 0000 0001 0100 0000 0001 2 = 00 00 14 01 Result: 0000 0000 0000 0000 0001 0111 1001 00002 = 00 00 17 90 Appendix I. Number Representation and Instruction-Use Examples 297
The initial contents of register 7 are not significant
Register 8 contains
Statement Comments
L 6,0(0,8)
Register 6 is
° 6,4(0,8) Performs the division
The machine format of the preceding DIVIDE instruction
is:
Machine Format
Register 6 contains
Register 7 contains
Note that if the dividend had not been first placed in
been filled with the proper sign bits (zeros in this example),
and the DIVIDE instruction would not have given the
expected results.
When the Boolean operation
two bits, the result is one when one, and only one, of the
two bits is one; otherwise, the result is zero. When two
bytes are
bits is handled separately; there is no connection from one
bit position to another.
Exclusive
to invert a bit (change a zero bit to a one or a one bit to a
zero). For example, assume that storage location
2
,
the rightmost bit to zero without affecting any of the other
bits, the following instruction can be used (assume that
register 9 contains
97 81 9
When the instruction is executed, the byte in storage is
Location
inverted is stored in location
set.
Exclusive
The
change the contents of two areas in storage without the use
of an intermediate storage area. For example, assume that
two words are in storage:
Word 1 Word 2
358 35B
17
1
90
Machine Format
07
1
), 02 (B
2
)
XC
Word 1:
The result replaces the former contents of word 1.
Now, execution of the instruction
Machine Format
°1
B2 °2
07
1
),02(B
2
)
XC 8(4,7)
Word 1:
Word 2:








































































































































































































































































































































