1 TITLE INITIALIZATION FOR MUDDLE
5 HTVLNT==3000 ; GUESS OF TVP LENGTH
7 LAST==1 ;POSSIBLE CHECKS DONE LATER
22 OBSIZE==151. ;DEFAULT OBLIST SIZE
24 .LIFG <TVBASE+TVLNT-TVLOC>
28 .GLOBAL SHRRM,SHRLM,SMOVEM,SSETZM,SXBLT,SHLRZ
29 .GLOBAL SETUP,TPBAS,GCPDL,GCPVP,PVBASE,PVLNT,PARNEW,AAGC,ICR,SWAP,OBLNT,MSGTYP,POPUNW
30 .GLOBAL ICLOS,OCLOS,GLOBASE,GLOBSP,PARBOT,PARTOP,CODTOP,START,BEGIN,VECBOT,VECTOP,TPBASE
31 .GLOBAL LISTEN,ROOT,INITIAL,TBINIT,TOPLEV,INTOBL,ERROBL,MUDOBL,TTYOPE,RESFUN,QUITTER
32 .GLOBAL IOINS,BUFRIN,IOIN2,ECHO,MTYI,MTYO,IMTYO,MUDSTR,P.TOP,TTICHN,TTOCHN,TYPVEC,SQDIR
33 .GLOBAL PDLBUF,PHIBOT,%UNAM,PURVEC,STOSTR,ISTOST,TD.LNT,TD.PUT,TD.GET,CAFRE1
34 .GLOBAL FRETOP,LPUR,SQBLK,REALGC,INTDIR,AGCLD,PAGEGC,TD.AGC,TVSTRT,REALTV,PVSTOR
35 .GLOBAL GCSTOP,SPSTOR,DSTORE,SQBYTE,INBYTE,GCBYTE,FRSTCH,OPSYS,IJFNS,GETJS
38 LPUR==.LPUR ; SET UP SO LPUR WORKS
40 ; INIITAL AMOUNT OF AFREE SPACE
44 ISTOST: TVSTRT-STOSTR,,0
48 SETUP: MOVEI 0,0 ; ZERO ACS
52 IFN ITS, .SUSET [.RUNAM,,%UNAM] ; FOR AGC'S BENFIT
53 MOVE P,GCPDL ;GET A PUSH DOWN STACK
54 IFN ITS, .SUSET [.SMASK,,[200000]] ; ENABLE PDL OVFL
55 MOVE 0,[TVBASE,,TVSTRT]
56 BLT 0,TVSTRT+HTVLNT-3 ; BLT OVER TVP
57 IFE ITS, PUSHJ P,TWENTY ; FIND OUT WHETHER IT IS TOPS20 OR NOT
58 PUSHJ P,TTYOPE ;OPEN THE TTY
59 AOS A,20 ; TOP OF LOW SEGG
61 SOSN A ; IF NOTHING YET
62 IFN ITS, .SUSET [.RMEMT,,P.TOP]
65 SUB A,FRETOP ; SETUP FOR GETTING NEEDED CORE
74 .CALL HIGET ; GET THEM
75 FATAL INITM--CORE NOT AVAILABLE FOR INITIALIZATION
78 SUBI A,2000 ; WHERE FRETOP IS
87 HRRE A,P.TOP ; CHECK TOP
88 TRNE A,377777 ; SKIP IF ALL LOW SEG
89 JUMPL A,PAGLOS ; COMPLAIN
90 MOVE A,HITOP ; FIND HI SEG TOP
93 MOVEM A,RHITOP ; SAVE IT
103 HIBOK: MOVEI B,[ASCIZ /MUDDLE INITIALIZATION.
105 PUSHJ P,MSGTYP ;PRINT IT
106 MOVE A,CODTOP ;CHECK FOR A WINNING LOAD
107 CAML A,VECBOT ;IT BETTER BE LESS
108 JRST DEATH1 ;LOSE COMPLETELY
109 SETTV: MOVE PVP,[-PVLNT*2,,GCPVP] ;AND A PROCESS VECTOR
111 MOVEM PVP,PVSTOR+1-TVSTRT+TVBASE
112 MOVEI A,(PVP) ;SET UP A BLT
113 HRLI A,PVBASE ;FROM PROTOTYPE
114 BLT A,PVLNT*2-1(PVP) ;INITIALIZE
115 MOVE TP,[-ITPLNT,,TPBAS] ;GET A STACK FOR THIS PROCCESS
116 MOVEI TB,(TP) ;AND A BASE
118 IFE ITS, HRLI TB,400001 ; FOR MULTI SEG HACKING
119 SUB TP,[1,,1] ;POP ONCE
121 ; FIRST BUILD MOBY HASH TABLE
123 MOVEI A,1023. ; TRY THIS OUT FOR SIZE
125 MOVEM B,HASHTB+1-TVSTRT+TVBASE ; STORE IN TVP POINTER
131 ; ALLOCATE SOME OBLISTS FOR INITIAL ATOMS
133 PUSH P,[5] ;COUNT INITIAL OBLISTS
135 PUSH P,OBLNT ;SAVE CURRENT OBLIST DEFAULT SIZE
140 MCALL 0,MOBLIST ;GOBBLE AN OBLIST
141 PUSH TP,$TOBLS ;AND SAVE THEM
143 MOVE A,(P)-1 ;COUNT DOWN
144 MOVEM B,@OBTBL(A) ;STORE
147 POP P,OBLNT ;RESTORE DEFAULT OBLIST SIZE
149 MOVE C,[-TVLNT+2,,TVBASE]
150 MOVE D,[-HTVLNT+2,,TVSTRT]
152 ;MAIN INITIALIZE LOOP - SCAN XFER VECTOR FOR ATOMS, UPDATE
153 ;OFFSETS IN CODE, UNIQUIFY ATOMS AND COMPACT XFER VECTOR
155 ILOOP: HLRZ A,(C) ;FIRST TYPE
156 JUMPE A,TVEXAU ;USEFUL STUFF EXHAUSTED
157 CAIN A,TCHSTR ;CHARACTER STRING?
158 JRST CHACK ;YES, GO HACK IT
160 JRST ATOMHK ;YES, CHECK IT OUT
161 MOVE A,(C) ;MOVE TO NEW HOME (MAY BE SAME)
165 SETLP: AOS (P) ;COUNT NUMBER OF PAIRS IN XFER VECTOR
166 ADD D,[2,,2] ;OUT COUNTER
167 SETLP1: ADD C,[2,,2] ;AND IN COUNTER
168 JUMPL C,ILOOP ;JUMP IF MORE TO DO
170 ;NEW XFER VECTOR FINISHED, NOW GIVE AWAY THE REST
172 TVEXAU: HLRE B,D ; LEFT HALF OF AOBJN
173 MOVNI TVP,HTVLNT-2 ; CALCULATE LENGTH OF TVP
174 SUB TVP,B ; GET -LENGTH OF TVP IN TVP
176 HRRI TVP,TVSTRT ; BUILD A TASTEFUL TVP POINTER
177 MOVNI C,TVLNT-HTVLNT+2(B) ; SMASH IN LENGTH INTO END DOPE WORDS
178 HRLM C,TVSTRT+HTVLNT-1
180 MOVEM E,TVSTRT+HTVLNT-2
182 MOVNI C,-2(C) ; CLOBBER LENGTH INTO REAL TVP
186 HRLM C,1(B) ; PUT IN LENGTH
188 MOVEM TVP,REALTV+1(PVP)
193 MOVE A,TYPVEC+1 ;GET POINTER
194 MOVEI 0,0 ;FOR POSSIBLE NULL SLOTS
195 MOVSI B,TATOM ;SET TYPE TO ATOM
196 MOVEI D,400000 ; TYPE CODE HACKS
198 TYPLP: HLLM B,(A) ;CHANGE TYPE TO ATOM
199 MOVE C,@1(A) ;GET ATOM
200 HLRE E,C ; FIND DOPE WORD
202 HRRM D,(E) ; STUFF INTO ATOM
208 \f; CLOSE TTY CHANNELS
215 ;GENERAT THE LOGICAL TTY IN AND OUT CHANNELS
217 ;SETUP CALL TO OPEN OUTPUT TTY CHANNNEL
219 IRP A,,[[PRINT,TCHSTR],[TTY:,TCHSTR]]
227 MCALL 2,FOPEN ;OPEN THE OUT PUT CHANNEL
228 MOVEM B,TTOCHN+1 ;SAVE IT
230 ;ASSIGN AS GLOBAL VALUE
233 PUSH TP,IMQUOTE OUTCHAN
236 MOVE A,[PUSHJ P,MTYO] ;MORE WINNING INS
237 MOVEM A,IOINS(B) ;CLOBBER
240 ;SETUP A CALL TO OPEN THE TTY CHANNEL
242 IRP A,,[[READ,TCHSTR],[TTY:,TCHSTR]]
250 MCALL 2,FOPEN ;OPEN INPUTCHANNEL
251 MOVEM B,TTICHN+1 ;SAVE IT
252 PUSH TP,$TATOM ;ASSIGN AS A GLOBAL VALUE
253 PUSH TP,IMQUOTE INCHAN
256 MOVE C,BUFRIN(B) ;GET AUX BUFFER PTR
257 MOVE A,[PUSHJ P,MTYI]
258 MOVEM A,IOIN2(C) ;MORE OF A WINNER
259 MOVE A,[PUSHJ P,IMTYO]
260 MOVEM A,ECHO(C) ;ECHO INS
262 MOVEI A,3 ;FIRST CHANNEL AFTER INIT HAPPENS
265 ;GENERATE AN INITIAL PROCESS AND SWAP IT IN
267 MOVEI A,TPLNT ;STACK PARAMETERS
269 PUSHJ P,ICR ;CREATE IT
274 MOVEM 0,REALTV+1(B) ; STUFF IN TRANSFER VECTOR POINTER
277 MOVE D,B ;SET UP TO CALL SWAP
278 JSP C,SWAP ;AND SWAP IN
279 MOVEM PVP,MAINPR" ;SAVE AS THE MAIN PROCESS
280 PUSH TP,[TENTRY,,TOPLEV] ;BUILD DUMMY FRAME
288 PUSH TP,C ;TPSAV PUSHED
290 HRRI TB,(TP) ;SETUP TB
292 IFE ITS, HRLI TB,400002
295 MOVEM TB,TBINIT+1(PVP)
299 MOVEM A,RESFUN+1(PVP)
301 PUSH TP,IMQUOTE THIS-PROCESS
306 ; FIND TVP OFFSET FOR THE ATOM 'T' FOR TEMPLATE
316 PUSH TP,IMQUOTE TVTOFF,,MUDDLE
321 ; HERE TO SETUP SQUOZE TABLE IN PURE CORE
323 PUSHJ P,SQSETU ; GO TO ROUTINE
326 MOVEI A,400000 ; FENCE POST PURE SR VECTOR
330 SUBI A,-PDLBUF(B) ;POINT TO DOPE WORDS
331 MOVEI B,12 ;GROWTH SPEC
338 IFE ITS, PUSHJ P,GETJS
344 MOVEM A,TPBASE+1(PVP)
346 ; CREATE LIST OF ROOT AND NEW OBLIST
351 NAMOBL: PUSH TP,$TATOM
352 PUSH TP,@OBNAM-1(A) ; NAME
354 PUSH TP,IMQUOTE OBLIST
357 MCALL 3,PUT ; NAME IT
362 PUSH TP,IMQUOTE OBLIST
370 ;Define MUDDLE version number
372 MOVEI B,0 ;Initialize result
373 MOVE C,[440700,,MUDSTR+2]
374 VERLP: ILDB D,C ;Get next charcter digit
375 CAIG D,"9 ;Non-digit ?
378 SUBI D,"0 ;Convert to number
380 ADD B,D ;Include number into result
381 SOJG A,VERLP ;Finished ?
384 PUSH TP,IMQUOTE MUDDLE
387 MCALL 2,SETG ;Make definition
393 PUSH TP,MQUOTE IPC-HANDLER
403 ; Allocate inital template tables
411 ADD B,[10,,10] ; REST IT OFF
415 MOVEI 0,TUVEC ; SETUP UTYPE
424 MOVEI 0,TUVEC ; SETUP UTYPE
433 MOVEI 0,TUVEC ; SETUP UTYPE
441 PTSTRT: MOVEI A,SETUP
443 SUB A,PARBOT ;FIND WHERE PAIRS SHOULD GO
446 ; PURIFY/IMPURIFY THE WORLD (PDL)
449 PURIMP: MOVE A,FRETOP
455 DOTCAL CORBLK,[[1000,,310000],[1000,,-1],A]
456 FATAL INITM -- CAN'T IMPURIFY LOW CORE
462 DOTCAL CORBLK,[[1000,,0],[1000,,-1],B]
463 FATAL INITM -- CAN'T FLUSH MIDDLE CORE
464 MOVE A,[-<400-PHIBOT>,,PHIBOT]
465 DOTCAL CORBLK,[[1000,,210000],[1000,,-1],A]
466 FATAL INITM -- CAN'T PURIFY HIGH CORE
474 PUSH P,[15.,,15.] ;PUSH A SMALL PRGRM ONTO P
475 MOVEI A,1(P) ;POINT TO ITS START
476 PUSH P,[JRST AAGC] ;GO TO AGC
477 PUSH P,[MOVE PVP,PVSTOR+1]
478 PUSH P,[MOVE B,PSTO+1(PVP)] ;GET SAVED P
479 PUSH P,[SUB B,-14.(P)] ;FUDGE TO POP OFF PROGRAM
480 PUSH P,[MOVEM B,PSAV(TB)] ;INTO FRAME
481 PUSH P,[MOVE B,TPSTO+1(PVP)] ;GET TP
482 PUSH P,[MOVEM B,TPSAV(TB)] ;STORE IT
483 PUSH P,[MOVE B,SPSTOR+1] ;SP
484 PUSH P,[MOVEM B,SPSAV(TB)]
485 PUSH P,[MOVEI B,TOPLEV] ;WHERE TO GO
486 PUSH P,[MOVEM B,PCSAV(TB)]
487 IFN ITS, PUSH P,[MOVSI B,(.VALUE )]
488 IFE ITS, PUSH P,[MOVSI B,(JRST)]
490 PUSH P,[JRST B] ;GO DO VALRET
492 PUSH P,A ; PUSH START ADDR
493 MOVE B,[JRST -12.(P)]
495 IFE ITS, MOVE C,[HALTF]
497 MOVE C,[ASCII \
\170/
\e9\]
498 MOVE D,[ASCII \B/
\e1Q\]
499 MOVE E,[ASCIZ \
\r\16*
\r\] ;TERMINATE
507 DEATH1: MOVEI B,[ASCIZ /LOSSAGE--CODE AND DATA OVERLAP
512 ;CHARACTER STRING HACKER
514 CHACK: MOVE A,(C) ;GET TYPE
515 HLLZM A,(D) ;STORE IN NEW HOME
516 MOVE B,1(C) ;GET POINTER
519 PUSH P,E+1 ; IDIVI WILL CLOBBER
520 ADDI E,4+5*2 ; ROUND AND ACCOUNT FOR DOPE WORDS
521 IDIVI E,5 ; E/ WORDS LONG
522 PUSHJ P,EBPUR ; MAKE A PURIFIED COPY
524 HRLI B,010700 ;MAKE POINT BYTER
526 MOVEM B,1(D) ;AND STORE IT
527 ANDI A,-1 ;CLEAR LH OF A
528 JUMPE A,SETLP ;JUMP IF NO REF
529 HRRZ B,-1(A) ;SEE IF PREVIOUS INSTRUCTION REFERS TO $TCHSTR
530 CAIE B,$TCHSTR ;SKIP IF IT DOES
531 JRST CHACK1 ;NO, JUST DO CHQUOTE PART
532 HRRM D,-1(A) ;CLOBBER
534 HRRM E,(A) ;STORE INTO REFERENCE
539 ; SUBROUTINE TO COPY A HUNK OF STRUCTURE TO THE HIGH SEGMENT
543 ADD E,HITOP ; GET NEW TOP
544 CAMG E,RHITOP ; SKIP IF TOO BIG
547 ; CODE TO GROW HI SEG
550 ADDB A,RHITOP ; NEW TOP
554 ASH A,-10. ; NUM OF BLOCKS
555 SUBI A,1 ; BLOCK TO GET
560 EBPUR1: MOVEI A,-1(E) ; NEEDED TO TERMINATE BLT
583 ; PROCESS AN ATOM AND ADD IT TO AN APPROPRIATE OBLIST IF IT ISN'T
586 ATOMHK: PUSH TP,$TOBLS ; SAVE OBLIST
587 PUSH TP,[0] ; FILLED IN LATER
588 PUSH TP,$TVEC ;SAVE TV POINTERS
592 MOVE C,1(C) ;GET THE ATOM
593 PUSH TP,$TATOM ;AND SAVE
597 HRRZ B,(C) ;GET OBLIST SPEC FROM ATOM
599 ADDI B,1(TB) ;POINT TO ITS HOME
602 MOVEM B,-10(TP) ; CLOBBER
604 SETZM 2(C) ; FLUSH CURRENT OBLIST SPEC
620 ;HERE IF THIS ATOM MUST BE PUT ON OBLIST
622 USEATM: MOVE B,-2(TP) ; GET ATOM
623 HLRZ E,(B) ; SEE IF PURE OR NOT
624 TRNN E,400000 ; SKIP IF IMPURE
632 PUSHJ P,VALMAK ;MAKE A GLOBAL VALUE FOR THIS LOSER
633 PURAT2: MOVE C,-6(TP) ;RESET POINTERS
636 MOVE B,(C) ;MOVE THE ENTRY
637 HLLZM B,(D) ;DON'T WANT REF POINTER STORED
638 MOVE A,1(C) ;AND MOVE ATOM
641 ANDI B,-1 ;CHECK FOR REAL REF
642 JUMPE B,SETLP1 ;DON'T SAVE THIS ATOM ON TVP
643 HRRM A,(B) ;CLOBBER CODE
645 DPB A,[220400,,(B)] ; CLOBBER TVP PORTION
649 ; HERE TO MAKE A PURE ATOM
651 PURATM: HRRZ B,-2(TP) ; POINT TO IT
652 HLRE E,-2(TP) ; - LNTH
655 PUSHJ P,EBPUR ; PURE COPY
656 HRRM B,-2(TP) ; AND STORE BACK
665 FATAL INITM--PURE IMPURE LOSSAGE
669 MOVE D,-2(TP) ; GET ATOM BACK
670 HRRZ 0,(D) ; GET OBLIST CODE
676 CAILE D,HIBOT ; IF NEXT PURE & I AM ROOT
677 JUMPE 0,PURAT8 ; TAKES ADVANTAGE OF SYSTEM=0
692 PURAT9: HLRE A,-2(TP)
696 PURAT6: MOVE B,-10(TP) ; GET BUCKET BACK
699 HRRM 0,2(C) ; STORE OBLIST IN ATOM
700 PURAT1: HRRZ C,(B) ; GET CONTENTS
701 JUMPE C,HICONS ; AT END, OK
702 CAIL C,HIBOT ; SKIP IF IMPURE
703 JRST HICONS ; CONS IT ON
713 PUSHJ P,EBPUR ; MAKE PURE LIST CELL
717 HRRM B,(C) ; STORE IT
718 MOVE B,1(B) ; ATOM BACK
719 MOVE C,-6(TP) ; GET TVP SLOT
720 HRRM B,1(C) ; AND STORE
721 HLRZ 0,(B) ; TYPE OF VAL
723 CAIN 0,TUNBOU ; NOT UNBOUND?
724 JRST PURAT3 ; UNBOUND, NO VAL
725 MOVEI E,2 ; COUNT AGAIN
726 PUSHJ P,EBPUR ; VALUE CELL
727 MOVE C,-2(TP) ; ATOM BACK
733 HRRZ A,(C) ; GET OBLIST CODE
735 HRRM A,2(C) ; STORE OBLIST SLOT
739 ; A POSSIBLE MATCH ARRIVES HERE
741 CHCKD: MOVE D,(TP) ;THEY MATCH!, GET EXISTING ATOM
742 MOVEI A,(D) ;GET TYPE OF IT
743 MOVE B,-2(TP) ;GET NEW ATOM
745 TRZ A,377777 ; SAVE ONLY 400000 BIT
747 CAIN 0,(A) ; SKIP IF WIN
754 MOVE A,(B) ;MOVE VALUE
758 MOVE B,D ;EXISTING ATOM TO B
762 PUSHJ P,VALMAK ;MAKE A VALUE
766 ;NOW FIND ATOMS OCCURENCE IN XFER VECTOR
768 OFFIND: MOVE D,-4(TP) ;GET CURRENT POINTER INTO TP
769 MOVE C,[-TVLNT,,TVSTRT] ;AND A COPY OF TVP
770 MOVEI A,0 ;INITIALIZE COUNTER
771 ALOOP: CAMN B,1(C) ;IS THIS IT?
773 ADD C,[2,,2] ;BUMP COUNTER
775 AOJA A,ALOOP ;NO, KEEP LOOKING
777 MOVEI B,[ASCIZ /LOSSAGE--ATOM DISAPPEARED
779 TYPIT: PUSHJ P,MSGTYP
782 AFOUND: LSH A,1 ;FOUND ATOM, GET REAL OFFSET
785 MOVE C,-6(TP) ;GET TV POINTER TO NEW ATOM
786 HRRZ B,(C) ;POINT TO REFERENCE
788 HRRM A,(B) ;YES, CLOBBER AWAY
791 DPB A,[220400,,(B)] ; KILL TVP POINTER
792 JRST SETLP1 ;AND GO ON
794 A1VAL: HLRZ C,(B) ;GET VALUE'S TYPE
795 MOVE B,D ;NOW PUT EXISTING ATOM IN B
796 CAIN C,TUNBOU ;UNBOUND?
797 JRST OFFIND ;YES, WINNER
799 MOVEI B,[ASCIZ /LOSSAGE--ATOM TRIES TO HAVE 2 VALUES
804 IM.PUR: MOVEI B,[ASCIZ /LOSSAG--ATOM TRIES TO BE BOTH PURE AND IMPURE
808 PAGLOS: MOVEI B,[ASCIZ /LOSSAGE--IMPURE CORE EXTENDS INTO HIGH SEGMENT
812 HIFUL: MOVEI B,[ASCIZ /LOSSAGE--HI SEG FULL
817 ;MAKE A VALUE IN SLOT ON GLOBAL SP
819 VALMAK: HLRZ A,(B) ;TYPE OF VALUE
821 CAIN A,TUNBOU ;VALUE?
823 MOVE A,GLOBSP+1 ;GET POINTER TO GLOBAL SP
824 SUB A,[4,,4] ;ALLOCATE SPACE
825 CAMG A,GLOBAS+1 ;CHECK FOR OVERFLOW
827 MOVEM A,GLOBSP+1 ;STORE IT BACK
828 MOVE C,(B) ;GET TYPE CELL
830 HLLZM C,2(A) ;INTO TYPE CELL
831 MOVE C,1(B) ;GET VALUE
832 MOVEM C,3(A) ;INTO VALUE SLOT
833 MOVSI C,TGATOM ;GET TATOM,,0
835 MOVEM B,1(A) ;AND POINTER TO ATOM
836 MOVSI C,TLOCI ;NOW CLOBBER THE ATOM
837 MOVEM C,(B) ;INTO TYPE CELL
838 ADD A,[2,,2] ;POINT TO VALUE
845 SPOVFL: MOVEI B,[ASCIZ /LOSSAGE--GLOBAL SP OVERFLOW
863 \f;SET UP LIST OF INTERNAL NAMES AND ADDRESS NEEDED BY COMPILER
867 IRP A,,[FINIS,SPECBIND,WNA,WRONGT,$TLOSE,CALER1,POPUNW
868 ILOC,IGLOC,IDVAL,ILVAL,IGVAL,INTFLG,LCKINT,ONINT,TYPLOO,TDEFER
869 IFALSE,UNAS,UNBOU,RCALL,SEGMNT,SEGLST,NUMPRI,OPSYS,SSPEC1,COMPERR
870 MAKACT,MAKENV,BFRAME,TTP,TTB,$TTP,$TTB,MAKTUP,TPALOC,IBIND,SSPECS
871 CILVAL,CISET,CIGVAL,CSETG,IBLOK1,IBLOCK,CLLOC,CGLOC,CASSQ,CGASSQ
872 CILNT,CILNQ,CILEGQ,CEMPTY,CIEQUA,CIREST,CINTH,CIAT,CSETLO,CIN
873 CIPUT,CIGET,CIGETL,CIMON,CISTRU,CIMEMQ,CIMEMB,CITOP,CIBACK,TYPSEG
874 C1CONS,CICONS,CIUVEC,CIVEC,IIFORM,IILIST,CISTNG,HITOP,INCR1,TYPG,VALG,TESTR
875 OTBSAV,CITYPE,CFRAME,CARGS,CFUNCT,CUTYPE,CPTYPE,CTYPEP,CTYPEQ,CCHUTY
876 CIREMA,RTFALS,CIPUTP,CIGETP,CIGTPR,MPOPJ,TAB,$TAB,ICONS,CSTO,DSTO,NTPALO
877 CPLUS,CTIMES,CTIME,CDIVID,CMINUS,CLQ,CLEQ,CGQ,CGEQ,CLOG,CSIN,CCOS,CATAN,CSQRT
878 CFIX,CFLOAT,CEXP,CRAND,CINEQU,SPECBND,PGGIVE,PGFIND,MTYO,CMIN,CMAX,RCL,R1C,W1C
879 CALLTY,CTYPEC,CTYPEW,NOTTY,CHKAB,CTMPLT,IUNWIN,UNWIN2,NOSHUF,ROOT,ERROBL,INTOBL
880 CINSER,CIRMV,CLOOKU,CATOM,CIPNAM,ISTRCM,CITERP,CIPRIN,CIPRN1,CIPRNC,CGFALS
881 CPATM,CP1ATM,CPCATM,CPSTR,CP1STR,CPCSTR,CPCH,CREADC,CNXTCH,CREDC1,CNXTC1
882 CGBOUN,IIGLOC,MAKTU2,CIFLTZ,CIUPRS,SAT,TFA,WTYP,NAPT,PTYPE,APLQ,PURBOT,GCSBOT
883 GLOTOP,TYPVEC,1STEPR,LSTRES,NODES,MAINPR,CVTYPE,CSPNAM,CSBSTR,INTBCK,CICRLF
884 CERR1,CERR2,CERR3,CANDP,CORP,CSQUTA,CIMAGE,ATOSQ,CFILLE,CPRTYC,FMPOPJ
885 TD.PUT,TD.GET,TD.LNT,CBYTES,MARK,MARK2G,TD.AGC,DSTORE,RCLV,NUMSAT,RMCALL,NPRFLG
886 NSPOPJ,NFPOPJ,PURCLN,FRETOP,PURVEC,SWAPGC,NTTYPE,CLRSTR]
893 ; ROUTINE TO SORT AND PURIFY SQUOZE TABLE
895 SQSETU: MOVE A,[SQUTBL-SQULOC+2,,SQUTBL]
910 STSQU: MOVE B,[440700,,SQBLK]
915 FATAL CANT MAKE FIXUP FILE
917 MOVE B,[440000,,100000]
919 FATAL CANT OPEN FIXUP FILE
920 MOVE B,[444400,,SQUTBL]
921 MOVNI C,SQULOC-SQUTBL
926 MOVE A,[SQUTBL-SQULOC,,SQUTBL]
931 STSQU: MOVE C,MUDSTR+2 ; CALCULATE SECOND FILE NAME FOR SQUOZE TABLE
933 HRRI C,(SIXBIT/TAB/) ; TABxxx IS SECOND NAME OF FILE
935 MOVEM C,SQBLK+2 ; STORE IN APPROPRIATE BLOCKS
937 .SUSET [.SSNAM,,SQDIR]
938 .OPEN GCHN,SQWBLK ; OPEN FILE
939 FATAL CAN'T CREATE SQUOZE FILE
940 MOVE A,[SQUTBL-SQULOC,,SQUTBL]
943 .CLOSE GCHN ; CLOSE THE CHANNEL
961 OBTBL: INITIAL+1-TVSTRT+TVBASE
962 MUDOBL+1-TVSTRT+TVBASE
963 INTOBL+1-TVSTRT+TVBASE
964 ERROBL+1-TVSTRT+TVBASE
966 OBNAM: MQUOTE INITIAL
980 SQWBLK: SIXBIT / 'DSK/
985 MNGNAM: MOVE A,[440700,,MUDSTR+2] ; FOR NAME HACKING
986 ILDB 0,A ; SEE IF IT IS A VERSION
991 CAIN 0,"X ; LOOK FOR X'S
996 MOVE A,[440700,,MUDSTR+2]
1007 .GLOBAL VCREATE,MUDSTR
1009 DEBUG: MOVE E,[440600,,[SIXBIT /EXPERIMENTAL/]]
1013 VCREATE: .SUSET [.SSNAM,,[SIXBIT /MUDSYS/]]
1016 MOVEI 0,0 ; SET 0 TO DO THE .RCHST
1023 STUFF: MOVE D,[440700,,MUDSTR+2]
1024 STUFF1: ILDB A,E ; GET A CHAR
1025 CAIN A,0 ;SUPRESS SPACES
1026 MOVEI A,137 ;RUBOUT'S DON'T TYPE OUT
1027 ADDI A,40 ; TO ASCII
1035 OP%: 1,,(SIXBIT /DSK/)
1047 .GLOBAL GCDIR,ILDBLK,TILDBL,GCLDBK,LENGC,SLENGC,SGCLBK,RLENGC
1048 .GLOBAL SECBLK,SECLEN,RSLENG,DECBLK
1050 ; ROUTINE TO DUMP OUT THE GARBAGE-COLLECTOR
1054 .SUSET [.SSNAM,,GCDIR] ; SET SNAME
1055 MOVE C,MUDSTR+2 ; CREATE SECOND NAMES
1057 HRRI C,(SIXBIT /MUD/)
1058 MOVS A,C ; MUDxx IS SECOND NAME
1062 MOVEM A,GCDBLK+2 ; SMASH IN SECOND NAMES
1065 .OPEN 0,GCDBLK ; OPEN GC FILE
1066 FATAL CANT CREATE AGC FILE
1067 MOVNI A,LENGC ; CALCULATE IOT POINTER
1071 .IOT 0,A ; SEND IT OUT
1072 .CLOSE 0, ; CLOSE THE CHANNEL
1073 .OPEN 0,SGCDBK ; OPEN GC FILE
1074 FATAL CANT CREATE AGC FILE
1075 MOVNI A,SLENGC ; CALCULATE IOT POINTER
1078 HRRI A,REALGC+RLENGC
1079 .IOT 0,A ; SEND IT OUT
1080 .CLOSE 0, ; CLOSE THE CHANNEL
1083 ; ROUTINE TO DUMP THE INTERPRETER
1085 .SUSET [.SSNAM,,INTDIR]
1086 .OPEN 0,ILDBLK ; OPEN FILE TO INTERPRETER BLOCK
1087 FATAL CANT FIXUP INTERPRETER
1088 HLRE B,TP ; MAKE SURE BIG ENOUGJ
1089 MOVNS B ; SEE IF WE WIN
1090 CAIGE B,400 ; SKIP IF WINNING
1091 FATAL NO ROOM FOR PAGE MAP
1095 .IOT 0,A ; GET IN PAGE MAP
1098 FATAL CANT FIXUP INTERPRETER
1099 MOVEI A,1 ; INITIALIZE FILE PAGE COUNT
1100 MOVEI B,0 ; CORE PAGE COUNT
1103 JUMPE 0,NOPAG ; IF 0 FORGET IT
1104 ADDI A,1 ; AOS FILE MAP
1105 NOPAG: ADDI B,1 ; AOS PAGE MAP
1106 CAIE B,PAGEGC ; SKIP IF DONE
1108 ASH A,10. ; TO WORDS
1111 ASH B,10. ; TO WORDS
1118 GCDBLK: SIXBIT / 'DSK/
1122 SGCDBK: SIXBIT / 'DSK/
1126 INTDBK: 100007,,(SIXBIT /DSK/)
1132 MOVE B,[440700,,GCLDBK]
1133 PUSHJ P,MNGNAM ; VERSION TO NAME IF NECESSARY
1137 FATAL CANT WRITE OUT GC
1139 MOVE B,[440000,,100000]
1141 FATAL CANT OPEN GC FILE
1144 MOVE B,[444400,,REALGC]
1160 MOVE B,[440700,,SGCLBK]
1161 PUSHJ P,MNGNAM ; VERSION TO NAME IF NECESSARY
1165 FATAL CANT WRITE OUT GC
1167 MOVE B,[440000,,100000]
1169 FATAL CANT OPEN GC FILE
1172 MOVE B,[444400,,REALGC+RLENGC]
1178 MOVEI D,SLENGC+SLENGC
1180 MOVEI B,REALGC+RLENGC
1188 MOVE B,[440700,,SECBLK]
1189 PUSHJ P,MNGNAM ; VERSION TO NAME IF NECESSARY
1193 FATAL CANT WRITE OUT GC
1195 MOVE B,[440000,,100000]
1197 FATAL CANT OPEN GC FILE
1200 MOVE B,[444400,,REALGC+RLENGC+RSLENG]
1207 ; NOW MUNG THE THING TO BE DIFFERENT TO USE UUOS FOR DEBUGGING VERSION
1209 .GLOBAL %FXUPS,%FXEND
1215 LDB 0,[331100,,(A)] ; GET INS
1220 CAIN B,<<(XBLT)>_<-9.>>
1227 MOVE B,[440700,,DECBLK]
1228 PUSHJ P,MNGNAM ; VERSION TO NAME IF NECESSARY
1232 FATAL CANT WRITE OUT GC
1234 MOVE B,[440000,,100000]
1236 FATAL CANT OPEN GC FILE
1239 MOVE B,[444400,,REALGC+RLENGC+RSLENG]
1245 MOVEI D,SECLEN+SECLEN
1247 MOVEI B,REALGC+RLENGC
1255 MOVE B,[440700,,ILDBLK]
1257 MOVE B,[440700,,TILDBL]
1263 TLNN B,400 ; SKIP IF NOT PRIVATE
1272 FATAL CANT CLOSE STUFF
1276 FATAL GARBAGE COLLECTOR IS MISSING
1277 HRRZS E,A ; SAVE JFN
1278 MOVE B,[440000,,300000]
1280 FATAL CANT OPEN GC FILE
1281 MOVEI A,(E) ; FIND OUT LENGTH OF MAP
1282 BIN ; GET LENGTH WORD
1284 CAIE 0,1776 ; TOPS20 SSAVE FILE FORMAT
1285 CAIN 0,1000 ; TENEX SSAVE FILE FORMAT
1287 FATAL NOT AN SSAVE FILE
1288 MOVEI A,(B) ; ISOLATE SIZE OF MAP
1289 HLRE B,TP ; MUST BE SPACE FOR CRUFT
1292 FATAL NO ROOM FOR PAGE MAP (GULP)
1294 MOVEI A,(E) ; READY TO READ IN MAP
1295 MOVEI B,1(TP) ; ONTO TP STACK
1299 MOVEI A,1(TP) ; POINT TO MAP
1301 JRST RPA1 ; GO TO THE TOPS20 CODE
1302 LDB 0,[221100,,(A)] ; GET FORK PAGE
1303 CAIE 0,PAGEGC+PAGEGC ; GOT IT?
1307 RPA1: ADDI A,1 ; POINT TO PROCESS PAGE NUMBER
1308 LDB 0,[331100,,(A)] ; REPEAT COUNT IN 0
1309 LDB B,[3300,,(A)] ; FIRST PAGE NUMBER IN B
1310 ADD 0,B ; LARGEST PAGE NUMBER
1311 CAIL 0,PAGEGC+PAGEGC
1312 CAILE B,PAGEGC+PAGEGC
1313 AOJA A,RPA1 ; NEXT PAIR OF WORDS PLEASE
1314 SUBI A,1 ; POINT TO FILE PAGE NUMBER
1315 SUBI B,PAGEGC+PAGEGC
1317 ADDM B,(A) ; SET UP THE PAGE
1319 RPA2: HRRZ B,(A) ; GET PAGE
1320 MOVEI A,(E) ; GET JFN
1323 FATAL ACCESS OF FILE FAILED
1325 MOVE B,[444400,,AGCLD]
1334 ; CODE TO DISTINGUISH BETWEEN TOPS20 AND TENEX AT SETUP TIME
1336 TWENTY: HRROI A,C ; RESULTS KEPT HERE
1338 MOVEI C,0 ; CLEAN C UP
1341 MOVEI A,1 ; TENEX HAS OPSYS = 1
1342 CAME C,[ASCII/NUL/] ; TOPS20 GIVES "NUL"
1343 MOVEM A,OPSYS ; TENEX GIVES "NIL"
1345 %TBL: IRP A,,[HRRM,HRLM,MOVEM,SETZM,HLRZ,XBLT]
1349 GCLDBK: ASCIZ /MDLXXX.AGC/
1350 SGCLBK: ASCIZ /MDLXXX.SGC/
1351 SECBLK: ASCIZ /MDLXXX.SEC/
1352 ILDBLK: ASCIZ /MDLXXX.EXE/
1353 TILDBL: ASCIZ /MDLXXX.SAV/
1354 DECBLK: ASCIZ /MDLXXX.DEC/