After the instructions listed above are
executed:
Register 6 contains00 00 00 14 = 20{10} = the remainder.
Register 7 contains00 00 00 2D = 45{10} = the quotient.
Hote that if the dividend had not been
first placed in register 6 and shifted
into register7, register 6 might not
havebeen filled with the proper
dividend-sign bits(zeros in this exam ple), and the DIVIDE instruction might
not have given the expected results.EXCLUSIVE OR (X, XC, XI, XR) When the Boolean operator EXCLUSIVE OR is applied to two bits, the result is
one when either, but not both, of the
two bits isone; otherwise, the result
iszero. When two bytes are EXCLUSIVE ORed, each pair of bits is handled sepa
rately;there is no connection from one
bit position to another. The following
is an example of theEXCLUSIVE OR of two
bytes:
First-operand byte:0011 0101{2) Second-operand byte: 0101 1100{2) Result byte: 0110 1001{2) XC Example
TheEXCLUSIVE OR (XC) instruction can be
used to exchange the contents of two
areas in storage without the use of an
intermediate storage area. Forexample, assume two three-byte fields in storage:
359 358
Field 11001171901 360 362
Field 21001141011 Execution of the instruction (assume
that register 7 contains00 00 03 58):
Machine FormatOp Code L
D702 7 0011 7 008
1 Assembler Format XC 1(3,7),8(7)
Field 1 isEXCLUSIVE ORed with field 2
as follows:
Field 1 :00000000 00010111 10010000{2} = 00 17 90{16} Field 2: 00000000 00010100 00000001{2} = 00 14 01{16} Result: 00000000 00000011 10010001{2} = 00 03 91{16}
The result replaces the former contents
of field 1.Condition code 1 is set to
indicate a nonzero result.
Now, execution of the instruction:
Machine FormatOp Code L
D702 7 0081 7
Assembler FormatXC 8(3,7),1(7)
produces the following result:
Field 1 :00000000 00000011 10010001{2} = 00 03 91{16}
Field 2:00000000 00010100 00000001{2} = 00 14 01{16} Result: 00000000 00010111 10010000{2} = 00 17 90{16} The result of this operation replaces
the former contents of field 2. Field 2
now contains the original value of field
1.Condition code 1 is set to indicate
a nonzero result.
Lastly, execution of the instruction:
Appendix A. Number Representation and Instruction-Use Examples A-17
executed:
Register 6 contains
Register 7 contains
Hote that if the dividend had not been
first placed in register 6 and shifted
into register
have
dividend-sign bits
not have given the expected results.
one when either, but not both, of the
two bits is
is
rately;
bit position to another. The following
is an example of the
bytes:
First-operand byte:
The
used to exchange the contents of two
areas in storage without the use of an
intermediate storage area. For
359 358
Field 1
Field 2
that register 7 contains
Machine Format
D7
1
Field 1 is
as follows:
Field 1 :
The result replaces the former contents
of field 1.
indicate a nonzero result.
Now, execution of the instruction:
Machine Format
D7
Assembler Format
produces the following result:
Field 1 :
Field 2:
the former contents of field 2. Field 2
now contains the original value of field
1.
a nonzero result.
Lastly, execution of the instruction:
Appendix A. Number Representation and Instruction-Use Examples A-17