Download Print this page

IBM 4300 Manual page 262

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

Advertisement

this instruction, register 9 contains FFFFFFFC
=
-410'
Considering the case when no equality is
found, the BXH instruction will be executed seven
times. Each time BXH is executed, a value of -4 is
added to register 10, thus reducing the value in
register 10 by 4. The new value in register 10 is
compared with the -4 value in register 9. The
branch is taken each time until the value in register
10 is -4.
BRANCH ON INDEX LOW OR EQUAL
(BXLE)
This instruction is similar to BRANCH ON INDEX
HIGH except that the branch is successful when
the sum is low or equal compared to the compare
value.
COMPARE HALFWORD (CH)
The COMPARE HALFWORD instruction
compares a 16-bit signed binary integer in storage
with the contents of a register. For example,
assume that:
Register 4 contains FF FF 80 00
=
-32,76810'
Register 13 contains 00 01 60 50.
Storage locations
16080~16081
contain 8000
=
-32,76810'
When the instruction:
Machine Format
Op Code
R1
49
4
o
Assembler Format
Op Code
R1,02(X2,B2)
CH
4,X ' 30 ' (0,13)
is executed, the contents of locations 16080-16081
are fetched, expanded to 32 bits (the sign bit is
propagated to the left), and compared with the
contents of register 4. Because the two numbers
are equal, condition code 0 is set.
COMPARE LOGICAL (CL, CLC, CLI,
CLR)
The COMPARE LOGICAL instructions differ
from the signed-binary comparison instructions (C,
CH, CR) in that all quantities are handled as
unsigned binary integers or as unstructured data.
Compare Logical (CLC)
The COMPARE LOGICAL (CLC) instruction can
be used to perform the byte-by-byte comparison of
storage fields up to 256 bytes in length. For
example, assume that the following two fields of
da ta are in storage:
Field 1
1886
1891
1011061
cs
l051E210610516BICl14BIC214BI
Field 2
1900
190B
101106l
cs
l051E210610516BICl14BIC314BI
Also assume:
Register 9 contains 00 00 18 80.
Register 7 contains 00 00 19 00.
Execution of the instruction:
Machine Format
Op Code
L
05
OB
Assembler Format
Op Code
01(L,B1),02(B2)
CLC
6(12,9),0(7)
7
I
0001
sets condition code 1, indicating that the contents
of field 1 are lower in value than the contents of
field 2.
Because the collating sequence of the EBCDIC
code is determined simply by a logical comparison
of the bits in the code, the CLC instruction can be
used to collate EBCDIC-coded fields. For
example, in EBCDIC, the above two data fields
are:
Field 1 JOHNSON,A.B.
Field 2 JOHNSON,A.C.
Condition code 1 tells us that A.B.JOHNSON
precedes A.C.JOHNSON, thus placing the names in
the correct alphabetic sequence.
Compare Logical (CLI)
The COMPARE LOGICAL (CLI) instruction
compares a byte from the instruction stream with a
byte from storage. For example, assume that:
Appendix A. Number Representation and
Instruction~Use
Examples
A~9

Advertisement

loading