interruption for fixed-point overflow
occurs.
ResultingCondition Code: o
1
2
3
Result zero; no overflow
Result less thanzero; no over
flow
Result greater than zero; no
overflowOverflow Program Exceptions:
Access (fetch, operand 2 of S only)Fixed-point overflow
Programming Notes
1. When, in the RR format,R1 and R2
designate the same register,
subtracting is equivalent to clear
ing the register.
2. Subtracting a maximum negative
number from anothermaximum nega
tive number gives a zero result and
no overflow.SUBTRACT HALFWORO SH [RX]
'4B'O
2 o 8 12 16 20 31
The second operand is subtracted from
the first operand, and the difference is
placed at the first-operand location.
The second operand is two bytes in
length and is treated as a 16-bit signed
binary integer. The first operand and
the difference are treated as 32-bit
signed binary integers.
When thereis an overflow, the result is obtained by allowing any carry into the
sign-bit position and ignoring any carry
out of the sign-bit position, and condi
tion code 3is set. If the fixed
point-overflow mask is one, a program
interruption for fixed-point overflow
occurs.
ResultingCondition Code: 0 Result zero; no overflow
1 Result less than zero; no over-
flow
2 Result greater than zero; no
overflow
3Overflow Program Exceptions:
Access (fetch, operand 2)
Fixed-point overflowSUBTRACT LOGICAL SLR [RR] , 1 F' I R1 I R2 I 0 8 12 15
SLR 1 ,02(X
2
,B
2
) [RX]
'5 F'I R1 I X 2 I B2 O 2 o 8 12 16 20 31
The second operand is subtracted from
the first operand, and the difference is
placed at the first-operand location.
The operands and the difference are
treated as 32-bit unsigned binary inte
gers.
ResultingCondition Code: o
1
2
3
Result not zero; no carry
Result zero; carry
Result not zero; carry
Program Exceptions:
Access (fetch, operand 2 of SL
only)
Programming Notes
1. Logical subtraction is performed by
adding the one's complement of the
second operand and a value of one
to the first operand. The use of
the one's complement and the value
of one instead of the two's comple
ment of the second operand resultsin a carry when the second operand
is zero.
2.SUBTRACT LOGICAL differs from SUBTRACT only in the meaning of the
condition code and in the absence
of the interruption for overflow.
3.
4.
A zero difference
panied by a carry
tionO. is always accom
out of bit posi-
The condition-code setting forSUBTRACT LOGICAL can also be inter-
preted as indicating the presence
and absence of a borrow,
follows:
1
2
3
Result not zero; borrow
Result zero; no borrow
Result not zero; no borrow
asChapter 7. General Instructions 7-37
occurs.
Resulting
1
2
3
Result zero; no overflow
Result less than
flow
Result greater than zero; no
overflow
Access (fetch, operand 2 of S only)
Programming Notes
1. When, in the RR format,
designate the same register,
subtracting is equivalent to clear
ing the register.
2. Subtracting a maximum negative
number from another
tive number gives a zero result and
no overflow.
'4B'
2
The second operand is subtracted from
the first operand, and the difference is
placed at the first-operand location.
The second operand is two bytes in
length and is treated as a 16-bit signed
binary integer. The first operand and
the difference are treated as 32-bit
signed binary integers.
When there
sign-bit position and ignoring any carry
out of the sign-bit position, and condi
tion code 3
point-overflow mask is one, a program
interruption for fixed-point overflow
occurs.
Resulting
1 Result less than zero; no over-
flow
2 Result greater than zero; no
overflow
3
Access (fetch, operand 2)
Fixed-point overflow
SL
2
,B
2
)
'5 F'
The second operand is subtracted from
the first operand, and the difference is
placed at the first-operand location.
The operands and the difference are
treated as 32-bit unsigned binary inte
gers.
Resulting
1
2
3
Result not zero; no carry
Result zero; carry
Result not zero; carry
Program Exceptions:
Access (fetch, operand 2 of SL
only)
Programming Notes
1. Logical subtraction is performed by
adding the one's complement of the
second operand and a value of one
to the first operand. The use of
the one's complement and the value
of one instead of the two's comple
ment of the second operand results
is zero.
2.
condition code and in the absence
of the interruption for overflow.
3.
4.
A zero difference
panied by a carry
tion
out of bit posi-
The condition-code setting for
preted as indicating the presence
and absence of a borrow,
follows:
1
2
3
Result not zero; borrow
Result zero; no borrow
Result not zero; no borrow
as