Download Print this page

Unpack - IBM 4300 Manual

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

Advertisement

first nonzero function byte is inserted in general
register 2, and the related argument address in
general register 1.
The L field designates the length of only the
first operand.
The bytes of the first operand are selected one
by one for translation, proceeding from left to
right. The first operand remains unchanged in
storage. Fetching of the function byte from the list
is performed as in TRANSLATE. The function
byte retrieved from the list is inspected for a value
of zero.
When the function byte is zero, the operation
proceeds with the next byte of the first operand.
When the first-operand field is exhausted before a
nonzero function byte is encountered, the operation
is completed by setting condition code O. The
contents of general registers 1 and 2 remain
unchanged.
When the function byte is nonzero, the
operation is completed by inserting the function
byte in general register 2 and the related argument
address in general register 1. This address points
to the argument byte last translated. The function
byte replaces bits 24-31 of general register 2. The
address replaces bits 8-31 of general register 1.
Bits 0-7 of general register 1 and bits 0-23 of
general register 2 remain unchanged.
When the function byte is nonzero, either
condition code 1 or 2 is set, depending on whether
the argument byte is the rightmost byte of the first
operand. Condition code 1 is set if one or more
argument bytes remain to be translated. Condition
code 2 is set if no more argument bytes remain.
Access exceptions are recognized only for those
bytes in the second operand which are actually
required. Access exceptions are not recognized for
those bytes in the first operand which are to the
right of the first byte for which a nonzero function
byte is obtained.
Resulting Condition Code:
o
All function bytes zero
1
Nonzero function byte; first-operand field
not exhausted
2
Nonzero function byte; first-operand field
exhausted
3
Program Exceptions:
Access (fetch, operands 1 and 2)
Programming Notes
1. An example of the use of TRANSLATE AND
TEST is given in Appendix A.
2. The instruction TRANSLATE AND TEST may
be used to scan the first operand for characters
with special meaning. The second operand, or
list, is set up with all-zero function bytes for
those characters to be skipped over and with
nonzero function bytes for the characters to be
detected.
UNPACK
UNPK
D1(L1,B1),D2(L2,B2)
[55]
'F3
1
I
Ll
I
L2
I
81
I
~_1 --L....-B_2.....J....-~~
o
8
12
16
20
32
36
47
The format of the second operand is changed from
packed to zoned, and the result is placed in the
first-operand location. The packed and zoned
formats are described in Chapter 8, IIDecimal
Instructions. II
The second operand is treated as having the
packed format. Its digits and sign are placed
unchanged in the first-operand location, using the
zoned format. Zones with coding of 1111 are
supplied for all bytes except the low-order byte,
which receives the sign of the second operand. The
sign and digits are not checked for valid codes.
The result is obtained as if the operands were
processed right to left. When necessary, the second
operand is considered to be extended on the left
with zeros.
If
the first-operand field is too short to
contain all digits of the second operand, the
remaining leftmost portion of the second operand is
ignored. Access exceptions for the unused portion
· of the second operand mayor may not be
indicated.
When the operands overlap, the result is
obtained as if the operands were processed one
byte at a time and each result byte were stored
immediately after the necessary operand byte is
fetched. The entire rightmost second-operand byte
is used in forming the first result byte. For the
remainder of the field, information for two result
bytes is obtained from a single second-operand
byte, and the leftmost four bits of the byte remain
available and are not refetched. Thus, two result
bytes are stored immediately after fetching a single
operand byte.
Chapter 7. General Instructions
7-37

Advertisement

loading