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 may be 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, where these bits may be treated either as a zone or as 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 applicable Principles of Operation manual. Decimal operands always reside in storage.

For further information, see "Decimal Instructions" in the applicable Principles of Operation manual.


[ Top of Page | Previous Page | Next Page | Contents | Index ]