When the last field edited is nonzero and the sig­
nificance indicator is off, the condition code is made
2 to indieate a result field is greater than zero.
Summary: The following table summarizes the func­
tions of the editing operation. The leftmost four
columns list all the significant combinations of the
four conditions that can be encountered in the execu­
tion of an editing operation. The rightmost two
columns llist the action taken for each case --the
type of character placed in the result field and the
new setting of the significance indicator.
Resulting Condition COde: o Last field is zero
1 Last field is less than zero
2 Last field is greater than zero
3 -
Program Exaptiom: Operation (if the decimal feature is not installed)
Access (fetch, operand 2; fetch and store, oper­
and 1)
Data
Conditions
Programming Notes
As a rule, the source is shorter than the pattern be­
cause for each source digit a zone and numeric are
inserted in the result.
The total number of digit selectors and signifi­
cance starters in the pattern must equal the number
of source digits to be edited.
If the fill character is a blank, if no significance
starter appears in the pattern, and if the source is all
zeros, the editing operation blanks the result field.
The resultant condition code indicates whether or
not the last field is all zeros, and, if nonzero, reflects
the state of the significance indicator. The signifi­
cance indicator reflects the sign of the source field
only if the last source byte examined a sign
code in the low-order digit position. For multiple­
field editing operations, the condition code reflects
the sign and value only of the field following the last
field separator.
Edit and Mark
EDMK [SS] \..--.D----I-F _L I o 8 16 20 32 36 47
Results
State of Significance
Previous State of
Significance Indicator
Source Low-Order Source Result I ndicator at End of
Pattern Character Digit Digit Is a Plus Sign
Digit selector starter
Field separator
Message character
Explanation:
off
on
off
on
*
off
on 0 1-9
1-9 0-9 0-9 0 0 1-9
1-9 0-9 0-9 **
* No effect on result character and new state of significance indicator
* * Not applicable because source digit not examined
Summary of EDIT Functions
152 System/370 Principles of Operation no
yes
no
yes
no
yes
no
yes
no
yes
Character Digit Examination
fill character off
source digit on
source digit off
source digit on
source digit off
fill character on
fill character off
source digit on
source digit off
source digit on
source digit off
fill character off
fill character off
message character on
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 address of each first significant result charac­ ter is recorded in general register 1. The edited result
replaces the pattern.
The instruction EDIT AND MARK is identical to
EDIT, except for the additional function of inserting
the address of the result character in bit positions
8-31 of general register 1 whenever the result charac­ ter is a zoned source digit and the significance indi­ cator was off before the examination. The use of
general register 1 is implied. The contents of bit po­ sitions 0-7 of the register are not changed.
Resulting Condition Code:
o Last field is zero
1 Last field is less than zero
2 Last field is greater than zero
3 -
Program Exceptions: Operation (if the decimal feature is not installed)
Access (fetch, operand 2; fetch and store, oper­ and 1)
Data
Programming Note
The instruction EDIT AND MARK facilitates the
programming of floating currency-symbol insertion.
The character address inserted in general register 1 is
one more than the address where a floating
currency-sign would be inserted. The instruction
BRANCH ON COUNT (BCTR), with zero in the
R2 field, may be used to reduce the inserted address
byone.
The character address is not stored when signifi­ cance is forced. To ensure that general register 1
contains a valid address when significance is forced,
it is necessary to place into the register beforehand
the address of the pattern character that immediately
follows the significance starter.
Multiply Decimal
The product of the multiplier (the second operand)
and the multiplicand (the first operand) replaces the
multiplicand.
The multiplier size is limited to fifteen digits and
sign and must be less than the multiplicand size.
Length code L2, larger than seven, or larger than or
equal to the length code L 1, is recognized as a speci­ fication exception. The operation is suppressed, and
a program interruption occurs.
The multiplicand must have at least as many bytes
of high-order zeros as the multiplier field size, in bytes; otherwise, a data exception is recognized, the
operation is terminated, and a program interruption
occurs. This definition of the multiplicand field en­ sures that no product overflow can occur. The maxi­ mum product size is 31 digits. At least one high­ order digit of the product field is zero.
All operands and results are treated as signed
integers, right-aligned in their field. The sign of the
product is determined by the rules of algebra from
the multiplier and multiplicand signs, even if one or
both operands are zero.
The multiplier and product 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
Shift and Round Decimal
The first operand is shifted in the direction and for
the number of digit positions specified by the
second-operand address, and, when shifting to the
right is specified, is rounded by the rounding factor, 13· The second-operand address, specified by the B2
and D2 fields, is not used to address data; its low­ order six bits are the shift value, and the remainder
of the address is ignored.
Second -Operand Address :
o 26
Shift
Value
31
The shift value is a six-bit signed binary integer,
indicating the direction and the number of digit posi­ tions to be shifted. Positive shift values specify
Decimal Instructions 153
Previous Page Next Page