Download Print this page

IBM 4300 Manual page 266

Processors principles of operation for ecps: vse mode
Hide thumbs Also See for 4300:

Advertisement

After all the foregoing instructions are executed:
Register 6 contains 00 00 00 14
=
20 1 0
=
the remainder.
Register 7 contains 00 00 00 20
=
45 1 0
=
the quotient.
Note that if the dividend had not been first
placed in register 6 and shifted into register 7,
register 6 might not have been filled with the
proper sign bits (zeros in this example), and the
DIVIDE instruction might not have giventhe
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 is one; otherwise, the
result is zero. When two bytes are EXCLUSIVE
ORed, each pair of bits is handled separately; there
is no connection from one bit position to another.
The following is an example of the EXCLUSIVE
OR of two bytes:·
First-operand byte:
Second-operand byte:
0011 01012
0101 11002
Result byte:
0110 10012
Exclusive Or (XC)
The EXCLUSIVE OR (XC) instruction can be
used to exchange the contents of two areas in
storage without the use of an intermediate storage
area. For example, assume two three-byte fields in
storage:
359
35B
Field 1
1 00 1 17 1 90
I
360
362
Fie 1 d 2
1 00 1141 01 1
Execution of the instruction (assume that
register 7 contains 00 00 03 58):
Machine Format
Op Code
L
Bl
01
07
02
7
I
008 1
Assembler Format
Op Code
01(L,Bl),02(B2)
XC
1(3,7),8(7)
Field 1 is EXCLUSIVE ORed with field 2 as
follows:
Field 1 :
0000 0000 0001 0111 1001 00002
00 17 90
Field 2:
0000 0000 0001 0100 0000 00012
00 14 01
Result:
0000 0000 0000 0011 1001 00012
00 03 91
The result replaces the former contents of field
1.
Now, execution of the instruction:
Machine Format
Op Code
L
07
02
7
1
008
1
Assembler Format
Op Code
01(L,Bl),02(B2)
XC
8(3,7),1(7)
produces the following result:
Field 1: 0000 0000 0000 0011 1001 00012
00 03 91
Field 2: 0000 0000 0001 0100 0000 00012
00 14 01
Result:
0000 0000 0001 0111 1001 00002
00 17 90
The result of this operation replaces the former
contents of field 2. Field 2 now contains the
original value of field 1.
Lastly, execution of the instruction:
Machine Format
Op Code
L
07
02
7
1
001
1
7
1
008
1
Assembler Format
Op Code
XC
Appendix A. Number Representation and Instruction-Use Examples
A-13

Advertisement

loading