ToDragonCore^.paDateAugust23,1984FromRussAtkinsonLocationPARCSubjectDragonOpcodesOrganizationCSLXEROXReleaseas[Indigo]Doc>DragOps.tiogaLasteditedbyRussAtkinson,August23,19849:51:57amPDTAbstractThisdocumentdescribestheDragoninstructionsetasseenbythemachinecodeprogrammerandcompilerbuilder.DragonOpcodesCopyrightc1984byXeroxCorporation.Allrightsreserved.ThisdocumentisaDRAFT,andmostoftheinformationinitisvolatile.ThisdocumentisalsoINCOMPLETE,andshouldbeviewedwithsomesuspicion.RevisionsarecurrentlybeingsentthroughRussAtkinson.p_/ q_/_/B p_/(q_/3C8:?p[S q[SBp[S(q[S3CpWw qWwBApWw( qWw3CrO{sIQ otIQ!sG  tGg"%e).-0sD[ tD[)Y#Q&+ 3158;>2@G:B R?Ru2* 4t-4 v-4t-428{ %'+)  87w/))yt)))!!$&)= 12425;?-F,Gw(> t-(>(>! "%"(S,U 3:=QCG& z.TVm$DragonOpcodes2IntroductionTheDragonisamulti-processorgeneralpurposecomputercurrentlyunderdevelopmentintheComputerScienceLaboratoryatXeroxPARC.MostofthepartswillwillbefabricatedincustomCMOS.TheDragonwillhaveasharedaddressspaceof2^3232-bitwords.Itshouldhaveveryhighperformanceatrelativelylowcost.EachDragonprocessorhastwologicalparts,theIFU(instructionfetchunit)andtheEU(executionunit).TheIFUfetchesinstructionsanddirectstheEUtoperformarithmetic,logical,shifting,fetching,andstoringoperations.Therearealsotwocachesonmemory,onefortheIFUandonefortheEU.ADragonwordis32-bitswide.InthisdocumentwefollowtheMesaconventionofnumberingthebitsfromlefttoright,sothatthemostsignificantbithasindex0,andtheleastsignificantbithasindex31.ThiscorrespondstotheMesadeclaration:Word:TYPE=PACKEDARRAY[0..32)OFBOOL;TheremainderofthisdocumentassumessomefamiliaritywiththeMesalanguage,sinceweuseittodescribedataformatsandtheeffectofinstructions.TherearesomechangesassociatedwithputtingMesaonDragon,detailedin[Indigo]Doc>DragonMesaChanges.tioga.EUstateTheEUperformsvariousoperationsonlocalregisters,andcommunicateswiththeoutsideworldthroughacacheattachedtoabus(theM-bus).TheEUhasa32-bitALU,aFieldUnit(FU)forshiftingandotherfieldoperations,andamultiplierunit.TheEUhasasetofregistersthatcontainthemostrecentelementsofthedatastackforaprocess.Therearealsoregistersthatcontainconstants,aswellasspecialpurposequantities.Thisarchitecturepermitsmostelementaryoperationsinvlovinglocalvariablestobeperformedin1EUcycle.However,thisarchitecturerequiresspecialattentiontomigratingthecontentsofaprocessstackbetweenregistersandmemory.TheEUhasthefollowingregisters:Stackdenotesthestackregisters(ARRAY[0..StackSize)OFWord)StackSize=128incurrentversion.Localsdenotesthelocalregisters(Locals[x]==Stack[(x+L)MODStackSize])notethatLocalsisaliasedwithStack.AuxRegsdenotestheauxilliaryregisters(ARRAY[0..15]OFWord).Mostoftheseregisterswillbeusedforruntimesupportforhigher-levellanguages(i.e.Mesa).ConstantsisanarrayofregistersintheEU(ARRAY[0..11]OFWord).Althoughtheseregistersarenotreallyconstantasfarasthehardwareisconcerned,theyareusedtoholdconstantsintheMesaruntime.TheyaremoregeneralthantheAuxRegsinthattheycanbeusedinmoreaddressingmodes.Fielddenotesaspecialregisterthatcanbeusedtocontrolthefieldunitoperations,andalsoparticipatesinmultiplicationanddivision.MAR(MemoryAddressRegister)denotestheregisterwhichholdstheaddressgiveninthelastmemoryoperation.ItisusedtoreportEUpagefaults.xg$)tgIy^ q[  -V"(.F4#8% @UBDaY  BA!%p'K)-W0$25 ;=dBDHXW >#m%4(,137:>AD IVV ~T4  ZTbx!%'* 2958;> @ G:R  ; $&&)x+[0 7<B]H7P }  \)!&%(+-02598H:=?BHNj !` :")^+/2=5 =>EHML  gpH+  &(+u/T03639m @BJDHK   U^ HpsHH,qHpHHrHqH!p%HH&H'q+&HHF$  s$(N /2i48?BEGI@D} KKFS ! *-0L39 ?jBGEB  Jt0BB+y<7  q8  V5 "& +.~ 7y:<AE7@ 1ype#V&J(+,046$9=5@C'H75   y "3  K#&)z-3U5 7i:l=@AAF1v  ^I #$').\3 ;!>Y E/   "%+-/68:4=AHM.' !o#:),13g49=-BH7, *  O#5 z'q'\"2p"''#q''R p/''0q'1z% 1n#X"q"it"| (, p4""5q"7] z 1/["B%=q { !'p'}(Qq,3p0N1*q2w7;o=8@FCHJ  '-0zwqwYB"a$&r(p)www*Jqw.p2+ww3qw4G9?C6HF\+!'( /25>8w:!=OC>DGE)Yl# &K(.03|69N;Z>@{D* zq t0"N%\(&*W-/47R:= E+H"^ X "z q  F#(+}048; @3DEHn ;| d "N&r(,C TVm$iDragonOpcodes3IFUstateTheIFUturnsastreamofvariable-lengthinstructionsintosignalsthatcontroltheEU.Italsoperformsaddresscalculationsusedforjumps,callsandreturns.TheIFUcontainsasmallstackofthemostrecentprocedurecontexts.AprocedurecontextfortheIFUissimplyaprogramcounter(PC)andanindexintotheEUstackgivingthebaseofthelocalvariables.TheIFUhasthefollowingregisters(actuallymorethanthese,butforsimplicity):PCistheprogramcounter(abyteaddress).Instructionspaceislimitedto2^32bytes(roughly4gigabytes),eventhoughthefullDragonaddressspaceis2^32words.Sisthestackpointer(anindexintoStack).Manyinstructionstakeoperandsimplicitlyusingthestack.Procedurecallsusethestackforargumentsandreturns.Lgivesthebaseofthelocalframe(anindexintoStack).Thefirst16registersatoraboveLareeasilyaddressablethroughDragoninstructions.SLimitgivesthelimitforS.AstackoverflowoccurswhenSisincrementedtoreachSLimit.xg$)tgIy_  }q[  2$i +.346:=8@B:EZ  @| 5#D%W  Q*g!%5)a/637>TC1EwGU  X!~#o'9*,q.2o68< =@#Cj Sm  H %)?,e0G25 zPqPs" #*S 1_5%6;c=!@wDIOK $7!&+/a04zLqLkA"%*/.6 58> DHK)]o $A&~--/zHqH{f $$&&*s-W2y5]8A:2?AFCG#HG 7o#o zDqD! +!%**/245 =n?BhTVm$DragonOpcodes4InstructionformatsThissectiondescribesthevariousinstructionformats.Notethatthedescription[0..255]specifiesanunsignednumberoccupying8bits,while[-128..127]specifiesasignednumberoccupying8bits.Thedescriptionoftheinstructionformatgivestentativebitassignments,followedbyalistoftheinstructionsusingtheformat(in{}brackets),followedbyaroughdescriptionofhowtheformatisinterpreted.ArithmeticinvolvingSorLwillalwaysbeperformedmodulothesizeoftheEUstack,withoutdetectionofunderfloworoverflow.Wewillnotfurtherindicatethislimitationofprecision.Forconvenience,weusethefollowingabbreviationstorefertonumbersobtainedfrombytesthatfollowtheopcodebyte:Alphaisthefirstbyteaftertheopcode.AlphaZisAlphaextendedto32bitswithhigh-order0s.AlphaSisAlphaextendedto32bitswiththesign(high-order)bitofAlpha.Betaisthesecondbyteaftertheopcode.BetaZisBetaextendedwith0s.Whentakenasapairoffourbitnumbers,BetaListheleftmosthalfofBeta,andBetaRistherightmosthalf.Gammaisthethirdbyteaftertheopcode.Deltaisthefourthbyteaftertheopcode.AlphaBetaistheunsignedunalignedhalfwordfollowingtheopcodebyte,interpretedasAlpha+Beta*256.AlphaBetaZisAlphaBetaextendedto32bitswith0s.AlphaBetaSisAlphaBetaextendedto32bitswiththesign(high-order)bitofAlphaBeta.AlphaBetaGammaDeltaisthe32-bitunsignedunalignedquantityfollowingtheopcodebyte.ThenumberisinterpretedasAlphaBeta+256*256*(Gamma+Delta*256).OI-OperationImplicit[op:[0..255]]--1byte{ADD,BNDCK,DIS,DUP,EXCH,EXDIS,J1,LCn,MDIV,MUL,RDIV,RETN,RETT,SFC,SFCI,SJ,SUB,UDIV,UMUL}ForOIinstructionstheoperand(ifany)isimplicitintheopcode.OB-OperationByte[op:[0..255],lit:[0..255]]--2bytes{ADDB,ARL,AS,ASL,CST,EP,IN,J2,JB,LEUR,LIB,LIFUR,OUT,PSB,RB,RET,RSB,SEUR,SIFUR,SUBB,WB,WSB}ForOBinstructionstheoperandisgivenbyAlphaZorAlphaS.ODB-OperationDoubleByte[op:[0..255],lit:[0..65535]]--3bytes{ADDDB,FSDB,J3,JDB,LFC,LGF,LIDB,SHL,SHR}ForODBinstructionstheoperandisgivenbyAlphaBetaZorAlphaBetaS.OQB-OperateQuadByte[op:[0..255],addr:Word]--5bytesxg$)tgIy^ Wq[  I)T  ' -1;4L6 >DCBHY Sr $~ +B02C6<BD;HXX E 0 $=), 49;= ?WA C V  p} $W&R'|+~ 24I7N9>(? T5 1i"$v+?0X25l7)9<?DR  ="7&, . 46 P  " *,A/1V7<@>CFNl  KzKqK#k!z'KK(qK,.62k8e:%<>A HzJIqJIY|e !$'*, 468zGqGO7 @"z(oGG)bqG,.(1\7R:|=-ASE"FHF'zF'F'qF' "(0*,03z2F'F'3qF'78:AzCqCQa "z(CC)qC,W-0"4\7l:=zA0qA0O%"+1)38v; CDI ?z??q?B$I*+-03z5??6q?<>VE=C^ $b&(9 z;gq;g $*06<? CH9; g$+& 1Y3> x3   q0z0 @q.+{.+.+qF.+.+{.+.+qL.+.+{.+.+q.+.+{q.+.+Iq.+.+{.+.+q!'.+.+{!.+.+"q&-.+.+{&.+.+'q(.+.+{)y.+.+*Qq,.+.+{,.+.+-q0/.+.+{0.+.+1q3.+.+{4T.+.+5,q7.+.+{8.+.+9Zq;.+.+{<.+.+=q@.+.+{@.+.+AqCf.+.+{D4.+.+E qG.+.+{Hb.+.+I:qJ.+{,q,,{s,,Jq,,{,,q,,*  5!#&(X-c/1qx&  vq#k7z#kQ q { q { q {_ 6q { qr {O &q { q!b {"? #q# {$ %q&z {'W (/q) {) *q-B {. .q0 {1 2Zq5 {6 7nq9 {9 :q< {=^ >6q? {? @qBr {CN D&qE {F GqJ {IqFII{"IIqII{^II6qII{IIqrII9 "[#'{)w.0Ex   q07 z0; !q{q{q2{q{sq#{q {!c";q#{$%q('{))q+{,h-@q.:X #z$(* 2A4 x  q z  !9TVm$DragonOpcodes5{DFC,J5,LIQB}ForOQBinstructionstheoperandisAlphaBetaGammaDelta.JBB-JumpByteByte[op:[0..255],dist:[-128..127],lit:[0..255]]--3bytes{JEBB,JEBBJ,JNEBB,JNEBBJ}ForJBBinstructionsthenewPCisthebyteaddressgivenbyPC+AlphaS.BetaZisusedforcomparisonwiththetopofstack.LR-LocalRegister[op:[0..15],reg:[0..15]]--1byte{LRn,SRn}ForLRinstructionstheoperandisLocals[reg],whichiseitherpushedtoorpoppedfromthestack.LRB-LocalRegisterByte[op:[0..15],reg:[0..15],disp:[0..255]]--2bytes{LRIn,SRIn}Fortheseinstructions,theoperandis(Locals[reg]+AlphaZ)^,whichiseitherpushedtoorpoppedfromthestack.LRRB-LocalRegisterRegisterByte[op:[0..255],disp:[0..255],reg1,reg2:[0..15]]--3bytes{RAI,RRI,WAI,WRI}Forallinstructions,reg1(BetaL)indicatesalocalregister.ForRRIandWRI,reg2(BetaR)indicatesalocalregisteraswell.ForRAIandWAI,reg2indicatesanauxilliaryregister.RR-RegistertoRegister[op:[0..255],c,a:[0..15],aOpt,cOpt,bOpt,aux:BOOL,b:[0..15]]--3bytes{RADD,RAND,RBC,RFU,ROR,RRX,RSUB,RUADD,RUSUB,RVADD,RVSUB,RXOR}FortheseinstructionstheeffectisroughlyRc_RaopRb.SEisusedtoindicatetheeffectoftheinstructiononS.SE_0atthestartoftheinstruction,andS_S+SEattheendoftheinstruction.Ra:IFNOTaOptTHENIFauxTHENAuxRegs[a]ELSELocals[a]ELSESELECTaFROM<12=>Constants[a]12=>Stack[S];13=>Stack[S-1];14=>Stack[S];SE_SE-115=>Stack[S-1];SE_SE-1Rb:IFNOTbOptxg$)tgIq_'{_'_'qF_'_'{#_'_'q_'_'{_'_'q_'_'\L  #o$xY\  qV  "@zV ')Y*qS{SSqSS{SSq2SS{SSqFSS{#SSq"2SSQ !0#%G'+0$46+ ?yCEIHOo m\xL  U H(qHT,zHqFU{FUFUqFFUFU{#FUFUqFUFUC% ":# *.0T4<9:,q@ F FR  !#g(-k/y246f9;`@BFH#  $ %(# /V2 879@B p$bqdp|p-| p#E#|&pXXn|XApkXX$|1eJd  1 dp | a1adpa|a1dp|p"|$p%|&s&1dp|p"|$p%|&s&q p F q TVm$NDragonOpcodes6THENIFauxTHENAuxRegs[b]ELSELocals[b]ELSESELECTbFROM<12=>Constants[b]12=>Stack[S];13=>Stack[S-1];14=>Stack[S];SE_SE-115=>Stack[S-1];SE_SE-1Rc:IFNOTcOptTHENIFauxTHENAuxRegs[c]ELSELocals[c]ELSESELECTcFROM<12=>Constants[c]12=>Stack[S];13=>Stack[S-1];14=>Stack[S+1];SE_SE+115=>Stack[S+1];SE_SE+1RJB-RegisterJumpByte[op:[0..255],dist:[-128..127],sdd,sd,opt,aux:BOOL,reg:[0..15]]--3bytes{RJEB,RJEBJ,RJGB,RJGBJ,RJGEB,RJGEBJ,RJLB,RJLBJ,RJLEB,RJLEBJ,RJNEB,RJNEBJ}FortheseinstructionstheeffectistojumptothebytePCgivenbyPC+AlphaSiftheindicatedcomparisionofRawithRbistrue.BetaisdecodedasmuchaspossibleinthesamewaythatBetaisdecodedfortheRRformatinstructions.Thecomparisionisalwaysmadeinvolvingeither[S]or[S-1]witharegisterdeterminedbythedecodingofBeta.SEisusedasintheRRformatdescription.IFsddTHENSE_SE-1Ra:IFsdTHENStack[S-1]ELSEStack[S]Rb:IFNOToptTHENIFauxTHENAuxRegs[reg]ELSELocals[reg]ELSESELECTregFROM<12=>Constants[reg]12=>Stack[S];13=>Stack[S-1];14=>Stack[S];SE_SE-115=>Stack[S-1];SE_SE-1xg$)tgIp_,_,|_,p-_,_,|_, p#g_,_,$ |_,&p]]n|]Ap]]F|[1eJ[d Z61Z6dpZ6|Z6X1XdpX|XV1VdpV|VpV"|$VpV%|&sVV&U@1U@dpU@|U@pU@"|$U@pU@%|&sU@U@&qRpRRRWqRYpQQ|Qp-QQ|Q p#;QQ#|Q&pOvOvn|OvAp`OvOv|M1eJMd L(1L(dpL(|L(J1JdpJ|JH1HdpH|HpH"|$HpH%|&sHH'G21G2dpG2|G2pG2"|$G2pG2%|&sG2G2'xC  };q@ p)~@@*8q,@@-0^z@5P67q>{>>q>>{>>q>>{>>q7>>{>>q 0>>{ >>!q%(>>{%>>&q*>>{+>>,q/>>{/>>0q4>>{4>>5q9 >>{9>>:q>>>{?>>@s qI>>;o Z"<#%)8*-r0368ABD9  $='_(.?/35i:B)DG8P|71 (+ 349^= C)GI*613D !:#%d+3,024738:^<?"C p4-q4-pL4-4-4-qj4-p4-rq4-4-D1p11$q1bp111q1p1q1*p;11q1!p%1q1%/7p/7/7iq/7kp--|-p---|- p$z--%3|-' p++n|+Ap++Y|*A1eJ*Ad (1(dp(|(&1&dp&|&%K1%Kdp%K|%Kp%K"|$%Kp%K%|&s%K%K&#1#dp#|#p#"|$#p#%|&s##&TVm$DragonOpcodes7InstructiondescriptionsThefollowingisalistoftheinstructionscurrentlyplannedforthefirstversionoftheDragonIFU.Thisinstructionsetisrelativelysparse,toleaveroomformoreadvancedIFUs.Notation[x]meansthecontentsofEUregisterx.Hence[S-1]isthesecondwordonthestack(arithmeticwithinsquarebracketsisperformedmodulothestacksize).SisthestackpointerandListheRegisterLocalpointer(so[L+1]isregisterlocal1).(y)^isthecontentsofmemorylocationy.LoadsandStoresNameformatopcodesDUPOI1DUPlicate.[S+1]_[S];S_S+1.EXCHOI1EXCHange.temp_[S];[S]_[S-1];[S-1]_temp.EXDISOI1EXCHangediscard.[S-1]_[S];S_S-1.LCnOI8LoadConstantn.[S+1]_Constants[n];S_S+1.nindicatesoneofthefirst8constantregisters.LIBOB1LoadImmediateByte.[S+1]_AlphaZ;S_S+1.LIDBODB1LoadImmediateDoubleByte.[S+1]_AlphaBetaZ;S_S+1.LIQBOQB1LoadImmediateQuadByte.[S+1]_AlphaBetaGammaDelta;S_S+1.LIQBisusefulforloading32-bitconstants.LRnLR16LoadRegistern.[S+1]_[L+n];S_S+1.SRnLR16StoreRegistern.[L+n]_[S];S_S-1.Reads&WritesNameformatopcodesLGFODB11LoadGlobalFrame.[S+1]_([GB]+AlphaBetaZ)^;S_S+1.xg$)tgIy^ W q[  N{z #@)!.r035:<{>CGY P A k#')-m3zW qU ti5 %',_/1,38D;=@lC SbS$L)b+/4PZ%a #O(,|1E3791>AVNkR !G&}xK zG GGm{ER qERERmB  {@\ q@\@\m=> #! {;f q;f;fm8b !G{6p q6p6pm3{t3q3K&{1yq1yk%[ {. q..m, &{* q**m'|!.T{% q%%m"R ^4G{ q ^v" { qm%+ "{ qm/7 x z m{  q  m !- >~.%TVm$ DragonOpcodes8Thisoperationisusedtoloadglobalframes.GBdenotesauxilliaryregister0intheEU.Unfortunatelywehavetohaveaglobalframetable,butatleastitisquitelarge(64Kframes).Thedecisiontousethisinstructionisnotentirelyfinal,sinceLIQBmaybepreferable.LRInLRB16LoadRegisterIndirectn.[S+1]_([L+n]+AlphaZ)^;S_S+1.PSBOB1PutSwappedByte.([S-1]+AlphaZ)^_[S];S_S-1.RAILRRB1ReadAuxilliaryregisterIndirect.[L+BetaL]_(AuxRegs[BetaR]+AlphaZ)^.RBOB1ReadByte.[S]_([S]+AlphaZ)^.RRILRRB1ReadRegisterIndirect.[L+BetaL]_([L+BetaR]+AlphaZ)^.RRXRR1ReadRegisterindeXed.[Rc]_([Ra]+[Rb])^.RSBOB1ReadSaveByte.[S+1]_([S]+AlphaZ)^;S_S+1.SRInLRB16StoreRegisterIndirectn.([L+n]+AlphaZ)^_[S];S_S-1.WAILRRB1WriteAuxilliaryregisterIndirect.(AuxRegs[BetaR]+AlphaZ)^_[L+BetaL].WBOB1WriteByte.([S]+AlphaZ)^_[S-1].S_S-2.WRILRRB1WriteRegisterIndirect.([L+BetaR]+AlphaZ)^_[L+BetaL].WSBOB1WriteSwappedByte.([S-1]+AlphaZ)^_[S];S_S-2.ArithmeticandlogicalAllarithmeticisperformedusing32-bit2s-complementarithmetic.ProvisionsaremadeforextendedprecisionarithmeticbyusingCarryforsomeinstructions.Integeroverflowisdetectedandtrappedformostarithmetic.Overflowisdefinedtooccurforadditionifthetwooperandshaveequalsignandthesignoftheresultisnotequaltothesignoftheoperands.Overflowcannotoccurforadditioniftheoperandsignsdiffer.Overflowisdefinedforsubtractionbyconsideringittobeadditionwithmodifiedoperands.Somelangauges,especiallyLisp,needtodistinguishbetweennumbersandaddresseswithinaword.TheconventioninDragonistoprovidecheckingforLispNaN(NotaNumber),whichisdefinedtooccurwhenthetwotopbitsofawordarenotequal.LispNaNcheckingisperformedonbothoperandsandxg$)tgIq_/~"'-05 BUH[f+ !"r$)-o{0[[1q[479 {Ye qYeYemV1X/\{To qToTomQ(c{Ox qOxOxmL "#{J qJJmH{E qEEmC{@ q@@m>|{; q;;m9$'{6 q66m4-=d-V{1 q11m/7 Z8#@#{, q,,m*@$2{' q''m%JR[{" q""m T)x Zq  s *# - 5N <>BE  KG"%  X># %H( 06 7t"ADI  wNa"%9(G*+,02C48:=2@@B%DE  "$* -2}8:3?UA H ?D5$"  o !!#7 *./5X8>.BxCH { T {&T(+/p24:>@FEcG.  V #y(/+W.46<>BBH7:TVm$DragonOpcodes9results.NameformatopcodesADDOI1ADD.[S-1]_[S]+[S-1];S_S-1.Carryisnotusedorset.Traponintegeroverflow.ADDBOB1AddByte.[S]_[S]+AlphaZ.Carryisnotusedorset.Traponintegeroverflow.ADDDBODB1AddDoubleByte.[S]_[S]+AlphaBetaZ.Carryisnotusedorset.Traponintegeroverflow.BNDCKOI1BouNDsChecK.BoundsChecktrapif[S-1]<0OR[S-1]-[S]>=0;S_S-1.NochangetoCarry.Thisinstructionisusedtocheckindexesagainstbounds.Itisalsousedwhenanumberisnarrowedtofitintoasubrange.MDIVOI1ModulusDIVide.[S-2],[S-1]=[S-2],[S-1]MDIV[S];S_S-1.Initially,x=[S-2],[S-1](mostsignificantwordin[S-2]),y=[S],then[S-2]_q;[S-1]_r;wherex=q*y+r,and|r|<|y|,andSign[r]=Sign[y].Integeroverflowtraponoverflowordividebyzero.MULOI1MULtiply.[S-1],[S]_[S-1]*[S].Signedmultiplication,32x32->64bits.Notrapspossible.RADDRR1RegisterADD.Rc_Ra+Rb+Carry.Carry_0.Traponintegeroverflow.RANDRR1RegisterAND.Rc_RaANDRb.RBCRR1RegisterBoundsCheck.BoundsChecktrapifRa<0ORRa-Rb>=0;Rc_Ra.NochangetoCarry.Note:ifRb=FIRST[INT],RBCwillfaultwhenRa<0,whichisusefulforassignmentsbetweenINTandCARD.RDIVOI1RemainderDIVide.[S-2],[S-1]=[S-2],[S-1]RDIV[S];S_S-1.Initially,x=[S-2],[S-1](mostsignificantwordin[S-2]),y=[S],then[S-2]_q;[S-1]_r;wherex=q*y+r,and|r|<|y|,andSign[r]=Sign[x].Integeroverflowtraponoverflowordividebyzero.RLADDRR1RegisterLispADD.Rc_Ra+Rb.Carry_0.TraponintegeroverfloworLispNaN.RLSUBRR1RegisterLispSUBtract.Rc_Ra-Rb.Carry_0.TraponintegeroverfloworLispNaN.RORRR1xg$)tgIq_/ zZ8 Z8Z8m{W qWWmUA"7&')-5.15M7T;{R qRRmPJ)5 $%(`+-`0Y35:X{M qMMmKS)*(5,-/3247;K=RA{H qHHmF\HH"%p&* +Ap,vF\F\-RqF\.3680=P?DZF C @m !&+O02S36l9==>WCtDB9d{? q??m=BP {!@ p'j=B=B({q=B*-e2E 78:v @DV ;FSm#:$&)+U,02%4 689<>n?ADI 9D "(*P.~0z{7x q7x7xm4w$ "y' 0/4%57;5=@{2 q22m0q%,5/165{- q--m+qp++q+ !{( q((m&vz"&)+=-t./2458:157m;= Et Mq Mt M Mqr M M{ qmVn "Q$y p+VV+qV.170 <>c@ G * #]&)+D-0?13I7_8:t=?@^CDEH7~c$H',)2.046{ qmq2$*-/4:A<?{ qmq[%_+/1175;=F@`{ q  myTVm$:DragonOpcodes10RegisterOR.Rc_RaORRb.RSUBRR1RegisterSUBtract.Rc_Ra-Rb-Carry.Carry_0.Traponintegeroverflow.RUADDRR1RegisterUnsignedADD.Rc_Ra+Rb+Carry.Carry_adderCarryOut.Notrap.RUSUBRR1RegisterUnsignedSUBtract.Rc_Ra-Rb-Carry.Carry_NOT[adderCarryOut].Notrap.RVADDRR1RegisterVanillaADD.Rc_Ra+Rb.Carrynotaffected.Notrap.RVSUBRR1RegisterVanillaSUBtract.Rc_Ra-Rb.Carrynotaffected.Notrap.RXORRR1RegisterXOR.Rc_RaXORRb.SUBOI1SUBtract.[S-1]_[S-1]-[S];S_S-1.Carryisnotusedorset.Traponintegeroverflow.SUBBOB1SubtractByte.[S]_[S]-AlphaZ.Carryisnotusedorset.Traponintegeroverflow.UDIVOI1UnsignedDIVide.[S-2],[S-1]=[S-2],[S-1]UDIV[S];S_S-1.Initially,x=[S-2],[S-1](mostsignificantwordin[S-2]),y=[S],then[S-2]_q;[S-1]_r;wherex=q*y+r,andr64bits.Notrapspossible.FieldunitoperationsNameformatopcodesFSDBODB1FieldSetupDoubleByte.Field_AlphaBeta.StoresAlphaBetatoFieldtosetupthefielddescriptorforafieldunitoperation.RFURR1RegisterFieldUnit.Rc_FieldUnit[Ra,Rb,Field].Thisageneralshiftoperation,includingextract,insert,andshift.TheFieldregistersuppliesthefielddescriptor.SHLODB1SHiftLeft.[S]_FieldUnit[[S],0,AlphaBeta].xg$`)StgHq_/qp_/_/q_/{\ q\\mZ8qA&,/16{W qWWmU@qM+ 4;;@={R qRRmPIq u,Op0PIPI1q32PIPI37v >AA{M qMMmKRq.%),2)4{H qHHmFZq.'*-W3k5{C qCCmAcqpAcAcqAc{> q>>m2C)Hc? { qm k "[ TVm$DragonOpcodes11ThisoperationshiftsandmaskssinglewordsaccordingtothefielddescriptorinAlphaBeta.Itisespeciallyusefulforshiftingleft.SHRODB1SHiftRight.[S]_FieldUnit[[S],[S],AlphaBeta].ThisoperationshiftsandmaskssinglewordsaccordingtothefielddescriptorinAlphaBeta.Itisespeciallyusefulforshiftingright,rotating,andextractingfields.IFUindexadjustinginstructionsNameformatopcodesALOB1AddtoL.L_L+AlphaZ.Thisinstructionisespeciallyusefulforsavingandrestoringstackframes,butmayhaveotherexoticuses.ASOB1AddtoStack.S_S+AlphaZ.Stackoverflowisnotcheckedbythisinstruction,soitisprimarilyusefulfordiscardingwordsfromthestack.ASLOB1AddtoStackfromL.S_L+AlphaZ.Stackoverflowisnotcheckedbythisinstruction,soitisprimarilyusefulfordiscardingwordsfromthestackwhenthedistancefromLisknown,butScouldbeatanylevel.DISOI1DIScard.S_S-1.EPOB1EnterProcedure.L_S+Alpha.Thisinstructionisusedatprocedureentrytoestablishthebaseofthelocalframe.UnconditionaljumpsNameformatopcodesDJOQB1DirectJump.PC_AlphaBetaGammaDelta.JBOB1JumpByte.PC_PC+AlphaS.JDBODB1JumpDoubleByte.PC_PC+AlphaBetaS.JnO*4nIN{1,2,3,5}.JumpstobyteaddressPC+n.Thesejumpinstructionsareimplementedasnullxg$`)StgHq_/:u&"&*302E47 >w@6 GI] C[{[ q[ [ mXw!$ V:u&"&*302E47 >w@6 GITn C[#8(+h 1xQ  r zM MMm{KT qKTKTmH) F]! Z #%*,2e5:=@CTFD{B: qB:B:m?)i =Dzn=D=D7q=D X"Q$ , -/506:< C}G;n{9! q9!9!m6); 4*zn4*4*7q4* X"Q$ , -/506:< C}G2nC"$%*`,.,1358!{0 q00m-d{+ q++m( B &( oD$(Z* /25696<|x" z{ {{m{ qmH{ q  m { qm{ qm{ p jq A~ Xb"q'[{* q +c,04d ;> FhHjTVm$WDragonOpcodes12operationsforspeed.J4isnotanopcodebecausethereareno4byteopcodes.SJOI1StackJump.PC_PC+[S].S_S-1.Thisoperationisusefulforcomputedjumps.ConditionaljumpsEachofthefollowingconditionaljumpstakestwoopcodes:onewherethepredictionistonotjump(notrailingJtotheopcode),andonewherethepredictionistojump(atrailingJtotheopcode).Comparisontreatsthetwonumbersas32-bitsignednumbers,unsignedcomparisonsbeingjudgedlesscommon.NameformatopcodesJEBB(J)JBB2JumpEqualByteByte.IFBetaZ=[S]THENPC_PC+AlphaS.S_S-1.JNEBB(J)JBB2JumpNotEqualByteByte.IFBetaZ#[S]THENPC_PC+AlphaS.S_S-1.RJEB(J)RJB2RegisterJumpEqualByte.IFRa=RbTHENPC_PC+AlphaS.RJGB(J)RJB2RegisterJumpGreaterByte.IFRa>RbTHENPC_PC+AlphaS.RJGEB(J)RJB2RegisterJumpGreaterEqualByte.IFRa>=RbTHENPC_PC+AlphaS.RJLB(J)RJB2RegisterJumpLessByte.IFRawA zM MMm{KR q LKR{KR qKRKRKRmHp$HHqH"$p&HH'qH* 6a{FZ q#FZ{FZquFZFZFZmCpCC _qC!%'p)CC*YqC-e 93{Ac q LAc{Ac qAcAcAcm>qHJpW>>q> p&a>>'q>*' {CeDG#+d#N&]) { i q i imTVm$<DragonOpcodes13StackFunctionCallIndirect.CallsprocedureviaPC_([S])^.ThereturnPCandcurrentLaresavedintheIFUstack(possiblycausingIFUstackoverflow).RETOB1RETurn.Returnsto(PC,L)savedinIFUstack(stackunderflowtrapifIFUstackisempty).ThestackisadjustedtoS_L+Alpha.RETNOI1RETurnNoadjustment.Returnsto(PC,L)savedinIFUstack(stackunderflowtrapifIFUstackisempty).ThereisnochangetoS.RETTOI1RETurnfromTrap.Returnsto(PC,L)savedinIFUstack(stackunderflowtrapifIFUstackisempty).Trapsareenabledonreturn.ThereisnochangetoS.SpecialoperationsNameformatopcodesCSTOB1ConditionalSTore.Takes3wordsofdataonthestack:ptr=[S-2],new=[S-1],old=[S].[S+1]_(ptr+AlphaZ)^{hold};IF[S+1]=oldTHEN(ptr+AlphaZ)^_newELSE[]_(ptr+AlphaZ)^{releasehold};S_S+1.CSTisusedtoacheiveatomicmodificationofstoragethatissharedbetweenmultipleprocessors.Thesampledvalueispushedontothestacktobetestedagainsttheoldvalue.Iftheyareequalthestorewassuccessfulinupdatingthedesignatedword.INOB1INputoperation.[S]_([S]+AlphaZ)^;bypassescache.Detailstobesupplied.LEUROB1LoadfromEURegister.[S+1]_PReg[Alpha];S_S+1.LEURreadsdatafromtheEUregisterindicatedbytheAlphabytetothestack.RegisterassignmentsaregivenbyDragOpsCross.ProcessorRegister.LIFUROB1LoadfromIFURegister.[S+1]_PReg[Alpha];S_S+1.LIFURreadsdatafromtheIFUregisterindicatedbytheAlphabytetothestack.RegisterassignmentsaregivenbyDragOpsCross.ProcessorRegister.OUTOB1OUTputoperation.([S]+AlphaZ)^_[S-1];S_S-2;bypassescache.Detailstobesupplied.SEUROB1StoretoEURegister.PReg[Alpha]_[S];S_S-1.SEURstoresawordfromthetopofstackintoadesignatedEUregister.RegisterassignmentsaregivenbyDragOpsCross.ProcessorRegister.SIFUROB1StoretoIFURegister.PReg[Alpha]_[S];S_S-1.xg$`)StgHq_'!I$+- 58<?JB#GH]i"/'*'- {[ q[[mXL~&E $#%(,/69]:=A.BHVg {Tf qTfTfmQ{ "$')-}/*2859@+CDnG{PDz  v}!%"{M qMMmKN_ "g%'+o-.0N37>xAmBEII~!&*+|-2*3xFW  zC CCm{@ q@@m> 3 $&),.25#74:>@CFtHpC 6@A #&%{(*,n0\47C9>?BDH4k m!$B +{2~ q2~2~m06 <%+0)468o{- q--m+  + {(q(^J O%*,/3!679>CY &b{$o q$o$om! V+{yqyH #)/[14G8< >@E {V qVVm (-A27<+=?{` q``m\%'N{iqi #$(A+#,V 3/5;@ H{ G q G Gm \k'kTVm$DragonOpcodes14SEURstoresawordfromthetopofstackintoadesignatedIFUregister.RegisterassignmentsaregivenbyDragOpsCross.ProcessorRegister.ProcessorRegisters(Note:thisdescriptionispartial).IntheIFUweneedthefollowingregisters:Status-containstrapenable/disablebit.Maycontainotherbitsaswethinkofthem.EldestL-containseldestLintheIFUstack.EldestPC-containseldestPCintheIFUstack,readingthisregisterremovestheeldestentry,whilewritingthisregisteraddsaneweldestentry.YoungestL-containsyoungestLintheIFUstack.YoungestPC-containsyoungestPCintheIFUstack.Thisisusefulintraproutinesthatneedtoexaminecode,orincaseswherethetraproutinewantstoskiptheoffendinginstruction.SLimit-containscurrentstacklimit.L-containscurrentvalueofLregister.(Not:notavailablethroughLIFURandSIFURforcurrentIFU)S-containscurrentvalueofLregister.(Not:notavailablethroughLIFURandSIFURforcurrentIFU)IntheEUweneedthefollowingregisters:Field-FieldUnitControl.MAR-MemoryAddressRegister.ThingsleftoutThereareseveralinstructionsleftoutoftheabovelist,forvariousreasons.Tofirstapproximationthesearethefloatingpointoperations.XOPsXOPsaretheundefinedinstructionsintheinstructionset.Topermitefficientemulationofextendedinstructionsets,allXOPsbehaveasprocedurecallstoanaddresslinearlydependentontheinstructioncode.XOPshavedifferentlengths,dependingontheinstructioncode.AllXOPsofmorethan1bytepushAlphaBetaGammaDeltaontothestackbeforetheycall,althoughpartsofAlphaBetaGammaDeltaarenotused,dependingonthelengthoftheXOP.Forimplementationreasonssomeundefinedoperationsdonottrap,butalsodonotproducewell-definedresults.TheseoperationswillbedetailedwhenthePLAfortheIFUissufficientlydetermined.TimingestimatesThissectiongivesapproximatetimesfortheDragoninstructionset.Overall,anestimateof2cyclesperinstructionisagoodguessforaveragetime.cyclesoperation36?MDIV,RDIV,UDIV19?MUL,UMUL8CSTxg$`)StgH{_/q_/ U"$'*, 25;A H]xZ9 @qV U  uTo  )Q  R(%m $'*/3M579=c?P$"q "%NW< "/$'+S0@27=?pCUG:L1c!"%)Ku!<"$U&)I! {"L$&a(+0G3k49:=CEI@Gz1H "-&E(+0Q4258;.An E!=C} ?!z&CC'm*-2}7CC8zC<}?LCC@$zCDF@A1q@ eng +!z&@ @ ']*- 2}7@ @ 8z@ <}?H@ @ @ z@ D F@>a1q;  ) 9I8 x4 }q1l  V Z!Y#%),2.y3K9;K>- Ge/  ?I x,v {)' q t)')' 3 !"% ,/2G6)Z,H257GFHy"  EK{ ""!q#""   xW%z ,).1036f93;;=C g  rc#'P),/2146 = y q{  ? ; #>%* 149;AjC1DtHy 3]y!zXXqj{j!q$rjj{%Ojj&'q(jj{)jj*cq |{ |!q# | |{$w | |%Oq { !TVm$DragonOpcodes155conditionaljumpincorrectlypredicted5SFCI,SFC,SJ4SIFUR32,3,5byteXops21byteXops2conditionaljumpcorrectlypredicted2JB,JDB,DJ,returns,LFC,DFC2EXCH1allothersAdditional1cycledelaysarecausedbythefollowing:*usingtheresultsofacachefetchonthenextEUcycle*aword-boundaryspanninginstructionwhentheinstructionbufferisempty(forexample,jumpingtoaninstructionthatspansawordboundary)Returnsaredelayeduntilpreviouscallsorreturnshavecompleted(3cyclesfromstartofpreviouscallorreturn).Thereareadditionaldelaysduetothefetch-aheadoftheinstructionbuffer.AtthestartofeveryIFUcycleafetch-aheadisperformedifthebusisnotbusyfromtheprevioususeoftheIFUcache.Thismaycausethebustobebusywhenthereisacachemiss,butotherwisedoesnotaddcycles.Forstraightlinecodetheinstructionbuffercanusuallykeepupwithcachemisses.FortheEUcache,assume6cyclesforwritingadirtyvictim,6cyclesforaquadread,and6cyclesforamapmiss.Thesewilltakemoretime,ofcourse,whenthereiscontentionbyotherprocessors.OpcoderestrictionsThissectiondescribesthevariousrestrictionsonopcodes.TheserestrictionsreducetheamountofhardwareintheIFU.Furtherrestrictionsmaybeimposed.ChangesaremostlyatthewhimoftheIFUdesigner(theserestrictionshavebeenchangedseveraltimes).InstructionlengthTheinstructionlengthisinferredfromthe3highbitsoftheopcodebyteasfollows:000=>1byte[000B..037B](1byteXOPs)001=>5bytes[040B..077B]OQBformat01x=>1byte[100B..177B]OI,LRformats10x=>2bytes[200B..277B]OB,LRBformats11x=>3bytes[300B..377B]RR,RJB,ODB,JDB,LRRBformatsFormatrestrictionsLR&LRBformatmustbeinalignedblocksof16opcodes(therearefoursuchblockscurrently)JBB&RJBformatxg$`)StgHq_/_/! (:+ 2]A{]A!q$r]A]A{%O]A]A&'q']A]A{(]A]A)q[S{[S!qYeYe!$Y'hWwWw!"G%WUU! (:+1S{S!q"SS{#SS$wq&'SS{'SS'q(SS){.SS/rq1"SS{1SS2qQ{Q!qOO!#J n k"g$ Hq  $B&I(+.BF M  &*x, 378=?EuEE1 y#9$b'B )~"$\),a348<2?GAFI*A# >  y  U)"n )+.E 5;:}<?B;DG=  Z~ K f!$R%((+j.1&69 :=.@8DG;Y  PDE "?#l':*-33_69 ;@CKH89  3 m'!%+'>*Y.$76  q!&'+ 01N5F78<.?BYCGI5  6!#l(+/R0 79=( y.  q+  m:~+ % &,0 7<>WCHD)  6 >!N#J)/]1697:I>*?B[Eu(T  1 %x% q!  E!$M%(+I-/a4*7:8{nq %'{*+q-D-{nq %*{nq %(r+k{nq %(,{nq %(,T0K38x  zr  a Kq#vg-!'+-n0s37 z  s%TVm$cDragonOpcodes16lowbitsmaygovernthejumpcode(details?)xg$`)StgHq_'PTD $* 4TVm$(DragonOpcodes17CallsandReturnsThissectiongivestentativeinformationaboutthestrategyusedforprocedurecallsandreturnsonDragon.SimplecallThesimplecaseofcallingaprocedurefirstpushesanyargumentsexpectedbytheprocedure,thencallstheprocedureviaDFCorLFC.ThefirstinstructionisnormallyanEPinstruction,whichsetsLtothebaseofthearguments.Therefore,theargumentsbecometheinitiallocalvariableswithoutmovingthosearguments.ThereturnPCandthereturnLarepushedontotheIFUstackbythecall.Ifthereisinsufficientroomtodothis,anIFUstackoverflowtrapistakenafterthecallhastransferredcontrol.GlobalframesIftheprocedureneedsaccesstoaglobalframe,thenitistheresponsibilityoftheproceduretosetuparegisterwiththepointertotheglobalframe.CurrentplansaretousetheLGFinstructiontoloadtheglobalframepointerfromtheglobalframetableintoalocalregister.TheLIQBinstructioncouldbeusedtosetuptheglobalframepointerinthecasewheretherearefewproceduresfortheframe,butspaceconsiderationswillnormallymakeitmoredesirabletousethe3-byteLGFinsteadofthe5-byteLIQB,sincethatwillsave2bytesperprocedure.SimplereturnThesimplecaseofreturningfromaprocedureusestheRETopcode,whichspecifieshowmuchtoadjustthestackbeforereturning.IftheIFUstackisnotempty,thenthereturnPCandLaretakenfromtheIFUstack,andthemostrecententryintheIFUstackisdiscarded.IftheIFUstackisemptywhenaRETisperformed,theresultsareundefined.Sisadjustedaccordingtothealphabyte.ForcaseswherethestackshouldnotbeadjustedonreturntheRETNopcodeisused.ProcedurevariablesForvariousreasonscoveredbelow,procedurevariablesarecalledwithonemorelevelofindirectionthansimpleprocedures.Procedurevariablesareimplementedaspointerstowordsthatcontainthestartingaddressoftheprocedure.Tocallthroughaprocedurevariable,theprocedurevariableispushed,thenacallismadeto([S])^usingSFCI.Thisconventionleavesanextrawordonthestack,soprocedurevariablecallsmustgotoadifferententrypointthansimpleprocedurecalls.NestedproceduresNestedproceduresareimplementedbyplacingthestartingaddressinthelocalframeextension(thepartofthelocalframerequiredtobeinmemory).Theprocedurevariableforthisnestedprocedurewillbeapointertothisword.Therefore,onentrytothenestedprocedure,theaddressoftheframe(plusanoffset)willbeonthestack,whichmakescomputingthestaticlinkeasy(aSUBBinstruction).InterfacefunctioncallInterfacefunctioncallsarebothmoreflexibleandmoreinvolvedthansimpleprocedurecalls.Interfacerecordsarereferredtoviapositionsintheglobalframe.Proceduresexportedthroughthoseinterfaceshaveprocedurevariablesinvariousslotsoftheinterfacerecord.Tomakeaninterfacefunctioncallonesimplysetsupthearguments,fetchestheprocedurevariablefromthexg$`)StgHy^ Bq[   "%(D-R0297<>>CExXW |qUPAc&(-y06<>@ GS` {GS`S`qS`V{!S`S`!q#S`S`% '* 13 8{:S`S`;qS`= D=HMQj Xc [ ": (+2169&=@8EP Ms. "2$)V,.15v7u9=E>BWC KflfVe &)k*z.KK/GqK14)69) @$xH fqEQ4! "$'(k,0$13)5 >?@BI@CV"$#&<*d/A4s8:o<#>{ACCAqCD B@6g#j' ).2258:J=C{G BBGq@[ tD`"x$(,18257;?4AgC >M6 &/(.2b37N=!>AGC{G>>Hq= z{= = qs= = O"%(<+@,t02} x9 |q6nUG #~$+3.1{06n6n1mq6n38<B\EeI@4 [ "$2&),.=05#89:>@CDG.3 '#'+l-*/26<7 >@qBEI1x_+{l1x1xDq1x #E%*", 4$57 <BDG./0"&~(*0_2e6{8//9q/<AC x, xq)2e5G#*/258;?BSC '0 j#)+ 4F5;8<@CH%9 #%(-/ 5;;=D<I$<R  !%{)t$<$<*Lq,$<$<.x1 8=?(BFgH" W"f%')m*0<37o:>E}xF  q  $4&#*-2268:>BHO!h#$&}-/6Q;u=@.DkX 'o)d,.05 ;>)CDFi@l #'+248M;={?w@OqCB x qb#&&,/28<#@Gh "%*,/@38 ?E  H"(u*\/\2478=BEH le #_&(J* 169?E H TVm$DragonOpcodes18interfacerecord,andperformsaprocedurevariablecall.MultipleglobalframesAlthoughproceduresmustbespeciallycompiledtousemultipleglobalframes,thereisnoadditionalmechanismbeyondforcingallcallstoroutineswithmultipleglobalframestousetheindirectprocedurecall.Theaddressontopofthestackcanthenbeusedtofindtheglobalframe(probablyviaaddingaconstant).CoroutinesCoroutinecallsarehandledbytraps.Thedatastructurestobeusedarenotyetdefined.However,co-routinecallswillberoughlyasexpensiveasprocessswitches.xg$`)StgHq_/\ "(-x[ qX  [ 6%+-0/49=A1BDw V~!% &,/59>@CFEUCr!j#%{'+1-0257v:V<@DSL xPM qL! %=( + 1>247:F<>DKW aR!h#)`+/TVm$DragonOpcodes19TrapsThissectiongivestentativeinformationabouttrapsgeneratedbytheIFU.Thegeneralapproachtotrapsistohavetheinstructionthatgeneratesthetraphavenoeffect,andthereturnPCforthetraproutinebethePCofthetrappinginstruction.Maskabletraps(Reschedule,EUStackoverflow,andIFUstackoverflow)disablefurthermaskabletrapsuntiltheyarereenabled(usuallyviaRETT).RescheduleTherescheduletrapoccurswhentheRESCHEDULElineisraisedandinterruptsareenabled.AnattemptismadetohaveidleprocessorsnoticetheRESCHEDULElinebeforenon-idleprocessors(thisiscontrolledbysoftware).IftheRESCHEDULElineisraisedwhileinterruptsaredisabled,therescheduletrapwillbedeferreduntilinterruptsareenabledagain.Theresponsetotherescheduletrapisquitecomplex,andwillnotbecoveredinthisnote.EUStackoverflowThestackoverflowtrapoccurswhenanattempttoincreasetheEUstackpointerby1(S_S+1)wouldresultinScrossingthestackoverflowlimitregister(andtrapsareenabled).Thelimit,whichissetbysoftware,mustallowsufficientroomforthetraphandler.ThehandlerforthistrapshouldmigratetheeldestframeintheEUandIFUstackregisterstomemory,thenreturnviaRETT.IFUstackoverflowTheIFUstackoverflowtrapoccurswhenanattempttocallaprocedurewhentheIFUstackisfull(andstackoverflowisenabled).SomenumberofIFUframesarestillavailableafterthistrapoccurs,socallscanbemadebythetraphandler.ThehandlerforthistrapisthesameasforEUstackoverflow.StackunderflowThestackunderflowtrapoccurswhenareturninstruction(RET,RETN,orRETT)triestoreturntoanemptyIFUstack.ThetraphandlermustarrangetomigrateaframefrommemorytotheIFUandEUregisters.Thisisnotatruetrap,sincetheIFUstackisleftemptyonentrytothehandler.Whenthetransfertakesplace,maskabletrapsaredisabled.ALUfaultTheALUfaulttrapoccurswhentheALUdetectsintegeroverflow,aboundscheck(duetotheBNDCKinstruction)oraNILcheck(duetotheNILCKinstruction),orLispNaN.ThehandlerforALUfaultshouldturnthistrapintotheappropriateerror,dependingontheinstructionthatraisedthefault.EUpagefaultTheEUpagefaulttrapoccurswhenareferencetounmappedmemoryismadebytheEU.ThefaultingaddressisavailablethroughaspecialEUregister(MAR).Thehandlershoulddetermineifthepageisvalid,theneithercausethepagetobemadepresent,orcauseapagefaulterror.Interruptsaredisabledduringthetraphandler.IFUpagefaultxg$`)StgHy_ q[   "B&%)/14:8(;?EGZ  X N X"a$'*,136/:^<>APD4HXc  z !(#+ 406:A6D-G{V em"&),+17{9>VV:qACFr=mZP!^#&)-!2439=AM{C==DbqF==x:  q7KU$').0^24:>1@CFHc5n#g'k,.169;AE:H 3*#!$V'B-905-7r:=>{@DhFHd2Ux/  q+^"%%'+8 2{2++3gq5++{5++6q9U++:3{;++<q?Y++@XC_EI@*E[!&*.056:>QCEyG(hG } j!$o'+-p0z35P7;=AC1E&& '*k,x#q  ^q !#V%).=29":l?lCnFH{zqz   $'0({+>zz,qz/ 79j<@CHPR!$' .`2'8:=I D!F+nx  kq9.!%K&,.U5B:<>@BDH4-s$%*~-27:?Dl>G"X&3(,$-039E;.? @XCG% {= #%x G   TVm$CDragonOpcodes20TheIFUpagefaulttrapoccurswhenareferencetounmappedmemoryismadebytheIFU.ThefaultingaddressisavailableasthereturnPC.Thehandlershoulddetermineifthepageisvalid,theneithercausethepagetobemadepresent,orcauseapagefaulterror.xg$`)StgHq_/Di!%i&,.F5$:<?AD&H]73!?#'+G.23O7>r?BWEG/[4!6| +"%+,0148-TVm$DragonOpcodes21FieldUnitSpecificationThissectiongivesaMesaspecificationfortheFieldUnitfunctionsandthefielddescriptorformat.Weexpectthisdescriptiontobemademorehuman-readableinthenearfuture.Note:thisentiresectionwillberevisedaccordingtowhattheEUcanprovide.Treattheinformationhereinasentertainingfiction!Word:TYPE=PACKEDARRAY[0..bitsPerWord)OFBOOL;ZerosWord:Word=LOOPHOLE[LONG[0]];OnesWord:Word=LOOPHOLE[LONG[-1]];FieldDescriptor:TYPE=MACHINEDEPENDENTRECORD[reserved:[0..7]_0,reservedbits,notcurrentlyused,butmustbe0sinsert:BOOL_FALSE,governschoiceofbackgroundandlowbitsofmaskmask:[0..32]_32,maskgives#ofleft-justified1sinthemask(mask=0=>no1s,mask=32=>all1s)shift:[0..32]_0gives#ofbitstoleft-shiftthedoubleword];Operate:PROC[Left,Right:Word,fd:FieldDescriptor]RETURNS[out:Word]={shifter:Word=DoubleWordShiftLeft[Left,Right,fd.shift];Theshifteroutputhastheinputdoublewordshiftedleftbyfd.shiftbitsmask:Word_SingleWordShiftRight[OnesWord,32-fd.mask];Thedefaultmaskhasfd.mask1sright-justifiedinthewordIFfd.insertTHENmask_DragAnd[mask,SingleWordShiftLeft[OnesWord,MIN[fd.mask,fd.shift]]];fd.insert=>clearrightmostfd.shiftbitsofthemaskout_DragAnd[mask,shifter];1bitsinthemaskselecttheshifteroutputIFfd.insertTHENout_DragOr[out,DragAnd[DragNot[mask],Right]];fd.insert=>0bitsinthemaskselectbitsfromRighttoORintotheresult};END.DefinitionsusedfromDragOpsCrossUtilsDoubleWordShiftLeft:PROC[w0,w1:Word,dist:SixBitIndex]RETURNS[Word]=TRUSTEDINLINE{ThisprocedureshiftstwoDragonwordsleftbydistbitsandreturnstheleftmostword.<>};SingleWordShiftLeft:PROC[word:Word,dist:SixBitIndex]RETURNS[Word]=TRUSTEDINLINE{ThisprocedureshiftsoneDragonwordleftbydistbitsandreturnstheshiftedword.<>xg$`)StgHy^  q[  F: "/$|&*-369.:z= qV+ "'%|;`x8 |88p88l|8k !/#mp-88.|837 ;\=A6h)x- z4  H #'+./138;|3,{ z1q bm"{$3,.00|p/|/p//|."? p3'."."49|5."."5;q z,z1bI#M'*X+.G|* z)* Th!a%p'|'p''|'S $4z% PM#/&)h,0h2 46H7:9|$3p | z 8xD|DDpDD| 5x p$v%J|*/4p117|;z /[s$_(4*,o.14+8;@+M11 | xV|iVVpgVV|  p#$|).p0i1"6W|:z  /[u$`'*+.y138@:> _11 TVm$DragonOpcodes22};SingleWordShiftRight:PROC[word:Word,dist:SixBitIndex]RETURNS[Word]=TRUSTEDINLINE{ThisprocedureshiftsoneDragonwordrightbydistbitsandreturnstheshiftedword.<>};DragAnd:PROC[a,b:Word]RETURNS[Word]=INLINE{Thisprocedureisa32-bitAND<>};DragOr:PROC[a,b:Word]RETURNS[Word]=INLINE{Thisprocedureisa32-bitOR<>};DragNot:PROC[w:Word]RETURNS[Word]=INLINE{Thisprocedureisa32-bitNOT<>};xg$`)StgH|_, x[|;[[p9[[|Z6  p#Z6Z6$|Z6).p0iZ6Z61"Z66W|Z6:zX /[u$`'*,/a149(;t?V11 |U@ xQ|eQQpcQQ |Q 0p~QQ R|Q%*<p,!QQ,|Q0zPJ /[N11 |L xI|IIpIIP|IPupII|I$)p+gII+|I0zH /[F^11 |D xAh|OAhAhpMAhAh|AhRpAhAhu|Ah$)_p+DAhAh+|Ah/z? /[>11 |=0;S_S-1CSTOB1[S+1]_([S-2]+AlphaZ)^;[S+1]=[S]=>([S-2]+AlphaZ)^_[S-1];S_S+1;special:atomicDFCOQB1callprocatAlphaBetaGammaDeltaDISOI1S_S-1DJOQB1PC_AlphaBetaGammaDeltaDUPOI1[S+1]_[S];S_S+1EPOB1L_S+AlphaEXCHOI1[S+1]_[S];[S]_[S-1];[S-1]_[S+1]EXDISOI1[S-1]_[S];S_S-1FSDBODB1Field_AlphaBetaINOB1[S]_([S]+AlphaZ)^;special:usesIOlinesJBOB1PC_PC+AlphaJDBODB1PC_PC+AlphaBetaSJEBBjJBB2BetaZ=[S]=>PC_PC+AlphaS;S_S-1JnO*4Noopoflength1,2,3,or5bytes(usedasjump)JNEBBjJBB2BetaZ#[S]=>PC_PC+AlphaS;S_S-1LCnOI8[S+1]_Constants[n];S_S+1LEUROB1[S+1]_PReg[Alpha];S_S+1LFCJDB1callprocatPC+AlphaBetaSLGFODB1[S+1]_([GB]+AlphaBetaZ)^;S_S+1LIBOB1[S+1]_AlphaZ;S_S+1LIDBODB1[S+1]_AlphaBetaZ;S_S+1LIFUROB1[S+1]_PReg[Alpha];S_S+1LIQBOQB1[S+1]_AlphaBetaGammaDelta;S_S+1LRInLRB16[S+1]_([L+n]+AlphaZ)^;S_S+1LRnLR16[S+1]_[L+n];S_S+1MDIVOI1[S-2],[S-1]_[S-2],[S-1]/[S];signed,Sign[rem]=Sign[divisor]MULOI1[S-1],[S]_[S-1]*[S];signedOUTOB1([S]+AlphaZ)^_[S-1];S_S-2;special:usesIOlinesPSBOB1([S-1]+AlphaZ)^_[S];S_S-1RADDRR1Rc_Ra+Rb+carry;carry_0;traponoverflowRAILRRB1[L+BetaL]_(AuxRegs[BetaR]+AlphaZ)^RANDRR1Rc_RaANDRbRBOB1[S]_([S]+AlphaZ)^RBCOB1trapifRa<0ORRa-Rb>=0;Ra_RcRDIVOI1[S-2],[S-1]_[S-2],[S-1]/[S];signed,Sign[rem]=Sign[dividend]RETOB1S_L+Alpha;returnfromprocRETNOB1returnfromprocRETTOB1returnfromproc;enabletrapsRFURR1[Rc]_FieldUnit[[Ra],[Rb],Field]RJEBjRJB2Ra=Rb=>PC_PC+AlphaSRJGBjRJB2Ra>Rb=>PC_PC+AlphaSRJGEBjRJB2Ra>=Rb=>PC_PC+AlphaSRJLBjRJB2RaPC_PC+AlphaSRJLEBjRJB2Ra<=Rb=>PC_PC+AlphaSRJNEBjRJB2Ra#Rb=>PC_PC+AlphaSRLADDRR1Rc_Ra+Rb;carry_0;traponoverfloworLispNaNRLSUBRR1Rc_Ra-Rb;carry_0;traponoverfloworLispNaNRORRR1Rc_RaORRbRRILRRB1[L+BetaL]_([L+BetaR]+AlphaZ)^RRXRR1[Rc]_([Ra]+[Rb])^RSBOB1[S+1]_([S]+AlphaZ)^;S_S+1RSUBRR1Rc_Ra-Rb-carry;carry_0;traponoverflowRUADDRR1Rc_Ra+Rb+carry;setcarryxg$`)StgHy^ WW]  kq 8TVm$(p\ 8TVm$s\\*#&R( >$TVm$pZ bTVm$sZZ* "$AjTVm$pY\ TVm$sY\Y\*"n$&!TVm$pW TVm$sWWp TVm$pV TVm$sVV TVm$pU< TVm$sU<U< TVm$pS TVm$sSS!;C(($d&u'TVm$&pR|  TVm$sR|R|*$TVm$p*QR|R|*0TVm$sR|,82TVm$q=iR|R|=ApQ NTVm$sQQgdTVm$pO TVm$sOOTVm$pN\ TVm$sN\N\TVm$pL TVm$sLL*TVm$pK TVm$sKKp TVm$pJ= TVm$sJ=J=* " TVm$pH TVm$sHH*LTVm$pG| TVm$sG|G|p TVm$pF (TVm$sFF*.TVm$q!eFF!%(*pD @TVm$"sDD X TVm$pC\ dTVm$sC\C\lTVm$pA | TVm$sAAC )TVm$p@ TVm$s@@^ S!#$~%(+-&TVm$*p?<  TVm$s?<?<C )?TVm$p= TVm$s==*"TVm$pTVm$p9 VTVm$s99*&[^TVm$p8O |TVm$s8O8O* 9TVm$p6 TVm$s66*!TVm$p5 TVm$s55*" TVm$p4, TVm$s4,4,*'tTVm$p2  TVm$s22*$TVm$p1k  TVm$s1k1k* (TVm$p0 :TVm$s0 0 * x #d$m&*051 B:TVm$$p. |TVm$s..*x "TVm$p-H TVm$s-H-H*"eTVm$q&d-H-H&*-/p+ TVm$"s++*"eTVm$p* TVm$s** !m&6(*a%TVm$p)( TVm$s)()(*!&"TVm$p' HTVm$s''P TVm$p&h ZTVm$s&h&h*`TVm$p% rTVm$s%%!;C  '%t&xTVm$$p# TVm$s##* x #d$m&*051 ;TVm$$p"H TVm$s"H"H!K$ TVm$p TVm$s 3LTVm$p  TVm$s3L #TVm$p) ,TVm$s))*2TVm$p R TVm$s \TVm$pi p TVm$sii zTVm$p  TVm$s   TVm$p  TVm$s TVm$pI  TVm$sII TVm$p  TVm$sL] TVm$p TVm$s"~$&+j,/r(TVm$"p* 6TVm$s**!$7%*,,.>(TVm$"p fTVm$sl TVm$pj vTVm$sjj*~TVm$p TVm$s  *TVm$p TVm$s *#TVm$p I TVm$s I I $'6(%TVm$p TVm$s  !m#Z TVm$DragonOpcodes24RUSUBRR1Rc_Ra-Rb-carry;setcarryRVADDRR1Rc_Ra+RbRVSUBRR1Rc_Ra-RbRXORRR1Rc_RaXORRbSEUROB1PReg[Alpha]_[S];S_S-1SFCOI1callprocat[S];S_S-1SFCIOI1callprocat([S])^SHLODB1[S]_FieldUnit[[S],0,AlphaBeta]SHRODB1[S]_FieldUnit[[S],[S],AlphaBeta]SIFUROB1PReg[Alpha]_[S];S_S-1SJOI1PC_PC+[S]SRInLRB16([L+n]+AlphaZ)^_[S];S_S-1SRnLR16[L+n]_[S];S_S-1SUBOI1[S-1]_[S-1]-[S];S_S-1;traponoverflowSUBBOB1[S]_[S]-AlphaBetaZ;traponoverflowWAILRRB1(AuxRegs[BetaR]+AlphaZ)^_[L+BetaL]WBOB1([S]+AlphaZ)^_[S-1];S_S-2WRILRRB1([L+BetaR]+AlphaZ)^_[L+BetaL]WSBOB1([S-1]+AlphaZ)^_[S];S_S-2UDIVOI1[S-2],[S-1]_[S-2],[S-1]/[S];unsignedUMULOI1[S-1],[S]_[S-1]*[S];unsignedxg$`)StgHTVm$p_l TVm$s_l_l !TVm$p^ 0TVm$s^ ^ 8TVm$p\ @TVm$s\\HTVm$p[M PTVm$s[M[MX TVm$pY bTVm$sYY TjTVm$pX TVm$sXXgSTVm$pW- TVm$sW-W-gTVm$pU TVm$sUU*TVm$pTl TVm$sTlTl* TVm$pS TVm$sS S  TTVm$pQ TVm$sQQ$ TVm$pPK . TVm$sPKPK*#8TVm$pN RTVm$sNN*ZTVm$pM jTVm$sMM*(#'%'Rp$TVm$pL) TVm$sL)L)*!$&%!TVm$pJ TVm$sJJ*!"TVm$pIi TVm$sIiIi*"eTVm$pH TVm$sHH*TVm$pF .TVm$sFF*"e4TVm$pEG NTVm$sEGEG* x #d$m&V$TVm$pC zTVm$sCC*x "TVm$DragonOpcodes25SamplecodesequencesNotationInthefollowingexamples,FD[insert,mask,shift]denotesafielddescriptorwithindicatedfields.RRformatoperationsarewrittenwiththeoperandsintheorderRa,Rb,Rc.Packedsequencefetch/storeAssumethefollowingCedar/Mesacode:r:REFTEXT;--inlocalregisterLr(32-bitmaxLengthinword1)i:INT;--inlocalregisterLic:CHAR;--inlocalregisterLcc_r[i];--generatesthefollowingcode{11cycles,26bytes}LRILr,1--pushthewordcontainingtheboundRBCLi,[S],[S]--boundschecktheindexgiven(leaveLionstack)SHRFD[0,30,30]--makeawordindexRADD[S],Lr,[S]--getthewordaddress(-1)RB2--fetchthewordcontainingthedesiredcharLRLi--pushthecharacterindexSHLFD[0,5,3]--makeitabitindexintothewordADDDBFD[0,8,8]--addintherestofthefielddescriptorSEURField--settheFieldregistertocontroltheshiftRFU[S]-,C0,Lc--extractthecharandstoreittocr[i]_c;--generatesthefollowingcode{14cycles,32bytes}LRILr,1--pushthewordcontainingtheboundRBCLi,[S],[S]--boundschecktheindexgiven(leaveLionstack)SHRFD[0,30,30]--makeawordindexRADD[S],Lr,[S]--getthewordaddress(-1)RSB2--fetchthearrayword(leaveaddronstack)LIDBFD[1,32,24]--pushthebasefielddescLRLi--pushthecharacterindexSHLFD[0,5,3]--makeitabitindexintothewordSHRFD[1,10,5]--alsoinsertitintothemaskpositionSUB--adjustthefielddescriptorSEURField--settheFieldregistertocontroltheshiftRFULc,[S],[S]--insertthecharintothearraywordWSB2--storethechangedwordProcedurebody&callAddFunny:PROC[x,y:INT]RETURNS[INT]={z:INT_x+y;IFz>1THENz_z+z;RETURN[z];};GeneratesEP377B--pointLatxRADDLx,Ly,[S+1]+--z:INT_x+yxg$`)StgHy^ x[ qXX   8', -#0A 69?CFsV #$'*xSa  qP w w|Nk p NkNkSNkJ|INkzNk~!&(-4>595|L p ^LL |iLzL1N^|K p KKa|KzK1N^|G zG1!$'e+-{F&|F&BzF&"9$' .x0{D~|D~B zD~#'t)-x1468{B|BB zB"#'8{A/|A/B zA/!F#&+{?|?Bz?"\$' .05n{=|=Bz="9$*p{<9|<9Bz<9"$ %?'G*-0{:|:Bz:!#A%(%),/ {8|8Bz8!#f&+-H14*{7C|7CB z7C#%(+.0<1|3 /z31!$'e+-{2L|2LBz2L"9$' .x0{0|0B z0#'t)-x1468{.|.B z."#'8{-V|-VB z-V!F#&+{+|+Bz+"\$(;+/n24z{*|*B z*"9$'*{(`|(`Bz(`"9$*p{&|&Bz&"$ %?'G*-0{%|%B z%!%&)+/{#iz#i"%L(P {!|!Bz!!#f&+-H14*{ | B z "% (*-/0{s|sBzs"N$)x} xK. |..p..|.p..-|..p..|."p#%..#|%0..&'p|6p| p=|!p7|7{z { A| ABz A"}#%{ | B z &(STVm$r) *hTVm$z ,-TVm$DragonOpcodes26RJLEB6,[S],C1--IFz>1THENRADDLz,Lz,Lz--z_z+zRORLz,Lz,Lx--RETURN[z]RET0--(S_L+0)u_AddFunny[v,w]+1;Assumeu,v,wareinlocalsLu,Lv,LwAssumeAddFunnytobecalledviaDFCGeneratesLRLv--pushvLRLw--pushwDFCAddFunny--AddFunny[v,w]RADD[S-1]-,C1,Lu--u_...+1ArithmeticprecisionchangesMultiple-precisionarithmeticquantitiesarestoredwithhigherorderwordsinloweraddresses,evenwithintheregisterstack.Thatis,thewordat[S-1]ismoresignificantthanthewordat[S].Doubleprecisionnumbersshowupinmultiplicationanddivision.Extend32-bitsignednumberonstackto64-bitsignednumberonstack{3cycles,7bytes}DUP--low-orderwordontopofstackRUADD[S-1],[S],[S]--carrybit_signbit&putgarbagein[S-1]RSUBC0,C0,[S-1]--negatesignbitintohigh-orderword,clearthecarryNarrow64-bitsignednumberonstackto32-bitsignednumberonstack{4cycles,10bytes}RUADD[S]-,[S],[S+1]+--carry_signbitofloworderword,garbageat[S+1]RADD[S-1],C0,[S+1]+--[S+1]+_signbitplushigh-orderwordRBC[S]-,C1,[S]--boundscheckfaultwhen[S]#0,popstackEXDIS--flushthehigh-orderwordExtend16-bitsignednumberonstackto32-bitsignednumberonstack{4cycles,12bytes}RXOR[S+1]+,C0,[S]--pushNOTofthenumberSHRFD[0,17,0]--isolatehighbitsofnumberADDDB100000B--bumpthesign,whichcarriesthroughROR[S-1],[S]-,[S-1]--ORbacktheextensionNarrow32-bitsignednumberonstackto16-bitsignednumberonstack{4cycles,10bytes}DUPSHRFD[0,17,0]--isolatethe17highbits,noshiftADDDB100000B--bumpthesign,whichcarriesthroughRBC[S]-,C1,[S]--boundscheckfaultwhen[S]#0,popstackxg$`)StgH{_,|_,Bz_,TVm$"r_,_,TVm$z_, !#  TVm$r$?_,_,$$TVm${]|]Bz] !#$>&#{[|[Bz[( TVm$.r[[HTVm$z[$U{Z6|Z6BzZ6 !#V|V H G-zU@zt>SJ #-Q {PJ|PJBzPJ"9{N|NBzN"9{L|LBzL '{KT|KTB zKT G!#A%&xF^ qC ]  "$k(+/379A= CjFAh  aU,{!"&'+C 15,7;@<@E? %7 "hz; #!$(,13719=P>{9z9!#),k._02W{8P|8PB z8P!#&(*,.0u279{6|6B z6!#'g*B,J/ 59H<>3Z #Q$(,137a9F=?e{1|1Bz1!#&( *,.148?=U>{0 |0 Bz0 !#(*:-/1 8{.d|.dB z.d!#'+.2A4~6c7:{,|,z,!#&r( /M)n #!$(,13719=P?5{'|'B z'!#&P)+-{&|&B &!z#&&#'Y*j,.{$x|$xBz$x!#&)",U084{"|"Bz"!#%(+F #Q$(,137a9F=?e{3|3B z3!#'Y)+.13s{|Bz!#&)",U084{|B z!#'+.2A4~6c7:NUTVm$DragonOpcodes27RecentChanges23Aug84definitionfixestoBNDCK&RBC...tofixupcarelessness.22Aug84RBCadded...duetointerestingusesinarithmeticchangesandotherspecialboundschecking.21Aug84Cleanuppass...tofixbugsindescriptions.Arithmeticprecisionchangeswereadded.MUL&DIV->MUL,UMUL,RDIV,MDIV,UDIV...sincewethinkweneedsigned&unsignedversionsoftheseoperations.ThedifferencebetweenRDIVandMDIVissubtle(basedonsignofremainder),andmaynotbeinthefinalmachine.24Apr84Addedtimingestimates...toaidinchoiceofinstructionswhenhandcoding.6Apr84AddedMUL&DIV...asplaceholdersfortheeventualinstructions.Thecurrentassumptionisthattheywillperformcompletesignedmultiply÷.AddedDJ&ASL...tomaketheinstructionsetmorecomplete.DJisusefulforfillinguptrapvectorsandotherlongtransfers.ASLisusefulforcuttingbackthestacktoaknownvaluerelativetoL,whichwedoinexitingablockwithextrastuffonthestack.ARL->AL...tomakethenamesalittlemoreconsistent.21Mar84Stackunderflowtrapaddedxg$`)StgHy^ x[  zXV .}XVXVzXV}XVXVqU  w %6I xQ  }Ng zNg qK  w. = !&)-C16xG  zDy HqA)  w %6}+  #)_.1}= z= }y==Pz=}1== z==}==lz==}==z,==} ==z"g==}#C==$q:  zI 8&+h-$0 8B; A{G ::Gq8 { 88 {q8\bE (g+."024669x5  }z2D Zq.  w %y'l% "9%x+ ! z(U }(U(Uz(U%}(U(U~q%  f UE '_*&. 6 7h:%=$?E#^ ;Wz  }  z M}  q   b B!{("(q*,0c269<SEUR&SIFUR,LPR=>LEUR,LIFUR...atthetherequestoftheIFUdesigners.Noticethatthisreversesadecisiontakenon27Feb84.AllinstructionsuseidenticaldecodingofAlpha,soEUregistersandIFUregisterssharethesameencodingspace(seethedeclarationofProcessorRegisterinDragOpsCross).15Mar84RECdumped...sinceitwaslargelyuseless.9Mar840-byteinstructionsdumped...sincetheIFUnolongerneededthem.Thisletsusdeterminetheinstructionlengthbasedonthetop3bitsoftheopcode.6Mar84LILDBdumped...sinceitcomplicatedtheIFUandisnotlikelytobeaveryhighfrequencyinstruction.CSTchangedtoOBformat...tosimplifytheIFU.ThiswasmadepossiblebyanIFUchangethatallows[S-2]tobeeasilyaddressable.1Mar84IN&OUTreplaceMAP...Alphanolongerdesignatestheoperation.Theseoperationsperformread&writeoperationswithcachebypassing(Ithink).27Feb84LIFUR&LEUR=>LPR,SIFUR&SEUR=>SPR...thelocationoftheregisterisgivenbyAlpha,nottheopcode.TheregistersofinterestaredescribedunderLPR.RL=>L...whichisinbetteragreementwithSasaname.xg$`)StgHq_/   !$+.26f >&BEG]  xZ8  }V zV }VVdzVn}VVz&VV}VVzV }VV zz#VV}#VV$qS   )0 %"),/-4p5; >@BEHQ a!]%'*h/25;J>AtEPJ  n &(C xL  }I zI qF[  w@fxC !:}?  z?nq!z$ }&'q  K!#(j*-h366#;=hB[D {   qv  z  aq k  wD _!#X$4TVm$DragonOpcodes29RLADD&RLSUBadded...tosupportLisp(&maybeSmalltalk)arithmetic.AnewtraphasbeenaddedforListNaN.21Feb84WriteProtectfaultadded...sowecoulddistiguishitfrompagefault.RIFdumped...sinceitonlyhada1-byteadvantageovertworeadinstructions.10Feb84Codegenerationsamples...wereadded.7Feb84FieldDecsriptormaskfieldwidenedTohelpwithboundaryconditionsingeneratingfielddescriptorsonthefly,themaskfieldofFieldDescriptorwaswidenedtoinclude32.Thisalsomakesitfollowthesameconventionastheshiftfield.Wemaywishtorevisitbothdecisionswhenweseemorecases.NILCKdumpedNILCKisusedtocheckforNILpointersbeforetheyaredereferenced.WedonotanticipateusingNILCKoftenenoughtowarrantitsinclusion.Incaseswherewewoulduseit,insertinganextrafetchthroughthepointerwillbequitesufficient.Wecanevenaffordtokeepallofthelow64Kofvirtualmemoryunmappedtofurtherreducethisproblem.SHL&SHRTwousefulshiftoperations,SHLandSHR,havebeenintroducedtoreplacefrequentlyoccuringcasesofFSDBfollowedbyRFU.6Feb84SFCIreplacesSFCBSFCIreplacesSCFBtosaveabyte,whichincreasesthepossiblenumberofinterfacesthatcanbecalledfromagivenglobalframe,sincewecanhave4bytesoffetchingprecedingtheSFCI.ThisallowsustodumpRIFifitbecomesnecessary.RRXreplacesRFXSimplenamechange.xg$`)StgH}_/ z_/}(_/_/z_/q[  w %1K\ "Y )+E.3136; =I@ xX  zU@  zqQ  w ;b. X!\}N zN qKQ  w@Y;t!%'* xH  zD  j  qAb  wx> ! z:  ^ q7s   l &) 0c2D469VBIDG4%   $}0 z0{- q-<p--q-~"' *,c 5c79368:>D(  Ca}%@ z%@ }y%@%@Pq!  #N{ {!!kq!{!{!!"Sq$!!$(J+ 24}9N @EI5{ I q I u{p I IHq I Ix ! z  {Z qZ {.ZZqZ & $*,2I79K ?B_DF  ^Q~U #&n'+M-2i8{;4< q>@ C.GfI@ {   q \L z  iq l STVm$DragonOpcodes30LCnreplacesLInLCnnowallowsshortaccesstothefirst8constants.LCnreplacesLIn,whichwaslimitedtothefirst5constants.LRRBbytesswappedFormorecommonalitywithinstructionsthataddedAlphaZbeforefetching(Curry'ssuggestion).AND,OR,andXORdumpedTheyarenotusedoftenenoughtowarrantseparateinstructions.RAND,ROR,andRXORshouldbeusedinstead.FieldUnitinstructionschanged(again)TheFieldUnitinstructionshavebecomeFSDB(FieldSetupDoubleByte)andRFU(RegisterFieldUnit).Thepreviousinstructions(FUDB,FUI,RFUI)areeliminated.FSDBandRFUaresufficienttodoeverythingweneed,althoughtheyarenotalwaysthemostcompactorefficientmeanstodoso.Wemayidentifyspecialcaseslaterinthedesign.3Feb84EUregisternames(Field,MQ)TheoldnameQisnowField;ICANDisnowMQ.FieldUnitinstructionschangedTheFieldUnitisnowaccessibleto3instructions:FUDB,FUI,RFUI.Theseinstructionsalltaketwowordsofdata,andtakethefielddescriptorfromeitherAlphaBetaorField,andproduceonewordofoutput.xg$`)StgHz_,  A{[ q[ S $# $M {+8[[,q[.R{3[[4zq6)[[7;0=BDfFIZ6 zV RqS  * e "%).3+8y= }PJ z rPJPJ} OPJPJ&zPJPJ}~PJPJUzPJqL  `G=% *r {2LL3q6$LL{7 LL7q9LL:|{=?LL>qLA.EGKT zH  ^  qD  Z /{#ADD$qD'!+4/47{:hDD;?qD=oCHFC   d{CCq=CC{CCq CC{!JCC""q$CC%' {/3CC0 qC2{5CC6rqC8: @B>D* Ah  )U"Z$(A-/59s;7=S@BE? h xsCcIPX_` 1j&l su v } Jj/Tҳ[]<>Dragon>DragOps.tioga&Thursday, August 23, 1984 10:11 am PDT