Download Print this page

IBM 4300 Manual page 279

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

Advertisement

Assembler Format
Op Code
01(L1,B1),02(L2,B2)
AP
0(3,12),0(4,13)
is executed, the storage locations 2000-2002
contain 73 88 5C; condition code 2 is set to
indicate that the sum is positive. Note that:
1. Because the two numbers had different signs,
they were in effect subtracted.
2. Although the second operand is longer than the
first operand, no overflow interruption occurs
because the result can be entirely contained
within the first operand.
COMPARE DECIMAL (CP)
Assume that the signed, packed-decimal contents of
storage locations 700-703 are to be algebraically
compared with the signed, packed-decimal contents
of locations 500-502. Also assume:
Register 12 contains 00 00 06 00.
Register 13 contains 00 00 03 00.
Storage locations 700-703 contain 17 25 35 6D.
Storage locations 500-502 contain 72 14 2D.
After the instruction:
Machine Format
Op Code
F9
3
2
C
I
100
1
Assembler Format
CP
X'100'(4,12),X'200'(3,13)
is executed, condition code 1 is set, indicating that
the first operand (the contents of locations
700-703) is less than the second.
DIVIDE DECIMAL (DP)
Assume that the signed, packed-decimal number at
storage locations 2000-2004 (the dividend) is to be
divided by the signed, packed-decimal number at
locations 3000-3001 (the divisor). Also assume:
Register 12 contains 00 00 20 00.
Register 13 contains 00 00 30 00.
Storage locations 2000-2004 contain 01 23 45 67
8e.
Storage locations 3000-3001 contain 32 lD.
A-26
IBM 4300 Processors Principles of Operation
After the instruction:
Machine Format
Op Code
FO
4
C
I
0001
o
I
0001
Assembler Format
Op Code
01(Ll,B1),02(L2,B2)
OP
0(5,12),0(2,13)
is executed, the dividend is entirely replaced by the
signed quotient and remainder, as follows:
2000
2004
Locations 2000-2004
13814610010118CI
quotient
I
remainder
Notes:
1. Because the dividend and divisor have different
signs, the quotient receives a negative sign.
2.
The remainder receives the sign of the dividend
and the length of the divisor.
3. If an attempt were made to divide the dividend
by the one-byte field at location 3001, the
quotient would be too long to fit within the
four bytes allotted to it. A decimal-divide
exception would exist, causing a program
interruption.
EDIT (ED)
Before decimal data in the packed format can be
used in a printed report, digits and signs must be
converted to printable characters. Moreover,
punctuation marks, such as commas and decimal
points, may have to be inserted in appropriate
places. The highly flexible EDIT instruction
perf orms these functions in a single instruction
execution.
This example shows step-by-step one way that
the EDIT instruction can be used. The field to be
edited (the source) is four bytes long; it is edited
against a pattern 13 bytes long. The· following
symbols are used:
Symbol
Meaning
b (Hexadecimal 40) Blank character
(
(Hexadecimal 21) Significance starter
d (Hexadecimal 20)
~igit
selector

Advertisement

loading