DragonOpcodes1XEROXToFromDragonCore^.paRussAtkinsonPARC-CSLSubjectDateDragonOpcodesDecember17,1984PathName/Indigo/Dragon/Documentation/DragOps.tiogaLasteditedbyRussAtkinsononDecember17,19845:36:21pmPSTAbstractThisdocumentdescribestheDragoninstructionsetasseenbythemachinecodeprogrammerandcompilerbuilder.Attributestechnical,Cedar,DragonDragonOpcodesCopyrightc1984byXeroxCorporation.Allrightsreserved.ThisdocumentisaDRAFT,andmostoftheinformationinitisvolatile.ThisdocumentisalsoINCOMPLETE,andshouldbeviewedwithsomesuspicion.RevisionsarecurrentlybeingsentthroughRussAtkinson.pf qfHDrf sb b *q`e `e*.^*/806sT T*qS* -S**14msL  qL*sJ  JqKJJHD&^(,o14sG qG "%+ 257-:= ?EE R?RsB qB n5t2 4q-" u-"q-"28{ %'+)  $v))+q)) $E&( 0U23H4:=DFjv(, q-(,(,$'+ 39<'BLFT& 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.pf qfHDwa x^  "8'_-n307 ?+@C]  !P$&),/N24 :CS  4 !$(*03T57:=@bBDQj pfI"7(*.1@4 ;=DFO  U~*# &(<*.025,8T >ACGRN   U^ KysKK,xKyKKrKxK!y%KK&K'x+&KKI#  a$' .o147>ACFqGG{ r!" +]/15: ADE  +qEER+w?5  x;  # 4"%%V *- 6~9;@DW:< }6k "%(8*+/358<?AF8   y "6  )S_#+%x(,2{4"6n9a<>@E4q  FX> "$F':(-r2 9= D2  t  !%-+,/ 5792;@F1# q@! "(+W0238<ArF/{ ,  O#5 z*x*\"2y"**#x*'R y/**0x*1z(1n#X%x%it"| (, y4%%5x%7] z# 1/["B%= x 4 !4&y' 'x +y/ 0x 16:m<?DGJ  '-0zlxlhI"$|&)y*ll*xl.y2ll3xl4:b@D,^!w#)+? 2,587:@DEv zx3!$')- .36J9< CFR X "zxp#\(w*/37:%?BDG.| d "N&r(,C TVm$iDragonOpcodes3IFUstateTheIFUturnsastreamofvariable-lengthinstructionsintosignalsthatcontroltheEU.Italsoperformsaddresscalculationsusedforjumps,callsandreturns.TheIFUcontainsasmallstackofthemostrecentprocedurecontexts.AprocedurecontextfortheIFUissimplyaprogramcounter(PC)andanindexintotheEUstackgivingthebaseofthelocalvariables.TheIFUhasthefollowingregisters(actuallymorethanthese,butforsimplicity):PCistheprogramcounter(abyteaddress).Instructionspaceislimitedto2^32bytes(roughly4gigabytes),eventhoughthefullDragonaddressspaceis2^32words.Sisthestackpointer(a7-bitindexintoStack).Manyinstructionstakeoperandsimplicitlyusingthestack.Procedurecallsusethestackforargumentsandreturns.Lgivesthebaseofthelocalframe(a7-bitindexintoStack).Thefirst16registersatoraboveLareeasilyaddressablethroughDragoninstructions.SLimitgivesthelimitforS.AstackoverflowoccurswhenSisincrementedtoreachorexceedSLimit.StatushastherestoftheabstractstateoftheIFU.Itcontrolswhethertrapsareenabled,whetheraresheduleiswaiting,andretainspartofthefloatingpointstate.SeetheProcessorRegisterssectionformoredetails.pf qfHDwb  }x^  Bc{# +/-2e5+9<+?@C]  @| 5#D%Z  51!3$(/556=/AD+FX  X!~#o'9*,q.2o68< =@#Cj Vq  H %)?,e0G25 zSxSs4 Y#d) 04A5:V;?@BHZRO $7!&+/a04zOxOg#O )#&+/ 69? EN,nJY #.&(/2DzKxK xa $%),/47:<BCEJ z "/'. zGxG-# W!%c+/d3 4q5 =?C>EEzCmxCm1y"r"z%'E)-a.39/<>DAAV3|R#&(+60^48d;z=AA>}Cx@{3TVm$DragonOpcodes4InstructionformatsThissectiondescribesthevariousinstructionformats.Notethatthedescription[0..255]specifiesanunsignednumberoccupying8bits,while[-128..127]specifiesasignednumberoccupying8bits.Thedescriptionoftheinstructionformatgivestentativebitassignments,followedbyaroughdescriptionofhowtheformatisinterpreted.ArithmeticinvolvingSorLwillalwaysbeperformedmodulothesizeoftheEUstack,withoutdetectionofunderfloworoverflow.Wewillnotfurtherindicatethislimitationofprecision.Forconvenience,weusethefollowingabbreviationstorefertonumbersobtainedfrombytesthatfollowtheopcodebyte:Alphaisthefirstbyteaftertheopcode.AlphaZisAlphaextendedto32bitswithhigh-order0s.AlphaSisAlphasign-extendedto32bitswiththehigh-orderbitofAlpha.Betaisthesecondbyteaftertheopcode.BetaZisBetaextendedwith0s.BetaZisBetasign-extendedto32bitswiththehigh-orderbitofBeta.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]]--1byteForOIinstructionstheoperand(ifany)isimplicitintheopcode.OB-OperationByte[op:[0..255],lit:[0..255]]--2bytesForOBinstructionstheoperandisgivenbyAlphaZorAlphaS.ODB-OperationDoubleByte[op:[0..255],lit:[0..65535]]--3bytesForODBinstructionstheoperandisgivenbyAlphaBetaZorAlphaBetaS.OQB-OperateQuadByte[op:[0..255],addr:Word]--5bytesForOQBinstructionstheoperandisAlphaBetaGammaDelta.JBB-JumpByteByte[op:[0..255],lit:[0..255],dist:[-128..127]]--3bytesForJBBinstructionsthenewPCisthebyteaddressgivenbyPC+BetaS.AlphaZisusedforpf qfHDwa Wx^  0  &,0Y3Q5 =AG] $ &# *0/1p5;AC F[[ /  $)+ 39{;<@ GY  P7 W8 !#*/14t68k:>CU  ="7&, . 46 S  &y!~ )+.0k6;?BEWQn  KzNxNy!Tz&NN'xN+-_17g9:=@ G~zMLxMLY| !<"$'q*, 357zJxJ-!l$ z*1JJ+$xJ.0N39=7z@MJJA@xJDFiI) G! (*,0/3791:?<>ACzGxG4M#Pz&GG&xG*8+.4-zExEQa "z(EE)xE,W-0"4\7l:=zBxBoC$*c0l27: ACG@zK@@Ix@7%,-026Iz9X@@:Ux@A"B?=,F" *K,h.! z<x<t 0$ )0N5;>BF;; g$+& 1Y3> {5P   x2z2 @x/ 5!#&(X-c/1q{,6  vx(7z(Q x&l9 "[#'{)w.0E{#   x7 z; !xSX #z$(* 2A4 {  xz !9x9L  #o${  x 7K e z ')Y*x  M #3$'-*T/U3 53=ZB{CGRrTVm$DragonOpcodes5comparisonwiththetopofstack.LR-LocalRegister[op:[0..15],reg:[0..15]]--1byteForLRinstructionstheoperandisLocals[reg],whichiseitherpushedtoorpoppedfromthestack.LRB-LocalRegisterByte[op:[0..15],reg:[0..15],disp:[0..255]]--2bytesFortheseinstructions,theoperandis(Locals[reg]+AlphaZ)^,whichiseitherpushedtoorpoppedfromthestack.LRRB-LocalRegisterRegisterByte[op:[0..255],disp:[0..255],reg1,reg2:[0..15]]--3bytesForallinstructions,reg1(BetaL)indicatesalocalregister.ForRRIandWRI,reg2(BetaR)indicatesalocalregisteraswell.ForRAIandWAI,reg2indicatesanauxilliaryregister.RR-RegistertoRegister[op:[0..255],aOpt,cOpt,bOpt,aux:BOOL,b:[0..15],c,a:[0..15]]--3bytesFortheseinstructionstheeffectisroughlyRc_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:IFNOTbOptTHENIFauxTHENAuxRegs[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+1pf qfHDxb2 m\{^  U H(x[T,z[xYw #$ ,0415:<>CG/Wp{T  H;xPT, zP%'(PxNT #U$3i7b8<AEBDLu{I] F9xF x $zF )+_,xC N#)n*.M4v|7YCC81xC:|=CC>dx@CCA'DnA/"|%0AA&xA(<|*AA+x-{AA.X1g79 ?{>  l _x;Ky# ;K;K#x&6;K;K'(-:/z;K4697nx8- !"(,.145v8:J?lAEG/7( e #%r' .179Q;>V@B\ 4y44$4bx4dy33}3y-33}3 y#E33#}3&y1[1[n}1[Ayk1[1[$}/1eJ/d . 1. dy. }. ,c1,cdy,c},c*1*dy*}*y*"}$*y*%}&s**&)1)dy)})y)"}$)y)%}&s))&x&y&&F&x&y$$}$y-$$}$ y#g$$$ }$&y#F#Fn}#FAy#F#FF}!1eJ!d 1dy}N1NdyN}N1dy}y"}$y%}&s&1dy}y"}$y%}&s&xyWxYy}y-} y#;#}&y11n}1Ay`11}1eJd 1dy}919dy9}91dy}y"}$y%}&s' 1 dy } y "}$ y %}&s 'TVm$DragonOpcodes6QR-QuickRegister[op:[0..255],spare0,spare1,bOpt,aux:BOOL,b:[0..15]]--2bytesFortheseinstructionstheeffectisroughly[S]_[S]opRb,whereRbisdecodedasforRRformat.Thisformatisthe"quick"registerformatbecauseittakesuplessspacethantheRRformat,whilecoveringmanyofthesamecases,andwewanttoemphasizethatshorterinstructionsarequicker,sincemorecanfitintheIFUcachethanthelongervariety.Actually,wejustwantedawordthatbeganwithQ.RJB-RegisterJumpByte[op:[0..255],sdd,sd,opt,aux:BOOL,reg:[0..15],dist:[-128..127]]--3bytesFortheseinstructionstheeffectistojumptothebytePCgivenbyPC+BetaSiftheindicatedcomparisionofRawithRbistrue.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-1pf qfHD{b0  x^y$^^%x'^^(*z^/128x\f, !"',.185D78>]?B1DZNW$[(.C/3b58Tb@ByEE yC xC yLC C C xjC yC rxC C D@y@@$x@by1@@x@y@x@*y;@@x@!y%@x@%>y>>ix>kyAVQnR !G&}{N zJ JJm|HU xHUHUmE  |C^ xC^C^m@> #! |>g x>g>gm;b !G|9q x9q9qm6|t6x6K&|4zx4zk%[ |1 x11m/ &|- x--m*|!.T|( x((m%R ^4G|#x#^v" | x  m%+ "| xm.7 { z m| xm >~2' 5` a$u) 2479~<=AE]TVm$,DragonOpcodes8butatleastitisquitelarge(64Kframes).Thedecisiontousethisinstructionisnotentirelyfinal,sinceLIQBmaybepreferable.LRInLRB16LoadRegisterIndirectn.[S+1]_([L+n]+AlphaZ)^;S_S+1.PSBOB1PutSwappedByte.([S-1]+AlphaZ)^_[S];S_S-1.QRXQR1ReadRegisterindeXed.[S]_([S]+Rb)^.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.LispNaNcheckingisperformedonbothoperandsandpf qfHDxb*&oJ"'*/136 =N>AF`|``Yx`eiY |^ x^^m[1X/\|Y xYYmV(c|T xTTmQ| |O% xO%O%mL "#|J/ xJ/J/mG|E9 xE9E9mB|@C x@C@Cm=| |;L x;L;Lm8'|6V x6V6Vm3=d-V|1` x1`1`m. Z8#@#|,j x,j,jm)$2|'t x't'tm$R[|"} x"}"}m ){ Zxe  X yV#* , 4Z ; =wAPC  KG"% B X># %I( 06 7u#AD   T o^t ^#%(o*/,0i14Y8!9<>?(@CP R !#)[,179>!@j GL ?D5$  @ c!" ).47*=,A_BvF * 6%(+*.13%9=?DE  a  Y"']*r-34;=@FTVm$DragonOpcodes9results.NameformatopcodesADDOI1ADD.[S-1]_[S]+[S-1]+Carry;Carry_0;S_S-1.Traponintegeroverflow.ADDisanabbreviationforRADD[S-1],[S-1],[S]-.ADDBOB1AddByte.[S]_[S]+AlphaZ+Carry;Carry_0.Traponintegeroverflow.ADDDBODB1AddDoubleByte.[S]_[S]+AlphaBetaZ+Carry;Carry_0.Traponintegeroverflow.BCOI1BoundsCheck.Boundschecktrapif[S-1]<0OR[S-1]-[S]>=0;S_S-1.NochangetoCarry.BCisanabbreviationforRBC[S-1],[S-1],[S]-.LADDOI1LispADD.[S-1]_[S]+[S-1];Carry_0;S_S-1.TraponintegeroverfloworLispNaN.LADDisanabbreviationforRLADD[S-1],[S-1],[S]-.LSUBOI1LispSUBtract.[S-1]_[S-1]-[S];Carry_0;S_S-1.TraponintegeroverfloworLispNaN.LSUBisanabbreviationforRLSUB[S-1],[S-1],[S]-.QADDQR1QuickADD.[S]_[S]+Rb+Carry;Carry_0.Traponintegeroverflow.QADDisanabbreviationforRADD[S],[S],Rb.QANDQR1QuickAND.[S]_[S]ANDRb.QANDisanabbreviationforRAND[S],[S],Rb.QBCQR1QuickBoundsCheck.BoundsChecktrapif[S]<0OR[S]-Rb>=0.NochangetoCarry.QBCisanabbreviationforRBC[S],[S],Rb.QLADDQR1QuickLispADD.[S]_[S]+Rb;Carry_0.TraponintegeroverfloworLispNaN.QLADDisanabbreviationforRLADD[S],[S],Rb.QLSUBQR1QuickLispSUBtract.[S]_[S]-Rb;Carry_0.TraponintegeroverfloworLispNaN.QLSUBisanabbreviationforRLSUB[S],[S],Rb.QORQR1QuickOR.[S]_[S]ORRb.QORisanabbreviationforROR[S],[S],Rb.QSUBQR1QuickSUBtract.[S]_[S]-Rb-Carry;Carry_0.Traponintegeroverflow.QSUBisanabbreviationforRSUB[S],[S],Rb.RADDRR1pf qfHDxb2 z]< ]<]<m|Z xZZmXE_!S';,/715|;XEXE<xXE>?A V|LVV#xV/V|T" xT"T"mQ)5$+n.05n|O+ xO+O+mL)*,36a8h=|J4 xJ4J4mGOY!E$4%(*%y+dGG,@xG-257I<~>CEW|FxFB |FFxF $i'|C xCCmA) 2&E+f.05f;<?|D?AAExAH#?s |*?s?sx?s"y& |< x<<m:|,!',02$6=AZ|E:|:|Fx8zj Y|88nx8 R#'y|6Z x6Z6Zm3#*-p/m4|:{33;Sx3>V?A 27|L2727#x27/|/ x//m-@&yx-@-@Kx-@|!-@-@"x-@%') 0|39-@-@4x-@79;|* x**m(I;O!&(*r,-/)1457:(CEW|&x&v e|&&zx&!$&|$& x$&$&m!&? "4(,. 28S:=/|Ay!!BPx!F4G  |:  x _!| xm 1U8 #*6-/4S: ;>|C]  D5x H#e |*eexe!P#| xmn&yJnn'xn|nn xn"$'& .|0Bnn1xn3N58"| xmx#*P-/4!|:xx;fxx>c?A |L #x /| U x U Um;TVm$oDragonOpcodes10RegisterADD.Rc_Ra+Rb+Carry;Carry_0.Traponintegeroverflow.RANDRR1RegisterAND.Rc_RaANDRb.RBCRR1RegisterBoundsCheck.BoundsChecktrapifRa<0orRa-Rb>=0;Rc_Ra.Carrynotaffected.Thisinstructionisusedtocheckindexesagainstbounds.Itisalsousedwhenanumberisnarrowedtofitintoasubrange.NotethatifRb=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].Divideoverflowtraponoverflowordividebyzero.RLADDRR1RegisterLispADD.Rc_Ra+Rb;Carry_0.TraponintegeroverfloworLispNaN.RLSUBRR1RegisterLispSUBtract.Rc_Ra-Rb;Carry_0.TraponintegeroverfloworLispNaN.RORRR1RegisterOR.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.SMULOI1SignedMULtiply.[S-1],[S]_[S-1]*[S].Signedmultiplication,32x32->64bits.Notrapspossible.SUBOI1SUBtract.[S-1]_[S-1]-[S]-Carry;Carry_0;S_S-1.Traponintegeroverflow.SUBisanabbreviationforRSUB[S-1],[S-1],[S]-.SUBBOB1SubtractByte.[S]_[S]-AlphaZ-Carry;Carry_0.Traponintegeroverflow.pf qfG~xb2q%^+//165|_ x__m]<qy]<]<x]< !|Z xZZmXE# '*+.O/025!6;8;^=)CGVT"_ ql#(-35[6:=sA_BH#R{C#&)t*-Vq/RR{R{0#x6xR{R{|7kR{R{8CxR{:=P@DnFHP !sq&PP'ExP)q,[PP-Xx0EPP|NX xNXNXmKTy !# y*pKK+DxK. 065 ;=6?E EJ6 H]!N#&*?+-0248=9~;p>(@ADKFGRH6!&)+1a3%7T9O|F xFFmCq2#*0-/4/9;>|A xAAm>q[$+r.05q; <?|<& x<&<&m9qy99x9|7/ x7/7/m4qA%,-/16,|28 x2828m/qM+ 3:=@|-B x-B-Bm*q u+y0Q**1:x2**327 >|@|(K x(K(Km%q.%^)>+14)|#T x#T#Tm q.&*,35k|] x]]mqyx|g xggm &+I4b:>@@C|p xppmm#'-)*04K6;}|BCoxEGM |:MMxM#E| x  m W%)l*- 0f2l7TVm$1DragonOpcodes11SUBDBOB1SubtractDoubleByte.[S]_[S]-AlphaBetaZ-Carry;Carry_0.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,andr|]< x]<]<mZ| !B#a y)ZZ*xZ-0e5 ;=?6 EY g0Y!$0'r*,r.R13R49$:tBEFHWrZ$+06c9h;A_CDGU{R{  i@ xO,  !] 'Q)/M05Y6:&<ACM 0 y#F%&^) 047V9a? CHeK '!e&d(2*.X1Q5:<>AEG/|J6 xJ6 |'J6J6xJ63 zG GGm|E? xE?E?mB@I2C#%), /12609 |= x==m;Rq'&)?8*U)E &+/269b=AG/7/? |4 x44m29%' /(/$I!%)/137 =o? FH#. Ih +%),./12799>|CL..D$x.F^,oOM|) x))m'x "[ $$I!%)/137 =o? FH##U Gd"p(1),.147=6@jBCKF!)|!!x! "M$(K|3 x33mw!$ <$I!%)/137 =o? FH# Ig#T({,/ 5|:;sx=@C^G/{  r zO OOm| x  m X) TVm$IDragonOpcodes12Thisinstructionisespeciallyusefulforsavingandrestoringstackframes,butmayhaveotherexoticuses.ALSOB1AddtoLfromStack.S_L+Alpha.Thisinstructionisusedatprocedureentrytoestablishthebaseofthelocalframe.ASOB1AddtoStack.S_S+AlphaZ.Stackoverflowisnotcheckedbythisinstruction,soitisprimarilyusefulfordiscardingwordsfromthestack.ASLOB1AddtoStackfromL.S_L+AlphaZ.Stackoverflowisnotcheckedbythisinstruction,soitisprimarilyusefulfordiscardingwordsfromthestackwhenthedistancefromLisknown,butScouldbeatanylevel.DISOI1DIScard.S_S-1.ThisisprimarilyusedasanabbreviationforAS255.UnconditionaljumpsNameformatopcodesDJOQB1DirectJump.PC_AlphaBetaGammaDelta.JBOB1JumpByte.PC_PC+AlphaS.JDBODB1JumpDoubleByte.PC_PC+AlphaBetaS.JnO*4nIN{1,2,3,5}.JumpstobyteaddressPC+n.Thesejumpinstructionsareimplementedasnulloperationsforspeed.J4isnotanopcodebecausethereareno4byteopcodes.SJOI1StackJump.PC_PC+[S].S_S-1.Thisoperationisusefulforcomputedjumps.ConditionaljumpsEachofthefollowingconditionaljumpstakestwoopcodes:onewherethepredictionistonotjump(notrailingJtotheopcode),andonewherethepredictionistojump(atrailingJtotheopcode).Comparisontreatsthetwonumbersas32-bitsignednumbers,unsignedcomparisonsbeingjudgedlesscommon.NameformatopcodesJEBBjJBB2JumpEqualByteByte.IFBetaZ=[S]THENPC_PC+AlphaS.S_S-1.JNEBBjJBB2JumpNotEqualByteByte.IFBetaZ#[S]THENPC_PC+AlphaS.S_S-1.pf qfG~xb2Q U G$&+O./47<?TBE`|^ x^^m[)C; Y( oD$(Z* /25696<||V xVVmT$)i QzQQ>xQ!# % -4/0285 EPu|M xMMmK ); HzHH>xH!# % -4/0285 EFuH\"&'}(-0H15^7O8;|Dm xDmDmmAd $'C(* 2|5 AA5xA7A{> z;U ;U;Um|8 x88m6_H|3 x33m1h |. x..m,r|) x))m|'|y'|x'|k_[ #C(B|+r'|x'|,I-15 =?z G%  ^!$?&/*035792?gA CyG Ym!$3 *+-}02789;A   ] "R([.7 69>wA zw wwm| xmy$x"$y&'x* 6a|  x  m y _x !%'y) *Yx -e 93?TVm$DragonOpcodes13RJEBjRJB2RegisterJumpEqualByte.IFRa=RbTHENPC_PC+AlphaS.RJGBjRJB2RegisterJumpGreaterByte.IFRa>RbTHENPC_PC+AlphaS.RJGEBjRJB2RegisterJumpGreaterEqualByte.IFRa>=RbTHENPC_PC+AlphaS.RJLBjRJB2RegisterJumpLessByte.IFRa,14\8|:=iB#CE)&+d#N&]) |& x&&m$/ $Y*-0 47;>,@EG;"i"/'*'- | x  m $&{)-+1/7:B CG34"%(0 /+2:6 <BG< s  &([./2| xm  M#%s(*.0u377;DADF _|~$&FTVm$9DragonOpcodes14FloatingpointunitoperationsDragonsupportsIEEEstandard32-bitand64-bitfloatingpointnumbers.ThefloatingpointinstructionsaredefinedinsuchawayastomakeiteasyfortheIFUtocontrolapairofWeitecfloatingpointchips(ALUandMultiplier).Doubleprecisionoperandsarestackedwiththehigherprecisionpartin[S-1],therestin[S].TheinterestingregistersinthefloatingpointchipsareshadowedbytheEU,andaresavedduringprocessswitch.SeeDragonFP.tiogaformoredetails.NameformatopcodesSFPOB1StoreFloatingPoint.[fpA]_[S];S-S-fpAdjust.StoresfromthestacktofloatingpointregisterA.Alphaisdecodedasfollows:Alpha[0]0=>fpAisinALUchip1=>fpAisinMultiplierchipAlpha[1]0=>StoretoA1=>FloatingpointmodecontrolAlpha[6..7]0=>Clearsflags;fpAdjust_01=>AoperandissingleREAL;fpAdjust_12=>AisdoubleREAL;fpAdjust_23=>AissingleINT;fpAdjust_1FLIPODB1FloatingpointInternaloP.[fpA]_[fpA]op[stack];S_S-fpAdjust.Performsaflotingpointoperation.AlphaBetaisdecodedasfollows:Alpha[0]0=>ALUoperation1=>MultiplieroperationAlpha[1]0=>resulttoALU1=>resulttoMultiplierAlpha[2..7]6bitfunctioncodeBeta[0..1]0=>noBoperand;fpAdjust_01=>Boperandissingle;fpAdjust_12=>Boperandisdouble;fpAdjust_2Beta[2..7]58-#ofwaitcyclesFLOPODB1FloatingPointOnstackoP.[stack]_[fpA]op[stack].JustlikeFLIP,butplacesresultontheEUstackinsteadofintothefloatingpointregisters.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.INOB1pf qfG~{b0 c x^ W!p$',0~69>B/ ]:  81%C "?%<'r),.y3$4G78=_BbE[  #),L1A4r6;LA>D8EY  d #=%'z,0T46l<>AqDlG;XD  ' (*.kzU UUm|SM xSMSMmP&? #V NW2k"$%*- 1-289Lj1Lj ?!t$ &(B)-J ?!t$ &(B) 0}H1H ?!t$ ')WG- ?!t$ )-!0E?1 E? ?!t$ (B+134C ?!t$ %*,e0P5.:BE'G&y#$Zx&,"/;y23x7yF@FxB#6|xcJ (*y/(13[7=)B  Zt A#t%)K*,057:W>@fCyE xnv {$B& -r| x  mTVm$DragonOpcodes15INputoperation.[S]_([S]+AlphaZ)^;bypassescache.Detailstobesupplied.LIPOB1LoadfromInternalProcessorregister.[S+1]_PReg[Alpha];S_S+1.LIPreadsdatafromtheEUorIFUregisterindicatedbytheAlphabytetothestack.RegisterassignmentsaregivenbyDragOpsCross.ProcessorRegister.OUTOB1OUTputoperation.([S]+AlphaZ)^_[S-1];S_S-2;bypassescache.Detailstobesupplied.PINOB1PbusINputoperation.[S]_PBus[Alpha,[S]].Detailstobesupplied.Aninstructiontrapoccursifthisinstructionisexecutedinusermode.POUTOB1PbusOUTputoperation.[S]_PBus[Alpha,[S]];S_S-1.Detailstobesupplied.Aninstructiontrapoccursifthisinstructionisexecutedinusermode.SIPOB1StoretoInternalProcessorregister.PReg[Alpha]_[S];S_S-1.LIPstoresawordfromthetopofstackintoadesignatedEUorIFUregister.RegisterassignmentsaregivenbyDragOpsCross.ProcessorRegister.Aninstructiontrapoccursifthisinstructionisexecutedinusermode.ProcessorRegisters(Note:thisdescriptionispartial).IntheIFUweneedthefollowingregisters:Status-containsIFUandfloatingpointstatus.EachstatusfieldhasanaccompanyingbittoindicatewhetherthefieldshouldbesetbyanSIPinstruction.Traps{enabled,disabled}Reschedule{clear,waiting}Mode{kernel,user}fpAluA{clear,single,double,integer}fpMultA{clear,single,double,integer}EldestL-containseldestLintheIFUstack.EldestPC-containseldestPCintheIFUstack,readingthisregisterremovestheeldestentry,whilewritingthisregisteraddsaneweldestentry.YoungestL-containsyoungestLintheIFUstack.YoungestPC-containsyoungestPCintheIFUstack.Thisisusefulintraproutinesthatneedtoexaminecode,orincaseswherethetraproutinewantstoskiptheoffendinginstruction.SLimit-containscurrentstacklimit.TheIFUwilltrap(iftrapsareenabled)whenthestackisincrementedtoliein[SLimit..SLimit+15](modulo128arithmetic).L-containscurrentvalueofLregister.(Not:notavailablethroughLIPandSIP)S-containscurrentvalueofLregister.(Not:notavailablethroughLIPandSIP)IntheEUweneedthefollowingregisters:Field-FieldUnitControl.ThisregistergovernsthebehavioroftheRFUinstruction,andcanbesetbyeithertheFSDBorSIPFieldinstructions.MAR-MemoryAddressRegister.ThisregisterhasthelastaddressaccessedbytheEU.Itispf qfG~xb*6 <%+0)468o|_ x__m]3 @ ^&3R|ZxZ"D >" %!*024m8;=f?D,Y |V xVVmT (-A27<+=?|Q xQQmO# *,.029;u B[EJM|o W !$|K xKKmHO +0579@AB F79 !'=(+|Dc xDcDcmA\$k/|?lx?l$i "%() 0L24V7C<A =n+.: 5A8Q<>OA H#<yr{8 @x5 U  u3  )Q  1Kl%$.',04z7:g )#'),15T69<*B\ !d%(u+.?1*3 6|8>BADH#+1 a,614[ =zxN !sz&=='"*T,2\~7l==8Cz=:w~====z?==xOZW.!Sz&OO'*3,2<~7LOO8#zO:V~<OO=z?OOx  ) 0cC"U'+,7.465|8>9x;B BlEG >1MI5| > >mx > y|"= > >#x >%I( P ${',/149>@CFH#TVm$DragonOpcodes16usedinhandlingpagefaults,andshouldbethefirstthingreadonanEUPageFaultorWriteProtectFaulttrap.ThingsleftoutThereareseveralinstructionsleftoutoftheabovelist,forvariousreasons.Tofirstapproximationthesearethefloatingpointoperations.XOPsXopsaretheundefinedinstructionsintheinstructionset.Topermitefficientemulationofextendedinstructionsets,allXopsbehaveasprocedurecallstoanaddresslinearlydependentontheinstructioncode.Xopshavedifferentlengths,dependingontheinstructioncode.Xopsoflength2pushAlphaontothestack(high-orderbytesundefined),Xopsoflength3pushAlphaBetaontothestack(high-orderbytesundefined),andXopsoflength5pushAlphaBetaGammaDelta.Forimplementationreasonssomeundefinedoperationsdonottrap,butalsodonotproducewell-definedresults.TheseoperationswillbedetailedwhenthePLAfortheIFUissufficientlydetermined.TimingestimatesThissectiongivesapproximateminimalinstructiontimesforDragon.Simulationresultsindicateanestimateof2cyclesperinstructionisaconservativeguessforaveragetime.cyclesoperation36?UDIV19?SMUL8CST5conditionaljumpincorrectlypredicted5SFCI,SFC,SJ4SIP32,3,5byteXops3KFC,RETK21byteXops2conditionaljumpcorrectlypredictedtojump2JB,JDB,DJ,RET,RETN,LFC,DFC,EXCH1conditionaljumpcorrectlypredictedtocontinue1allothersAdditional1cycledelaysarecausedbythefollowing:*usingtheresultsofacachefetchonthenextEUcycle*aword-boundaryspanninginstructionwhentheinstructionbufferisempty(forexample,jumpingtoaninstructionthatspansawordboundary)Returnsaredelayeduntilpreviouscallsorreturnshavecompleted(3cyclesfromstartofpreviouscallorreturn).Thereareadditionaldelaysduetothefetch-aheadoftheinstructionbuffer.AtthestartofeveryIFUcycleafetch-aheadisperformedifthebusisnotbusyfromtheprevioususeoftheIFUcache.Thismaycausethebustobebusywhenthereisacachemiss,butotherwisedoesnotaddcycles.Forstraightpf qfG~xb21}; ]$'L+-0H3069<>@DG`1o{]< }xY  , r "$(+c-2S7:< FXF  ?I {T xQ  ( "j$ +/1F5;CACP }>&)+e-d2\7^>2@FB NY =E /' )'+ 26:<[@AElL  b  $(c*.</c29k<>BF K  +!"R%H   F $ +-/35k8:##+x,##|-##.zx0*##|1##1!x!!! !H$*02Q|x! n k"g$ q  $B&I(+.B: ! (,/: 6N:<[@CF1XI "$$()-d 0"$)J,3W59<?AiG#    R ~! )Y+- 4e9;=ABF  o #r"R$&s(,N/247:X< >AFu Y  T# $z%)L,/538R:=[B DTVm$DragonOpcodes17linecodetheinstructionbuffercanusuallykeepupwithcachemisses.WhentheFieldregisterissetbyanFSDBorSIPFieldinstruction,therewillbeadelayifthereisanattempttoperformanRFUinstructioninthenexttwocycles.ThisistoallowtheFieldcontentstimetoreachtheshadowregisterintheEU.FortheEUcache,assume6cyclesforwritingadirtyvictim,6cyclesforaquadread,and6cyclesforamapmiss.Thesewilltakemoretime,ofcourse,whenthereiscontentionbyotherprocessors.pf qfG~xb2  I $S$')-0_  oh| __!Zx_$k|&5__' x_)F, 4#7:c,0|1 8:>R TVm$DragonOpcodes18InstructionMapThisinstructionmapshowsthecurrentplacementofinstructioncodesintheopcodespace.IthasbeenarrangedtominimizethedecodingdifficultyfortheIFU.Thismapissubjecttochange.formlen0123456700000:OI1xopxopxopxopxopxopxopxop00001:OI1xopxopxopxopxopxopxopxop00010:OI1xopxopxopxopxopxopxopxop00011:OI1xopxopxopxopxopxopxopxop00100:OQB5xopxopxopxopxopxopxopxop00101:OQB5xopxopxopxopxopxopxopxop00110:OQB5xopDFCLIQBxopxopxopJ5DJ00111:OQB5xopxopxopxopxopxopxopxop01000:OI1ORANDRXBCADDSUBLADDLSUB01001:OI1DUPDISEXCHEXDISSFCSFCIRETNxop01010:OI1xopSMULUDIVxopKFCxopJ1SJ01011:OI1LC0LC1LC2LC3LC4LC5LC6LC701100:LR1LR0LR1LR2LR3LR4LR5LR6LR701101:LR1LR8LR9LR10LR11LR12LR13LR14LR1501110:LR1SR0SR1SR2SR3SR4SR5SR6SR701111:LR1SR8SR9SR10SR11SR12SR13SR14SR1510000:QR2QORQANDQRXQBCQADDQSUBQLADDQLSUB10001:OB2ALSALASLASCSTxopRETRETK10010:OB2LIPSIPLIBSFPADDBSUBBJ2JB10011:OB2RBWBRSBWSBPINPOUTxopPSB10100:LRB2LRI0LRI1LRI2LRI3LRI4LRI5LRI6LRI710101:LRB2LRI8LRI9LRI10LRI11LRI12LRI13LRI14LRI1510110:LRB2SRI0SRI1SRI2SRI3SRI4SRI5SRI6SRI710111:LRB2SRI8SRI9SRI10SRI11SRI12SRI13SRI14SRI1511000:RR3RORRANDRRXRBCRADDRSUBRLADDRLSUB11001:RR3RXOR***RFU***RVADDRVSUBRUADDRUSUB11010:ODB3LGFLFCLIDBxopADDDBSUBDBJ3JDB11011:ODB3RAIWAIRRIWRIINOUTxopxop11100:RJB3***RJEBRJLBRJLEB***RJNEBRJGEBRJGB11101:RJB3***RJNEBJRJGEBJRJGBJ***RJEBJRJLBJRJLEBJ11110:JBB3JEBBJNEBBJEBBJJNEBBJxopxopxopxop11111:ODB3SHLSHRSHDFSDBFLIPFLOPxopxop***=>NotdefinedasXOP=>Undefinedbehaviorpf qfG~wa Wx^   R"(*` 16469=BOCF2] V] %'**.1.4I5:]< Xt F$).q3*7<Wn!-$R) -2}76;Vn!-$R) -2}76;Tn!-$R) -2}76;S]n!-$R) -2}76;Pn!-$R) -2}76;O;n!-$R) -2}76;Mn!-$R) -2}76;Lyn!-$R) -2}76;In!-$R) -2}76;HWn!-$R) -2}76;Fn!-$R) -2}76;En!-$R) -2}76;Bn!-$R) -2}76;Asn!-$R) -2}76;@n!-$R) -2}76;>n!-$R) -2}76;;n!-$R) -2}76;:n!-$R) -2}76;9/n!-$R) -2}76;7n!-$R) -2}76;5 n!-$R) -2}76;3n!-$R) -2}76;2Kn!-$R) -2}76;0n!-$R) -2}76;.(n!-$R) -2}76;,n!-$R) -2}76;+gn!-$R) -2}76;*n!-$R) -2}76;'Dn!-$R) -2}76;%n!-$R) -2}76;$n!-$R) -2}76;#"n!-$R) -2}76; az!(^TVm$DragonOpcodes19CallsandReturnsThissectiongivestentativeinformationaboutthestrategyusedforprocedurecallsandreturnsonDragon.SimplecallThesimplecaseofcallingaprocedurefirstpushesanyargumentsexpectedbytheprocedure,thencallstheprocedureviaDFCorLFC.ThefirstinstructionisnormallyanALSinstruction,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,fetchestheprocedurevariablefromthepf qfG~wa Bx^  d3 !%`',/185;%=BQD8{[[ |xX   S&).1b83>@1B VdLs|VdVd xVd"|$VdVd%x'aVdVd(+. 57G=0|?8VdVd@xVdB\ T5t;"2 * 1]3:?BDFIS!h P>9 Y!#(+.,1,468<=A Bg NflfVe &)k*z.NN/GxN14)69) @${K fxHU  "_#',"/U0214 =>APGF!#O%).j379^:=e|?FF@xFB E"&z(-G1c479=<B|EEEFxC_ !%N $'#+}/469+:\<@C'EG;6#Q!x#'O+/"03K6g9;a BDF4|f1|p4|4|Hx4|! (D*/1 9:z;AG2s90Y"v$(T,/P1F68=|?k22@Cx2CTH#1-{- xx*3#!)|/1;5 7:=A B (C $T*, 46;=AD'AV( %' )./6/;=DX%u[ |"%%|)x%%*Px,%%.,1A 8M?AE/G/# W"f%')m*0<37o:>E}{  xT C $&+-279<?kCp#y% &(*14g:@@BE? k"'? -/3_47L; BVD^53"$&) ,054<>}B DG|x {h x?"&U+b.=17:?F(q i""$j*;+.^27t >DW  "%().136N<ACG "3o"%') 158>CG/ TVm$DragonOpcodes20interfacerecord,andperformsaprocedurevariablecall.MultipleglobalframesAlthoughproceduresmustbespeciallycompiledtousemultipleglobalframes,thereisnoadditionalmechanismbeyondforcingallcallstoroutineswithmultipleglobalframestousetheindirectprocedurecall.Theaddressontopofthestackcanthenbeusedtofindtheglobalframe(probablyviaaddingaconstant).CoroutinesCoroutinecallsarehandledbytraps.Thedatastructurestobeusedarenotyetdefined.However,co-routinecallswillberoughlyasexpensiveasprocessswitches.pf qfG~xb2\ "(-{^ x[z !'-/28k<AEGY  %|'v*,G14:G>sBDG/XF }$e&[(*i,0257:A%G<Q{1M v '$+Sy-Q{Q{.xQ{669=hB O> Ue "\#y&gOO';xO.13 76: A`CN- %) /27qNB;EvG/|x : C c$S')M|+,x0 8>:=8AD8O&!T$;')z 04;t=~? Fp{A  kxm!$%+-4k9;@>@CUFK]$=%]),O1$69>C N!%(+k-,/038B:=?BwE {= #%{   x _ 5!<$%+-4N9;>@BFTVm$jDragonOpcodes22faultingaddressisavailableasthereturnPC.Thehandlershoulddetermineifthepageisvalid,theneithercausethepagetobemadepresent,orcauseapagefaulterror.pf qfG~xb2" t, #5'b*-c2l6=e>A!DfE`4!6| +"%+,0148-TVm$ZDragonOpcodes23FieldUnitSpecificationThissectiongivesaMesaspecificationfortheFieldUnitfunctionsandthefielddescriptorformat.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#ofright-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.<>};pf qfG~wa  x^  . !#&G)-358!;M AG] < O" -.146TVm$\pZ  m")*.E03f6;?B= X  }qTVm$:}U ybUU}UyUU`U }Uy)UU*U, }/4UUS ySSN}!SyS"G}%SS&RAwcyHRARA}!RAyRA!}%fRARA%N yUNN}NyNNN!N)}N.MJ[zK M1 K#&)a+0}IySII %}IIzHS ' ""$'D)+t}F%zE "$&F(C\1@%Z#%o'T)+}A:z@  qV+ "'%}>d{; };;y;;l};k !/#my-;;.};37 ;\=A9m)x- z7  H #'+./138;}6,{ z4v bm"{$3,.00|y2}2y22}1'? y3'1'1'49}51'1'5;q z/1bI#M'*X+.G}- z,0 Th!a%y*}*y**}*S $4z( PM#/&)h,0h2 46H7:9}'9y# }##z 8{K}KKyKK} 5x y$v%J}*/4y117};z /[s$_(4*,o.14+8;@+T11 } {\}i\\yg\\}  y#$}).y0i1"6W}:z  /[u$`'*+.y138@:>e11 }  .nTVm$/DragonOpcodes24SingleWordShiftRight: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<>};pf qfG~{b0};b0b0y9b0b0}`  y#``$}`).y0i``1"`6W}`:z^ /[u$`'*,/a149(;t?]:11 }[ {XD}eXDXDycXDXD }XD 0y~XDXD R}XD%*<y,!XDXD,}XD0zV /[T11 }SN {O}OOyOOP}OPuyOO}O$)y+gOO+}O0zNX /[L11 }K  {G}OGGyMGG}GRyGGu}G$)_y+DGG+}G/zF /[Dl11 }B TVm$^DragonOpcodes25InstructionSetSummaryNameform#DescriptionADDOI1[S-1]_[S]+[S-1];S_S-1;traponoverflowADDBOB1[S]_[S]+AlphaZ;traponoverflowADDDBOB1[S]_[S]+AlphaBetaZ;traponoverflowALOB1L_L+AlphaALSOB1L_S+AlphaASOB1S_S+AlphaASLOB1S_L+AlphaBCOI1trapif[S]<0or[S-1]-[S]>=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+1EXCHOI1[S+1]_[S];[S]_[S-1];[S-1]_[S+1]EXDISOI1[S-1]_[S];S_S-1FLIPODB1fpA_fpAopstack;S_S-fpAdj;special:usesFPchipsFLOPODB1stack_fpAopstack;special:usesFPchipsFSDBODB1Field_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+1LIPOB1[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+1LIQBOQB1[S+1]_AlphaBetaGammaDelta;S_S+1LRInLRB16[S+1]_([L+n]+AlphaZ)^;S_S+1LRnLR16[S+1]_[L+n];S_S+1SMULOI1[S-1],[S]_[S-1]*[S];signedOUTOB1([S]+AlphaZ)^_[S-1];S_S-2;special:usesIOlinesPINOB1[S]_Pbus[Alpha,[S]];special:usesPbusdirectlyPOUTOB1[S]_Pbus[Alpha,[S]];S_S-1;special:usesPbusdirectlyPSBOB1([S-1]+AlphaZ)^_[S];S_S-1QADDQR1[S]_[S]+Rb+carry;carry_0;traponoverflowQANDQR1[S]_[S]ANDRbQLADDQR1[S]_[S]+Rb;carry_0;traponoverfloworLispNaNQLSUBQR1[S]_[S]-Rb;carry_0;traponoverfloworLispNaNQORQR1[S]_[S]ORRbQRXQR1[[S]]_([[S]]+Rb)^QSUBQR1[S]_[S]-Rb-carry;carry_0;traponoverflowQXORQR1[S]_[S]XORRbRADDRR1Rc_Ra+Rb+carry;carry_0;traponoverflowRAILRRB1[L+BetaL]_(AuxRegs[BetaR]+AlphaZ)^RANDRR1Rc_RaANDRbRBOB1[S]_([S]+AlphaZ)^RBCOB1trapifRa<0ORRa-Rb>=0;Ra_RcRETOB1S_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;traponoverfloworLispNaNpf qfG~wa WW$TVm$q`  kq $TVm$_! s_!_!*#&R( ] s]]* "$A\_ s\_\_*"n$&Z sZZpY sYYpX? sX?X?V sVVU sUU!;C(($d&u'T sTT*$*QTT*sT,88TVm$r=iTT=APTVm$R sRRgQ^ sQ^Q^O sOON sNN*M= sM=M=* " K sKK*LJ} sJ}J}!2^! ^TVm$r'J}J}(%+.0sTVm$I sIIV(T 0TVm$$r"~II# &)+YJTVm$G sGGp F] sF]F]*^.TVm$+r!eF]F]!%(*TVm$D sDD C sCCB= sB=B=C )@ s@@^ S!#$~%(+-?| s?|?|C )?> s>>*"< s<<*" ;O s;O;Og 9 s99*&[8 s88* 97. s7.7.*!5 s55*'t4l s4l4l*$3 s3 3 * 1 s11*x "0I s0I0I*"eTVm$Lr&d0I0I&*-/TVm$. s..*TVm$r!.."w&A) ,TVm$- s--*!!TVm$r%--&v*@- 0TVm$,& s,&,&*"e* s***!&Z(*)d s)d)d*( s((* "%&+- /& s&&* !$[&*,P.%A s%A%A*# s##*" s""* $'Z)! s!!* s !m&6(*a^ s^^*! s s*> s>>!;C  '%t& s!K$  s3L s3L # s*_ s__  s  s ? s??  s    s  L]   s  "~$&+j,/r TVm$DragonOpcodes26RLSUBRR1Rc_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;setcarryRUSUBRR1Rc_Ra-Rb-carry;setcarryRVADDRR1Rc_Ra+RbRVSUBRR1Rc_Ra-RbRXOI1[S-1]_([S-1]+[S])^;S_S-1RXORRR1Rc_RaXORRbSIPOB1PReg[Alpha]_[S];S_S-1SFCOI1callprocat[S];S_S-1SFCIOI1callprocat([S])^SFPOI1fpA_stack;S_S-fpAdj;special:usesFPchipsSHLODB1[S]_FieldUnit[[S],0,AlphaBeta]SHRODB1[S]_FieldUnit[[S],[S],AlphaBeta]SJOI1PC_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]-AlphaZ;traponoverflowSUBDBODB1[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];unsignedpf qfG~bo sbobo!$7%*,,.a saa_ s__*^P s^P^P*\ s\\*#[ s[[ $'6(Z0 sZ0Z0 !m#ZX sXX !Wr sWrWrV sVVT sTT*!0SS sSSSSQ sQQ TP sPPgSO3 sO3O3gM sMM!2 TVm$Nr#MM$A( *,TVm$Lt sLtLt*K sKK*I sIIHS sHSHS*#F sFF*E sEE*(#'%'RD1 sD1D1* ]!#B sBB*!$&%Ap sApAp*!@ s@@*"e> s>>*=O s=O=O*"e; s;;* x #d$m&TVm$DragonOpcodes27SamplecodesequencesNotationInthefollowingexamples,FD[insert,mask,shift]denotesafielddescriptorwithindicatedfields.RRformatoperationsarewrittenwiththeoperandsintheorderRc,Ra,Rb(destinationisfirstmentioned).Thefollowingconstantregistersarereserved:c0:0,c1:1,c2:2,c3:3,c4:4,c5:-2,c6:-1,c8:FIRST[INT],c9:100000BPackedsequencefetch/storeAssumethefollowingCedar/Mesacode:r:REFTEXT;--inlocalregisterLr(32-bitmaxLengthinword1)i:INT;--inlocalregisterLic:CHAR;--inlocalregisterLcc_r[i];--generatesthefollowingcode{11cycles}LRILr,1--pushthewordcontainingtheboundLRC1--pushthecharacterindexSHLFD[0,5,3]--makeitabitindexintothewordADDDB[0,8,8]--addintherestofthefielddescriptorSIPField--settheFieldregistertocontroltheshiftRBC[S],Li,[S]--boundschecktheindexgiven(leaveLiin[S])SHRFD[0,30,30]--makeawordindexQADDLr--getthewordaddress(-2)RB2--fetchthewordcontainingthedesiredcharRFULc,C0,[S]---extractthecharandstoreittocr[i]_c;--generatesthefollowingcode{13cycles}LRILr,1--pushthewordcontainingtheboundLIDBFD[1,32,24]--pushthebasefielddescLRLi--pushthecharacterindexSHLFD[0,5,3]--makeitabitindexintothewordSHRFD[1,10,5]--alsoinsertitintothemaskpositionSUB--adjustthefielddescriptorSIPField--settheFieldregistertocontroltheshiftRBC[S],Li,[S]--boundschecktheindexgiven(leaveLiin[S-1])SHRFD[0,30,30]--makeawordindexQADDLr--getthewordaddress(-2)RSB2--fetchthearrayword(leaveaddronstack)RFU[S],[S],Lc--insertthecharintothearraywordWSB2--storethechangedwordProcedurebody&callAddFunny:PROC[x,y:INT]RETURNS[INT]={z:INT_x+y;IFz>1THENz_z+z;RETURN[z];};GeneratesALS377B--pointLatxpf qfG~wa {^ x[[  m'(>-r.2 8;BFY g i6!'~),+/@5 =>AZ W9  ETW-e!;#%')y,"TT,x/rTyT/x1TT2C3 5i{Qo  xN w w}Ly y LyLySLyJ}ILyzLy~!&(-4>595}J y ^JJ }iJzJ1N^}I* y I*I*a}I*zI*1N^}E zE1!$'e|D4}D4BzD4"9$' .x0|B}BBzB"9$*p|@}@Bz@"$ %?'G*-0|?>}?>Bz?>!#A%(%),/ |=}=Bz=!#f&+-H14*|;};B z;#'t)-x1468f|:H}:HB z:H"#'8|8}8Bz8!F#&+|6}6Bz6"\$' .05n|5R}5RB z5R#%(+.0<1}2 /z21!$'e|0\}0\Bz0\"9$' .x0|.}.B z."9$'*|- }- Bz- "9$*p|+f}+fBz+f"$ %?'G*-0|)})B z)!%&)+/|(z("%L(P |&p}&pBz&p!#f&+-H14*|$}$B z$#'t)-x1468f|#!}#!B z#!"#'8|!y}!yBz!y!F#&+|}Bz"\$(;+/n24z|+}+B z+"% (*-/0|}Bz"N$){ xK? }??y??}?y??-}??y??}?"y#%??#}%0??&'y}6y} y=}!yH}H{ z | R} RBz R"}#%!TVm$DragonOpcodes28RADD[S+1]+,Lx,Ly--z:INT_x+yRJLEB6,[S],C1--IFz>1THENRADDLz,Lz,Lz--z_z+zRORLx,Lz,Lz--RETURN[z]RET0--(S_L+0)u_AddFunny[v,w]+1;Assumeu,v,wareinlocalsLu,Lv,LwAssumeAddFunnytobecalledviaDFCGeneratesLRLv--pushvLRLw--pushwDFCAddFunny--AddFunny[v,w]RADDLu,[S-1]-,C1--u_...+1ArithmeticprecisionchangesMultiple-precisionarithmeticquantitiesarestoredwithhigherorderwordsinloweraddresses,evenwithintheregisterstack.Thatis,thewordat[S-1]ismoresignificantthanthewordat[S].Doubleprecisionnumbersshowupinmultiplicationanddivision.Extend32-bitsignednumberonstackto64-bitsignednumberonstack{3cycles}DUP--low-orderwordontopofstackRUADD[S-1],[S],[S]--carrybit_signbit&putgarbagein[S-1]RSUBC0,C0,[S-1]--negatesignbitintohigh-orderword,(clearcarry)Narrow64-bitsignednumberonstackto32-bitsignednumberonstack{4cycles}RUADD[S+1]+,[S],[S]---carry_signbitofloworderword,garbageat[S+1]RADD[S+1]+,C0,[S-1]--[S+1]+_signbitplushigh-orderword(clearcarry)RBC[S],[S]-,C1--boundscheckfaultwhen[S]#0,popstackEXDIS--flushthehigh-orderwordExtend16-bitsignednumberonstackto32-bitsignednumberonstack{2cycles}(assumesleftmost16bitsare0s)RXOR[S],CNSI,[S]--complementthesignbitQSUBCNSI--subtract100000B,whichcarriesthroughNarrow32-bitsignednumberonstackto16-bitsignednumberonstack{4cycles}(assuresresultingleftmost16bitsare0s)RVADD[S],CNSI,[S]--bumpthesign(100000B)RXOR[S],CNSI,[S]--complementthesignbacktoitsoriginalLIQB2000001B--pushthelimit+1BC--boundscheckfaultwhennotin16-bitrangepf qfG~|b0}b0B zb0&(S#TVm$$s)b0b0*h$TVm$zb0,-|`}`Bz`(TVm$s``<TVm$z` !# >TVm$s$?``$BTVm$|^}^Bz^ !#$>&#|]:}]:Bz]:F TVm$.s]:]:fTVm$z]:$U|[}[Bz[ !#V}XD H G-zVzt>TJ #-SN |Q}QBzQ"9|O}OBzO"9|NX}NXBzNX '|L}LB zL G!#A%&{G xDl  S "%`)- 15}9;? FIB I8t!%'>*,/ 6r9<)?A{DA y %(Ez< #!$(,13719|;Sz;S!#),k._02W|9}9B z9!#&(*,.0u279|8}8B z8!#'g*B,J/ 59H=4 #Q$(,137a9F|3}3Bz3!#&( *,.148?=U>|1g}1gBz1g!#(*:-/1 8;?|/}/B z/!#'+.2A4~6c7:|.}.z.!#&r( /M* #!$(,13719)#D|'{}'{B z'{!# *,/|%}%Bz%!#(C.526s" #Q$(,137a9F %"<$|7}7B 7!z#77#&)"+|}B !z##*,/246|}B!z##&P(|AzA!#'+.2A46J:,lHTVm$DragonOpcodes29RecentChanges17Dec84ALUopschanges(QRformat)TheQRformatwasestablished,moreOIformatoperationswereadded,andnowthereisacommonsubsetofoperations(ADD,AND,BC,LADD,LSUB,OR,RX,SUB)intheOI,QR,andRR1formats.Also,SMULandUDIVarethesurvivingmultiplyanddivideoperations.Also,SUBDBhasbeenadded.FieldopschangesSHDnowallowsextractionoffieldswithoutrequiringthatthefieldsbepartofaword.Kernel/usermodeKFC(KernelFunctionCall)hasbeenaddedtocallkernelroutines,andRETK(returnfromkernel)hasbeenadded(RETKalsoreplacesRETT).LEUR,LIFUR=>LIP,SEUR,SIFUR=>SIPOnceagain,theinstructionsuseAlphatodistinguishwhichunittheyaddress.FloatingpointinstructionsForthefirsttime,asketchofthefloatingpointinstructionshasbeenprovided.ThecurrentinstructionsareSFP,LFIP,andFLOP,butmaychange.BNDCK=>BC,EP=>ALS...foruniformity.NewPIN&POUT...asplaceholdersforPbusaccessinstructions.Detailsnotyetdefined.28Aug84fixestoexamples...tomakethemmoreaccurate(therewerebugs).23Aug84definitionfixestoBNDCK&RBC...tofixupcarelessness.22Aug84RBCadded...duetointerestingusesinarithmeticchangesandotherspecialboundschecking.pf qfG~wa {^  z[Z  uxX  & _" $=( /27:_=zABCVc  f|VcVcxgVcVc|:VcVcxVcVc|VcVcmxDVcVc| VcVc x#wVcVc|$JVcVc%"x'VcVc|(}VcVc)Ux*-VcVc|+VcVc+x,VcVc|-VcVc.[x0 VcVc0247d:T=@?F|T xT |TT_xTk$'L+z 3|6TT7cxT;G=AzQl  ^|N xN ) C%+-0/358:q;zJ exG~  smD!%'k).)3|6G~G~7XxG~:a?BkGE  Im|EExE|EEx!8EE!~B z JBB~&BBzB~uBBMzBB~BBz6BB~BBzB!~$bBB%9x?8   K!# *.1t4z; S x8  =km#l& .S04:=qB/ 6 | ?66 x66|66|x66|66ox66T X~3 z3~;33z33~33z3~33gx0S  w z- ~ -- z-~--jx)  w %=K ',-.0{&e  z#  (x  w %cZ!]${w  z' .~''z'~''x  w %6I {  ~9 z9 x  w. = !&)-C162TVm$#DragonOpcodes3021Aug84Cleanuppass...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.21Mar84Stackunderflowtrapadded...byarrangementbetweenMcCreightandAtkinson.Thismakesstacksave/restoremucheasiertocode(andfasteraswell).16Mar84SPR=>SEUR&SIFUR,LPR=>LEUR,LIFUR...atthetherequestoftheIFUdesigners.Noticethatthisreversesadecisiontakenon27Feb84.AllinstructionsuseidenticaldecodingofAlpha,soEUregistersandIFUregisterssharethesameencodingspace(seethedeclarationofProcessorRegisterinDragOpsCross).15Mar84RECdumped...sinceitwaslargelyuseless.pf qfG~{b0  z^ Hx[  w %6}+  #)_.1~XC zXC ~yXCXCPzXC~1XCXC zXCXC~XCXClzXCXC~XCXCz,XCXC~ XCXCz"gXCXC~#CXCXC$xT  fk %^*,A/ 7 9 @M|ETTFxSM | SMSM {xSM\bE (g+."024669{O  }zL ZxIa  w %y'l% "9%{F ! zB ~BBzB%~BB~x?t   ^s~!9 ),1 9f; >AUD7= #?z:~ ~:~:~z:~M~:~:~x7/   [+  |'{7/7/(Sx7/)+Q/158';&?BFu5 |=55x5;f"$(X)+/3*79;T?TAnChE 3 c~0 z0 ~00|x-C  w %9}j {)  z&  x#V  i V A!y$#*-15d = @DFH!  {`  ~ z ~dzn~z&~z ~ zz#~#$x  t eH $(+.]34: =?ADG< JK1 %b'$)/14:1=@,Ct  n &(C {%  ~ z x  w@fTVm$DragonOpcodes319Mar840-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.RLADD&RLSUBadded...tosupportLisp(&maybeSmalltalk)arithmetic.AnewtraphasbeenaddedforListNaN.21Feb84WriteProtectfaultadded...sowecoulddistiguishitfrompagefault.RIFdumped...sinceitonlyhada1-byteadvantageovertworeadinstructions.10Feb84Codegenerationsamplespf qfG~{b0 !:~^  z^nx[  r:DEH#&)4*1|3 :>BDGY ! {{V !:~SJ zSJxO  w@ L[ !~#')`+Q,{/29 zL  2xxI\   3> $*,D.u169>)ACEG {De !:~A zA ~ AAyzAIx=  Y  &* 17!:X<? Ft<  {8  ~5 z5~(55z5 ~55wz&55~55z5~ >55!z5$ ~&55'x20  y 1!5#3'*(,235 :r<-ACd0 | 00xv00z-9  ax)  wD _!#X$~& z&~(&&z&x#K  w %1K\ "Y )+E.3136; =I@ {  z  zx\  w ;b. X!\~ z x  w@Y;t!%'* {n  z   j  TVm$=DragonOpcodes32...wereadded.7Feb84FieldDecsriptormaskfieldwidenedTohelpwithboundaryconditionsingeneratingfielddescriptorsonthefly,themaskfieldofFieldDescriptorwaswidenedtoinclude32.Thisalsomakesitfollowthesameconventionastheshiftfield.Wemaywishtorevisitbothdecisionswhenweseemorecases.NILCKdumpedNILCKisusedtocheckforNILpointersbeforetheyaredereferenced.WedonotanticipateusingNILCKoftenenoughtowarrantitsinclusion.Incaseswherewewoulduseit,insertinganextrafetchthroughthepointerwillbequitesufficient.Wecanevenaffordtokeepallofthelow64Kofvirtualmemoryunmappedtofurtherreducethisproblem.SHL&SHRTwousefulshiftoperations,SHLandSHR,havebeenintroducedtoreplacefrequentlyoccuringcasesofFSDBfollowedbyRFU.6Feb84SFCIreplacesSFCBSFCIreplacesSCFBtosaveabyte,whichincreasesthepossiblenumberofinterfacesthatcanbecalledfromagivenglobalframe,sincewecanhave4bytesoffetchingprecedingtheSFCI.ThisallowsustodumpRIFifitbecomesnecessary.RRXreplacesRFXSimplenamechange.LCnreplacesLInLCnnowallowsshortaccesstothefirst8constants.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.pf qfG~xb2  w{^ ! z[  ^ xXF  }' !5#M *p. 5f7:=t@>D;GV "%(+u/15R7;> BWD FtT  e}%)K+r-1Y~Q zQ|NZ xNZky"NZNZ xNZ$W(, . 7:<?y E|L xLSH &(,&0J2}697:@BFK 1s+) %(K*.62f4!79|;B=@\CoE4Id Y5!#~F zF ~yFFPxB  4 |5BB xB<| BB!x#vBB$M'* 13|84 >DhG|A xA u|pAAHxAA{= ! z:  |72 x72 |7272x72 $),+1f68> >aA)CE5  Lo8 "%&*,=17|:,55;x=55>AFG3 | 33x3\L z0  ix-F Sz)  A|& x& M"}# |*v&&+Nx&-|2&&3x5E&&6:(<AC*EHZ% z! Rxd  * e "%).3+8y= ~ z r~ O&z~~Uzx  l"Uf$h) |12x5@|66x89o|<<x?DkFS z  ^  x  $ "|$e%=x(u,059|<=x?E 2 | x"~ |#n $Fx% |& 'x*F +W- |5 6]x 9}|GQ TVm$ TIMESROMAN HELVETICAGACHA TIMESROMANGACHAGACHA LAUREL GACHA TIMESROMAN TIMESROMAN TIMESROMAN TIMESROMAN TIMESROMANY HELVETICAYMATH HELVETICA HELVETICALOGO HELVETICA HELVETICA !>&+r18>FEcKRYai'k:r 1|&~ 'V x/j/"9[]<>Dragon>DragOps.tioga%Monday, December 17, 1984 5:47 pm PST