Download Print this page

Subtract Decimal; Zero And Add - IBM 4300 Manual

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

Advertisement

SUBTRACT DECIMAL
5P
D1(L1,B1),D2(L2,B2)
[55]
I
Ll
I
L2
I
B1
I
/
I
B2
I
~U
IFBI
°
1
/
0
8
12
16
20
32
36
47
The second operand is subtracted from the first
operand, and the resulting difference is placed in
the first-operand location. The operands and result
are in the packed format.
SUBTRACT DECIMAL is executed the same as
ADD DECIMAL, except that the second operand is
considered to have a sign opposite to the sign in
storage. The second operand in storage remains
unchanged.
Resulting Condition Code:
o
Difference is zero
1
Difference is less than zero
2
Difference is greater than zero
3
Overflow
Program Exceptions:
Access (fetch, operand 2; fetch and store,
operand 1)
Data
Decimal Overflow
ZERO AND ADD
ZAP
D1(L1,B1),D2(L2,B2)
[55]
L--I _F
8_
1
---L1_L_1 -L-I_L 2--,--1 _B
1--,1_~
1
I
B 2
I
o
8
12
16
20
32
36
~u
47
The second operand is placed in the first-operand
location. The operation is equivalent to an
addition to zero. The operand and result are in the
packed format.
Only the second operand is checked for valid
sign and digit codes. Extra high-order zeros are
supplied for the shorter operand if needed.
If the first operand is too short to contain all
significant digits of the second operand, decimal
overflow occurs. The operation is completed. The
result is obtained by ignoring the overflow
information, and condition code 3 is set. If the
decimal-overflow mask is one, a program
interruption for decimal overflow takes place.
A zero result is positive. However, when
significant high-order digits are lost because of
overflow, a zero result has the sign of the second
operand.
The two operands may overlap, provided the
rightmost byte of the first operand is coincident
with or to the right of the rightmost byte of the
second operand. In this case the result is obtained
as if the operands were processed right to left.
Resulting Condition Code:
o
Result is zero
1
Result is less than zero
2
Result is greater than zero
3
Overflow
Program Exceptions:
Access (fetch, operand 2; store, operand 1)
Data
Decimal Overflow
Programming Note
An example of the use of ZERO AND ADD is
given in Appendix A.
Chapter 8. Decimal Instructions
8-11

Advertisement

loading