The register pair 8-9 covers the second operand with bits
8-31 of register 8 containing the length of the second oper
and, inthis case 132 bytes. Bits 0-7 of register 9 contain
anEBCDIC blank character (X'40') to logically pad the
shorteroperand. In this example, the blank padding char
acter is used in the first operand, after the100th character,
to compare with the remaining characters in the second
operand.
With the 4-5 and 8-9 register pairs thus set up, the format
of theCLCL instruction is:
Machine FormatOp Code R1 R2 OF Assembler Format Op Code 1=l1' R2
CLCL4,8 When thiis instruction is executed, the comparison starts
at the high-order end of both operands and proceeds to the
right. The operation ends as soon as an inequality is de
tected or the end of the longest operand is reached.
If thisClLCL instruction is interrupted after 60 bytes are
successfully compared, the operand lengths in registers 5
and 9 are decremented to X'28' and X'48', respectively,
and the operand locations in registers 4 and 8 are incre
mented toX'2083C' and X'20A3C'. When the CLCL instruction is reexecuted, the comparison begins at the
point of interruption.
If the instruction is interrupted after110 bytes are suc
cessfully compared, the operand lengths in registers 5 and
9 are decremented to0 and X'16', respectively, and the
operand locations in registers 4 and 8 are incremented to
X'2086E' and X'20A6E'.. When the comparison ends, the condition code indicates
the result. The condition code settings are as follows:
Condition Code:
o Operands are equal, or both field lengths are
zero
2
3
First operand is low
First operand is high
When the operands are unequal, the address fields of regis
ters 4 and 8 can be used to locate the bytes that caused the
mismatch. The byte count fields in registers 5 and 9 can be
used to determine how far the comparison progressed suc
cessfully.
Convert to Binary (CVB)
TheCONVERT TO BINARY instruction converts an eight
byte, signed, packed-decimal number into a siglied binary
number and loads the result into a general register. After
296System/370 Principles of Operation
the conversion operation is completed, the number is in the
proper form for use as an operand in fixed-point arithmetic.
For example, assume:
Storage locations7608-760F contain a positive packed-decimal
number,00 00 00 00 00 25 59 4C
The contents of register 7 are not significant
Register 13 contains00 00 76 00 The format of the conversion instruction is:
Machine FormatOp Code R1 X
2
8
2008 Assembler Format Op Code R
1
, 02 (X
2
, 82)
CV87,8(0,13) After the instruction is executed, register 7 contains 00 00 63 FA = + 25,594 10 . Convert to Decimal (CVD)
TheCONVERT TO DECIMAL instruction performs func
tions exactly opposite to those of theCONVERT TO BINARY instruction. CVD converts a binary number in a
register to packed decimal and stores the result in a double
word. For example, assume:
Register 1 contains00 00 OF OF = 385510 Register 13 contains 00 00 76 00 PSW bit 12 = 0 (EBCDIC mode)
The format of the instruction is:
Machine FormatOp Code R1 X
2
8
202 4E 11 1 0 I ° 008 Assembler Format Op Code R
1
,02 (X
2
, 82) CVO 1,8(0,13) After the instruction is executed, locations 7608-760F contain 00 00 00 00 00 03 85 5C. The plus sign generated is the standard EBCDIC plus sign, 1100
2
• Divide (0, DR)
The DIVIDE instruction divides a dividend in an even/odd
register pair by the divisor in a register or in storage.Since the dividend is assumed to be 64 bits long, it is important
that the proper sign be first affixed. For example, assume
that:
Storage locations3550-3553 contain 00 00 08 D7 = 227010 = the
dividend
Storage locations 3554-3557 contain00 00 00 32 = 5010 = the
divisor
8-31 of register 8 containing the length of the second oper
and, in
an
shorter
acter is used in the first operand, after the
to compare with the remaining characters in the second
operand.
With the 4-5 and 8-9 register pairs thus set up, the format
of the
Machine Format
CLCL
at the high-order end of both operands and proceeds to the
right. The operation ends as soon as an inequality is de
tected or the end of the longest operand is reached.
If this
successfully compared, the operand lengths in registers 5
and 9 are decremented to X'28' and X'48', respectively,
and the operand locations in registers 4 and 8 are incre
mented to
point of interruption.
If the instruction is interrupted after
cessfully compared, the operand lengths in registers 5 and
9 are decremented to
operand locations in registers 4 and 8 are incremented to
X'2086E' and X'20A6E'.
the result. The condition code settings are as follows:
Condition Code:
o Operands are equal, or both field lengths are
zero
2
3
First operand is low
First operand is high
When the operands are unequal, the address fields of regis
ters 4 and 8 can be used to locate the bytes that caused the
mismatch. The byte count fields in registers 5 and 9 can be
used to determine how far the comparison progressed suc
cessfully.
Convert to Binary (CVB)
The
byte, signed, packed-decimal number into a siglied binary
number and loads the result into a general register. After
296
the conversion operation is completed, the number is in the
proper form for use as an operand in fixed-point arithmetic.
For example, assume:
Storage locations
number,
The contents of register 7 are not significant
Register 13 contains
Machine Format
2
8
2
1
,
2
,
CV8
The
tions exactly opposite to those of the
register to packed decimal and stores the result in a double
word. For example, assume:
Register 1 contains
The format of the instruction is:
Machine Format
2
8
2
1
,
2
,
2
•
The DIVIDE instruction divides a dividend in an even/odd
register pair by the divisor in a register or in storage.
that the proper sign be first affixed. For example, assume
that:
Storage locations
dividend
Storage locations 3554-3557 contain
divisor