than or eq[ual to the dividend length code, a specifi
cation exception is recognized. The operation is sup
pressed, and a program interruption occurs.
The dividend, divisor, quotient, and remainder are
all signed integers, right-aligned in their fields. The
sign of quotient is determined by the rules of
algebra from dividend and divisor signs. The sign of
the remainder has the same value as the dividend
sign. These rules are true even when the quotient or
remainder is zero.Overflow cannot occur. A quotient larger than the
number of digits allowed is recognized as a dedmal
divide exception. The operation is suppressed, and a
program interruption occurs. The divisor and divi
dend remain unchanged in their storage locations.
The divisor and dividend fields may overlap only
if their low-order bytes coincide.
Condition Code: The code remains unchanged.
Program Exceptions:Operation (if the decimal feature is not installed)
Access (fetch, operand 2; fetch and store, oper-
and 1)Specification Data
Decimal Divide
Programming Notes
The maximum dividend size is 31 digits and sign.Since the smallest remainder size is one digit and
sign, the maximum quotient size is 29 digits and sign.
The condition for a decimal divide exception can
be determined by a trial subtraction. The leftmost
digit of the divisor field is aligned with the leftmost
less-onedigit of the dividend field. When the divisor,
soaligned" is less than or equal to the dividend, a
divide exception is indicated.
A decimal-divide exception occurs if the dividend
does not have at least one leading zero.
Edit
ED[SS] _L -.1-.-
8
----'--(, I 8 16 20 32 36 47 o
The format of the source (the second operand) is
changed from packed to zoned, and is modified un
der control of the pattern (the first operand). The
edited result replaces the pattern.
Editing includes sign and punctuation control, and
the suppressing and protecting of leading zeros. It150 System/370 Principles of Operation
also facilitates programmed blanking of all-zero
fields. Several fields may be edited in one operation,
and numeric information may be combined with
text.
The length field applies to the pattern (the first
operand). The pattern has the zoned format and may
contain any character. The source (the second oper
and) has the packed format. The leftmost four bits
of a source byte must specify a decimal digit code(0000-1001); a sign code (1010-1111) is recognized
as a data exception and causes a program interrup
tion. The rightmost four bits may specify either a
sign or a decimal digit.
The result is obtained as if both operands were
processed left to right one byte at a time.Overlap ping pattern and source fields give unpredictable
results.
During the editing process, each character of the
pattern is affected in one of three ways:
1. It is left unchanged.
2. It is replaced by a source digit expanded to
zoned format.
3. It is replaced by the first character in the pat
tern, called the fill character.
Which of the three actions takes place is deter
mined by one or more of the following: the type of
the pattern character, the state of the significance
indicator, and whether the source digit examined is
zero.Pattern Characters: There are four types of pattern
characters: digit selector, significance starter, field
separator, and message character. Their coding is as
follows:
Name
Digitselector Significance starter Field separator
Message characterCode 0010 0000 0010 0001 0010 0010 Any other
The detection of either a digit selector or a signifi
cance starter in the pattern causes an examination to
be made of the significance indicator and of a source
digit. As a result, either the expanded source digit or
the fill character, as appropriate, is selected to re
place the pattern character. Additionally, encounter
ing a digit selector or a significance starter may
cause the significance indicator to be changed.
The field separator identifies individual fields in a
multiple-field editing operation. It is always replaced
in the result by the fill character, and the significance
indicator is always off after the field separator is
encountered.
cation exception is recognized. The operation is sup
pressed, and a program interruption occurs.
The dividend, divisor, quotient, and remainder are
all signed integers, right-aligned in their fields. The
sign of
algebra from dividend and divisor signs. The sign of
the remainder has the same value as the dividend
sign. These rules are true even when the quotient or
remainder is zero.
number of digits allowed is recognized as a dedmal
divide exception. The operation is suppressed, and a
program interruption occurs. The divisor and divi
dend remain unchanged in their storage locations.
The divisor and dividend fields may overlap only
if their low-order bytes coincide.
Condition Code: The code remains unchanged.
Program Exceptions:
Access (fetch, operand 2; fetch and store, oper-
and 1)
Decimal Divide
Programming Notes
The maximum dividend size is 31 digits and sign.
sign, the maximum quotient size is 29 digits and sign.
The condition for a decimal divide exception can
be determined by a trial subtraction. The leftmost
digit of the divisor field is aligned with the leftmost
less-one
so
divide exception is indicated.
A decimal-divide exception occurs if the dividend
does not have at least one leading zero.
Edit
ED
8
----'--(,
The format of the source (the second operand) is
changed from packed to zoned, and is modified un
der control of the pattern (the first operand). The
edited result replaces the pattern.
Editing includes sign and punctuation control, and
the suppressing and protecting of leading zeros. It
also facilitates programmed blanking of all-zero
fields. Several fields may be edited in one operation,
and numeric information may be combined with
text.
The length field applies to the pattern (the first
operand). The pattern has the zoned format and may
contain any character. The source (the second oper
and) has the packed format. The leftmost four bits
of a source byte must specify a decimal digit code
as a data exception and causes a program interrup
tion. The rightmost four bits may specify either a
sign or a decimal digit.
The result is obtained as if both operands were
processed left to right one byte at a time.
results.
During the editing process, each character of the
pattern is affected in one of three ways:
1. It is left unchanged.
2. It is replaced by a source digit expanded to
zoned format.
3. It is replaced by the first character in the pat
tern, called the fill character.
Which of the three actions takes place is deter
mined by one or more of the following: the type of
the pattern character, the state of the significance
indicator, and whether the source digit examined is
zero.
characters: digit selector, significance starter, field
separator, and message character. Their coding is as
follows:
Name
Digit
Message character
The detection of either a digit selector or a signifi
cance starter in the pattern causes an examination to
be made of the significance indicator and of a source
digit. As a result, either the expanded source digit or
the fill character, as appropriate, is selected to re
place the pattern character. Additionally, encounter
ing a digit selector or a significance starter may
cause the significance indicator to be changed.
The field separator identifies individual fields in a
multiple-field editing operation. It is always replaced
in the result by the fill character, and the significance
indicator is always off after the field separator is
encountered.