63.2.2. OPR (OPeRate) instrukce

OPR není instrukce ale tři skupiny mikrokódovcýh operací. Základním kódem je 111 xxx xxx xxx. Devět bitů instrukčního slova kódují jednu ze tří skupin a jednotlivé bity spouští jednotlivé mikrooperace ve skupině. Tento způsob kódování mikrooperací je použit mimo jiné například v počítači TX-0.

A nyní k rozlišení jednotlivých skupin. Prvotním dělícím prvkem je hodnota bitu b3. Pokud má tento bit hodnotu 0, jedná se o skupinu 1. Pokud má hodnotu 1 jedná se o skupinu 2 nebo 3. Mezi skupinami 2 a 3 pak rozlišuje hodnota bitu b11, hodnota 0 znamená skupinu 2 a hodnota 1 pak skupinu 3 a EAE rozšíření.

Obrázek 63.9. Rozdělení OPR na skupiny a koncentrovaný popis mikroinstrukcí (PDP-8)

  0   1   2   3   4   5   6   7   8   9  10  11
+---+---+---+---+---+---+---+---+---+---+---+---+
|           |   |   |   |   |   |RAR|RAL| 0 |   |
| 1   1   1 | 0 |CLA|CLL|CMA|CML|RTR|RTL| 1 |IAC|  Skupina 1
|           |   |   |   |   |   | 0 | 0 |BSW|   |
|           |   |   |   |   |   | 1 | 1 | x |   |  nepovolená kombinace
+---+---+---+---+---+---+---+---+---+---+---+---+
|           |   |   |SMA|SZA|SNL| 0 |   |   |   |
| 1   1   1 | 1 |CLA|SPA|SNA|SZL| 1 |OSR|HLT| 0 |  Skupina 2
|           |   |   | 0 | 0 | 0 |SKP|   |   |   |
+---+---+---+---+---+---+---+---+---+---+---+---+
| 1   1   1 | 1 |CLA|MQA|SCA|MQL|EAE opcode | 1 |  Skupina 3 (EAE)
+---+---+---+---+---+---+---+---+---+---+---+---+

Bity mikrokódové instrukce spouštějí jednotlivé mikroinstrukce. Tyto ale mohou, a také ovlivňují stejné registry. Například instrukce CLA, CMA, RAR, RAL a IAC všechny mění obsah registru AC. Protože jsou přípustné i kombinace mikroinstrukcí, jsou tyto rozdělěny do sekvencí které se vykonávají postupně. Takto je zajištěno, že například kombinace mikroinstrukcí CLA IAC skončí s hodnotou 1 v akumulátoru AC. Pořadí sekvencí je uvedeno v seznamu:

Skupina 1

Mikroinstrukce v jednotlivých sekvencích jsou voleny tak, aby mohly být v rámci sekvence vykonávány všechny najednou, paralelně. U bitů ve čtvrté sekvenci popisujících rotaci je tomu jinak, protože všechny tři tyto bity kódují jen jednu operaci.

Tabulka 63.8. Kombinace bitů mikroinstrukcí pro rotace ve skupině 1

b8b9b10instrukce
000NOP
001BSW
010RAL
011RTL
100RAR
101RTR
110ilegální kombinace
111ilegální kombinace

Instrukční slovo skupiny 1 vypadá takto.

Obrázek 63.10. Group 1 microinstructions of PDP-8

  0   1   2   3   4   5   6   7   8   9  10  11
+---+---+---+---+---+---+---+---+---+---+---+---+
| 1   1   1 | 0 |CLA|CLL|CMA|CML|       |BSW|IAC|
+---+---+---+---+---+---+---+---+---+---+---+---+
                                  ↑   ↑   ↑
 ROTATE AC AND L RIGHT -----------+   |   |
 ROTATE AC AND L LEFT ----------------+   |
 ROTATE 1 POSITION IF 0, 2 POSITIONS IF 1-+
 (BSW IF BITS 8,9 ARE 0)

 LOGICAL SEQUENCE:   1 - CLA, CLL     2 - CMA, CML
                     3 - IAC          4 - RAR, RAL, RTR, RTL, BSW

Tabulka 63.9. Group 1 Microinstructions od PDP-8

MNEMONICOPCODEOPERATION
NOP7000No Operation. This instruction causes a 1-cycle delay in program execution, without affecting anything. It may be used for timing synchronization or as a convenient means of deleting another instruction from program.
IAC7001Increment Accumulator. AC+1→AC.
BSW7002Byte Swap. AC0-5↔AC6-11. Value in lower six bits in AC is swapped with value in upper six bits in AC.
RAL7004Rotate Accumulator Left. AC1-11→AC0-10, L→AC11, AC0→L. <AC,L> is rotated left.
RTL7006Rotate Two Left. Same as RAL, RAL.
RAR7010Rotate Accumulator Right. AC0-10→AC1-11, L→AC0, AC11→L. <AC,L> is rotated right.
RTR7012Rotate Two Right. Same as RAR, RAR.
CML7020Complement Link. ¬L→L.
CMA7040Complement Accumulator. ¬AC→AC.
CLL7100Clear Link. 0→L.
CLA7200Clear Accumulator. 0→AC.
CIA7041Complement and Increment Accumulator. CMA IAC. -AC→AC.
STL7120Set the Link. CLL CML. 1→L.
STA7240Set the Accumulator. CLA CMA. 7777→AC.
GLK7204Get the Link. CLA RAL. L→AC11, 0→L.

Skupina 2

Instrukční slovo skupiny 2 vypadá takto.

Obrázek 63.11. Group 2 microinstructions of PDP-8

          0   1   2   3   4   5   6   7   8   9  10  11
        +---+---+---+---+---+---+---+---+---+---+---+---+
        | 1   1   1 | 1 |CLA|SMA|SZA|SNL|   |OSR|HLT| 0 |
        +---+---+---+---+---+---+---+---+---+---+---+---+
                                          ↑
 REVERSE SKIP SENSING OF BITS 5,6,7 IF SET+

 LOGICAL SEQUENCE: 1 (BIT 8 IS 0) - SMASZASNL
                     (BIT 8 IS 1) - SPASNASZL
                   2 - CLA
                   3 - OSR, HLT

Tabulka 63.10. Group 2 Microinstructions od PDP-8

MNEMONICOPCODEOPERATION
HLT7402Halt. Clears the run flip-flop so that program execution stops at the end of TP4 of the current machine cycle.
OSR7404Logical OR with Switch Register. The content of th programmer's console switch register (SR) is combined with the content of the AC by a bitwise OR operation. The result is left in the AC and the original content of the AC is lost. The content of the SR is not affected.
SKP7410Skip. The content of the PC is incremented by 1, to skip the next sequential instruction.
SNL7420Skip on Non-Zero Link. The conetent of the link is sampled. If the link contains a 1, the content of the PC is incremented to skip the next sequential instruction. If the link contains a 0, the next instruction is executed.
SZL7430Skip on Zero Link. The conetent of the link is sampled. If the link contains a 0, the content of the PC is incremented to skip the next sequential instruction. If the link contains a 1, the next instruction is executed.
SZA7440Skip on Zero Accumulator. The content of each bit of the AC is sampled. If every bit contains a 0, the content of the PC is incremented to skip the next sequential instruction. If any bit contains a 1, the next instruction is executed.
SNA7450Skip on Non-Zero Accumulator. If AC≠0 then PC+1→PC. So the next sequential instruction is skipped. Otherwise execution continues with the next sequential instruction.
SMA7500Skip on Minus Accumulator. IF AC0=1 then PC+1→PC.
SPA7510Skip on Positive Accumulator. IF AC0=0 then PC+1→PC.
CLA7600Clear Accumulator. 0→AC.
SZA SNL7460Skip if AC=0 or L=1.
SNA SZL7470Skip if AC=0 and L=0.
SMA SNL7520Skip if AC<0 or L=1.
SPA SZL7530Skip if AC≥0 and L=0.
SMA SZA7540Skip if AC≤0.
SPA SNA7550Skip if AC>0.
SMA SZA SNL7560Skip if AC≤0 or L=1.
SPA SNA SZL7570Skip if AC>0 or L=0.

Nepoužité kombinace OPR byly dány do třetí skupiny mikroprogramových akcí.

Obrázek 63.12. Group 3 microinstructions of PDP-8

  0   1   2   3   4   5   6   7   8   9  10  11
+---+---+---+---+---+---+---+---+---+---+---+---+
| 1   1   1 | 1 |CLA|MQA|   |MQL|   |   |   | 1 |
+---+---+---+---+---+---+---+---+---+---+---+---+
  LOGICAL SEQUENCE: 1 - CLA
                    2 - MQA, MQL
                    3 - ALL OTHERS

Tabulka 63.11. Group 3 Microinstructions od PDP-8

MNEMONICOPCODEOPERATION
CLA7601Clear Accumulator. Each bit of the AC is loaded with a binary 0.
MQL7421Multiplier Quotient Load. The content of the AC is loaded into the MQ. The AC is cleared and the original content of the MQ is lost.
MQA7501Multiplier Quotient into Accumulator. The content of the MQ is combined with the content of the AC by a bitwise logical OR operation, and the result is loaded into the AC. The original content of the AC is lost, but the original contento of the MQ is not affected. Note that this instruction provides the programmer with a direct insclusive OR operation.
SWP7521Swap Accumulator and Multiplier Quotient. The content of the AC and the content of the MQ are exchanged. This is a microprogrammed combination of MQA and MQL.
CAM7621Clear Accumulator and Multiplier Quotient. Each bit of both the AC and the MQ loaded with a binary 0. This is microprogrammed combination of CLA and MQL.
Licence Creative Commons
Elektronika a počítače, jejímž autorem je Radek Hnilica, podléhá licenci Creative Commons Uveďte autora-Nevyužívejte dílo komerčně-Zachovejte licenci 3.0 Česká republika .