Download Print this page

IBM 2030 Manual Of Instruction page 50

Processing unit, field engineering

Advertisement

INSTRUCTION BRANCHING
A branch instruction is used to make
program decisions"
A branch instruction provides a way
to leave one instruction sequence
and branch to another instruction
sequence.
The instruction address field of the
current PSW is changed to the branch
to address when the program
branches.
You should be familiar with the use of
flow charts in writing :a, program. Deci-
sion blocks in a program are represented
by a diamond shaped symbol.
The use of this symbol in a program
represents a decision as to what to do
next.
Should the program continue with
its present sequence of instructions, or
should it branch out to another sequence
of instructions?
Sometimes a decision
bloek represents leaving a sequence of
instructions.
Xn this case the program
is trying to decide which of two or more
new sequences to branch to.
AS you know the instruction address
portion of the current PSW is used to
fetch the next sequential instruction.
What happens to the instruction address
portion of the current PSW when a branch
is taken?
Whenever a branch is
executed, the contents of the instruc-
tion address portion of the current PSW
are replaced by the address of the
instruction being branched to,
For Example:
If an RX instruction at location 1000
is fetched, the instruction address
portion of the current PSW would normal-
ly be changed to 1004.
If howeVer, the
instruction at 1000 says to branch to
location 2000, the instruction address
portion of the current PSW will be
changed to
2000.
In the above example bits
40-63
(the
instruction address) of the current PSW
might actually be updated to 1004 and
then changed to 2000.
This depends on
the particular branch-type instruction.
However, at the time the system decides
that it will branch, the address of the
1-46
branch to location is placed in bits 40
to
63
(instruction address portion) of
the current
psw.
CONDITION CODE FIELD
The condition code occupies bits
34
and 35 of the currentPSW.
The 4 combinations of the condition
code'are
00,
01, 10 and 11.
The condition code indicates the
results of instructions such as add,
subtract, compare, etc.
Not all instructions affect the
condition code.
The condition code is located in bits
34
and 35 of the current PSW.
34,35
I I
I I
I I
o
- - - 3 3
I I
40-----------38
r---------T4-~T--T---------------------,
I
I
C
I
I
Instruction
I
I
I
C
I
I
Address
I
l _________
~
___
~
__
~
____________________
J
Condition Code
The condition code can have four
possible bit combinations:
1)
00
2)
01
3)
10
4)
11
The condition code is set to one of
its four possible combinations after an
instruction has been executed.
Then it
is placed in the condition code portion
of the current PSW.
Not all instruc-
tions affect the condition code.
One of the uses of the condition code
is to indicate the result of arithmetic
operations such as add or subtract.
There are 4 possible results of an alge-
braic add or subtract.
The result could
be a 1) positive number, 2) negative
number, 3) zero balance or, 4) an over-
flow.
The condition code reflects the
results with these settings:

Advertisement

loading

This manual is also suitable for:

System/360 30