Decimal instructions
Use the decimal instructions when you want to do arithmetic and editing operations on data that has the binary equivalent of decimal representation.
Decimal data is represented in either zoned or packed format. In the zoned format, the rightmost four bits of a byte are called the numeric bits and normally consist of a code representing a decimal digit. The leftmost four bits of a byte are called the zone bits, except for the rightmost byte of a decimal operand; these bits are treated as a zone or a sign.
In the packed format, each byte contains two decimal digits, except for the rightmost byte, which contains a sign to the right of a decimal digit.
Decimal instructions treat all numbers as integers. For example, 3.14
, 31.4
,
and 314
are all processed as 314
.
You must keep track of the decimal point yourself. The integer and
scale attributes discussed in Data attributes can
help you do this.
Additional operations on decimal data are provided by several of
the instructions in General Instructions
in the z/Architecture Principles of Operation information.
Decimal operands always reside in storage.
For further information, see Decimal Instructions
in the
applicable z/Architecture® Principles of
Operation manual.