domingo, 19 de enero de 2014

Anexo 7: Instrucciones del procesador 1802

Instrucciones del microprocesador COSMAC 1802

Código Op Mnemónica
Instrucción
Operación
0NLDNLoad via NM(R(N))->D; For N not 0
4NLDALoad AdvanceM(R(N))->D; R(N)+1->R(N)
F0LDXLoad via XM(R(X))->D
72LDXALoad via X and advanceM(R(X))->D; R(X)+1->R(X)
F8LDILoad ImmediateM(R(P))->D; R(P)+1->R(P)
5NSTRStore via ND->M(R(N))
73STXDStore via X and DecrementD->M(R(X)); R(X)-1->R(X)
1NINCIncrement register NR(N)+1->R(N)
2NDECDecrement register NR(N)-1->R(N)
60IRXIncrement Register XR(X)+1->R(X)
8NGLOGet Low register NR(N).0->D
ANPLOPut Low register ND->R(N).0
9NGHIGet High register NR(N).1->D
BNPHIPut High register ND->R(N).1
F1OROrM(R(X)) or D->D
F9ORIOr ImmediateM(R(P)) or D->D;
R(P)+1->R(P)
F3XORExclusive OrM(R(X)) xor D->D
FBXRIExclusive or ImmediateM(R(P)) xor D->D;
R(P)+1->R(P)
F2ANDAndM(R(X)) and D->D
FAANIAnd ImmediateM(R(P)) and D->D;
R(P)+1->R(P)
F6SHRShift RightShift D right; lsb(D)->DF;
0->msb(D)
76SHRCShift Right with CarryShift D right; lsb(D)->DF;
DF->msb(D)
FESHLShift LeftShift D left; msb(D)->DF;
0->lsb(D)
7ESHLCShift Left with CarryShift D left; msb(D)->DF;
DF->lsb(D)
F4ADDAddM(R(X))+D->DF,D
FCADIAdd ImmediateM(R(P))+D->DF,D;
R(P)+1->R(P)
74ADCAdd with CarryM(R(X))+D+DF->DF,D
7CADCIAdd with Carry ImmediateM(R(P))+D+DF->DF,D;
R(P)+1->R(P)
F5SDSubtract DM(R(X))-D->DF,D
FDSDISubtract D ImmediateM(R(P))-D->DF,D;
R(P)+1->R(P)
75SDBSubtract D with BorrowM(R(X))-D-DF->DF,D
7DSDBISubtract D with Borrow
Immediate
M(R(P))-D-DF->DF,D;
R(P)+1->R(P)
F7SMSubtract MemoryD-M(R(X))->DF,D
FFSMISubtract Memory
Immediate
D-M(R(P))->DF,D;
R(P)+1->R(P)
77SMBSubtract Memory
with Borrow
D-M(R(X))-DF->DF,D;
7FSMBISubtract Memory with
Borrow Immediate
D-M(R(P))-DF->DF,D;
R(P)+1>R(P)
30BRBranchM(R(P))->R(P).0
38NBRNo BranchR(P)+1->R(P)
32BZBranch if D=0If D=0, M(R(P))->R(P).0
else R(P)+1->R(P)
3ABNZBranch if D<>0If D<>0, M(R(P))->R(P).0
else R(P)+1->R(P)
33BDFBranch if DF=1if DF=1, M(R(P))->R(P).0
else R(P)+1->R(P)
3BBNFBranch if DF=0if DF=0, M(R(P))->R(P).0
else R(P)+1->R(P)
31BQBranch if Q=1if Q=1, M(R(P))->R(P).0
else R(P)+1->R(P)
39BNQBranch if Q=0if Q=0, M(R(P))->R(P).0
else R(P)+1->R(P)
34B1Branch if EF1=1if EF1=1, M(R(P))->R(P).0
else R(P)+1->R(P)
3CBN1Branch if EF1=0if EF1=0, M(R(P))->R(P).0
else R(P)+1->R(P)
35B2Branch if EF2=1if EF2=1, M(R(P))->R(P).0
else R(P)+1->R(P)
3DBN2Branch if EF2=0if EF2=0, M(R(P))->R(P).0
else R(P)+1->R(P)
36B3Branch if EF3=1if EF3=1, M(R(P))->R(P).0
else R(P)+1->R(P)
3EBN3Branch if EF3=0if EF3=0, M(R(P))->R(P).0
else R(P)+1->R(P)
37B4Branch if EF4=1if EF4=1, M(R(P))->R(P).0
else R(P)+1->R(P)
3FBN4Branch if EF4=0if EF4=0, M(R(P))->R(P).0
C0LBRLong BranchM(R(P))->R(P).1;
M(R(P)+1)->R(P).0
C8NLBRNo Long BranchR(P)+2->R(P)
C2LBZBranch if D=0if D=0 then M(R(P))->R(P).1;
M(R(P)+1)->R(P).0
else R(P)+2->R(P)
CALBNZBranch if D<>0if D<>0 then M(R(P))->R(P).1;
M(R(P)+1)->R(P).0
else R(P)+2->R(P)
C3LBDFBranch if DF=1if DF=1 then M(R(P))->R(P).1;
M(R(P)+1)->R(P).0
else R(P)+2->R(P)
CBLBNFBranch if DF=0if DF=0 then M(R(P))->R(P).1;
M(R(P)+1)->R(P).0
else R(P)+2->R(P)
C1LBQBranch if Q=1if Q=1 then M(R(P))->R(P).1;
M(R(P)+1)->R(P).0
else R(P)+2->R(P)
C9LBNQBranch if Q=0if Q=0 then M(R(P))->R(P).1;
M(R(P)+1)->R(P).0
else R(P)+2->R(P)
CELSZSkip if D=0if D=0, R(P)+2->R(P)
else Continue
C6LSNZSkip if D<>0if D<>0, R(P)+2->R(P)
else Continue
CFLSDFSkip if DF=1if DF=1, R(P)+2->R(P)
else Continue
C7LSNFSkip if DF=0if DF=0, R(P)+2->R(P)
else Continue
CDLSQSkip if Q=1if Q=1, R(P)+2->R(P)
else Continue
C5LSNQSkip if Q=0if Q=0, R(P)+2->R(P)
else Continue
CCLSIESkip if IE=1if IE=0, R(P)+2->R(P)
else Continue
00IDLIdleWait for DMA or Interrupt
M(R(0))->Bus
C4NOPNo operationContinue
DNSEPSet PN->P
ENSEXSet XN->X
7BSEQSet Q1->Q
7AREQReset Q0->Q
78SAVSaveT->M(R(X))
79MARKPush X,P to stack(X,P)->T; (X,P)->M(R(2))
then P->X; R(2)-1->R(2)
70RETReturnM(R(X))->(X,P);
R(X)+1->R(X); 1->IE
71DISDisableM(R(X))->(X,P);
R(X)+1->R(X); 0->IE
61OUT1Output 1M(R(X))->Bus;
R(X)+1->R(X); Nlines=1
62OUT1Output 2M(R(X))->Bus;
R(X)+1->R(X); Nlines=2
63OUT1Output 3M(R(X))->Bus;
R(X)+1->R(X); Nlines=3
64OUT1Output 4M(R(X))->Bus;
R(X)+1->R(X); Nlines=4
65OUT1Output 5M(R(X))->Bus;
R(X)+1->R(X); Nlines=5
66OUT1Output 6M(R(X))->Bus;
R(X)+1->R(X); Nlines=6
67OUT1Output 7M(R(X))->Bus;
R(X)+1->R(X); Nlines=7
69INP1Input 1Bus->M(R(X)); Bus->D;
Nlines=1
6AINP1Input 2Bus->M(R(X)); Bus->D;
Nlines=2
6BINP1Input 3Bus->M(R(X)); Bus->D;
Nlines=3
6CINP1Input 4Bus->M(R(X)); Bus->D;
Nlines=4
6DINP1Input 5Bus->M(R(X)); Bus->D;
Nlines=5
6EINP1Input 6Bus->M(R(X)); Bus->D;
Nlines=6
6FINP1Input 7Bus->M(R(X)); Bus->D;
Nlines=7