Machine Format Op Code R1
46 6 o A
Assembler FormatBCT The effect of the coding is to execute
three times the loop defined by the
instructions labeled lUPE throughBACK, while register 6 is decremented from
three to zero.BRANCH ON INDEX HIGH (BXH)
BXH Example !
TheBRANCH ON INDEX HIGH instruction is
an index-incrementing and loop
controlling instruction that causes a
branch whenever the sum of an index
value and an increment value is greater
than some compare value. Forexample, assume that: Register 4 contains 00 00 00 8A
=138{10} =
the index.
Register 6 contains00 00 00 02 = 2{10} =
the increment.
Register 7 contains00 00 00 AA
=170{10} = the compare value.
Register10 contains 00 00 71 30 =
the
branch address.
The format of the BXH instruction is:
Machine FormatOp Code R1
86 4 6 AI 0001 Assembler Format
BXH4,6,0(10) When the instruction is executed, first
the contents of register 6 are added to
register 4, second the sum is compared
with the contents of register 7, and
third the decision whether to branch is
made. After execution:
Register4 contains 00 00 00 8C = 140{10}. Registers 6 and 7 are unchanged.
Since the new value in register 4 is not
yet greater than the value in register7, the branch to address 7130 is not
taken. Repeated use ofthe instruction
will eventually causethe branch to be
taken when the value in register 4
reaches172{10}. BXH Example Z. When the register used to contain the
increment is odd, that register also
becomes the compare-value register. The
following assembler-language subroutine
illustrates howthis may be used to
search a table.
Table
2 Bytes 2 Bytes
ARG1FUNCT1 ARG2 FUNCT2 ARG3 FUNCT3 ARG4 FUNCT4 ARG5 FUNCT5 ARG6 FUNCT6 Assume that:
Register 8 containsthe search
argument.
Register 9 contains the width of the
table in bytes(00 00 00 04). Register 10 contains the length of the
table in bytes(00 00 00 18).
Register 11 contains the starting
address of the table.
Register 14 contains the return address
to the main program.
As the following subroutine is executed,
the argument in register 8 is succes
sively compared with the arguments in
the table, starting with argument 6 and
working backward to argument 1. If an
equality is found, the corresponding
function replaces the argument in regis
ter 8. If an equality is not found,
zero replaces the argument in register
8.SEARCH lNR 9,9
NOTEQUAl BXH10,9,lOOP NOT FOUND SR 8,8 BCR 15,14 lOOP CH 8,0(10,11) BC 7,NOTEQUAl
lH8,2(10,11) BCR 15,14
The first instruction (lNR) causes the
value in register 9 to be made negative.
After execution of this instruction,
register 9 contains FF FF FF Fe =-4{10}. Considering the case when no
equality is found, the BXH instructionAppendix A. Number Representation and Instruction-Use Examples A-I1
46 6 o A
Assembler Format
three times the loop defined by the
instructions labeled lUPE through
three to zero.
BXH Example !
The
an index-incrementing and loop
controlling instruction that causes a
branch whenever the sum of an index
value and an increment value is greater
than some compare value. For
=
the index.
Register 6 contains
the increment.
Register 7 contains
=
Register
the
branch address.
The format of the BXH instruction is:
Machine Format
86 4 6 A
BXH
the contents of register 6 are added to
register 4, second the sum is compared
with the contents of register 7, and
third the decision whether to branch is
made. After execution:
Register
Since the new value in register 4 is not
yet greater than the value in register
taken. Repeated use of
will eventually cause
taken when the value in register 4
reaches
increment is odd, that register also
becomes the compare-value register. The
following assembler-language subroutine
illustrates how
search a table.
Table
2 Bytes 2 Bytes
ARG1
Register 8 contains
argument.
Register 9 contains the width of the
table in bytes
table in bytes
Register 11 contains the starting
address of the table.
Register 14 contains the return address
to the main program.
As the following subroutine is executed,
the argument in register 8 is succes
sively compared with the arguments in
the table, starting with argument 6 and
working backward to argument 1. If an
equality is found, the corresponding
function replaces the argument in regis
ter 8. If an equality is not found,
zero replaces the argument in register
8.
NOTEQUAl BXH
lH
The first instruction (lNR) causes the
value in register 9 to be made negative.
After execution of this instruction,
register 9 contains FF FF FF Fe =
equality is found, the BXH instruction