CHAPTER22INTERLISP-10SPECIFICSThischapterdescribesanumberoffeaturesofInterlisp-10thataremachineorimplementation-dependent,andarenotexpectedtobeimplementedinnewerimplementationsofInterlisp.22.1INTERLISP-10INTERRUPTCHARACTERSThetablebelowgivestheinterruptcharacterscurrentlyenabledinInterlisp-10.Note:Itispossibletochangetheassignmentsofcontrolcharacterstointerruptswith(page9.17).control-BGeneratesanimmediateerror,andcausesabreak,regardlessofthedepthortimeofthecomputation.Thusifthefunctionisloopinginternally,typingcontrol-Bwillcausethecomputationtobestopped,thestackunwoundtothepointatwhichwascalled,andthencauseabreak.Thisisastrongerinterruptionthancontrol-H.Notethattheinternalvariablesofabovearenotavailableinthisbreak,andsimilarly,mayhavealreadyproducedsomechangesintheenvironmentbeforethecontrol-Bwastyped.Itmaynotbepossibletosimplycontinuethecomputation,dependingonthenatureofthefunctioninterruptedandwhenitwasinterrupted.Thereforewheneverpossible,itisbettertousecontrol-Hinsteadofcontrol-B.control-CComputationisstopped,andcontrolreturnstotheoperatingsystem(Tenex,etc.)Theprogramcanbecontinuedwiththecommand.control-DAbortsthecomputation,andunwindsthestacktothetoplevel.Calls(page9.14).control-EAbortsthecomputation,andunwindsthestacktothelast.Calls(page9.14).control-HAtthenextpointafunctionisabouttobeentered,thefunctioniscalledinstead.types,constructsanappropriatebreakexpression,andthencalls.Theusercanthenexaminethestateofthecomputation,andcontinuebytyping,or,and/orbacktosomepreviouspoint,exactlyaswithauserbreak.Control-Hbreaksarethusalways``safe''.Control-Hbreaksoccurwhenafunctioniscalled,sinceitisonlyatthistimethatthesystemisina``clean''enoughstatetoallowtheusertointeract.Thus,ifacompiledprogramisloopingwithoutcallinganyfunctions(orifInterlisp-10isinaI/Owait),control-Hwillnotaectit.Control-B,however,will.22.1INTERRUPTCHARFOOFOOFOOFOOCONTINUERESETERRORSETERROR!INTERRUPTINTERRUPTINTERRUPTEDBEFOREBREAK1OKGOEVALRETFROMonlyFN|\%L,V! )*xO  z0$<% +B- /17U8B M  e #$(34 |F i qT"- xBq  &/ &$+1#2 89?k  bu &m(,, 3N5 ;N=  : e"&R)-;.d2 8:<@BEG9e  #e+-v2~ 9 =YACuF+7ue [!H&)",24R6:F;BE5e=2e3 &*.04m7_9?D1$eS!#8%), 5`8Q;@CFM/er %)w+0249;><@BH0-e > (/14F8:=B ,3e-[ &,q28a9;H?PACH:*en' e ["%*/b1*39>jCG%ewf#&0" e. "o%*,0D1486:bBqF# e #$&+.@136D?@2e!- e|!o'D)-N/[17k:)HseD$n9:X @B eX !a$,.H1?4W7:E?BXEG<e $[&o,x/45A(DFMe!z#'&?'g*^.35[9<?Ceej"!%m)4*q/1z59e:>?ACF eT"x$Q)V+0(o"},`m$*x?k>m 9(7u?2F1$2g%)B"=8DO-?o' 1'<*-n1:{},p`m$Hx7!}`m$TypeNumberFunctionsAssoonascontrol-Histyped,Interlispclearsandsavestheinputbuer,andthenringsthebell,indicatingthatitisnowsafetotypeaheadtotheupcomingbreak.Ifthebreakreturnsavalue,i.e.,isnotabortedviaorcontrol-D,thecontentsoftheinputbuerbeforethecontrol-Hwastypedwillberestored.Note:Control-Hwillinterruptatlinkedfunctioncalls(seepage12.18).control-OClearstheteletypeoutputbuer.control-PChangesthesetting(seepage6.18).control-SChangesthesetting(seepage22.10).control-TPrintstotalexecutiontimefortheprogram,aswellasotherstatusinformation.22.2TYPENUMBERFUNCTIONSEachdatatypeinInterlisphasanassociated``typename''.InInterlisp-10,eachdatatypealsohasa``typenumber'',whichcanbeaccessedandmanipulatedwiththefunctionsbelow.Ingeneral,itispreferabletousethetypenamefunctions(seepage2.1).[Function]Returnsthetypenumberforthedatatypeof,e.g.,is8,thetypenumberforlists.[Function]Valueis,ifthetypenumberofisequalto.[Function]Valueistypenamefortypenumber,orifisnotavalidtypenumber,e.g.=.[Function]Valueiscorrespondingtypenumberfor,orifisnotatypename,e.g.=.willaccept,,,and,andreturnthesamevalueforeach,whichforInterlisp-10is1.Notehoweverthat=.[Function]Returnsthetypedescriptionstringfor,atypenameortypenumber.[Function]Setsthetypedescriptionstringfortobe.Thetypedescriptionisusedingarbagecollectionmessagesandby.22.2^notPRINTLEVELMINFS(NTYP)(NTYP'(A.B))(TYPEP)T(TYPENAMEFROMNUMBER)NIL(TYPENAMEFROMNUMBER30)STRING.CHARS(TYPENUMBERFROMNAME)NIL(TYPENUMBERFROMNAME'STRING.CHARS)30TYPENUMBERFROMNAMEREADTABLEPTERMTABLEPCCODEPARRAYP(TYPENAMEFROMNUMBER1)ARRAYP(GETTYPEDESCRIPTION)(SETTYPEDESCRIPTION)STORAGEDATUMDATUMDATUMNDATUMNNNNNAMENAMENAMETYPETYPETYPESTRINGTYPESTRING|b'"b%+x\:e{y "8&l+/2}6 8n<@COFyZe 1"#W$'*,C/S3T57c=B(CF Xe,n =!$M)m-5/358>=?BEWIe  S"&)y+hTDeQW#(*\.479= Q> e#N9 e$7(+c.K4 e $e'0*sH/ eX{ #&(e.F/248&; |A i~x<  MA@D $(-z/: 469<?BEF ; -E]! ),<.49f;B@zACV 9[   iv2+#96VC5 4""%'B)s+.178Hs3 2#%0C5 ._ "t%*1+26R8+ZC5 )+ L$&k)/058:<=A=D^(-9!% C5 #d %(-3i4.8>?eABE!69'b*$6@5F4G( $'S*.148;P @BDLFjm%2m8hC5 6"C )N-!23u47;g=)@6C5 & S '+r13}:';#>AG Hsq! '-0b8=(o }`m$xX+{TD xN9L K4L6V >4;^@iCEs0 ._+Z )2t(Y+'/ % J#d5!Y+' 8J.s 7 A)m03h  #rq2\}`m$xx6V43o4>40\._,`-/-7+Z).7% #d/:h/\-5"}4D`m$T123123INTERLISP-10SPECIFICS22.3VALIDITYOFDEFINITIONSININTERLISP-10Althoughthefunctiondenitioncellisintendedforfunctiondenitions,anddonotmakethoroughchecksonthevalidityofdenitionsthat``looklike''exprs,compiledcode,ors.Thusifisgivenanarraypointer,ittreatsitascompiledcode,andsimplystoresthearraypointerinthedenitioncell.willthenreturnthearraypointer.Similarly,acalltothatfunctionwillsimplytransfertowhatwouldnormallybetheentrypointforthefunction,andproducerandomresultsifthearraywerenotcompiledfunction.Similarly,ifisgivenadottedpairoftheformwhereandfallinthesubrrange,assumesitisasubrandstoresitawayasdescribedearlier.wouldthenreturnadottedpair(butnot)totheexpressionoriginallygiven.Similarly,acalltothisfunctionwouldtransfertothecorrespondingaddress.Finally,ifisgivenanyotherlist,itsimplystoresitaway.Acalltothisfunctionwouldthengothroughtheinterpreter.Notethatdoesnotactuallychecktoseeifthes-expressionisvaliddenition,i.e.,beginswithor.Similarly,istrueifadenitionisalistandnotoftheform,=0,1,2,or3andasubraddress;istrueifitisofthisform.andworkcorrespondingly.Onlyandcheckfunctiondenitionsfurtherthanthatdescribedabove:bothandreturnwhenistruebutofthedenitionisnotorInotherwords,iftheuserusestoputinafunctiondenitioncell,willreturnthisvalue,theeditorandprettyprintwillbothtreatitasadenition,willreturn,and,,and1.22.4REUSINGBOXEDNUMBERSININTERLISP-10-SETNandprovideawayofcannibalizingliststructureforreuseinordertoavoidmakingnewstructureandcausinggarbagecollections.ThissectiondescribesananalogousfunctioninInterlisp-10forreusinglargeintegersandoatingpointnumbers,.isusedlike,i.e.,itsrstargumentisconsideredasquoted,itssecondisevaluated.Ifthecurrentvalueofthevariablebeingsetisalargeintegeroroatingpointnumber,thenewvalueisdepositedintothatwordinnumberstorage,i.e.,nonewstorageisused.Ifthecurrentvalueisalargeintegeroroatingpointnumber,e.g.,itcanbeThesefunctionshavedierentvaluesonsandsandhencemustcheck.Thecompilerandinterpreteralsotakedierentactionsforsands,andthereforegenerateerrorsifthedenitionisneither.Thenoboxpackageprovidesamoreaestheticwayofreusingconscellsaswellasnumberboxes.However,itisstillthecasethattechniquesinvolvingreusingstaticstorageshouldbeusedwithextremecaution,andbereservedforthosecaseswherethenormalmethodofstorageallocationandgarbagecollectionisnotworkableorpractical.Thedeclpackage(page23.18)takesadierentapproachtothesameproblembyavoidingcreatingnumberboxesintherstplaceviatypedeclarationsinthebodyofthefunctiondenition.Thesecondargumenttomustalwaysbeanumberoraerrorisgenerated.22.3PUTDGETDSUBRPUTDGETDPUTD(number.address)numberaddressPUTDGETDEQUALEQPUTDPUTDPUTDLAMBDANLAMBDAEXPRP(number.address)numberaddressSUBRPARGLISTNARGSFNTYPARGTYPEARGTYPEFNTYPNILEXPRPCARLAMBDANLAMBDA.PUTD(ABC)GETDEXPRPTCCODEPSUBRPNILARGLISTBNARGSRPLACARPLACDSETNSETNSETQnotLAMBDANLAMBDALAMBDANLAMBDASETNNON-NUMERICARGy6H$"  D !}`m$"|b'! )*\8 i6 #,%F -NxW ~> "M(*[/ :ACF,V- $+  &)-1)5Q;k?1DrFbT c`!$&M(.)149?=7?CQH0R  O4]#%){. 5678:w=HBEqQ<  X0 ,"&5),&.4n70<AFGO  q2*L l/9!$&)w=G(JPa!'(j)*.0459l;A;IF Hz"%)*,z. 5 ;BC G  J^ ";$ -D  rg "$-(,.2@36|8=:@yDGB | ?  {f#%r')n+, 35U8 ?BUF>J+ #$r'Z()0%1257:=;>_<2&d!*T+.8:l=]>@1ACsF":Q87  !$n +/25;@A6T !#&+-0&6p7@.4  "##-.05;BE3   #/&j)*,- 9 ;@G(1b(A!|*? ih#% -/0x%ft K! */,W14"79B<>yB!F$4 >% #&+L1!39[>@b EG" ,O ",02H5;D{H}Z  Iya   V"(h+-w2599;&>R@@E % $*/37?AD[ X;Xd -#(*/46;v AD ,+) "3%(-e135W8:?EG V  q%(*-/358 @~B6DH&  I  U %Y'H(q-/Z=ABz (o!} `m$xW6=V-AT gRL -35AXJ EIF(?pD}?u>J JCAH< #4*: 7 XCw6T (:B 4(&) *>34S?A1b j% "(,88{%x_#V,%. 03:!} 8`m$ =$} `m$CaveatsconcerninguseofSETN,operatesexactlylike,i.e.,thelargeintegeroroatingpointnumberisboxed,andthevariableisset.Thiseliminatesinitializationofthevariable.willworkinterpretively,i.e.,reuseawordinnumberstorage,butwillnotyieldanysavingsofstoragebecausetheboxingofthesecondargumentwillstilltakeplace,whenitisevaluated.Theeliminationofaboxisachievedonlywhenthecalltoiscompiled,sincecompilesopen,anddoesnotperformtheboxiftheoldvalueofthevariablecanbereused.22.4.1CaveatsconcerninguseofSETNTherearethreesituationstowatchoutforwhenusing.Therstoccurswhenthesamevariableisbeingusedforoatingpointnumbersandlargeintegers.Ifthecurrentvalueofthevariableisaoatingpointnumber,anditisresettoalargeinteger,via,thelargeintegerissimplydepositedintoawordinoatingpointnumberstorage,andhencewillbeinterpretedasaoatingpointnumber.Thus,Similarly,ifthecurrentvalueisalargeinteger,andthenewvalueisaoatingpointnumber,equallystrangeresultsoccur.Thesecondsituationoccurswhenavariableisresetfromalargeintegertoasmallinteger.Inthiscase,thesmallintegerissimplydepositedintolargeintegerstorage.Itwillthenprintcorrectly,andfunctionarithmeticallycorrectly,butitisasmallinteger,andhencewillnotbetoanotherintegerofthesamevalue,e.g.,Inparticular,notethatwillreturnevenifthevariableisequalto0.Thusaprogramwhichbeginswithsettoalargeintegerandcountsitdownbymustterminatewithnot.Finally,thethirdsituationtowatchoutforoccurswhenyouwanttosavethecurrentvalueofavariableforlateruse.Forexample,ifisbeingusedby,andtheuserwantstosaveitscurrentvalueon,isnotsucent,sincethenextonwillalsochange,becauseitschangesthewordinnumberstoragepointedtoby,andhencepointedtoby.Thenumbermustbecopied,e.g.,,whichsetstoanewwordinnumber22.4NILSETNSETQSETNSETNSETNSETNSETN_(SETQFOO2.3)2.3_(SETNFOO10000)2.189529E-43SETNnotEQ_(SETQFOO10000)10000_(SETNFOO1)1_(IPLUSFOO5)6_(EQFOO1)NIL_(SMALLPFOO)NILZEROPNILFOO(SETNFOO(SUB1FOO))(EQPFOO0),(ZEROPFOO)SETNFOOSETNFIE(SETQFOOFIE)SETNFOOFIEFOOFIE(SETQFIE(IPLUSFOO))FIE|b'$ +.)/x\: q;J!V"9$'7*/A1 69>@DDGZ &>  $&K(W WE #% (*/47:l=@CJH&U 1 &$+R.914I8~BH1  1g A&s)J,1I67:=A. G(0K X   N!%U&u*.158(:>@GEE.  {y"  F`&*+s-34s829;?@GE| " #<'~(,p@iC #N m? A"% )Z-/3D48:y?LCD+ Rqf $6%)a,125t7:>@ECBE  S!3#)-1/6<>AI ,'#',.3"4 6:?AF!G : ^./39;@ *< S3 {0K"x,@BFxU#$%')+B-3v473;?~DEaFyTD/"&O+.~138=H> GRM "O$(,00V|Kz iMg &oxG    m ~#^( .36:=3C5 Ep  w !n# &Q,/58@=@ GC v `"#%'-f239(<@WB$ r2! (+b.0268:=F@"I#Q$(,* 18  m $0)2+.9S:5<?H07)   H!$', 368 ?BE/5  I,S k%*.40 7 :<>>2~ SQ\@!(&`(*+.36m:;g=>0CQF0  |Y0 047:44MiscellaneousOperatingSystemFunctionsrstofthethreeprintedbythecommand).[Function]isanerrornumberfromaJSYSfailreturn.=meansthemostrecenterror.returnstheoperatingsystemerrordiagnosticasastring.[Function]Loadsthe(unboxed)valuesof,,andintoappropriateaccumulaters,andexecutesJSYSnumber.If,,or=,0isused.returnsthe(boxed)contentsoftheaccumulatorspeciedby,i.e.,1means,2means,and3means,withequivalentto1.Compilesopenifisitselfasmallinteger,andisasmallinteger,or.IftheJSYScausesatrap,themessageisprintedbytheoperatingsystem,followedbyandtheoperatingsystemdiagnostic.Theuseristhentalkingtotheoperatingsystemexactlyasthoughcontrol-Chadbeentyped.Iftheuserthencontinuesusingthecommand,anInterlisperrorisgenerated,,andcontrolthenproceedsthesameasforanyotheravoroferror,i.e.unwindstolastorgoesintoabreakasdescribedonpage9.10.TheCJSYSpackage(page23.53)enablescallingJSYSesbytheircorrespondingname,ratherthantheirnumber.[Function]If=,returnstheloginusernumber;if=,returnstheconnectedusernumber;ifisaliteralatomorstring,returnsthenumberofthecorrespondinguser,orifnosuchuserexists.OnTOPS-20,thereisadierencebetweentheusernumber,whichisassociatedwiththejob,andthedirectorynumber,whichisassociatedwiththelesystem.Therefore,onTOPS-20,if=,returnsthedirectorynumberratherthantheusernumber.[Function]Returnsthehostnameasastringforhostnumber,e.g.,,etc.If=,thelocalhostisused.Ifthelocalhostisnotanarpanethost,valueis.Alsoreturnsifisnotavalidhostnumber.isinterpretedthesameasin.[Function]Returnsthehostnumerofthelocalhost,or,ifthelocalhostisnotanarpanethost.[Function]Startsupalowerexec(withoutamessage)using,andthenif=unreads,followedby(using,page6.47).returnsforInterlisponTOPS-20.22.6SYSTAT(ERSTR)NILERSTR(JSYS)NILJSYSNILNILTRAPATLOCATIONJSYSERROR:CONTINUEJSYSERRORERRORSET(USERNUMBER)NILTUSERNUMBERNILTUSERNUMBER(HOSTNAME)"PARC-MAXC2""BBN-TENEXD"NILNILNILUSERNAME(HOSTNUMBER)NIL(TENEX)SUBSYSNIL"QUIT"BKSYSBUFTENEX"POP"ERN_ERNERNNAC1AC2AC3RESULTACAC1AC2AC3NAC1AC2AC3RESULTACAC1AC2AC3NRESULTACNNNNNAFLGAAAFLGHOSTNFLGHOSTNHOSTNHOSTNFLGSTRFILEFLGFILEFLGSTRyN,m D !}`m$|b' %, 0x\:f{"&(0Y5C5 W!*&:)*.107<@6B|EU O$'[-t15Z ;=w>RC5 Q>?$)/-70h1]69 AP O\#)*s.21L2*6*::A_BILMd H#$?*+1 8:8<B#EHsJ($.-/04[9K=G;s#$(L*CE E`"'-9<?EfDW 4"=%g'*[/039>CNE.BI!)$*.,.25y;?A G %~(*+ 99<AD&?eK!$:'+-1`39q;)DF=|w!#'H)M,:o$(,16o;l=@ 9"&+6C5 4j,#&*(-L31578=@<F2[ 1!"&*\,,9_>@EG1 #(*,/A28.! w$%&-@2528>=ACw ,sI %"%e+H056 =@2BE*  $')+-T7i<>>D)(!1$'&#C5 $}V%'R(,m.1;< I"!"%+:/02r58:@>$?BEnHs!1&"! $(2,/-0Q8#>G?B?CuF #%l(*2C5 !&F'*7-h04569AC",!1)5 ,? 2Y0 ;4G'b1@  }`m$xY5EW5&R~Q>*+.,.4&4O(+,//34M7;l6?4jT42*(*5&#SY$}6"'!19,0S@D 5=$!}p`m$55INTERLISP-10SPECIFICSifallofisactuallyprocessed/readbythelowerexec,iftheusercontrol-C'sandmanuallyQUIT'sbacktoInterlisp.If=,passesthestringasthesecondargumentto,insteadofunreadingit.Thishastheadvantagethatcanbeofanylength,andalsothattypeaheadwillnotinterferewiththecalltothelowerexec.Thedisadvantageisthatcannottellwhetherthecommandstothelowerexecterminatedsuccessfully,orwereaborted.Thus,if=,thevalueofisalways.Forexample,(page11.9)isimplementedusing,with=,socantelliflistingsactuallywerecompleted.22.7STORAGEALLOCATIONANDGARBAGECOLLECTIONInthefollowingdiscussion,wewillspeakofaquantityofmemorybeingassignedtoaparticulardata-type,meaningthatthespaceisreservedforstorageofelementsofthattype.willrefertotheprocessusedtoobtainfromthealreadyassignedstorageaparticularlocationforstoringonedataelement.Asmallamountofstorageisassignedtoeachdata-typewhenInterlisp-10isstarted;additionalstorageisassignedonlyduringagarbagecollection.Thepageisthesmallestunitofmemorythatmaybeassignedforusebyaparticulardata-type.Foreachpageofmemorythereisaonewordentryinatypetable.Theentrycontainsthedata-typeresidingonthepageaswellasotherinformationaboutthepage.Thetypeofapointerisdeterminedbyexaminingtheappropriateentryinthetypetable.Storageisallocatedasisneededbythefunctionswhichcreatenewdataelements,suchas,,.Forexample,whenalargeintegeriscreatedby,theintegerisstoredinthenextavailablelocationinthespaceassignedtointegers.Ifthereisnoavailablelocation,agarbagecollectionisinitiated,whichmayresultinmorestoragebeingassigned.Thestorageallocationandgarbagecollectionmethodsdierforthevariousdata-types.Themajordistinctionisbetweenthetypeswithelementsofxedlengthandthetypeswithelementsofarbitrarylength.Listcells,atoms,largeintegers,oatingpointnumbers,andstringpointersarexedlength;alloccupy1wordexceptatomswhichuse3words.Arrays,printnames,andstrings(stringcharacters)arevariablelength.Elementsofxedlengthtypesarestoredsothattheydonotoverlappageboundaries.Thusthepagesassignedtoaxedlengthtypeneednotbeadjacent.Ifmorespaceisneeded,anyemptypagewillbeused.Themethodofstorageforthesetypesemploysafree-listofavailablelocations;thatis,eachavailablelocationcontainsapointertothenextavailablelocation.Anewelementisstoredattherstlocationonthefree-list,andthefree-listpointerisupdated.Theallocationroutineforlistcellsismorecomplicated.Eachpagecontaininglistcellshasaseparatefreelist.Firstapageischosen,thenthefreelistforthatpageisused.Listsaretheonlydata-typewhichoperatethisway.22.7TNILTTENEXSUBSYSTENEXTTENEXTLISTFILESTENEXNILLISTFILESAllocationCONSPACKMKSTRINGIPLUSallocatingSTRFILEFLGSTRFILEFLGFILEFLGym0 I !}`m$|b'! )*x\:?"$#% ) 25 7;BDLFZI!['R,L/1= W. d%)+/1/3l7=DsE.Up"%:'*/069*;+<?DLGTDo #& +.13537;R>A R>!%(J-0J7V90;?B P f!,$~*-4v679=DE|OR}LM#x'+D.{/379!?@4HHL,J!|$&b')y,Y-1k476|C i $L+ x?    *"$~%*,y15s:<^=l CFx=y p,yu!%'I,.1R;M=A$BE;  %v#'( /4M6;=@8 s  i!?"&),/ 5(78n=\ CHs7) `w ( 4#  RT"%t(l*Q/14V6F7e =@DF2~  6caA $d&'G*[.X144:1<?BG0  J<)s $'5*-02389 A;C6/2  I 2<J,- Q9 "e(b,r0v3f6n<?DI*la4#')J.145}7<>BBDQF( "$#)+ .027=^>C '<  V  !%)$7   j` ',,03e6;=BE" <5!&(,/0}3K59l<BlD=  "'+61N47=O?C'GE r"b#(J-05-7083 ;\ DFZ w;z  "W%{(* 269:N=QBDX Vk%<(* 1U 6 XN ;#' (.168< ?C6GTD 6 W "%'+R/06V8:@DGR  Ou $ !#(.z 5x8;=8C DG(P R':"$]) /257<>A_D_GOR BLM  4/`B #g&X)+-f 37"9n?3DSJ  ^  " )o+I.358;0?1BLDI  <C#&)&.0x26=:<?B8 G\ {m"%&(,/1e4709= DW !j '!;" +,.36k8z=DIFGB 3s $&+o.T/3 :=i?AE:A x #`&(*.t> L !j (/928=ACA <` KD )"$) - /v57<?EG:  nG~ %*/ 6O9>CF9 | %'l-./4e6:>@>E7o  WH 4!#(O,/2[6J<>^EE5  f9 >#&Q'*,.258;X@PEG4# npE"21 ^he u #|$ +Y/357~:>BLC/x  _ 5s$(*, 1?5y89@AC\G-  X *  1kV7 #%(+149b ?AbD)G)( tv] ["%),1i7+: >NCl ' (B$) ,m/35s8.< DF%  ="#&}+15 <@BKE$7  Iz$&} -06X9=@RB DtGJ" > {6n#'+0p5-9r=H@ E H  JcW !$!').C35c8/  e !v'(+. 46;m B2D@ qw$ +-37<>UBE  +S %_&)r.0e4i79W:=@PFn  a+ r ,#h&'/(2598;@gAHO Zy!#7'%*,,247C:k=>E   yk w*W.0 54 ;=1AD[FX sIbk#',/1136l8>% F'G   g8 !$&*,W.m2}6 >@MB EG(  (Q8 ]  I ![#']*/o05 ?#$&G),//1|7 9<A2BG4Z  !&%'-.269?A CFX  u!5$'*l.~ 47 >^BqEWI   i #( .K/257c9!=ACU  "p" (* 15&9Q;@RC5 P)#S )+W12:<?A5DPHOR G$(,"-{2478/=@vC0FM DWC5 Bh"g'a), 1P 7? AWB\HA  #z%)46< AD.F?e  "&(.[0 7<>C =C"(w*03:8:~>DG< /#W(*A.O4 6J9<?DGj:t $w&6)d,/3w7:/= @bC 8[ %N5E"#%* 0627<@BH_# A !'g/805m=>BfD $*,1:/;n?bB HsO%'e(,0t2b=>CG "$[(+026:< C~!"I'*d/1Y37h90CDH}O"$V'4+-03T 9;=FGX!P%&+  ^k v!$ &D(=Av(o"}`m$x\:ZlR OR%{J ] Yw %b'N),.l 4f6R9;@BEEI  ;t!%(r+/24 :>B7CEGG\  ixDW iB@A * 2 /x %- $A,-*'< % %#E $$`9'5;Ai ."}`m$xR{P.r6DWB9=qE)$)-O#o6:C/@D >=$ }pL`m$JStorageAllocationandGarbageCollectionTheinitialsettingforis40.Thevalueofisitsprevioussetting.q[Function]isimplementedintermsoftheprimitivewhichcanbeusedtofurtherrenegarbagecollectionmessagesforspecializedapplications.Thegarbagecollectionmessageisactuallycomposedofsevenseparatemessages:message#1isthe``collecting''string.If,thenneitherit,northetypedependenteld(whichissettableviadescribedbelow)isprinted.message#2isthecarriage-returnafterthetype-dependenteld.Thustosimplyprintastringatthebeginningofagarbagecollection,performand.message#3isthe``''whichcomesafterthenumberofcellsactuallycollected.If,thenneitheritnorthatnumberareprinted.message#4isthe``''whichcomesafterthenumberofcellsthatarenowallocated.If,neitheritnorthatnumberareprinted.message#5isthenumberofpagesleftbelowwhichthesystemprintsmessage6.message#6isthe``''message.If,neitheritnorthenumberofpagesleftareprinted.message#7istheterminatingcarriagereturn.[Function]Setstheminimumamountoffreestoragewhichwillbemaintainedbythegarbagecollectorfordatatypesoftypenumberortypename.If,afteranygarbagecollectionforthattype,fewerthanfreewordsarepresent,sucientstoragewillbeadded(in512wordchunks)toraisethelevelto.If=,isused,i.e.,thereferstolistwords.If=,returnsthecurrentsettingforthecorrespondingtype.22.10_GCGAG(100)T_RECLAIM()collectinglists10369,10369freecells,87pagesleft.GCGAGGCGAG(GCMESS)GCGAGGCMESScollectinglargenumbers12511,33071freecells4,875pages6left7NILSETTYPEDESCRIPTION(GCMESS1)(GCMESS2),NILfreecellsNILpagesleftNIL(MINFS)NILLISTPMINFSNILMINFSMINFSMESSAGESTRINGSTRINGNTYPETYPENNTYPEN|b'! (j+0 xOY|d")+#LT|"$%'-^}IO@xC5 Gy &f(.,-0^<@,BDH0F: % +103! 9 ADD] #($)015::B !$y ,E1w56:X?OAXD)F9X!b%'5,#=CHs7\4V!"#(,0*25C ,`$Z%(7+0*2|)[u #&,=-e1d58;@ADG' $%*|+.Y1%6L8$ #B(e*-0J4N8T:? CHR! #?,U-3X7X8/<>(@CH& n 2 #T */C5 Ux#'),b1479v @BsD:~"&#'*0+15 <<>BD   "&4).1H5M7<BG4c"n%+,02]585^e I%'G*-i4~8P9<8 Y#(5*48p:= E("}`m$Zx\A ZX U T"&,/-47OY%LTIO G6[A/ %A+,?R??R %?)K?R*"+?-?R/-?3`?R5?8k:3A9.Q2>=D1 _$.$O,`')[#( '"m!#(4 ^!%/ Yo/W"}`m$xIOE1 8 -c7M^' Y' }$`m$09101191011INTERLISP-10SPECIFICSAsettingcanalsobechangeddynamically,evenduringagarbagecollection,bytypingcontrol-Sfollowedbyanumber,followedbyaperiod.Whenthecontrol-Sistyped,Interlispimmediatelyclearsandsavestheinputbuer,ringsthebell,andwaitsforinput,whichisterminatedbyanynon-number.Theinputbueristhenrestored,andtheprogramcontinues.Iftheinputwasterminatedbyotherthanaperiod,itisignored.Ifthecontrol-Swastypedduringagarbagecollection,thenumberisthenewsettingforthetypebeingcollected,otherwisefortype8,i.e.,listwords.[Function]Theatomhashtableautomaticallyexpandsbyaspeciednumberofpageseachtimeitllsup.Thenumberofpagesissetviathefunction.Theinitialsettingis(roomfor1024newatoms).[Function]``GarbageCollectionTrap''.Causesa(simulated)control-Hinterruptwhenthenumberoffreelistwordsremainingequals,i.e.,whenagarbagecollectionwouldoccurinmoreconses.Themessageisprinted,thefunctioniscalled,andabreakoccurs.Notethatbyadvisingtheusercanprogramthehandlingofainsteadofgoingintoabreak.returnsitslastsetting.will``disable''aprevioussincetherearenever-1freelistwords.isinitializedthisway.returnsthenumberoflistcellsleft,i.e.,numberofesuntilnexttypegarbagecollection.[Function]Storesintomemorylocation.Bothandmustbenumbers.[Function]Returnsthenumberinmemorylocation,i.e.,boxed.22.8THEASSEMBLERANDLAPTheInterlisp-10compilerhastwoprincipalpasses.Therstcompilesitsinputintoamacroassemblylanguagecalled.ThesecondpassexpandstheLAPcode,producing(numerical)machinelanguageinstructions.Theoutputofthesecondpassiswrittenonaleand/orstoredinbinaryprogramspace.control-XforInterlisp-10onTOPS-20.Forinterrupts,iscalledwith(itsthirdargument)equalto3.Iftheuserdoesnotwanttogointoabreak,theadviceshouldstillallowtobeentered,butrstsetto-1.Thiswillcauseto``quietly''goawaybycallingthefunctionthatwasinterrupted.Theadviceshouldexitvia,asinthiscasethefunctionthatwasabouttobecalledwhentheinterruptoccurredwouldnotbecalled.Theexactformofthemacroassemblylanguageisextremelyimplementationdependent,aswellasbeinginuencedbythearchitectureandinstructionsetforthemachinethatwillrunthecompiledprogram.22.11MINFSMINFS(MINHASH)MINHASH(MINHASH2)(GCTRP)GCTRPINTERRUPTINTERRUPTGCTRPGCTRP(GCTRP-1)GCTRPGCTRP(GCTRP)CONSLISTP(CLOSER)(OPENR)LAPGCTRPINTERRUPTINTERRUPTINTERRUPTnotINTERRUPTRETURNXNNNAXXAXAAAINTYPEINTYPEy\HA.>OoO   !} `m$"|b'! )*x\: r (,#016 =5?%C[GZ m %!]&d*,124j8>+ F X  >[G #&*,\0j45 <>AD^WI  l!k#)T 0137:5 A!CFU /md!"%)./^4 ;<=BDzFS@q $*,/1x4 6EPC5 OR!l$ -d246;ABFM !J$!)I+.052Q46BCCEL'4+S-03IC5 G\ $)./ 7G;=CGEY!#3''-23e59:? ED\e!&)34:<\Bk; !%+..13AD3GT@0%C&,13@79;=^! "%c: #x )*5b8<?BCeDG9 "U (+C6"%S*,Y.147V<ACyF4jk$ 1eC5 /!%_+i,D05 8n:],C5 +6$^& +r1|2X4|# ix  EDh%E*9-)057;>}?D k"[')-;07R >D@  !$& *,-0:48:>D} # T7< E  !]"&/1r4;?XABD|F  K}\| H"'K+.:<>DlG ]/') /157<(>DCG4   *2E33469a<_>DVG4  wfY h!*&+-t/c ]  <$gx"4'),/a 9 @ADF  f %( *E,2"47:*<B(!} `m$x\: mS P SM\4j1e 4,  < 2{x"-: }`m$rxP{IE1D1e\/*/3,+0 A=$) +}`m$>121314121314AssembleInputtothecompilerisusuallyastandardInterlispdenition.However,inInterlisp-10,machinelanguagecodingcanbeincludedwithinafunctionbytheuseofoneormoreformsasdescribedbelow.Inotherwords,allowstheusertowriteportionsofafunctionin.Notethatisonlyacompilerdirective;ithasnoindependentdenition.Therefore,functionswhichusemustnormallybecompiledinordertorun.22.8.1AssembleTheformatofissimilartothatof:isalistofvariablestobeboundduringtherstpassofthecompilation,duringtherunningoftheobjectcode.Theassemblestatementsarecompiledsequentially,eachresultinginoneormoreinstructionsofobjectcode.Whenrun,thevalueofthe``form''isthecontentsofAC1attheendoftheexecutionoftheassembleinstructions.NotethatmayappearanywhereinanInterlisp-10function.Forexample,onemaywrite:totestifjobruntimeexceeds4seconds.22.8.1.1AssembleStatementsIfanassemblestatementisanatom,itistreatedasalabelidentifyingthelocationofthenextstatementthatwillbeassembled.Suchlabelsdenedinanformarelikelabelsinthattheymaybereferencedfromthecurrentandlowerlevelnestedsors.Thepackage(page5.19)doespermittheusertorunprogramsinterpretivelywhichcontaindirectives.Eachdirectiveiscompiledasaseparatefunction.Thereissomelossineciencyovercompilingtheentirefunctionasaunit,andnotallexpressionsaretractabletothisprocedure.Thisexampleistoillustrateuseof,andisarecommendationtousetheabovecode.Thefunction(page22.6)istheappropriatemethod.Alabelcanbethelastthinginanform,inwhichcaseitlabelsthelocationoftherstinstructiontheform.22.12EXPRASSEMBLEASSEMBLELAPASSEMBLEASSEMBLENote:ASSEMBLEisprovidedforsituationswhereitsuseisunavoidable.However,itsuseisdenitelynotencouraged.Thedisadvantagesareseveral.ASSEMBLEcodeisunavoidablydependentonthePDP-10,Tenex,andimplementationdetailsofInterlisp-10.Thus,ASSEMBLEcodeisnottransportabletoInterlisponanothermachineoroperatingsystem,andimplementationchangestoInterlisp-10can(andfrequentlydo)requirechangestoexistingASSEMBLEcode.ASSEMBLEPROG(ASSEMBLEVS1S2...SN)VnotS1...SNASSEMBLEASSEMBLE(IGREATERP(IQUOTIENT(LOC(ASSEMBLENIL(MOVEI1,-5)(JSYS13)))1000)4)ASSEMBLEPROGPROGASSEMBLEMACROTRANASSEMBLEASSEMBLEASSEMBLEASSEMBLEnotJSYSASSEMBLEafterASSEMBLEyV .$*d";K   } `m$"|b1&x\:  r $- 4:< BD^Z IlA#%*,/z2!4 68DH0X S%q)+.0t399:<ApEFjWI 9C_ %&W(* 2 9? ?EU $&_*+|Q> ixC=  8- !$)=3 A _@#%(+-[/ 9>K@EG; 2" *,q2 :=CEWH9   }"%'+-I6;=?~DF8B   e$ ,0W:l=sAH06  C'!$='?)  ""V|%  x!1  m \(X !#F')*. 47X<>B@C   Z!R&T(1}47i>)B!CF   [ "&)12;  !%)p+.0828 A E_2 "(L)/1y28>B&CG4  Q!2&(D)f,/F1: ADGZ  8  CP V'(+/0 ;i=.?B,FB  6 (W b  1Yh(,.r257; =BDG (!} `m$x\:* Z<X>CWI U ^{L x {& $;(&* ,v- 5;=@EAG|K4  x%k{,01 9C?ADIGI w%  %(x,O{3686: BDzG  uHU#% /m46] ;=@\C FC  Hx{#xC=&I@8 S?@8?]@8 h?@8=3 {7x;!;$";$\';$(9/8B3)3 * h )1).02@30K). . -**&:-.*4P _ f3!%{-x 6 b!r{ xN}`m$J E=$}T`m$INTERLISP-10SPECIFICSIfanassemblestatementisnotanatom,ofthestatementmustbeanatomandoneof:(1)anumber;(2)aop-def(i.e.,hasapropertyvalue);(3)anassemblermacro(i.e.,hasapropertyvalue);or(4)oneofthespecialassembleinstructionsgivenbelow,e.g.,etc.AnythingelsewillcausetheerrormessageThetypesofassemblestatementsaredescribedhereintheorderofpriorityusedintheprocessor;thatis,ifanatomhasbothpropertiesand,thewillbeused.Similarlyaspecialinstructionmayberedenedviaan.Thefollowingdescriptionsareoftherstpassprocessingofstatements.Thesecondpassprocessingisdescribedinthesectionon,page22.15.(1)numbersIfofanassemblestatementisanumber,thestatementisnotprocessedintherstpass(seepage22.15).(2)LAPop-defsThepropertyisusedfortwodierenttypesofop-defs:PDP-10machineinstructions,andmacros.Ifthedenition(i.e.,thepropertyvalue)isanumber,theop-defisamachineinstruction.Whenamachineinstruction,e.g.,,appearsasofanassemblestatement,thestatementisnotprocessedduringtherstpassbutispassedto.Theformsandprocessingofmachineinstructionsbyaredescribedonpage22.16.Ifthedenitionisnotanumber,thentheop-defisamacro.Whenamacroisencounteredinanassemblestatement,itsargumentsareevaluatedandprocessingofthestatementwithevaluatedargumentsisleftforthesecondpassand.Forexample,isamacro,andinassemblecoderesultsininthecode,whereisthevalueof.Theformandprocessingofmacrosaredescribedonpage22.17.(3)assemblemacrosIfofanassemblestatementhasaproperty,thestatementisanassemblemacrocall.Therearetwotypesofassemblemacros:lambdaandsubstitution.Ifofthemacrodenitionistheatom,thedenitionwillbetotheargumentsofthecallandtheresultinglistofstatementswillbeassembled.Forexample,couldbedenedasamacrowithtwoarguments,and,whichexpandsintooccurrencesof,e.g.,expandsto.Thedenition(i.e.,valueofproperty)forcouldbe:Ifofthemacrodenitionisnottheatom,itmustbealistofdummysymbols.Theargumentsofthemacrocallwillbesubstitutedforcorrespondingappearancesofthedummysymbolsin22.13CARLAPOPDAMACC,CQ,OPCODE?-ASSEMBLE.ASSEMBLEOPDAMACOPDASSEMBLEAMACASSEMBLELAPCAROPDLAPOPDHRRZCARLAPLAPOPDLAPLAPLAPLDVLAP(LDV(QUOTEX)SP)(LDVXN)LAPNSPLAPCARAMACCARLAMBDAappliedREPEATLAMBDANMNM(REPEAT3(CAR1))((CAR1)(CAR1)(CAR1))AMACREPEAT(LAMBDA(NM)(PROG(YY)A(COND((ILESSPN1)(RETURN(CARYY)))(T(SETQYY(TCONCYYM))(SETQN(SUB1N))(GOA)))))CARLAMBDA|b'! )*x\:  X 2[%J&)6/Q24|6V9<\>AC(D=Z  8B~h"%(x*),v.59T<?*@zF7X H^y# +.38;>lD}G4WI  jTD   p!(C+-d/35:>:@R g!%k *N0N16]8:>DNEfPI ?br#%+j,g/]5 =;?ADFOR ` #Z'* 1_28:s<ANEFM J  G _^:{!/&)1/r03p9;y=@CFE B  TN?  v@ %)+h-b14U6d< C>L 0*`s!'s+- .836#8:;=+B <  B  "T#=(P-.06 =M?EGj; 9*!%)*-14l ;'<B 9[ Afj6V  Xf{ #&B(<*+/48<@B 4    #P%,. 57:"@yC3  ^!&O';)24k8=U1ete()/289|;?tBCFy/  H %-'2*u,  ) hjJ!"P+V,E.46x8{>ZBE(  I`8w$i'* /A358@ G4$  #!P%%'!,-48;> G(# 4 ! #$6p;!x "B+4,037 I">$-.03579;m@G? K[ &)% 2 9;z=BH0(}x`m$x\:"UZ %X 68WIu!#TDBR'U,3eP (OR0CFG }?F>L<* ;'L9[ 6V ,93 #/5@DO1e  q $?%,6A&/) '(0&i {x$/E# "'.J/=DO!x '.lr * '*h6*?# %h!r  (u }xT`m$1515COREVALsofthedenition,andtheresultinglistofstatementswillbeassembled.Forexample,couldbeasubstitutionmacrowhichtakesoneargument,anumber,andexpandsintoinstructionstoplacetheabsolutevalueofthenumberinAC1:(4)specialassemblestatements(compilequote)takesanynumberofargumentswhichareassumedtoberegularInterlispexpressionsandarecompiledinthenormalway.E.g.Note:toavoidconfusionandminimizedependenceonthecurrentimplementation,itisbesttohaveasmuchofafunctionaspossiblecompiledinthenormalway,e.g.,toloadthevalueoftoispreferredto.(Compile)takesanynumberofargumentswhicharerstevaluated,thencompiledintheusualway.Bothandpermittheinclusionofregularcompilationwithinanassembleform.(Evaluate)takesanynumberofargumentswhichareevaluatedinsequence.Forexample,callsafunctionwhichincrementsthecompilervariable.Compilescodetosetthevariabletothecontentsof.Permitswritingamachineinstructionwiththevalueofavariableastheoperand.Generatestheappropriateaddressandindexeldstoreferencethevalueof.maybealocallyboundvariable,freevariable,,etc.Notethatmaygeneratemorethanoneinstruction.Usedtoindicateacomment;thestatementisignored.22.8.1.2COREVALsThereareseverallocationsinthebasicmachinecodeofInterlisp-10whichmaybereferencedfromcompiledcode.ThecurrentvalueofeachlocationisstoredonthepropertylistunderthepropertyNotethatassemblemacrosproducealistofstatementstobeassembled,whereascompilermacrosproduceasingleexpression.Anassemblemacrowhichalistofstatementsbeginswithandmaybespreadorno-spread.Theanalogouscompilermacrobeginswithanatom,(i.e.,isalwaysno-spread)andtheisunderstood.22.14CDRABS((X)(CQ(VAGX))(CAIGE1,0))(MOVN1,1))(CQ)CQ(CQ(COND((NULLY)(SETQY1)))(SETQX(IPLUSYZ)))XAC1,(CQX)(LDV(QUOTEX)SP)(C)CCCQ(E)E(PSTEP)SP(SETQ)AC1(VAR(,))GLOBALVARVAR(*...)computesLAMBDAeitherLAMBDAE1ENE1ENE1ENVARVAROPACVARNAMEVARNAMEVARNAMEy\8 }`m$|b'%x\: 9 "%& -0D2C :d=FZ   x ,")U*028 : B>CGX U8M  U }J|x$(K+&029f=@<FGIHT! (+.358<@>L &)}/d 68;?< w4"$D(')+'02i7=?zAF;To!%(4N5;9[,}6VAx1"$)+|157: @C4<"Y&+/2779>/ E3 a}0Ax y"%y*,>269?3@G4._#&( -1 8:@Gr+Z!"$''/K03U8<&!U"( .14U79:@AD(% w!) (.1589);+AxD*H&#d$')+/Q39(;I![#&,#/25 7" #4),2=3|T x bK+#_),.t 35:1=e? FyJ _bT '" %g*,^025f;)=ADGb "#u%' .02 9?GE/ 5S1 b#j'1[2y46W =AA ]  ~ga#&-B37o;? A5E8Hs LF !, ( }`m$x\: BU TD SR SP {*J FCD#jB_#j%AQ !')K;'W*}.2 =AG9[6V 4%)0 ._rE+Z e:w(U #dAq!   q{ +xDO{ ]x 3}`m$xJ HJJJ6V q5 86V50 q/ 80/+Z,Y-(U}LX#dU{) =$ },`m$\16171617INTERLISP-10SPECIFICS.SincetheselocationsmaychangeindierentreassembliesofInterlisp-10,theyarewrittensymbolicallyoncompiledcodeles,i.e.,thenameofthecorrespondingiswritten,notitsvalue.Someofthesusedfrequentlyinare:contains(pointerto)atomContains(apointerto)theatom.Routinetoboxaninteger.Routinetoboxoatingnumber.Routinetounboxaninteger.Routinetounboxoatingnumber.Theindexregistersusedforthepush-downstackpointersarealsoincludedasS.Thesearenotexpectedtochange,andarenotstoredsymbolicallyoncompiledcodeles;however,theyshouldbereferencedsymbolicallyinassemblecode.Theyare:Parameterstack.Controlstack.Basicframepointer.22.8.2LAPLAP(forLISPAssemblyProcessor)expandstheoutputoftherstpassofcompilationtoproducenumericalmachineinstructions.22.8.2.1LAPStatementsIfaLAPstatementisanatom,itistreatedasalabelidentifyingthelocationofthenextstatementtobeprocessed.IfaLAPstatementisnotanatom,ofthestatementmustbeanatomandeither:(1)anumber;(2)amachineinstruction;or(3)aLAPmacro.(1)numbersIfofaLAPstatementisanumber,alocationcontainingthenumberisproducedintheobjectcode.E.g.,Thevalueofisalistofallatomswithproperties.Notethatifafunctionisintendedtobeswappable,itmaynotcontainanyrelocatable,indexedinstructions.22.15COREVALCOREVALCOREVALASSEMBLEKTTKNILNILMKNMKFNIUNBOXFUNBOXCOREVALPPCPVPCARCAR(ADD1,A(1))..COREVALSCOREVALy\$   }`m$|b'! )*x\:C " &(.4 6"7 =V?BE.Z "[$(O),> ;k<ADEX  u "+|Ue &Re&!$*OeZLeZ!IeZ FeZ#C  R!%)^.1?4-9ACjGB$  [e #$? ,.47O:@oCyG@  1#'J=ye:tev7oe|3 ix.  jZ !^&).10$258: BD- R |(  x$7  i bMn$l&':* 1w39:=@FDG" X! #)+.$4`79;?JB FH Z !j#$'   \E$F%* 14N9;.ApCCE;   S! "&0u T r8"/$&J -/.2o5!:;= D (!}`m$0x\: Z5X$?U #R 'O L I F C;=y :t 7o "& 6 {* q q H*"}l`m$` =$}(`m$18191819LAPStatementsStatementsofthistypeareprocessedlikemachineinstructions,withtheinitialnumberservingasa36-bitop-code.(2)MachineInstructionsIfofaLAPstatementhasanumericvalueforthepropertythestatementisamachineinstruction.Thegeneralformofamachineinstructionis:isanyPDP-10instructionmnemonicorInterlispUUO.,theaccumulatoreld,isoptional.However,ifpresent,itbefollowedbyacomma.iseitheranumberoranatomwithaproperty.Theloworder4bitsofthenumberorareOR'dtotheACeldoftheinstruction.maybeusedanywhereintheinstructiontospecifyindirectaddressing(bit13setintheinstruction)e.g.,.istheaddresseldwhichmaybeanyofthefollowing:Referencetoanunboxedconstant.Alocationcontainingtheunboxedconstantwillbecreatedinaregionattheendofthefunction,andtheaddressofthelocationcontainingtheconstantisplacedintheaddresseldofthecurrentinstruction.Theconstantmaybeanumbere.g.,;anatomwithaproperty(inwhichcasetheconstantisthevalueoftheproperty,attime);anyotheratomwhichistreatedasalabel(theconstantisthentheaddressofthelabeledlocation)e.g.,isequivalentto;oranexpressionwhosevalueisanumber.TheaddressisareferencetoaInterlisppointer,e.g.,alist,number,string,etc.Alocationcontainingthepointerisassembledattheendofthefunction,andthecurrentinstructionwillhavetheaddressofthislocation,e.g.,Speciesthecurrentlocationinthecompiledfunction;e.g.,hasthesameeectas.aliteralatomIftheatomhasaproperty,itisareferencetoasystemlocation,e.g.,,andtheaddressusedisthevalueofthe.Thevalueisan18bitquantity(ratherthan9),sincesomeUUO'salsousetheACeldoftheinstruction.TheTENEXJSYS'sarenotdened,thatis,onemustwriteinsteadof.22.16.A(1)(4)(9)CAROPD,(,@(index))mustCOREVALCOREVAL@(HRRZ1,@1(VP))=(CAME1,=3596)COREVALLOAD(MOVE1,=TABLE)(MOVEI1,TABLE)'(HRRZ1,'"ISNOTDEFINED")(HRRZ1,'(NOTFOUND))*(JRST*2)(SKIPA)COREVAL(SKIPA1,KNIL)COREVAL(JSYS107)(KFORK)OPCODEACADDRESSOPCODEACACADDRESSCONSTANTPOINTERyL6EK1  J }`m$|b'$' xTA ~T #( 043?59i>C/DEGR  O   L R?%(+=-8;+ACD^J DL,$ +D~ x&5'-lA j X!8'c(-2w4b9;=DE@6 !U$"s(+.>13<57:?JG>  U;S h ; \sw > %(&+0 7:2<*>[@B 9 6]"$'P)+e 3 !r',.[3s : (Sp!_ (,;/1L2t%N!#"i(~*I+1 6a9d:=bCGT#2e %'w,<-4:580:<>DG"k #@%),+0o2&4:O@$U)+&-|3n9WEGM &aG t"$/1 24d5<>?DS(#)+,.368y:>@I ] +o $(B*.H27:<?eB.EG  K*!$&h),v8=E#("}$`m$x\8 qZ XWGL 3zG '{A/3x@6A; 9 13 .+E0P135Z-DA)'q,|.*/1@FH(S%N _ !%(t_ !% <0A:BM G) "A#C  /4?A"},`m$xG xD A BgC76 3 %N  =$ }0`m$62020INTERLISP-10SPECIFICSOtherwisetheatomisalabelreferencingalocationintheLAPcode,e.g.,.anumberThenumberistheaddress;e.g.,alistTheformisevaluated,anditsvalueistheaddress.Anythingelseintheaddresseldcausesanerrormessage,e.g.,.Anumbermayfollowtheaddresseldandwillbeaddedtoit,e.g.,.isdenotedbyafollowingtheaddresseld,i.e.,theaddresseldbepresentifanindexeldistobeused.Theindex(ofthelist)mustbeeitheranumber,oranatomwithaproperty,e.g.,.(3)LAPmacrosIfofaLAPstatementisthenameofaLAPmacro,i.e.,hastheproperty,thestatementisamacrocall.Theargumentsofthecallfollowthemacroname:e.g.,.LAPmacrocallscomprisemostoftheoutputoftherstpassofthecompiler,andmayalsobeusedin.Thedenitionsofthesemacrosarestoredonthepropertylistundertheproperty,andlikeassemblermacros,maybeeitherlambdaorsubstitutionmacros.Intherstcase,themacrodenitionisappliedtotheargumentsofthecall;inthesecondcase,theargumentsofthecallaresubstitutedforoccurrencesofthedummysymbolsinthedenition.Inbothcases,theresultinglistofstatementsisagainprocessed,withmacroexpansioncontinuingtillthelevelofmachineinstructionsisreached.SomeexamplesofLAPmacrosareshownbelow.Theargumentswerealreadyevaluatedintherstpass,seepage22.13.22.17(JRSTA)(MOVSI1,400000Q)(HLRZ2,1(1))(SKIPA1,KNILL)-LAPERROR(JRSTA2)INDEXlistmustCARCOREVAL(HRRZ1,0(1))CAROPD(LQ2FIE3)ASSEMBLEOPD(DEFLIST'[(LQ((X)(*LOADQUOTETOAC1)(HRRZ1,'X)))(LQ2((XAC)(*LOADQUOTETOAC)(HRRZAC,'X)))(LDV((ASP)(*LOADLOCALVARIABLETOAC1)(HRRZ1,(VREFASP))))(STV((ASP)(*SETLOCALVARIABLEFROMAC1)(HRRM1,(VREFASP))))(LDV2((ASPAC)(*LOADLOCALVARIABLETOAC)(HRRZAC,(VREFASP))))(LDF((ASP)(*LOADFREEVARIABLETOAC1)(HRRZ1,(FREFASP))))(STF((ASP)(*SETFREEVARIABLEFROMAC1)(HRRM1,(FREFASP))))(LDF2((ASP)(*LOADFREEVARIABLETOAC)(HRRZ2,(FREFASP))))(CAR1(NIL(*CAROFAC1TOAC1)y5" D }`m$|b'! )*x\A! }#%`&) 1 227c9;k>BHZTW |!#k(O |J %({*T-/e1L #R%P(.IK; w1".$'){-/H0<:H5ed #G(1+.?05;=BD"FF  fnveE "%('+s-{1}28^:9 a0"$%)>-0}35p=>@G8H=: !V!<%p'+0-*FHG(6   X%+& .83b57h:=K?C5C  ia!K$X&(-(029;w=@B 3  * W"#&( ,.158=@A Hs1  $;e! (*-"0d27 >@^.  m^#  "$&),/=2(!}`m$Nx\AE&ZT6 R_ !L1{7]9 :@BIK;38:H5 {8xFD A> ~;=:3 7?:8 C+ *H ),^058"(4& *),^058"%V4# *),^05=,?" ]  e *),^/4(]  *),^/3;~?] 7 ),^04{4  ),^/2@58" }4`m$ 5=$}`m$2121UsingAssemble22.8.3UsingAssembleInordertouse,itishelpfultoknowthefollowingthingsabouthowcompiledcodeisrun.Allvariablebindingsandtemporarypointersarestoredontheparameterpushdownstack(addressedbyindexregister).Controlinformationisstoredonthecontrolpushdownstack(addressedbyindexregister).Afunctioncallproceedsasfollows:1.Thecallingfunctionpushestheargumentvaluesontheparameterstack.2.Thecallingfunctioninvokesaroutinethatadjuststhenumberofargumentsiftoofewortoomanyweresupplied,andbindsthearguments.Bindingusuallyimpliesthecreationofabasicframe.3.Thenthecalledfunctionisrun.Theargumentsinthebasicframearereferencedrelativetoindexregister,e.g.,1addressestherstargument.However,itisbettertoreferencevariablesinlessimplementationdependentways,suchasor.Thecompilerwillthengeneratethecorrectcodewhetherthevariableisboundlocally,isafreereference,isa,etc.Theparameterstackmaybeusedfortemporarystorageofpointers.Bothhalvesofawordontheparameterstackmaybepointers.Onthecontrolstacktherighthalfofawordmustbeapointer,theleftanon-pointer.Anythingelsecancausethegarbagecollectortofail.Fortemporarystorageofunboxednumbers,thefollowingmacrosareprovided:``Pushes''thenumberreferencedby.maybeanylegalcodeaddresseld,forexample:,,``Pops''themostrecentnumberto.Whetherabasicframeiscreatedforaoropenlambdadependsonwhetheranyofthevariablesarespecvars.22.18(HRRZ1,0(1))))(CDR1(NIL(*CDROFAC1TOAC1)(HLRZ1,0(1))))(CAR2((AC)(*CAROFACTOAC)(HRRZAC,0(AC))))(CLL((NAMN)(*CALLFNWITHNARGSGIVEN)(CCALLN,'NAM)))(LCLL((NAMN)(*LINKEDCALLWITHNARGS)(LNCALLN,(MKLCLNAM))))(RET(NIL(*RETURNFROMFN)(POPJCP,))(PUSHP(NIL(PUSHPP,1)))(PUSHQ((X)(*PUSHQUOTE)(PUSHPP,'X)))]'OPD)ASSEMBLEPPCPVP(VP)(CQ...)(VAR(...))GLOBALVARASSEMBLE(PUSHN)ASSEMBLE(PUSHN1)(PUSHN=0)(PUSHN@2)(POPN)PROGADDRADDRADDRADDRADDRy0/Cj }`m$|b'$(@ i\xN@8AEIG  {!#(,B.2467;? ABKGy  ^ FP $&,13;t  1B%E'49;o  B% ,y2 7,:VE?ACFOY 2";@YBH&M,e"' '*,2cJ_ )#'- 476G  m ] & D F$"a$',.1248;@BFB  T!\&X(,.3w7@8 ?EGAX h $h!4(I*,/I17>S  !# ;N   w !s&(C+04:J<@FBF9**-0B21 8I6  L$(* 03<7?y@dAG4 s!M"%c8(=?:AF3W  Ix0g#&E' .X([  h!V#&b,~."0 6%7: APC#  ; ""&L(-/f518;  #%v #%v%W'P%W'#k%#  #T(*v(}$`m$x\A iU <%G*Q,-R \OY(/26B8M$J D B@AX#;N"9 #BI6&Q=4*.M2C0R .  q- 4+a  q*([N&  H*]h  H"o ]"o  *PK  H{ S!}$ `m$x\AT#Z0;<XWOt3#RR;RjR;SP4P5P:P;J!}D`m$JInterforkCommunicationinInterlisp-10PutstheunboxedvalueofinAC1.GetstheoatingunboxofAC1.Tocallafunctiondirectly,theargumentsmustbepushedontheparameterstack,andmustbeupdated,andthenthefunctioncalled:e.g.,andisequivalentto:22.9INTERFORKCOMMUNICATIONININTERLISP-10Thefunctionsdescribedbelowpermittwoforks(oneorbothofthemInterlisp-10)tohaveacommonareaofaddressspaceforcommunicationbyprovidingameansofassigningablockofstorage[Function]Createsablockinsize(512wordsperpage).Valueistheaddressoftherstwordintheblock,whichisamultipleof512sincetheblockwillalwaysbeginatapageboundary.Ifnotenoughpagesareavailable,generatestheerror.Tostoreanumberintheblock,thefollowingfunctioncouldbedened:Someboxingandunboxingcanbeavoidedbymakingthisfunctioncompileopenviaasubstitutionmacro.[Function]releasesablockofstoragebeginningatandextendingforpages.Causesanerrorifanyoftherangeisnotablock.Valueis.22.20(CQ(VAGX))X(FASTCALLFUNBOX)SP(CQ(CARX))(PUSHP)(*stackfirstargument)(E(PSTEP))(PUSHQ3.14)(E(PSTEP))(*stacksecondargument)(CLL(QUOTEFUM)2)(*callFUMwith2arguments)(E(PSTEPN-2))(*adjuststackcount)(CQ(FUM(CARX)3.14))guaranteednottomoveduringgarbagecollections.(GETBLK)pagesILLEGALORIMPOSSIBLEBLOCKNote:theblockcanbeusedforstoringunboxednumbersONLY.(SETBLOCK(LAMBDA(STARTNX)(CLOSER(IPLUS(LOCSTART)N)X]Note:GETBLKshouldbeusedsparinglysinceseveralunmovableregionsofmemorycanmakeitdicultorimpossibleforthegarbagecollectortondacontiguousregionlargeenoughforexpandingarrayspace.(RELBLK)ILLEGALORIMPOSSIBLEBLOCKNNADDRESSNADDRESSNADDRESS|b'#u -H. 4:x\A"&c)u+"WG"8&x(0T  BV$(*/14\; ?DXGR MqC!B   |8 iO %' /x4p  'H!$( +Z-502V5 ;]=?BD22  a ; "$*,0P178<>T. C5 ,z 'e)<,/G3{6:>@CH&*  b"$|(,. /Q469)<?BE|).}$\!(* ,15n7 =DFn'.V!~  jg 6&C+/1nt   %((-;0 5;>ABn  C5 xX"W$P)@/8 ;AEC58:D<>ADF=H -&( }t`m$x\A  H{(Y; STAO  H{N@ !r&}+L  qJ IO  q!r&},^G 4!r%)-6. F  q*!r'T,^?  H{4{2B 1%  M n x. {,z#x'_ *"{$  1 3!',xy S  # )/39eB C\H&# ^I #$ +/379@`Cx !(a* 4$"}t\`m$*x. ,z!x1D -!D"}`m$$222324222324INTERLISP-10SPECIFICS22.10SUBSYSThissectiondescribesafunction,,whichpermitstheusertorunaTenex/TOPS-20subsystem,suchasSNDMSG,SRCCOM,TECO,orevenanotherInterlisp,frominsideofanInterlispwithoutdestroyingthelatter.Inparticular,willstartupalowerexec,whichwillprinttheoperatingsystemherald,followedby.Theusercanthendoanythingatthisexeclevelthathecanatthetoplevel,withoutaectinghissuperiorInterlisp.Forexample,hecanstartanotherInterlisp,performa,runforawhile,typeacontrol-Creturninghimtothelowerexec,RESET,doaSNDMSG,etc.TheuserexitsfromthelowerexecviathecommandQUIT,whichwillreturncontroltointhehigherInterlisp.Thuswith,theuserneednotperformatosavethestateofhisInterlispinordertouseaTenex/TOPS-20capabilitywhichwouldotherwiseclobberthecoreimage.Similarly,providesawayofcheckingoutaleinafreshInterlispwithouthavingtocommandeeranotherterminalordetachajob.Whilecanbeusedtorunanysubsystemdirectly,withoutgoingthroughaninterveningexec,thisprocedureisnotrecommended.Theproblemisthatcontrol-Calwaysreturnscontroltothenexthighest.ThusiftheuserisrunninganInterlispinwhichheperforms,andthentypescontrol-CtothelowerInterlisp,controlwillbereturnedtotheexecabovetherstInterlisp.Iftheuserelectstocallasubsystemdirectly,hemustthereforeknowhowitisnormallyexitedandalwaysexitfromitthatway.Startingalowerexecdoesnothavethisdisadvantage,sinceitcanbeexitedviaor,i.e.,thelowerexeciseectively``errorsetprotected''againstcontrol-C.[Function]If=,startsupalowerexec,otherwiserunssystem,e.g.,etc.isthesameas.Control-Calwaysreturnscontroltonexthigher.NotethatmorethanoneInterlispcanbestacked,butthereisnobacktracetohelpyougureoutwhereyouare.andprovideawayofspecifyinglesforinputandoutput.canalsobeastring,inwhichcaseatemporaryleiscreated,andthestringprintedonit.maybe,,or.isequivalentto,exceptwhenisahandle(seebelow)inwhichcaseisequivalentto.Thevalueofisalargeintegerwhichisahandletothelowerfork.Thelowerforkisresetunlesstheuserspecicallydoessousing,describedbelow.IfisgivenasitsrstPOPonTOPS-20.Interlispisexitedviathefunction,TECOviathecommand,SNDMSGviacontrol-Z,andEXECvia.Theforkisalsoresetwhenthehandleisnolongeraccessible,i.e.,whennothingintheInterlispsystempointstoit.Notethattheforkisaccessiblewhilethehandleremainsonthehistorylist.22.21SUBSYS(SUBSYS'EXEC)@SYSINSUBSYSSUBSYSSYSOUTSUBSYSSYSOUTSUBSYSEXEC(SUBSYS'LISP)onlyQUITPOP(SUBSYS)EXEC(SUBSYS'SNDMSG)(SUBSYS'TECO)(SUBSYS)(SUBSYS'EXEC)EXECSTARTREENTERCONTINUENILSTARTNILCONTINUESUBSYSnotKFORKSUBSYSLOGOUT;HQUITFILE/FORKINCOMFILEOUTCOMFILEENTRYPOINTFLGFILE/FORKINCOMFILEOUTCOMFILEINCOMFILEENTRYPOINTFLGFILE/FORKyNZ1R<H5i p  } `m$"|b'! )*\8 ixW  #$(-0 3#47{8 AB V-  M,"$(-P 3\6;#=?/DT  |a ,f/'2L4t59= ABDGR 1!"%(+E.q0637:{=@CEHFQ<  <3-$ *,2p4R69> DO ^OJ#%I+b.M026`9?_AyBM  zE"`$'-_379=BLK  * l$%(+(.1)6=?JBeDH&J  DG $& ,05;'@ByE}H \t!8&)|0M24e59>CH0GZ Q"#DU [at ")q.37=?! FnB  D^ !+$)+E./24q8=BDUFA %$$&,.N2q4zF-G(?c  #0}4 #(+)-24+6x9=m?Bk H\=  JA5^$/&)/g3#6&7{8>BE|<  O9 N?u >" +g.0>57;BFfGK7m  I'  ',04hC5 2 $%)+-*14;E1(L5@mBDH0/v#j$p)v*/U48:\=gEFj-p! #);+-25^8:K+0f146 =@C<G('#&|)H+8,c02>6J97:bACTD%[ %['`""%+23<@ A} H0!/!`,.U/4_7X< =BHs O&  `M#')q*/v1O37;>BE  7_  "*+}17;>[?CE<G MQZ ;%%*K,.67>@EhG( B ]  1-+"$&*: 03P6<=?Ef  ," $(x*/X4~68=m(!} `m$,C4h 3d2!x>U1!)^09/v_{Ax"',5W<!/E:{G|x&e8 58 }"}`m$x4hK (,K2|2S`)&"8 '"!.!/%A)O [=$} d`m$>25262526JFNFunctionsinInterlisp-10argumentthevalueofapreviouscallto,itcontinuesthesubsystemrunbythatcall.Forexample,theusercando,loaduptheTECOwithabigsourcele,massagethele,leaveTECOwith,runInterlispforawhile(possiblyincludingothercallsto)andthenperformtoreturntoTECO,wherehewillndhisleloadedandeventheTECOpointerpositionpreserved.NotethatiftheuserstartsalowerEXEC,inwhichherunsanInterlisp,control-C'sfromtheInterlisp,thenfromtheEXEC,ifhesubsequentlycontinuesthisEXECwith,hecanreenterorcontinuetheInterlisp.Notealsothatcallstocanbestacked.Forexample,using,theusercanrunalowerInterlisp,andwithinthatInterlisp,yetanother,etc.,andascendthechainofInterlispsusing,andthendescendbackdownagainusing.Forconvenience,continuesthelastsubsystemrun.,,,andareall(page8.19)whichperformthecorrespondingcallsto.isawhichperforms,therebycontinuingthelast.[Function]Acceptsavaluefromandkillsit(RESETinTenexterminology).Ifissubsequentlyperformed,anerrorisgenerated.killsalloutstandingforks(fromthisInterlisp).22.11JFNFUNCTIONSININTERLISP-10JFNstandsforJobFileNumber.ItisanintegralpartoftheTenexlesystemandisdescribedin[Mur1],andinsomewhatmoredetailintheTenexJSYSmanual.InInterlisp-10,thefollowingfunctionsareavailablefordirectmanipulationofJFNs:[Function]ReturnstheJFNfor.Ifnotopen,generatesaerror.=,,,orasdescribedindiscussionof.Forexample,willwriteabyteonale,whilewillreadonebyte.[Function]Setsupa``long''calltoGTJFN(seeJSYSmanual).isalenamepossiblycontainingcontrol-Fand/or.isthedefaultextension,thedefaultversion(overridenifspeciesextension/version,e.g.,).isMustbetheexactsamelargenumber,i.e.,.Notethatiftheuserneglectstosetavariabletothevalueofacallto,(andhasperformedaninterveningcallsothatwillnotwork),hecanstillcontinuethissubsystembyobtainingthevalueofthecalltoforthehistorylistusingthefunction,describedinpage8.16.Theisdenedtosaveitsvalueonsothatsubsequentcommandswillrestartthesameexec.22.22SUBSYS(SETQSOURCES(SUBSYS'TECO));HSUBSYS(SUBSYS'SOURCES)QUITSUBSYSSUBSYSSUBSYSLOGOUTSUBSYS(SUBSYST)SNDMSGLISPTECOEXECLISPXMACROSSUBSYSCONTINLISPXMACRO(SUBSYST)SUBSYS(KFORK)SUBSYS(SUBSYS)(KFORKT)(OPNJFN)FILENOTOPENNILINPUTOUTPUTBOTHOPENP(JSYS51Q(OPNJFNFILE)BYTE)(JSYS50Q(OPNJFNFILE)NILNIL2)(GTJFN)FOO.COM;2EQSUBSYS(SUBSYST)SUBSYSVALUEOFEXECLISPXMACROLASTEXECEXECFORKFORKFILEACCESSFILEFILEACCESSFILEEXTVFLAGSFILEEXTVFILEFLAGSy\(@MG  }`m$|b' #*<+ 1/x\: ,g:~$!(+[,3 5<(>@CG4Z !2268:>BC0EX  EW$%(.005:A5DH0WI)+H/e159;>5@C!EfU  Af R  jA$q&)*>,8/[1U 7/;>9AD P //| '.#05X=>@CMHOR  LM  qM*H B"C'*0s96:$<?B6DFJ  "2'*-248T:% @7II  F (dE  #&(/$BGQ!-1p49>y@ AQ  =%)809> DG_?>AD@C5 "b$&+.2;=>>r@D #,$)1{35:u BE9O_ "',8,BHs .V#f'(,6/026;L= ?<@yEG[  U ^'!) 0R24@kCE  Ls!o'|)-h/1e3;=4?DF7 V  I| M#   "J%9'*35d8 B  ((!}``m$x\:#Z%x,1X#"WI !P /8LM4,JCI#ZEkB ;X# AQ /6? < E;%9[!AG% $7>mBE""4%+30 $*-^49!E)$4'.I3T6: @ aO;&[7z>35 V   ,?/"}hl`m$x<9[_%> $7&+"B@fu8.QA!O$ODFk 9=$!}@`m$LINTERLISP-10SPECIFICSasdescribedonpage17,section2ofJSYSmanual.andmaybestringsoratoms;andmustbenumbers.ValueisJFN,oronerrors.[Function]Releases.releasesallJFN'swhichdonotspecifyopenles.Valueofis.[Function]Converts(asmallnumber)toalename.iseither,meaningformatthelenameaswouldorotherInterlisp-10lefunctions,orelseisanumber,meaningformataccordingtoJSYSmanual.Thevalueofisatomicexceptwhereenoughoptionsarespeciedbytoexceedatomsize.Inthiscase,thevalueisreturnedasastring.isanoptionalstringpointertobereused.Inthiscase,thestringcharactersarestoredinaninternalscratchstring,,sothatasubsequentcalltowilloverwritethecharactersreturnedbythisone.Thevalueofwhenissuppliedisalwaysastring.ThefollowingfunctionisavailableinInterlisp-10forspecializedleapplications:[Function]Opens.isanumberwhosebitsspecifytheaccessandmodefor,i.e.,correspondstothesecondargumenttotheTenexJSYSOPENF(seeJSYSManual).Valueisfullnameof.Therstargumenttocanalsobeanumber,whichistheninterpretedasaJFN.doesnotaecttheprimaryinputoroutputlesettings,anddoesnotcheckwhethertheleisalreadyopen-i.e.,thesamelecanbeopenedmorethanonce,possiblyfordierentpurposes.Notethatforalmostallapplicationsthefunction(page6.1)providesamoreconvenient(andimplementationindependent)wayofopeningles.22.12DISPLAYTERMINALSThevalueofthevariableindicateswhethertheuserisrunningonadisplayterminalornot.isusedinvariousplacesinthesystem,e.g.,,,etc.,primarilytodecidehowmuchinformationtopresenttotheuser(moreonadisplayterminalthanonahardcopyterminal).isinitializedtothevalueof,wheneverInterlispis(re)-entered,andafterreturningfromasysout.[Function]Valueisifuserisonadisplayterminal,otherwise.InInterlisp-10,isdenedtoinvoketheappropriatejsystochecktheuser'sterminaltype.22.23NIL(RLJFN)(RLJFN-1)RLJFNT(JFNS)NILOPENPJFNSMACSCRATCHSTRINGJFNSJFNS(OPENF)OPENFOPENFOPENFILEDISPLAYTERMFLGDISPLAYTERMFLGPRETTYPRINTHELPSYSDISPLAYTERMFLG(DISPLAYTERMP)(DISPLAYTERMP)TNILDISPLAYTERMPFILEEXTVFLAGSJFNJFNJFNAC3STRPTRJFNAC3AC3STRPTRSTRPTRFILEXFILEXFILEXFILE|b'! )*x\:Tz!$'+,.2::@CEZh;&`)+157?:?AWC5 U).15B9z;>MCFTD" $JQ>C5 O 6!%m+ ,-0+7'8>?EfM8 "+-1 79; B7D-GHLM "'-R.28 :>xDEfJ P%Z*Y,279k>AELG>IG "X')*EO $%h)!-/_1567:J=z?Cv DW!e&c*>AB B ")('*v 06T8?:=@DTA  "4'))-.>  Cb! &x([* 1u3 ;C5 9[!#1$).W1/68<?CI7 #<$'O+2 36:L>C\F+6!#%)V-3 [#*,/128NCF/#0%')9.1m2e47J:= ?AxFM.e#%+r+  Z!W &"/&25;<5? F)n  " %|"J ix  ]h%+}036 7p<>?Di@  w!g&0*J+._35?XFF 1K6 $&+-E/269:J?DG 1 %& -.1T5BCO `^[$')$JC5 X! $U&(j).8w @B9 G"$:)i+^02 :c=I??CeF X("}`m$0xZ<W U &'dTDQ#sQ> %O3 %K1ee+' @ 6 @: 6 J 5 }`m$jx\:7=Z!$NWU]Q>8Oo4i59J45EA X;f9[+FH7>6+ }xH`m$T27282728TheInterlisp-10Swapper22.13THEINTERLISP-10SWAPPERInterlisp-10providesaverylargeauxilaryaddressspaceexclusivelyforswappablearrays(primarilycompiledfunctiondenitions).Inadditiontothe256Kofaddressspace,this``shadowspace''cancurrentlyaccomodateanadditonal256Kwords,caneasilybeexpandedto3.5millionwords,andwithsomefurthermodications,couldbeexpandedto128millionwords.Thus,theoverlaysystemprovidesessentiallyunlimitedspaceforcompiledcode.Shadowspaceandtheswapperareintendedtobemoreorlesstransparenttotheuser.However,thissectionisincludedinthemanualtogiveprogrammersareasonablefeelingforwhatoverlaysarelike,withoutgettingunnecessarilytechnical,aswellastodocumentsomenewfunctionsandsystemcontrolswhichmaybeofinterestforauthorsofexceptionallylargesystems.22.13.1OverlaysTheshadowspaceisaverylargeauxiliaryaddressspaceusedexclusivelyforanInterlispdata-typecalledaswappablearray.Theregularaddressspaceiscalledthe``resident''spacetodistinguishitfromshadowspace.Anykindofresidentarray-compiledcode,pointerdata,binarydata,orahasharray-canbecopiedintoshadowspace(``madeswappable''),fromwhichitisreferredtobyaone-wordresidententitycalledahandle.Theresidentspaceoccupiedbytheoriginalarraycanthenbegarbagecollectednormally(assumingtherearenoremainingpointerstoit,andithasnotbeenmadesharedbya).Similarly,aswappablearraycanbemaderesidentagainatanytime,butofcoursethisrequires(re)allocatingthenecessaryresidentspace.Thisisaccomplishedasfollows:Asectionoftheresidentaddressspaceispermanentlyreservedfora.Whenaparticularswappablearrayisrequested,itisbrought(swapped)inbymappingorthepagesofshadowspaceinwhichitliesontoasectionoftheswappingbuer.Thisprocessistheswappingoroverlayingfromwhichthesystemtakesitsname.Thearrayisnow(directly)accessible.However,furtherrequestsforswappingcouldcausethearraytobeoverlaidwithsomethingelse,soineectitisliabletogoawayatanytime.Thusallsystemcodethatrelatestoarraysmustrecognizehandlesasaspecialkindofarray,fetchthemintothebuer(ifnotalreadythere),whennecessarycheckthattheyhavenotdisappeared,fetchthembackiniftheyhave,andevenbepreparedforthesecondfetchtobringtheswappablearrayinatadierentplacethandidtherst.Themajoremphasisinthedesignoftheoverlaysystemhasbeenplacedonrunningcompiledcode,becausethisaccountsfortheoverwhelmingmajorityofarraysintypicalsystems,andforasmuchas60%oftheoveralldataandcode.ThesystemsupportstherunningofcompiledcodedirectlyfromtheSincecompiledcodearrayspointtoatomsforfunctionnames,andstringsforerrormessages,nottomentionthefactthatprogramsusuallyhavedatabase,whicharetypicallylistsratherthanarrays,thereisstillaveryrealandnitelimittothetotalsizeofprogramsthatInterlisp-10canaccomodate.However,sincemuchofthesystemandusercompiledcodecanbemadeswappable,thereisthatmuchmoreresidentspaceavailablefortheseotherdata-types.Initially64,512wordpages,butcanbechangedviathefunctiondescribedbelow.22.24residentMAKESYSThemainpurposeandintentoftheswappingsystemistopermitutilizationofswappablearraysdirectlyandinterchangeablywithresidentarrays,therebysavingresidentspacewhichisthenavailableforotherdata-types,suchaslists,atoms,strings,etc.swappingbueroverlayingSETSBSIZEyQ%*bc  D }`m$|b'" $ *H,+\8 i xW US%L*z.t 58*?Cm V- 7 #%'+26:=tCGTT  gk#W'*p.L0P68b:?CFR  0  '(+W048:?DSQ< r^"N7 36 %')-G/1 9:=<@G>L &$% # ,o- 495;?DoFJ   "1#&(*V04g7_=e@'DIF  x "P *-|D ix@|  ( g %+.2d 9;>)CF>  !&*;+/2 8% EFy=1 ! $%+/4|7]@9BbCFX9 5*5us %)/14)9E<?BD8@ !#*x/13957V9mABG>4 4 }%+   C t $&).j3l798 @F]H)  ' K&*_+ 2F34:@B9D'(S n#%)++-12f7%9;AELF& 0n !$(*/r249;?@C % ! #h)-X1378:@C@#a  !Sb"$'u+~/1*59'<@BNFx! 5nLO "&*T. 1379<AF+  4 '+4.235=8W<>BDp  '/2$(`* +,2V59 ;}=k  |!$Z)R-048:@FA / %+6-1B37=)@BeD7H0  lX"9&,T.35;?DG =Y !%()-2a5)9;?dEH0 H6!$'+(/&1j69=@DHs  K"!:$d'(.1 7"9 ; C  gr &*&,.2 :=?XBOFM  G!$ 0z!&#(*-:@(} `m${V--&x6 /{1  P^ ;&&*,-21 8:o@E0I  #i(M,159;>KDF_.  t!x) (S x 2 }  `m$x {=$} $`m$293031293031INTERLISP-10SPECIFICSswappingbuer,andthefunctioncallingmechanismknowswhenaswappabledenitionisbeingcalled,ndsitinthebuerifitisalreadythere,andbringsitinotherwise.Thus,fromtheuser'spointofview,thereisnoneedtodistinguishbetweenswappableandresidentcompileddenitions,andinfactwillbetrueforeither.22.13.2EciencyOnceofthemostimportantdesigngoalsfortheoverlaysystemwasthatswappablecodeshouldnotexecuteanyextrainstructionscomparedtoresidentcode,onceithadbeenswappedin.Thus,theinstructionsofaswappablepieceofcodeareidentical(exceptfortwoinstructionsattheentrypoint)tothoseoftheresidentcodefromwhichitwascopied,andsimilarlywhenaswappablefunctioncallsanotherfunction(ofanykind)itusestheexactsamecallingsequenceasanyothercode.Thus,allcostsassociatedwithrunningofswappablecodearepaidatthepointofentry(bothcallingandreturning).Thecostoftheswappingitself,i.e.thefetchofanewpieceofswappedcodeintothebuer,isevenhardertomeasuremeaningfully,sincetwosuccessivefetchesofthesamefunctionarenotthesame,duetothefactthattheinstancecreatedbytherstfetchisalmostcertaintoberesidentwhenthesecondisdone,ifnoswappingisdoneinbetween.Similarly,twosuccessivePMAP's(theTenexoperationtofetchonepage)arenotthesamefromonemomenttoanother,evenifthevirtualstateofbothforksisexactlythesame-adicultconstrainttomeetinitself.Thus,allthatcanbereportedisthatempiricalmeasurementsandobservationshaveshownnoconsistentslowdowninperformanceofsystemscontainingswappablefunctionsvizavizresidentfunctions.22.13.3SpecicationsAssociatedwiththeoverlaysystemisadatatypecalleda,(typename),whichoccupiesonewordofresidentspace,plushowevermuchofshadowspaceneededforthebodyofthearray.,,,,,,,,,,,andallworkequallywellwithswappableasresidentprograms.istrueforallcompiledfunctions/denitions.[Function]Analogousto.Returnsifisaswappablearrayand,otherwise.Therelocatableinstructionsareindexedbyabaseregister,tomakethemrunequallywellatanylocationinthebuer.Thenetslowdownduetothisextralevelofindirectionistoosmalltomeasureaccuratelyintheoverallrunningofaprogram.Onanalyticalgrounds,onewouldexpectittobearound2%.Ifthefunctioninquestiondoesnothing,e.g.acompiled,itcostsapproximatelytwiceasmuchtoenteritsdenitionifitisswappableascomparedtoresident.However,verysmallfunctionsarenormallynotmadeswappable(see,page22.26),becausetheydon'tsavemuchspace,andare(typically)enteredfrequently.Largerprogramsdon'texhibitameasurableslowdownsincetheyamortizetheentrycostoverlongerruns.Thecostoffetchingisprobablynotinthemappingoperationitselfbutintherstreferencetothepage,whichhasahighprobabilityoffaulting.Thisraisestheproblemofmeasuringpagefaultactivity,anothermorassofuncertainty.22.25CCODEPSWPARRAYSWPARRAYPARGLISTFNTYPNARGSGETDPUTDARGTYPEARRAYSIZECHANGENAMECALLSBREAKADVISEEDITACCODEP(SWPARRAYP)ARRAYPNIL(LAMBDANILNIL)MKSWAPPXXXyI*FG;j+   C } `m$"|b'! )*x\: eu#I*t.2c3:3@aAEZ  i1id $',-/[ 6k:j=@qDgH&X  7H !&-Q05h;x BEnG3WIz#/|R ixN  " $:&)'.258?[BGjL  3#%+"/ 247 :@~CbGK4 J5z 7#%+g022s5" <>@DH0I  p1 ",#&[,/5w9A:ACFG pGK!F#'1*/469P<@DFFC RjS $?&)+?-1826:2>AG C=  " #&(d),0N27;/>@EFA Og  !z$% */'03>6@CTG(?  &A ~"%'+e,1`579?BEO>L  jJv% ,). 5`:=AH0<  d4"$*%+1B458[<?ADHs; MEik !#_&(f-;1 258>:(?AC9[ i 1 b$& ,34 <>BC* 7 !H |3Q i x. u]!q"(W,d4_5Z8D_E-F S!7$G)-/48r=P?BEG+ "5&o-.5>CI)J=!$}'.E/5,A\BEG(U %PC5 #n%%&,,/u028<5BK   > Q$&(D+126:=OBSEsG? 3hA,$&(+[.284 ;<?BDt ] f ')_ /w57;@4AC5E$   b $(&(;i2A~D A (} 4`m$xWI .-<+ #'M. 6y ?D) ;%P # ?B-48 (?!} @`m$Jx%P*#+_. =$ } `m$Specications[Function]Analogousto.Returnsifisorhasaswappedcompileddenition.[Function]Ifisaresidentarray,returnsaswappablearraywhichisacopyof.Ifisaliteralatomandistrue,itsdenitioniscopiedintoaswappablearray,anditis(undoably)redenedwiththelatter.returns.[Function]Theinverseof.iseitheraswappablearray,oranatomwithswappeddenitiononitsproperty.[Function]Allcompileddenitionsbeginlifeasresidentarrays,whethertheyarecreatedby,orbycompilingtocore.Beforetheyarestoredawayintotheiratom'sfunctioncell,isappliedtotheatomandthearray.Ifthevalueofis,thedenitionismadeswappable;otherwise,itisleftresident.Byredeningoradvisingit,theusercancompletelycontroltheswappabilityofallfuturedenitionsastheyarecreated.Theinitialdenitionofwillmakeafunctionswappableif(1)is,and(2)thenameofthefunctionisnoton,and(3)thesizeofitsdenitionisgreaterthanwords,initially128.[Function]Setsthesizeoftheswappingbuerto,anumberof.Returnsthepreviousvalue.returnsthecurrentsizewithoutchangingit.Note:Currently,thesystemlackserrorrecoveryroutinesforsituationssuchasacalltoaswappablefunctionwhichistoobigfortheswappingbuer,orwhenthesizeiszero.Therefore,shouldbeusedwithcare.22.26(SCODEP)CCODEPT(MKSWAP)(CCODEP)MKSWAP(MKUNSWAP)MKSWAPCODE(MKSWAPP)LOADMKSWAPPMKSWAPPTMKSWAPPMKSWAPPNOSWAPFLGNILNOSWAPFNSMKSWAPSIZE(SETSBSIZE)pages(SETSBSIZE)SETSBSIZEXXXXXXXXXXFNAMECDEFNN|b'% x\:C5 Zn%%&,/I02u46;A WC5 UE"&+,37V;}=>KADcE\HsTD d,'-029:?AC5R8 '.13{=BOC5 MG&(m)-/59;=AD<LM%IHC5 G &*,.38U=@CGE ,&(,1R47;b? BEDWO' (-/2658;`@ADKH&B Z!<#)+E/ 62 <>?AGA $M%+3,/14M ;%?A ?eX@[ &'*-2G58?#G4=x"Y)"*591:.=?KAEG<9!S+,.136`86:-@{BF:t $)7oC5 5{i!#e)g-p/017;<BDS4#%*@,1b4 9>1 "]$)T,0J5;?= CFH/x(#)-.h035T7=BCG-O= .2{4j7:( }|`m$*x\: |Z +3W |TD#**R7O *M!LM!IH EDW qBA ?e@=,6<#v:t 7o {58x4# -%!}|`m$jx\:Z-WUDCFTD)RAOSM'IH{7o*5/"}$`m$: TIMESROMANGACHACMS CMR   TIMESROMAN  TIMESROMAN CMSYf <# , P5 ? 4LHT[ d m v~X& 0 | j/[ChapInterlisp10.PRESSSANNELLASEPTEMBER 15, 1983 12:36:59