Download Print this page

IBM 4300 Manual page 132

Processors principles of operation for ecps: vse mode
Hide thumbs Also See for 4300:

Advertisement

Chapter 8. Decimal Instructions
Contents
Decimal-Number Formats
8-1
Zoned Format
8-1
Packed Format
8-1
Decimal Codes
8-1
8-2
8-2
8-3
8-3
8-3
The decimal instructions of this chapter perform
arithmetic and editing operatio:t;ls on decimal data.
Additional operations on decimal data are provided
by several of the instructions in Chapter 7,
11
General Instructions." Decimal operands always
reside in storage, and all instructions operating on
decimal data use the SS instruction format.
Decimal-Number Formats
Decimal numbers may be in either the zoned or
packed format. Both decimal-number formats have
from one to 16 bytes, each byte consisting of a pair
of four-bit codes. The four-bit codes include
decimal-digit codes, sign codes, and a zone code.
Decimal operands occupy storage fields that start
on a byte boundary.
Zoned Format
In the zoned format, the rightmost four bits of a
I
byte are called the numeric bits (N) and normally
comprise a code representing a decimal digit. The
I
leftmost four bits of a byte are called the zone bits
(Z), except for the rightmost byte of a decimal
operand, where these bits may be treated either as
a zone or as a sign (S).
8-3
8-4
8-5
8-5
8-6
8-9
8-9
8-10
8-11
8-11
Decimal digits in the zoned format may be part
of a larger character set, which includes also
alphabetic and special characters. The zoned
format is, therefore, suitable for input, editing, and
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.
Packed Format
~~--~--~--~/~--~--~--~~
o
o
o
o
o
o
o
s
~~--~--~--~/~--~--~--~~
In the packed format,each byte contains two
decimal digits (D), except for the rightmost byte,
I
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.
F or all decimal instructions in this chapter other
than EDIT and EDIT AND MARK, both operands
are in the packed format.
Decimal Codes
The decimal digits 0-9 have the binary encoding
0000-1001.
The preferred sign codes are 1100 for plus and
1101 for minus. These are the sign codes
Chapter 8. Decimal Instructions
8-1

Advertisement

loading