Packed Format
Decimal
Decimal Operations
Deci mal-Ari thmeti c Instructi ons
Editing Instructions .................................... 8-3
Execution of Decimal Instructions •.............•........ 8-3
Instructions
ADD
DIVIDE
EDIT
EDIT
MUl TIPl Y
The decimal instructions of this chapter
perform arithmetic and editing oper
ations on decimal data. Additional
operations on decimal data are provided
by several of the instructions in
operands always reside in storage, and
all decimal instructions use the
occupy storage fields that can start on
any byte boundary.
DECIMAL-NUMBER
either the zoned or packed format. Both
decimal-number formats are of variable
length; the instructions used to operate
on decimal data each specify the length
of their operands and results. Each
byte of either format consists of a pair
of four-bit codes; the four-bit codes
include decimal-digit codes, sign
bits of a byte are called the numeric
bits (N) and normally consist of a code
representing a decimal digit. The left
most four bits of a byte are called the
zone bits
byte of a decimal operand, where these
bits may be treated either as a zone or
a s a sign (S).
Decimal digits in the zoned format may
be part of a larger character
includes also alphabetic and special
characters. The zoned format is, there
fore, suitable for input,
output of numeric data in human-readable
form. There are no decimal-arithmetic
instructions which operate directly on
decimal numbers in the zoned format;
such numbers must first be converted to
the packed format.
The editing instructions produce a
result of up to 256 bytes; each byte may
be a decimal digit in the zoned
D D
D
D
D
D
two decimal digits
rightmost byte, which contains a sign to
the right of a decimal digit. Decimal
arithmetic is performed with operands in
the packed format and generates results
in the packed format.
The packed-format operands and results
of decimal-arithmetic instructions may
be up to 16 bytes (31 digits and
multiplier or divisor is eight bytes (15
digits and sign). In division, the sum
of the lengths of the quotient and