6.3. Instrukční soubor procesoru COSMAC 1802

FIXME: dopsat

Tabulka 6.5. Instrukční soubor CPU COSMAC 1802 řazený dle operačích kódů

OP CODEMNEMONICInstrukcePopis
0NLDNLoad via NM(R(N))→D; For N Not 0
1NINCIncrement Reg. NR(N)+1→R(N)
2NDECDecrement Reg. NR(N)-1→R(N)
30BRShort BranchM(R(P))→R(P).0
31NBRNo Short BranchR(P)+1→R(P)
4NLDALoad advanceM(R(N))→D; R(N)+1→R(N)
5NSTRStore via ND→M(R(N))
60IRXIncrement Reg. XR(X)+1→R(X)
72LDXALoad via X and advanceM(R(X))→D; R(X)+1→R(X)
73STXDStore via X and DecrementD→M(R(X)); R(X)-1→R(X)
74ADCAdd With CarryM(R(X)) + D + DF →(DF,D)
75SDBSubtract D With BorrowM(R(X)) - D -(NOT DF) →(DF,D)
76SHRCShift Right With CarryShift D Right; LSB(D)→DF; DF→MSB(D)
76RSHRRing Shift RightShift D Right; LSB(D)→DF; DF→MSB(D)
7CADCIAdd With Carry ImmediateM(R(P)) + D + DF →(DF,D)
7DSDBISubtract With Borrow ImmediateM(R(P)) - D - (NOT DF) →(DF,D)
7ESHLCShift Left With CarryShift D Left; MSB(D)→DF; DF→LSB(D)
7ERSHLRing Shift LeftShift D Left; MSB(D)→DF; DF→LSB(D)
8NGLOGet Low Reg. NR(N).0→D
9NGHIGet High Reg. NR(N).1→D
ANPLOPut Low Reg. ND→R(N).0
BNPHIPut High Reg. ND→R(N).1
F0LDXLoad via XM(R(X))→D
F1OROrM(R(X)) OR D →D
F2ANDAndM(R(X)) AND D →D
F3XORExclusive OrM(R(X)) XOR D →D
F4ADDAddM(R(X)) + D →(DF,D)
F5SDSubtract DM(R(X)) - D →(DF,D)
F6SHRShift RightShift D Right; LSB(D)→DF
F7SMSubtract MemoryD - M(R(X)) →(DF,D)
F8LDILoad ImmediateM(R(P))→D; R(P)+1→R(P)
F9ORIOr ImmediateM(R(P)) OR D →D; R(P)+1→R(P)
FAANIAnd ImmediateM(R(P)) And D →D; R(P)+1→R(P)
FBXRIExclusive Or ImmediateM(R(P)) XOR D →D; R(P)+1→R(P)
FCADIAdd ImmediateM(R(P)) + D →(DF,D); R(P)+1→R(P)
FDSDISubtract D ImmediateM(R(P)) - D →(DF,D); R(P)+1→R(P)
FESHLShift LeftShift D Left; MSB(D)→DF; 0→LSB(D)
FFSMISubtract Memory ImmediateD - M(R(P)) →(DF,D); R(P)+1→R(P)

Tabulka 6.6. Opcode Map

H\L0123456789ABCDEF
0IDLLDN R1LDN R2LDN R3LDN R4LDN R5LDN R6LDN R7LDN R8LDN R9LDN RALDN RBLDN RCLDN RDLDN RELDN RF
1INC R0INC R1INC R2INC R3INC R4INC R5INC R6INC R7INC R8INC R9INC RAINC RBINC RCINC RDINC REINC RF
2                
3                
4                
5                
6IRXOUT 1OUT 2OUT 3OUT 4OUT 5OUT 6OUT 7 INP 1INP 2INP 3INP 4INP 5INP 6INP 7
7RETDISLDXASTXDADC           
8                
9                
A                
B                
CLBR LBZLBDFNOP           
D                
E                
F