• Keine Ergebnisse gefunden

CONDITIONAL JUMP INSTRUCTIONS .1 General

Im Dokument AUTOMATION COMPUTER (Seite 77-84)

IMMEDIATE CLASS OP CODE Field

2.6 CONDITIONAL JUMP INSTRUCTIONS .1 General

Conditional Jump instructions are those instructions which test conditions within the ALPHA 16 or NAKED MINI 16 computers and perform program branches depending on the

results of the test. A Jump occurs if the test condition is satisfied, and the next sequential instruction is executed if the test condition is not satisfied. All branches are relative to the contents of the P Register (location of the Condi-tional Jump instruction). Jumps may be relative to P for-ward, from 1 to 64 locations, or relative to P backfor-ward, from 0 to 63 locations:

Forward Jumps:

Backward Jumps:

P+ 1 through P+64 p-o through P-63 Figure 2-8 illustrates the general format for Conditional Jump instruction.

2.6.2 Testable Conditions

There are five different conditions within the computer which may be tested by Conditional Jump instructions.

These conditions are:

1. Sign of A (positive or negative) 2. Contents of A (zero or not zero) 3. Contents of X (zero or not zero) 4. Overflow Indicator (set or reset)

s.

Sense Switch (on or off)

The testable conditions may be tested individually or in combination. Test instructions may be coded so that all conditions specified must be met for a jump to occur (AND test group), or they may be coded so that only one of the selected conditions must be met for a jump to occur (OR test group). There are limits to the conditions that can be tested in each group. For example, the AND test group can test the A Register for a response if A is positive, but cannot test for a response if A is negative. The OR test group can test for a response if A is negative, but not for a response if A is positive.

2.6.2.1 AND Test Group. The AND test group is identi~·

fied by a I-bit in the G Field (Bit 12) of a Conditional Jump instruction. Bits 7 through 11 of the instruction

identify the conditions to be tested. A I-bit indicates that the test is to be performed, and a O-bit indicates that the test is not to be performed. For example, a I-bit in bit 7 specifies that the A Register is to be tested for a positive condition; Le., the sign bit (Bit 1 S) of A is positive. If bit 8 is on, the A Register is tested for a non-zero condition.

If bits 7 and 8 are both on, the A Register is tested for both positive and non-zero. Both conditions must be met for the test to be satisfied.

The test conditions in the AND test group are:

Bit Test

The test is satisfied if the sign bit of A is positive (AI S=O).

The test is satisfied if the

A Register contains at least one I-bit.

The test is satisfied if the Over-flow indicator is reset (OV=O).

The test is satisfied if the Sense Switch on the console is On (down).

The test is satisfied if the X Register contains at least one I-bit.

In the AND test group, all of the conditions specified by the instruction must be satisfied for the branch to occur.

2.6.2.2 OR Test Group. The OR test group is identified by a O-bit in the G Field (Bit 12) of a Conditional Jump in-struction. The OR group differs from the AND group in that only one of the conditions specified by the instruction must be satisfied for the branch to occur. Also, the OR group tests for opposite states than the AND group.

Test conditions in the OR test group are:

Bit Test 7 A Negative

Description

The test is satisfied if the sign bit of A is negative (A 1 S= 1).

16 14 13 12 11 10 9

o FIELD

Bits Field Definition

-13-15 Class Identifies the Conditional Jump Instruction Class

12 G Test Group Indicator:

G=1 for AND Group G=O for OR Group

7-11 Conditions Microcode of Test Conditions:

Bit AND Group OR Group 7 A Positive A Negative

8 A:/=O A=O

9 OV Reset OV Set (Resets OV)

10 SSOn SS Off

11 X=/:O X-O

6 R Jump Direction:

R=O for Forward Jump R=1 for Backward Jump

0-5 D Field Jump Distance (-63 to +64)

Figure 2-8. Conditional Jump Format

Bit Test Description Bit Test Description

8 A=O *The test is satisfied if the NOTE: The Overflow indicator

A Register contains all zeros. is conditionally reset when

9 oVSet The test is satisfied if the this test is executed.

Overflow indicator is set 10 SS Off The test is satisfied if the Sense

(OV=I). Switch on the console is Off (up).

*NOTE: All of the OR tests can be used in combination except for A=O andX=O. These two cannot be used in the same text.

For example, the test:

(A=O) OR (X=O)

cannot be used. The reason is that a condition such as the following would satisfy the test:

A = 0101 0101 0101 0101 X = 1010 1010 1010 1010

If the two registers taken together have a O-bit in each bit position, the test is satisfied. Therefore, this combination is excluded as a legitimate test.

Bit Test Description

11 X=O *The test is satisfied if the X Register contains all zeros.

2.6.3 Instruction Descriptions

Conditional Jump instructions for which symbolic codes have been derived are explained in the following paragraphs.

A general code, JOC, for Jump on Condition, is provided so that the programmer may microcode jump conditions for which symbolic codes are not provided.

The format of the instructions described is similar to the Memory Reference description format with the exception of the Machine Codes section. The hexadecimal codes listed show the range of each instruction for both forward and backward jumps.

2.6.3.1

JOC JUMP ON CONDITIONS

Assembler Format:

JOC XX, ADR

JOC is a general symbolic operation code recognized by the 16-bit machine language assemblers. It allows the pro-grammer to microcode specific Conditional Jump instruc-tions for which symbolic codes are not provided. The Assembler Format is as follows:

1. JOC 2.

xx

3. ADR

The general symbolic Op Code.

The hexadecimal code for the bit pattern in bits 7-12 (condition bits).

Jump direction and distance or symbolic address to which jump is to be made if jump condition(s) . is met.

Example: The JAL instruction could be microcoded using JOC in this manner:

JOC

2.6.3.2 JAM

:03, Loop (LOOP must be within

±64 locations)

JUMP IF A MINUS I REGISTER

15 14 13 12 11 10

OFlHO

=oJ

A jump occurs if the A Register is less than zero

(AIS

=

1). Otherwise the next instruction in sequence is executed.

If (A) < 0, then Jump If (A) 2: 0, then (P)+1 - P (A) are unchanged.

Machine Codes:

:2080 - :20BF for forward jumps (+1 thru +64) :20CO - :20FF for backward jumps (0 thru -63) Registers Affected:

P

Timing:

2.6.3.3 JAP

Incremented normally if test conditions not met.

Loaded with jump address if test condition met.

JUMP IF A POSITIVE I REGISTER

15 14 13 12 11 10 2 0

A jump occurs if the A Register is positive (AIS

=

0). Other-wise the next instruction in sequence is executed:

If (A) 2: 0, then Jump If (A) < 0, then (P)+ 1 - P (A) are unchanged.

Machine Codes:

:3080 - :30BF for forward jumps (+1 thru +64) :30CO - :30FF for backward jumps (0 thru -63) Registers Affected:

P Incremented normally if test condition not satisfied.

Offset by (D) if test condition satisfied.

Timing:

2.6.3.4

JAZ JUMP IF A ZERO

I REGISTER

16 14 13 12 11 10 9 8 6

D FIELD

Ajump occurs if the A Register is zero. Otherwise the next instruction in sequence is executed.

If (A)

=

0, then Jump If (A)=FO, then (P)+ 1 - P (A) unchanged.

Machine Codes:

:2100 - :213F for forward jumps (+1 thru +64) :2140 - :217F for backward jumps (0 thru -63) Registers Affected:

P

2.6.3.5

Incremented normally if test condition not satisfied.

Offset by (D) if test condition satisfied.

JAN JUMP IF A NOT ZERO

I REGISTER

16 14 13 12 11 10 8

D FIELD

Ajump occurs if the A Register is not zero. Otherwise the next instruction in sequence is executed:

If (A)=;O, then Jump If (A)=O, then (P)+ 1 - P (A) are unchanged.

Machine Codes:

:3100 - :313F for forward jumps (+1 thru +64) :3140 - :317F for backward jumps (0 thru -63) Registers Affected:

P

2.6.3.6 JAG

Incremented normally if test condition not satisfied.

Offset by (D) if test condition satisfied.

JUMP IF A GREATER THAN ZERO I REGISTER

D FIELD

A jump occurs if the A Register is greater than zero. Other-wise the next instruction in sequence is executed.

If (A) > 0, then Jump If (A) S 0, then (P)+ 1 - + P (A) are unchanged.

Note: The test conditions are:

(A) Positive AND (A)=FO Machine Codes:

: 3180 - : 31 BF for forward jum ps (+ 1 thru +64) :31CO - :31FF for backward jumps (0 thru -63) Registers Affected:

P Incremented normally if test conditions are not satisfied.

Timing:

2.6.3.7 JAL

Offset by (D) if all test conditions are satisfied.

JUMP IF A LESS THAN OR EQUAL TO ZERO I REGISTER

16 14 13 12 11 10

D FIEl D

Ajump occurs if the A Register is less than or equal to zero.

Otherwise the next instruction in sequence is executed.

If (A) < 0, then Jump If (A)

=

0:1 then Jump If (A) > 0, then (P)+ 1 - P (A) are unchanged.

Machine Codes:

:2180 - :21BF for forward jumps (+1 thru +64) :21 CO - :21 FF for backward jumps (0 thru -63) Registers Affected:

P

Timing:

2.6.3.8 JXZ

Incremented normally if neither test condition satisifed.

Offset by (D) if either test condition satisfied.

JUMP IF X ZERO I REGISTER

16 14 13 12 11 10 8

D FIELD

A jump occurs if the X Register is zero. Otherwise the next instruction in sequence is executed:

If (X)

=

0, then Jump If (X}I=O, then (P)+ 1 - P (X) are unchanged.

Machine Codes:

:2800 - :283F for forward jumps (+1 thru +64) :2840 - :287F for backward jumps (0 thru -63) Registers Affected:

P Incremented normally if test condition not satisfied.

Offset by (D) if test condition satisfied.

Timing:

2.6.3.9

JXN JUMP IF X NOT ZERO

I REGISTER

16 14 13 12 11 10

D FIELD

Ajump occurs if the X Register is not zero. Otherwise the next instruction in sequence is executed:

If (X):fO, then Jump If (X)=O, then (P)+ 1 P (X) are unchanged.

Machine Codes:

:3800 - :383F for forward jumps (+1 thru +64) :3840 - :387F for backward jumps (0 thru -63) Registers Affected:

P Incremented normally if test conditions not satisfied.

Offset by (D) if test condition satisfied.

2.6.3.10

JOR JUMP IF OVERFLOW RESET

I REGISTER

15 14 13 12 I 11 10 9

D FIELD

Ajump occurs if the overflow bit is reset (0). Otherwise the next instruction in sequence is executed.

If OV

=

0, then Jump If OV

=

1, then (P)+1 -. P OV is unchanged.

Machine Codes:

:3200 - :323F for forward jumps (+1 thru +64) :3240 - :327F for backward jumps (0 thru -63) Registers Mfected:

P

Timing:

2.6.3.11 JOS

Incremented normally if test condition satisfied.

Offset by (D) if test condition satisfied.

JUMP IF OVERFLOW SET I REGISTER

15 14 13 12 11 10 9

D FII:.LO

A jump occurs if the overflow bit is set (l). Otherwise the next instruction in sequence is executed:

If OV = 1, then Jump and reset OV.

If OV

=

0, then (P)+1 -- P OV is unconditionally reset by this instruction.

Machine Codes:

:2200 - :223F for forward jumps (+1 thru +64) :2240 - :227F for backward jumps (0 thru -63) Registers Mfected:

OV Unconditionally reset.

P

2.6.3.12 JSS

Incremented normally if test condition not satisfied.

Offset by (D) if test condition satisfied.

JUMP IF SENSE SWITCH SET I REGISTER

15 14 13 12 11 10

o FIELD

A jump occurs if the sense switch is set down. Otherwise the next instruction in sequence is executed.

If SS ON, the Jump If SS Off, then (P)+ 1 -- P Machine Codes:

:3400 - :343F for forward jumps (+1 thru +64) :3440 - :347F for backward jumps (0 thru -63) Registers Affected:

P Incremented normally if test condition not satisfied.

Offset by (D) if test condition satisfied.

Timing:

2.6.3.13

JSR JUMP IF SENSE SWITCH RESET

I REGISTER

15 14 13 12 11 10

~I

0

l' 1

0

I

0

l' 1

0

1

0

I

0

I

R

I

D FIELD

A jump occurs if the SENSE SWITCH is reset up. Otherwise the next instruction in sequence is executed:

If SS Off, then Jump If SS On, then (P)+ 1 - P Machine Codes:

:2400 - :243F for forward jumps (+1 thru +64) :2440 - :247F for backward jumps (0 thru -63) Registers Mfected:

P Incremented normally if test condition not satisfied

Offset by (D) if test condition satisfied.

Timing: 1

2.7 SHIFT INSTRUCTIONS

Im Dokument AUTOMATION COMPUTER (Seite 77-84)