Machine Format Op Code FA 2 3 C 000 I D 0001 Assembler Format
AP 0(3,12),0(4,13) is executed, the storage 2000-2002 contain 73 88 5Ci code 2 is set to indicate
result is greater than zero.
locations
condition
that the Note that:
1. Because the two numbers had differ­
ent signs, they were in effect
subtracted.
2. Although the second operand is
longer than the first operand, no
overflow interruption occurs because the result can be entirely contained within the first operand. COMPARE DECIMAL (CP) Assume that the signed, packed-decimal
contents of storage locations 700-703 are to be algebraically compared with
the signed, packed-decimal contents of
locations 500-502. Also assume:
Register 12 contains 00 00 06 00. Register 13 contains 00 00 03 00. Storage locations 700-703 contain 17 25 35 6D.
Storage locations 500-502 contain 72 14
2D.
After the instruction:
Machine Format Op Code F9 3 2 C 100 I D
Assembler Format
is executed, condition code 1 is set,
indicating that the first operand (the
contents of locations 700-703) is less
than the second.
DIVIDE DECIMAL (DP)
Assume that the signed, packed-decimal
number at storage locations 2000-2004 (the dividend) is to be divided by the
signed, packed-decimal number at
locations 3000-3001 (the divisor). Also
assume:
Register 12 contains 00 00 20 00. Register 13 contains 00 00 30 00. Storage locations 2000-2004 contain 01 23 45 67 8C. Storage locations 3000-3001 contain 32 10. After the instruction:
Machine Format Op Code L t
FD 4 1 C 000 I 0 0001 Assembler Format
DP 0(5,12),0(2,13) is executed, the dividend is entirely
replaced by the signed quotient and
remainder, as follows: 2000 2004 Locations 2000-2004 13814610DI0118Cl quotient I remainder
Notes:
1. Because the dividend and divisor
have different signs, the quotient
receives a negative sign.
2. The remainder receives the sign of
the dividend and the length of the
divisor.
3. If an attempt were made to divide
the dividend by the one-byte field
at location 3001, the quotient
would be too long to fit within the
four bytes allotted to it. A
decimal-divide exception would exist, causing a program inter­
ruption.
EDIT (ED)
Before decimal can be used in
and signs must
characters.
marks, such
data in the packed format
a printed report, digits
be converted to printable
Moreover, punctuation
as commas and decimal
Appendix A. Number Representation and Instruction-Use Examples A-31
points, may have to be inserted in
appropriate places. The highly flexible
EDIT instruction performs these func­
tions in a single instruction execution.
This example shows step-by-step one way
that the EDIT instruction can be used.
The field to be edited (the source) is
four bytes long; it is edited against a
pattern 13 bytes long. The following
symbols are used:
Symbol Meaning
b (Hexadecimal 40) Blank character
( (Hexadecimal 21) Significance
starter
d (Hexadecimal 20) Digit selector
Assume that register 12 contains: 00 00 10 00 and that the source and pattern fields
are:
Source 1200 1203 1021S714216Cl 1- L+
A-32 System/370 Principles of Operation Pattern 1000 lOOC 14012012016BI2012l12014BI20t2ot4otc31D91 b d d d d d d b C R
Execution of the instruction:
Machine Format Op Code L
DE OC C 000 I C Assembler Format
ED O(13,12),X'200'(l2) alters the pattern field as follows:
Previous Page Next Page