{
File name read.mc
Last edited by Jim August 20, 1981 2:20 PM: Fix for new assembler.
Last edited: Sandman, January 14, 1981 10:59 AM
Last edited: R. Garner, April 2, 1980 4:51 PM
Last edited: Charnley, March 28, 1980 5:06 PM
Description: Mesa Read op-codes
Author: don charnley
Created: February 16, 1980
}
{The read mesa op-codes consist of the following:
OPvalbytesstktime
R0100’b1—1+12
R1101’b1—1+12
R2102’b1—1+12
R3103’b1—1+12
R4104’b1—1+12
RB105’b2—1+12
RBL137’b2—2+13
RBLL0xxx2—1+23
RD0115’b1—1+23
RDB114’b2—1+23
RDBL141’b2—2+25
RIL0127’b1+13
RIL1xxx1+13
RIL2xxx1+13
RIL3xxx1+13
RIGP125’b2+14
RIGPL151’b2+16
RILP124’b2+14
RILPL147’b2+16
RIILPxxx2+15
RIIPxxx2—1+14
RXLP122’b2—1+15
RXLPL143’b2—1+16
RXGPL145’b2—1+16
}
{——————————————————————————————————————————————————————
Rn{n:[0..4]} and RB
——————————————————————————————————————————————————————}
{@Rn} {@RB,alpha}
{Timing:2 clicks, + 2 if fix map flags}
{entry:exit:
TOS =| ptr|| data|
STK =| ~|| ~|
-->| u| -->| u|}
@R0:Map ← Q ← [rhMDS, TOS + 0], L1 ← L1r.NoFixes, GOTO[RnTail],c1, opcode[100’b];
@R1:Map ← Q ← [rhMDS, TOS + 1], L1 ← L1r.NoFixes, GOTO[RnTail],c1, opcode[101’b];
@R2:T ← 2, L1 ← L1r.NoFixes, GOTO[RnMap],c1, opcode[102’b];
@R3:T ← 3, L1 ← L1r.NoFixes, GOTO[RnMap],c1, opcode[103’b];
@R4:T ← 4, L1 ← L1r.NoFixes, GOTO[RnMap],c1, opcode[104’b];
@RB:T ← ib, L1 ← L1r.DecOnly,c1, opcode[105’b];
PC ← PC + PC16, GOTO[RbMap],c2;
RnMap:Noop,c2;
RbMap:Noop,c3;
Map ← Q ← [rhMDS, TOS + T],c1;
RnTail:pop ,c2;
RbTail:Rx ← rhRx ← MD, XRefBr, push,c3;
RedoR:MAR ← [rhRx, Q + 0], L0 ← L0.RedoR, BRANCH[RMapUD,$],c1, at[L0.RedoR,10, RMapFixCaller];
PC ← PC + PC16, IBDisp, GOTO[LLTail],c2;
RMapUD:CALL[RMapFix] {will return to RedoR},c2;
{——————————————————————————————————————————————————————
RDB and RD0
——————————————————————————————————————————————————————}
{@RD0} {@RDB, alpha}
{Timing:3 clicks, + 2 if fix map flags, + 2 if words on 2 pages}
{entry:exit:
TOS =| ptr|| data1|
STK =| ~|| ~|
| ~| -->| data0|
-->| v|| v|}
@RD0:Map ← Q ← [rhMDS, TOS + 0], L1 ← L1r.PopDec,c1, opcode[115’b];
PC ← PC + PC16, fXpop, push, GOTO[rdbR0x],c2;
@RDB:T ← ib,c1, opcode[114’b];
Noop,c2;
Noop,c3;
Map ← Q ← [rhMDS, TOS + T], L1 ← L1r.PopDecDec,c1;
PC ← PC + 1, fXpop, push {chk underflow},c2;
rdbR0x:Rx ← rhRx ← MD, XRefBr, push,c3;
rdbR0:MAR ← [rhRx,Q + 0], L0 ← L0.rdbR0, BRANCH[rdbRMapUD0,$],c1, at[L0.rdbR0,10,RMapFixCaller];
Noop,c2;
T ← MD, push, fZpop {chk ovflo},c3;
MAR ← [rhRx,Q + 1],c1;
IBDisp, BRANCH[$,rdPgCr,1],c2;
RPushMD:TOS ← MD, STK ← T, DISPNI[OpTable],c3;
rdPgCr:Noop,c3;
Map ← Q ← [rhMDS,Q + 1],c1;
rdbX:Noop,c2;
Rx ← rhRx ← MD, XRefBr,c3;
rdbR1:MAR ← [rhRx,Q + 0], L0 ← L0.rdbR1, BRANCH[rdbRMapUD1,$],c1, at[L0.rdbR1,10,RMapFixCaller];
IBDisp, GOTO[RPushMD],c2;
rdbRMapUD0:CALL[RMapFix] {will return to rdbR0},c2;
rdbRMapUD1:CALL[RMapFix] {will return to rdbR1},c2;
{——————————————————————————————————————————————————————
RBL
——————————————————————————————————————————————————————}
{@RBL, alpha}
{Timing:3 clicks if no remap, 5 if remap (plus 1 if crosses 64K)}
{entry:exit:
TOS =| ptrH|| data|
STK =| ~|| ~|
-->| ptrL|| ~|
| v| -->| v|}
@RBL:TT ← STK{ptrL}, pop, L2 ← L2.RBL,c1, opcode[137’b];
TT ← TT + ib, pop, CarryBr,c2;
rhTT ← TOS{ptrH} LRot0, push, BRANCH[rblMap,rhTTInc],c3;
rhTTInc:Q ← rhTT ,c1;
rhTTIncx:Q ← Q + 1, pRet2,c2;
rhTT ← Q{ptrH+1} LRot0, RET[rhTTIncRets],c3;
rblMap:Map ← Q ← [rhTT,TT], L1 ← L1r.PushDec,c1, at[L2.RBL,10,rhTTIncRets];
PC ← PC + PC16, L0 ← L0.RedoLR,c2;
Rx ← rhRx ← MD, XRefBr,c3;
RedoLR:MAR ← [rhRx, Q + 0], BRANCH[RLMapUD,$],c1, at[L0.RedoLR,10,RMapFixCaller];
PC ← PC + PC16, IBDisp,c2;
TOS ← MD, DISPNI[OpTable],c3;
RLMapUD:CALL[RLMapFix] {will return to RedoLR},c2;
{——————————————————————————————————————————————————————
RBLL0
——————————————————————————————————————————————————————}
{@RBLL0, alpha}
{Timing:3 clicks if no remap, + 2 if fix map flags}
{Note that there is no page cross on local 0}
{entry:exit:
TOS =| ptr|| loc0|
STK =| ~|| ~|
| ~| -->| data|
-->| v|| v|}
{ UNUSED AT PRESENT
@RBLL0:Map ← Q ← [rhMDS, TOS + ib], L1 ← L1r.PopDec,c1, opcode[xxx];
PC ← PC + PC16, pop,c2;
Rx ← rhRx ← MD, XRefBr, push,c3;
rbll0Rd:MAR ← [rhRx, Q + 0], L0 ← L0.rbll0Rd, push, BRANCH[rblldMap,$],c1, at[L0.rbll0Rd,10, RMapFixCaller];
push, fZpop{chk ovflo},c2;
T ← MD,c3;
rbll0RL:MAR ← Q ← [rhL, L + Lbias], L2 ← L2.rbll0,c1, at[L0.rbll0RL,10, RMapFixCaller];
PC ← PC + PC16, IBDisp, BRANCH[$,LRemap0,1],c2;
TOS ← MD, STK ← T{data}, DISPNI[OpTable],c3;
{rbll0ret}TOS ← TT{loc0},c1, at[L2.rbll0,10,LGRemapCaller];
PC ← PC + PC16, IBDisp,c2;
STK ← T{data}, DISPNI[OpTable],c3;
rblldMap:GOTO[RMapFix] {will return to rbll0Rd},c2;
LRemap0:TT ← UvL, CALL[LGRemap] { will return to {rbll0ret} },c3;
}
{——————————————————————————————————————————————————————
RDBL
——————————————————————————————————————————————————————}
{@RDBL, alpha}
{Timing:5 clicks, + 1 if (ptr + ib) crosses 64K, + 2 if second word on new page, + 2 if second word crosses 64K}
{entry:exit:
TOS =| ptrH|| data1|
STK =| ~|| ~|
-->| ptrL| -->| data0|
| v|| v|}
@RDBL:TT ← STK{ptrL}, pop, L2 ← L2.RDBL0,c1, opcode[141’b];
TT ← TT + ib, CarryBr, pop,c2;
rhTT ← TOS{ptrH} LRot0, BRANCH[rdblMap0,rdblFixRh0],c3;
rdblFixRh0:Q ← rhTT, GOTO[rhTTIncx],c1;
rdblMap0:Map ← Q ← [rhTT,TT], L0 ← L0.rdblR0,c1, at[L2.RDBL0,10,rhTTIncRets];
PC ← PC + 1, L1 ← L1r.DecDec, push,c2;
Rx ← rhRx ← MD, XRefBr, push,c3;
rdblR0:MAR ← [rhRx,Q + 0], BRANCH[rdblM0,$],c1, at[L0.rdblR0,10,RMapFixCaller];
Noop,c2;
T ← MD, L0 ← L0.rdblR1,c3;
MAR ← [rhRx,Q + 1],c1;
rdblTail:IBDisp, BRANCH[$,rdblPgCr,1],c2;
TOS ← MD, STK ← T, DISPNI[OpTable],c3;
rdblPgCr:TT ← TT + 1, CarryBr, L2 ← L2.RDBL1,c3;
Map ← Q ← [rhTT,TT], BRANCH[$,rdbl64],c1, at[L2.RDBL1,10,rhTTIncRets];
Noop, ,c2;
Rx ← rhRx ← MD, XRefBr,c3;
rdblR1:MAR ← [rhRx,Q + 0], BRANCH[rdblM1,rdblTail],c1, at[L0.rdblR1,10,RMapFixCaller];
rdbl64:Noop,c2;
FixrhTT:CALL[rhTTInc]{WDBL comes here},c3;
rdblM0:CALL[RLMapFix] {will return to rdblR0},c2;
rdblM1:CALL[RLMapFix] {will return to rdblR1},c2;
{——————————————————————————————————————————————————————
RILn{n:[0..3]}
——————————————————————————————————————————————————————}
{@RILn}
{Timing:3 clicks, + 2 if fix map flags}
{No page carry is possible on local 0}
Set[L3.RIL0, 0];
{entry:exit:
TOS =| u|| data|
STK =| ~|| ~|
| ~| -->| u|
-->| v|| v|}
@RIL0:MAR ← Q ← [rhL, L + Lbias], L3 ← L3.RIL0, push,c1, opcode[127’b];
STK ← TOS, L3Disp, CANCELBR[rilMD,2],c2;
{ UNUSED AT PRESENT
Set[L3.RIL1, 1];
Set[L3.RIL2, 2];
Set[L3.RIL3, 3];
@RIL1:MAR ← Q ← [rhL, L + Lbias], L3 ← L3.RIL1, push,c1, opcode[xxx];
STK ← TOS, L3Disp, CANCELBR[rilMD,2],c2;
@RIL2:MAR ← Q ← [rhL, L + Lbias], L3 ← L3.RIL2, push,c1, opcode[xxx];
STK ← TOS, L3Disp, CANCELBR[rilMD,2],c2;
@RIL3:MAR ← Q ← [rhL, L + Lbias], L3 ← L3.RIL3, push,c1, opcode[xxx];
STK ← TOS, L3Disp, CANCELBR[rilMD,2],c2;
}
rilMD:TT ← MD, DISP2[rilMap0],c3;
rilMap0:Map ← Q ← [rhMDS,TT + 0], GOTO[RILCom],c1, at[L3.RIL0,10,rilMap0];
{ UNUSED AT PRESENT
rilMap1:Map ← Q ← [rhMDS,TT + 1], GOTO[RILCom],c1, at[L3.RIL1,10,rilMap0];
rilMap2:Map ← Q ← [rhMDS,TT + 2], GOTO[RILCom],c1, at[L3.RIL2,10,rilMap0];
rilMap3:Map ← Q ← [rhMDS,TT + 3], GOTO[RILCom],c1, at[L3.RIL3,10,rilMap0];
}
RILCom:L1 ← L1r.PopOnly, push, fZpop {chk ovflo},c2;
Rx ← rhRx ← MD, XRefBr, GOTO[RedoR],c3;
{——————————————————————————————————————————————————————
RIGPL
——————————————————————————————————————————————————————}
{@RIGPL, alpha{pair}}
{Timing:6 clicks, + 2 if G remap, +2 if fix map flags}
{entry:exit:
TOS =| u|| data|
STK =| ~|| ~|
| ~| -->| u|
-->| v|| v|}
@RIGPL:T ← Gbias, push, L0 ← L0.RedoLR,c1, opcode[151’b];
STK ← TOS, L1 ← L1.PopDec, push, fZpop {chk ovflo},c2;
IGPLcom:T ← alpha.left + T, L2 ← L2.RIxPL0,c3;
MAR ← Q ← [rhG,T + G],c1;
PC ← PC + PC16, BRANCH[$,GRemap1,1],c2;
TT ← MD,c3;
MAR ← Q ← [rhG,Q + 1], L2 ← L2.RIxPLTail, GOTO[rigplCom],c1;
{RIxPL0}MAR ← Q ← [rhRx,Q + 1], L2 ← L2.RIxPLTail,c1, at[L2.RIxPL0,10,LGRemapCaller];
rigplCom:T ← TT{ptrL}, BRANCH[$,GRemap2,1],c2;
rhTT ← TT ← MD{ptrH}, GOTO[RIxPLTail],c3;
RIxPLTail:T ← T + alpha.right, CarryBr,c1, at[L2.RIxPLTail,10,LGRemapCaller];
TT ← TT + 1, BRANCH[IxPLOK, IxPLCarry],c2;
IxPLOK: GOTO[IxPLMap],c3;
IxPLCarry:rhTT ← TT LRot0, GOTO[IxPLMap],c3;
IxPLMap:
Map ← Q ← [rhTT,T], L0Disp,c1;
Xbus ← ib, DISP4[ILPthings],c2;
ILPthings:
Rx ← rhRx ← MD, XRefBr, GOTO[RedoLR],c3, at[L0.RedoLR,10,ILPthings];
GRemap1:TT ← UvG, CALL[LGRemap] {will return to {RIxPL0}},c3;
GRemap2:TT ← UvG, CALL[LGRemap] {will return to RIxPLTail},c3;
{——————————————————————————————————————————————————————
RIGP
——————————————————————————————————————————————————————}
{@RIGP, alpha{pair}}
{Timing:4 clicks, + 2 if G remap, + 2 if fix map flags}
{entry:exit:
TOS =| u|| data|
STK =| ~|| ~|
| ~| -->| u|
-->| v|| v|}
@RIGP:push, T ← Gbias,c1, opcode[125’b];
STK ← TOS, L1 ← L1r.PopDec, push, fZpop {chk ovflo},c2;
T ← alpha.left + T, L2 ← L2.RIxPTail,c3;
MAR ← Q ← [rhG, T + G],c1;
PC ← PC + PC16, BRANCH[$,GRemap0,1],c2;
TT ← MD, GOTO[RIxPTail],c3;
RIxPTail:TT ← TT + alpha.right,c1, at[L2.RIxPTail,10,LGRemapCaller];
Xbus ← ib,c2;
Noop,c3;
Map ← Q ← [rhMDS, TT], GOTO[RnTail],c1;
GRemap0:TT ← UvG, CALL[LGRemap] {will return to RIxPTail},c3;
{——————————————————————————————————————————————————————
RILPL
——————————————————————————————————————————————————————}
{@RILPL, alpha{pair}}
{Timing:6 clicks, + 2 if L remap, +2 if fix map flags}
{entry:exit:
TOS =| u|| data|
STK =| ~|| ~|
| ~| -->| u|
-->| v|| v|}
@RILPL:push, T ← Lbias, L0 ← L0.RedoLR,c1, opcode[147’b];
STK ← TOS, L1 ← L1.PopDec, push, fZpop {chk ovflo} ,c2;
ILPLcom:T ← alpha.left + T, L2 ← L2.RIxPL0,c3;
MAR ← Q ← [rhL,T + L],c1;
PC ← PC + PC16, BRANCH[$,LRemap3,1],c2;
TT ← MD,c3;
MAR ← Q ← [rhL,Q + 1], L2 ← L2.RIxPLTail,c1;
T ← TT{ptrL}, BRANCH[$,LRemap4,1],c2;
rhTT ← TT ← MD{ptrH}, GOTO[RIxPLTail],c3;
LRemap3:TT ← UvL, CALL[LGRemap] {will return to {RIxPL0}},c3;
LRemap4:TT ← UvL, CALL[LGRemap] {will return to RIxPLTail},c3;
{——————————————————————————————————————————————————————
RILP
——————————————————————————————————————————————————————}
{@RILP, alpha{pair}}
{Timing:4 clicks, + 2 if L remap, + 2 if fix map flags}
{entry:exit:
TOS =| u|| data|
STK =| ~|| ~|
| ~| -->| u|
-->| v|| v|}
@RILP:push, T ← Lbias,c1, opcode[124’b];
STK ← TOS, L1 ← L1r.PopDec, push, fZpop {chk ovflo} ,c2;
T ← alpha.left + T, L2 ← L2.RIxPTail,c3;
MAR ← Q ← [rhL,T + L],c1;
PC ← PC + PC16, BRANCH[$,LRemap2,1],c2;
TT ← MD, GOTO[RIxPTail],c3;
LRemap2:TT ← UvL, CALL[LGRemap] {will return to RIxPTail},c3;
{——————————————————————————————————————————————————————
RIILP
——————————————————————————————————————————————————————}
{@RIILP, alpha{pair}}
{Timing:5 clicks, + 2 if fix map flags}
{No page cross is possible on local 0}
{entry:exit:
TOS =| u|| data|
STK =| ~|| ~|
| ~| -->| u|
-->| v|| v|}
{ UNUSED AT PRESENT
@RIILP:MAR ← Q ← [rhL,L + Lbias], push,c1, opcode[xxx];
STK ← TOS, L1 ← L1r.PopOnly, push, fZpop {chk ovflo}, CANCELBR[$,2] ,c2;
TT ← MD,c3;
{riilpRet0}Map ← Q ← [rhMDS,TT + alpha.right],c1;
PC ← PC + PC16, L1 ← L1r.PopDec,c2;
Rx ← rhRx ← MD, XRefBr,c3;
riilpRet1:MAR ← [rhRx,Q + 0], L0 ← L0.riilp0, BRANCH[riilpMapUD,$],c1, at[L0.riilp0,10,RMapFixCaller];
Noop,c2;
TT ← MD,c3;
Map ← Q ← [rhMDS,TT + alpha.left],c1;
Xbus ← ib,c2;
Rx ← rhRx ← MD, XRefBr, GOTO[RedoR],c3;
riilpMapUD:CALL[RMapFix] {will return to riilpRet1 },c2;
}
{——————————————————————————————————————————————————————
RIIP
——————————————————————————————————————————————————————}
{@RIIP, alpha{pair}}
{Timing:4 clicks, + 2 if fix map flags}
{entry:exit:
TOS =| ptr|| data|
STK =| ~|| ~|
-->| v| -->| v|}
{ UNUSED AT PRESENT
@RIIP:Map ← Q ← [rhMDS,TOS + alpha.right], pop,c1, opcode[34];
PC ← PC + PC16, L1 ← L1r.DecOnly,c2;
Rx ← rhRx ← MD, XRefBr, push, GOTO[riilpRet1],c3;
}
{——————————————————————————————————————————————————————
RXLP
——————————————————————————————————————————————————————}
{@RXLP, alpha{pair}}
{Timing:5 clicks, + 2 if L remap, + 2 if fix map flags}
{entry:exit:
TOS =| inx|| data|
STK =| ~|| ~|
-->| v| -->| v|}
@RXLP:T ← Lbias, L0 ← L0.RedoR,c1, opcode[122’b];
L1 ← L1r.DecOnly, pop,c2;
T ← T + alpha.left, L2 ← L2.rxlp, push, GOTO[XLPcom],c3;
XLPcom:MAR ← Q ← [rhL,T + L],c1;
PC ← PC + PC16, BRANCH[$,LRemap6,1],c2;
TT ← MD,c3;
{rxlpRet}TT ← TT + TOS,c1, at[L2.rxlp,10,LGRemapCaller];
TT ← TT + alpha.right,c2;
Xbus ← ib, L0Disp,c3;
Map ← Q ← [rhMDS,TT], DISP4[XLPthings],c1;
XLPthings:
Noop,c2, at[L0.RedoR,10,XLPthings];
Rx ← rhRx ← MD, XRefBr, GOTO[RedoR],c3;
LRemap6:TT ← UvL, CALL[LGRemap] {will return to {rxlpRet} },c3;
{——————————————————————————————————————————————————————
RXLPL
——————————————————————————————————————————————————————}
{@RXLPL, alpha{pair}}
{Timing:6 clicks, + 2 if L remap, + 2 if fix map flags, + 1 if (ptr + alpha.right + index) crosses 64K}
{entry:exit:
TOS =| inx|| data|
STK =| ~|| ~|
-->| v| -->| v|}
@RXLPL:T ← Lbias, L0 ← L0.RedoLR,c1, opcode[143’b];
L1 ← L1r.DecOnly, pop,c2;
T ← T + alpha.left, push,c3;
XLPLcom:MAR ← Q ← [rhL,T + L], L2 ← L2.rxlpl0,c1;
PC ← PC + PC16, BRANCH[$,LRemap7,1],c2;
TT ← MD,c3;
MAR ← Q ← [rhL,Q + 1], L2 ← L2.RXxPLTail, GOTO[rxlplCom],c1;
{rxlpl0}MAR ← Q ← [rhRx,Q + 1], L2 ← L2.RXxPLTail,c1, at[L2.rxlpl0,10,LGRemapCaller];
rxlplCom:T ← TT{ptrL}, BRANCH[$,LRemap8,1],c2;
TT ← MD{ptrH}, GOTO[RXxPLTail],c3;
RXxPLTail:T ← T + TOS, CarryBr,c1, at[L2.RXxPLTail,10,LGRemapCaller];
T ← T + alpha.right, CarryBr, BRANCH[$,rxCar0],c2;
rhTT ← TT LRot0, BRANCH[rxMap,rxCar1],c3;
rxCar0:CANCELBR[$],c3;
rxCar1:TT ← TT + 1,c1;
rhTT ← TT LRot0,c2;
Xbus ← ib, L0Disp, GOTO[rxMapX],c3;
rxMap:Noop,c1;
Noop,c2;
Xbus ← ib, L0Disp, GOTO[rxMapX],c3;
rxMapX:Map ← Q ← [rhTT,T], DISP4[XLPthings],c1;
Noop,c2, at[L0.RedoLR,10,XLPthings];
Rx ← rhRx ← MD, XRefBr, GOTO[RedoLR],c3;
LRemap7:TT ← UvL, CALL[LGRemap] {will return to {rxlpl0} },c3;
LRemap8:TT ← UvL, CALL[LGRemap] {will return to {RXxPLTail} },c3;
{——————————————————————————————————————————————————————
RXGPL
——————————————————————————————————————————————————————}
{@RXGPL, alpha{pair}}
{Timing:6 clicks, + 2 if G remap, + 2 if fix map flags, + 1 if (ptr + alpha.right + index) crosses 64K}
{entry:exit:
TOS =| inx|| data|
STK =| ~|| ~|
-->| v| -->| v|}
@RXGPL:T ← Gbias, L0 ← L0.RedoLR,c1, opcode[145’b];
L1 ← L1r.DecOnly, pop,c2;
T ← T + alpha.left, push,c3;
XGPLcom:MAR ← Q ← [rhG,T + G], L2 ← L2.rxgpl0,c1;
PC ← PC + PC16, BRANCH[$,GRemap7,1],c2;
TT ← MD,c3;
MAR ← Q ← [rhG,Q + 1], L2 ← L2.RXxPLTail, GOTO[rxgplCom],c1;
{rxgpl0}MAR ← Q ← [rhRx,Q + 1], L2 ← L2.RXxPLTail,c1, at[L2.rxgpl0,10,LGRemapCaller];
rxgplCom:T ← TT{ptrL}, BRANCH[$,GRemap8,1],c2;
TT ← MD{ptrH}, GOTO[RXxPLTail],c3;
GRemap7:TT ← UvG, CALL[LGRemap] {will return to {rxgpl0} },c3;
GRemap8:TT ← UvG, CALL[LGRemap] {will return to {RXxPLTail} },c3;
{ E N D }