FIXME: dopsat
Tabulka 6.5. Instrukční soubor CPU COSMAC 1802 řazený dle operačích kódů
OP CODE | MNEMONIC | Instrukce | Popis |
---|---|---|---|
0N | LDN | Load via N | M(R(N))→D; For N Not 0 |
1N | INC | Increment Reg. N | R(N)+1→R(N) |
2N | DEC | Decrement Reg. N | R(N)-1→R(N) |
30 | BR | Short Branch | M(R(P))→R(P).0 |
31 | NBR | No Short Branch | R(P)+1→R(P) |
4N | LDA | Load advance | M(R(N))→D; R(N)+1→R(N) |
5N | STR | Store via N | D→M(R(N)) |
60 | IRX | Increment Reg. X | R(X)+1→R(X) |
72 | LDXA | Load via X and advance | M(R(X))→D; R(X)+1→R(X) |
73 | STXD | Store via X and Decrement | D→M(R(X)); R(X)-1→R(X) |
74 | ADC | Add With Carry | M(R(X)) + D + DF →(DF,D) |
75 | SDB | Subtract D With Borrow | M(R(X)) - D -(NOT DF) →(DF,D) |
76 | SHRC | Shift Right With Carry | Shift D Right; LSB(D)→DF; DF→MSB(D) |
76 | RSHR | Ring Shift Right | Shift D Right; LSB(D)→DF; DF→MSB(D) |
7C | ADCI | Add With Carry Immediate | M(R(P)) + D + DF →(DF,D) |
7D | SDBI | Subtract With Borrow Immediate | M(R(P)) - D - (NOT DF) →(DF,D) |
7E | SHLC | Shift Left With Carry | Shift D Left; MSB(D)→DF; DF→LSB(D) |
7E | RSHL | Ring Shift Left | Shift D Left; MSB(D)→DF; DF→LSB(D) |
8N | GLO | Get Low Reg. N | R(N).0→D |
9N | GHI | Get High Reg. N | R(N).1→D |
AN | PLO | Put Low Reg. N | D→R(N).0 |
BN | PHI | Put High Reg. N | D→R(N).1 |
F0 | LDX | Load via X | M(R(X))→D |
F1 | OR | Or | M(R(X)) OR D →D |
F2 | AND | And | M(R(X)) AND D →D |
F3 | XOR | Exclusive Or | M(R(X)) XOR D →D |
F4 | ADD | Add | M(R(X)) + D →(DF,D) |
F5 | SD | Subtract D | M(R(X)) - D →(DF,D) |
F6 | SHR | Shift Right | Shift D Right; LSB(D)→DF |
F7 | SM | Subtract Memory | D - M(R(X)) →(DF,D) |
F8 | LDI | Load Immediate | M(R(P))→D; R(P)+1→R(P) |
F9 | ORI | Or Immediate | M(R(P)) OR D →D; R(P)+1→R(P) |
FA | ANI | And Immediate | M(R(P)) And D →D; R(P)+1→R(P) |
FB | XRI | Exclusive Or Immediate | M(R(P)) XOR D →D; R(P)+1→R(P) |
FC | ADI | Add Immediate | M(R(P)) + D →(DF,D); R(P)+1→R(P) |
FD | SDI | Subtract D Immediate | M(R(P)) - D →(DF,D); R(P)+1→R(P) |
FE | SHL | Shift Left | Shift D Left; MSB(D)→DF; 0→LSB(D) |
FF | SMI | Subtract Memory Immediate | D - M(R(P)) →(DF,D); R(P)+1→R(P) |
Tabulka 6.6. Opcode Map
H\L | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
0 | IDL | LDN R1 | LDN R2 | LDN R3 | LDN R4 | LDN R5 | LDN R6 | LDN R7 | LDN R8 | LDN R9 | LDN RA | LDN RB | LDN RC | LDN RD | LDN RE | LDN RF |
1 | INC R0 | INC R1 | INC R2 | INC R3 | INC R4 | INC R5 | INC R6 | INC R7 | INC R8 | INC R9 | INC RA | INC RB | INC RC | INC RD | INC RE | INC RF |
2 | ||||||||||||||||
3 | ||||||||||||||||
4 | ||||||||||||||||
5 | ||||||||||||||||
6 | IRX | OUT 1 | OUT 2 | OUT 3 | OUT 4 | OUT 5 | OUT 6 | OUT 7 | INP 1 | INP 2 | INP 3 | INP 4 | INP 5 | INP 6 | INP 7 | |
7 | RET | DIS | LDXA | STXD | ADC | |||||||||||
8 | ||||||||||||||||
9 | ||||||||||||||||
A | ||||||||||||||||
B | ||||||||||||||||
C | LBR | LBZ | LBDF | NOP | ||||||||||||
D | ||||||||||||||||
E | ||||||||||||||||
F |