• Keine Ergebnisse gefunden

CONDITIONAL BRANCH INSTRUCTIONS

Im Dokument The Computer Concepts (Seite 84-93)

Instruction: Branch on Digit Operation Code: 43

Symbolic Name: BD Description:

The program will branch to the instruction at the P address if the core storage location specified by the Q address does not contain a zero. If the core position contains a zero, the next instruction in sequence is

executed. The 1, 2, 4, and 8 core planes of the core storage position specified by the Q address are tested. If anyone of these bits is present, the program will branch. Thus a

t

(C-2-8) will also cause the program to branch. Since the P operand of the Branch on Digit instruction is the address of an instruction, it must reference an even-numbered core position.

Execution Time in Microseconds: 240 if a branch occurs

200 if a branch does not occur

66

Example: 43 15000 10312

The program will not branch but will execute the next instruction in sequence Execution Time: 200 microseconds Example: 43 12012 19013

The program will branch to the instruction at core position 12012 Execution Time: 240 microseconds

Example: 43 12060 04000

The program will not branch but will execute the next instruction in sequence Execution Time: 200 microseconds

Example: 43 06000 13068

The program will branch to core location 06000 Execution Time: 240 microseconds Example: The following program will

branch to location 16488 if any nonzero digit is dis-covered between positions 19000 -19003 inclusive

Branch Instructions

0-·---,1

Core location 10312

+ • I

Core location 19013

0-'---...,

Core location 04000

7 _. - - - ,

Core location 13068

LOCATION INSTRUCTION

00500 00512 00524 00536

43 16488 19000 43 16488 19001 43 16488 19002 43 16488 19003

Branch Instructions

Instruction: Branch no Flag Operation Code: 44

Symbolic Name: BNF Description:

67

The program will branch to the instruction at the P address if the core storage location specified by the Q address does not contain a Hag.

If a Hag is present, the next instruction in sequence is executed. Since the P address of the Branch no Flag instruction is the address of an instruction, it must reference an even-numbered core position.

This instruction may be used to test the sign of a data field or to find the length of a data field by testing for the field-defining Hag.

Execution Time in Microseconds: 240 if a branch occurs

200 if the branch does not occur

Example: 44 15000 12013

The program will branch to the instruction at core position 15000.

Execution Time: 240 microseconds

Example: 44 12068 19012

The program will not branch.

but will execute the next instruction in sequence.

Execution Time: 200 microseconds

Example: 44 15000 00612

The program will branch to the instruction at core position 15000.

Execution Time: 240 microseconds

6-·----....,1

Core location 12013

5-·---.\

Core location 19012

:1:-·---,1

Core location 00612

68

Instruction: Branch no Record Mark Operation Code: 45

Symbolic Name: BNR Description:

Branch Instructions

The program will branch to the instruction at the P address if the core storage location specified by the Q address does not contain a record mark. If a record mark is present, the next instruction in sequence is ' executed. Since the P address of the Branch no Record Mark instruction is the address of an instruction, it must reference an even-numbered core position.

Execution Time in Microseconds: 240 if a branch occurs

200 if the branch does not occur Example: 45 07000 13268

The program will branch to the instruction

at location 07000.

Execution Time: 240 microseconds Example: 45 09024 15012

The program will not branch but will execute the next instruction in sequence.

Execution Time: 200 microseconds Instruction: Branch on Indicator Operation Code: 46

Symbolic Name: BI Description:

o _. ---,1

Core location 13268

:1:-.---.\

Core location 15012

The program will branch to the instruction at the P address if the indi-cator or program switch specified by the Qs and Q9 positions of the in-struction is on. The Q7, QI0, and Qn positions of the instruction are not utilized. The 2-digit indicator codes used in the Qs and Q9 positions of the instruction are as follows:

Branch Instructions Ol-Program switch I Q2-=----Program switch 2 03-Program switch 3 04-Program switch 4 06-Read Check indicator 07-Write Check indicator 09-Last Card indicator

ll-High/Positive indicator 12-EqualjZero indicator

13-High/Positive or Equal/Zero indicator 14-0verflow indicator .

15-Exponent Overflow indicator 16-Memory Buffer Register

(MBR)-Even Check indicator

17-Memory Buffer Register (MBR)-Odd Check indicator

19-Any Data Check indicator

69

Indicator codes 01 through 04 refer to the four program switches lo-cated on the console. These switches are manually set to either an on or an off position.

The Read Check (06), Write Check (07), MBR-Even Check (16), and MBR~Odd Check (17) indicators reflect the results of parity check-ing durcheck-ing input-output operations and memory read-in and read-out cycles. If a parity error is discovered, the appropriate indicator is turned on.

The Any Data Check (19) indicator is turned on if anyone, or more, of the Read Check, Write Check, MBR-Even Check, or MBR-Odd Check indicators is on.

The High/Positive (11), Equal/Zero (12), and Overflow (14) indi-cators are. turned on or off during arithmetic operations (see Chapter 5).

The Exponent Overflow indicator (15) is discussed in the appendix on floating point hardware. The High/Positive or Equal/Zero indica-tor (13) is turned on if either the High/Positive or the Equal/Zero indi-cator is turned on.

Except for the Any Data Check indicator, the High/Positive indicator, the Equal/Zero indicator, and the High/Positive-Equal/Zcro indicator, all indicators are turned off if they are interrogated by their respective Branch Indicator instruction. The status of the console switches remain unchanged since they are manually controlled.

Execution Time in Microseconds: 200 if the branch occurs

160 if the branch does not occur'

70

Example: Branch to the address specified by the configuration of the instructions which test the same indicators for opposite conditions. How-ever, with a little thought it becomes evident that being able to test directly for either condition will both simplify programming and save program steps.

Execution Time in Microseconds: 200 if the branch occurs Example:

Branch Instructions

One program step is saved using the Branch no Indicator instruction.

Example: If the data fields at locations 17156 and 12123 are not equal, branch to location 00500 for the next instruction.

Problems

24 17156 12123 47 00500 01200

71

Give the results to the following problems as actual numbers or in an algebraic symbolic notation. For example, if the first problem summed the numbers from

1000

one to 1000, the answer could be expressed as ~ i

i=1

1. When the following program halts, what will the field whose units position is core location 13000 contain?

00500 16 13000 00000 00512 11 13000 00001 00524 47 0051~ 01400 00536 48 00000 00000

2. When the following program halts, what will the field whose units position is core location 13966 contain?

14168 16 13966 00000 14180 16 06745 00600 14192 11 13966 00002 14204 11 06745 00001 14216 14 06745 00100 14228 47 14192 01200 14240 48 00000 00000

3. When the following program halts, what will the field whose units position is core location 07000 contain?

00700 16 07000 00000 00712 16 07081 00000 00724 11 07081 00001

-00736 14 07081 00100 00748 46 00784 01200 00760 11 07000 00002 00772 49 00724 00000 00784 48 00000 00000

72 Branch Instructions 4. When the following program halts, what will the fIeld whose units position

is core location 17800 contain?

00800 16 00835 00001 00812 16 17800 00000 00824 11 17800 00000 00836 11 00835 00001 00848 14 00835 00101 00860 47 00824 01200 00872 48 00000 00000

5. When the following program halts, what will the fIelds whose units posi-tions are core locaposi-tions 19000 and 17199 contain?

00464 16 17199 00000 00476 16 19000 00000 00488 16 00511 00001 00500 11 17199 00000 00512 23 00511 00511 00524 21 19000 00099 00536 11 00511 00001 00548 14 00511 00200 00560 47 00500 01200 00572 48 00000 00000

6. When the following program halts, what will the fIelds whose units posi-tions an:, core locaposi-tions 14000 and 18000 contain?

02178 16 14000 00003 02190 16 18000 00000 02202 11 18000 OOOGI 02214 11 02213 00001 02226 14 02213 00101 02238 47 02202 01200 02250 12 14000 00001 02262 46 02298 01200 02274 16 02213 00001 02286 49 02202 00000 02298 48 00000 00000

Branch Instructions 73 7. The following problem is solving a quadratic equation of the form

AX2

+

BX

+

C

=

0 by a trial and error method. An integer solution is assumed. What is the equation (what are values of A, B, and C)?

07988 16 18500 00001 08000 23 18500 18500 08012 26 19000 00099 08024 13 19000 00013 08036 26 19000 00099 08048 13 18500 00009 08060 21 19000 00099 08072 14 19000 00904 08084 46 08120 01200 08096 11 18500 00001 08108 49 08000 00000 08120 48 00000 00000

8. When the following program halts, what will the field whose units position is core location 15000 contain?

00588 16 15000 00000 00600 13 00611 00001 00612 21 15000 00099 00624 11 00611 00002 00636 47 00600 01400 00648 48 00000 00000

Chapter 8

Im Dokument The Computer Concepts (Seite 84-93)