Download Print this page

Editing Instructions; Execution Of Decimal Instructions; Other Instructions For Decimal Operands; Instructions - IBM 4300 Manual

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

Advertisement

When a carry or some high-order nonzero digits
of the result are lost because the first-operand field
is too short, the result is obtained by ignoring the
overflow information, condition code 3 is set, and,
if the decimal-overflow mask bit is one, a program
interruption for decimal overflow occurs. The
operand lengths alone are not an indication of
overflow; significant digits must have been lost
during the operation.
The operands of decimal-arithmetic instructions
should not overlap at all or should have coincident
rightmost bytes. In ZERO AND ADD, the
operands may also overlap in such a manner that
the rightmost byte of the first operand (which
becomes the result) is to the right of the rightmost
byte of the second operand. For these cases of
proper overlap, the result is obtained as if operands
were processed right to left. Because the codes for
digits and signs are verified during the performance
of the arithmetic, improperly overlapping operands
are recognized as data exceptions.
Programming Note
The same decimal field in storage may be specified
for both operands of the instructions ADD
DECIMAL, COMPARE DECIMAL, DIVIDE
DECIMAL, MUL TIPL Y DECIMAL, and
SUBTRACT DECIMAL. Thus, a decimal number
may be added to itself, compared to itself, etc.
SUBTRACT DECIMAL may be used to set a
decimal field in storage to zero.
Editing Instructions
The editing instructions are EDIT and EDIT AND
MARK.~
For these instructions, only one operand
(the pattern) has an explicitly specified length.
The other operand (the source) is considered to
have as many digits as necessary for the completion
of the operation.
Overlapping operands for the editing instructions
yield unpredictable results.
Execution of Decimal Instructions
During the execution of a decimal instruction, all
bytes of the operands are not necessarily accessed
concurrently, and the fetch and store accesses to a
single location do not necessarily occur one
immediately after the other. Furthermore, for
decimal instructions, intermediate values may be
placed in the result field that may differ from the
original operand and final result values. Thus, in a
multiprocessing system, an instruction such as ADD
DECIMAL cannot be safely used to update a
shared storage location when the possibility exists
that another CPU may also be updating that
location.
Other Instructions for Decimal Operands
In addition to the decimal instructions in this
chapter, the instructions MOVE NUMERICS and
MOVE ZONES are provided for operating on data
in the zoned format. Two instructions are provided
for converting data between the zoned and packed
formats: the PACK instruction transforms zoned
data into packed data, and UNPACK performs the
reverse transformation. The MOVE WITH
OFFSET instruction operates on packed data. Two
instructions are provided for conversion between
the packed-decimal and binary formats. The
CONVERT TO BINARY instruction converts
packed decimal to binary, and CONVERT TO
DECIMAL converts binary to packed decimal.
These seven instructions are not considered to be
decimal instructions and are described in Chapter
7,
II
General Instructions.
II
The editing instructions
in this chapter may also be used to change data
from the packed to the zoned format.
Instructions
The decimal instructions and their mnemonics,
formats, and operation codes are listed in the figure
'!Summary of Decimal Instructions.'! The figure
also indicates when the condition code is set and
the exceptional conditions in operand designations,
data, or results that cause a program interruption.
Note: In the detailed descriptions of the individual
instructions, the mnemonic and the symbolic
operand designation for the assembler language are
shown with each instruction. For ADD
DECIMAL, for example, AP is the mnemonic and
D 1(L 1,B
1)'
D lL 2,B
2)
the operand designation.
Chapter 8. ' Decimal Instructions
8-3

Advertisement

loading