(FILECREATED "13-Mar-84 14:42:28" {PHYLUM}<LISPNEW>SOURCES>MAKEINIT.;1 17958 changes to: (FNS LOADMKIFILES) previous date: " 3-Jan-84 17:27:38" {PHYLUM}<LISP>SOURCES>MAKEINIT.;2) (* Copyright (c) 1982, 1983, 1984 by Xerox Corporation) (PRETTYCOMPRINT MAKEINITCOMS) (RPAQQ MAKEINITCOMS ((FNS I.RPAQ? LOADMAKEINIT LOADMKIFILES RELOAD) (FNS MAKEINIT MKI.START) (FNS DUMPVP) (FNS BOUTZEROS BIN16 BOUT16) (VARS BYTECOMPILE.EXT CODEINDICATOR (MKI.FirstDataByte 1024) (MKI.Page0Byte 512) (MKI.DATE (DATE)) MKI.CODESTARTOFFSET MKI.SEQUENTIAL PRINTEXPRS) (FNS MKI.PASSFILE SCRATCHARRAY DOFORM CONSTFORMP NOTICECOMS I.ADDTOVAR I.DECLARE: I.FILECREATED I.PUTPROPS I.RPAQ I.RPAQQ EVALFORMAKEINIT) (FNS I.ATOMNUMBER I.FIXUPNUM I.FIXUPPTR) (FNS MKI.ATOM MKI.IEEE) (FNS MKI.DSET MKI.ADDTO MKI.PUTPROP) (VARS (MKI.ARRAY) (MKI.TVHA (HASHARRAY 400)) (MKI.PLHA (HASHARRAY 150)) (MKI.ATOMARRAY (HASHARRAY 5000)) (INIT.EXT (QUOTE SYSOUT))) (PROP MKI ADDTOVAR DECLARE: FILECREATED PUTPROPS RPAQ RPAQ? RPAQQ LISPXPRINT PRETTYCOMPRINT *) [DECLARE: DONTEVAL@LOAD DOCOPY (P (PUTPROP (NAMEFIELD (INPUT) T) (QUOTE LOADDATE) (GETFILEINFO (INPUT) (QUOTE ICREATIONDATE] (DECLARE: EVAL@COMPILE (PROP MACRO SETXVAR IEQ) DONTCOPY (FILES (LOADCOMP) MEM)))) (DEFINEQ (I.RPAQ? [LAMBDA (FORM) (* lmm " 7-MAR-80 08:36") (PROG ((VAL (CADDR FORM)) V) (COND ((SETQ V (CONSTFORMP VAL)) (MKI.DSET (CADR FORM) (EVAL V))) (T (DOFORM (LIST (QUOTE SETTOPVAL) (KWOTE (CADR FORM)) VAL]) (LOADMAKEINIT [LAMBDA (LARGEFLG) (* lmm "31-JUL-81 14:27") [SELECTQ (SYSTEMTYPE) ((D ALTO)) (PROGN (ADDTOVAR DIRECTORIES BLISP) (GCGAG 1000) [COND ((NOT LARGEFLG) (SETSEPR (QUOTE (%| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26)) 1 FILERDTBL) (MINFS 45000 (QUOTE ARRAYP)) (MINFS 10000 (QUOTE FIXP)) (MINFS 3000 (QUOTE STRING.CHARS)) (MINFS 2000 (QUOTE ATOM.CHARS] (MOVD? (QUOTE NILL) (QUOTE MKNUMATOM)) (* This is a kludge to get around the problem that, while MKATOM is in LLNEW, MKNUMATOM is not, and MKATOM calls MKNUMATOM when given an atom beginning with a digit. It turns out that MKNUMATOM will always return NIL in the cases called from MAKEINIT because MAKEINIT is merely copying things which it knows are really LITATOM and spelled like it.) (MOVD? (QUOTE *) (QUOTE BLOCKRECORD)) (PUTDQ? FIXSPELL1 (LAMBDA (OLD NEW) (PRINT (LIST OLD (QUOTE ->) NEW) T T] (LOADMKIFILES) (SELECTQ (SYSTEMTYPE) ((D ALTO)) (PROGN (MINFS 10000 (QUOTE ALTOPOINTER)) (* doesn't work until after datatype declaration has been loaded) (RECLAIM (QUOTE ARRAYP)) (RECLAIM (QUOTE ATOM.CHARS)) (MINFS 10000 (QUOTE ARRAYP)) (MINFS 5000 (QUOTE LISTP)) (SYSOUT (QUOTE MKI.SAV]) (LOADMKIFILES [LAMBDA NIL (* mjs "13-Mar-84 14:41") (for X in (UNION MAKEINITFILES (SELECTQ (SYSTEMTYPE) ((ALTO D) NIL) MAXC.MAKEINITFILES)) do (RELOAD (PACKFILENAME (QUOTE BODY) X (QUOTE EXTENSION) COMPILE.EXT]) (RELOAD [LAMBDA (FILE) (* lmm "13-APR-81 21:16") (PROG (DATE FULLFILENAME) RETRY (COND ([ILESSP (OR (GETPROP FILE (QUOTE LOADDATE)) MIN.INTEGER) (SETQ DATE (GETFILEINFO (SETQ FULLFILENAME (OR (FINDFILE FILE T) (GO NOTFOUND))) (QUOTE ICREATIONDATE] (LOAD FULLFILENAME T) (PUTPROP FILE (QUOTE LOADDATE) DATE))) (RETURN T) NOTFOUND (COND ((GETP (NAMEFIELD FILE) (QUOTE FILEDATES)) (PRINT (CONS FILE (QUOTE (already loaded))) T) (RETURN))) (ERROR FILE "not found.") (GO RETRY]) ) (DEFINEQ (MAKEINIT [LAMBDA (TYPE TOFILE) (* bvm: " 1-NOV-83 22:47") (LOADMKIFILES) (PROG ([TYPELST (OR (LISTP TYPE) (OR (CDR (ASSOC TYPE MAKEINITTYPES)) (ERROR TYPE (QUOTE ?] FILES SIZEGUESS AFTERINITFILESET EXPRESSIONS) (SETQ FILES (CADR TYPELST)) (SETQ AFTERINITFILESET (CADDR TYPELST)) (SETQ SIZEGUESS (CADDDR TYPELST)) (RESETLST [RESETSAVE (OUTPUT (SETQ TOFILE (OPENFILE (PACKFILENAME (QUOTE BODY) (OR TOFILE (CAR TYPELST) (QUOTE XXX)) (QUOTE EXTENSION) INIT.EXT) (QUOTE OUTPUT) (QUOTE NEW) 8 (COND [NIL (* Can't do this until we can do GETFILEPTR on a sequential output file) (APPEND MKI.SEQUENTIAL (QUOTE ((TYPE BINARY))) (AND SIZEGUESS (CONS (LIST (QUOTE LENGTH) (UNFOLD SIZEGUESS BYTESPERPAGE] (T (QUOTE ((TYPE BINARY] (RESETSAVE NIL (LIST [FUNCTION (LAMBDA (FL) (AND (OPENP FL) (CLOSEF FL)) (AND RESETSTATE (DELFILE FL] TOFILE)) (PROG [(OUTX (GETOFD TOFILE (QUOTE OUTPUT] (MKI.START) (for X in FILES do (MKI.PASSFILE X)) [COND (AFTERINITFILESET [MKI.ADDTO (QUOTE MAKEINIT.EXPRESSIONS) (LIST (LIST (QUOTE MAPC) (KWOTE (EVAL AFTERINITFILESET)) (QUOTE (FUNCTION (LAMBDA (FILE) (OR [SOME LOADUPDIRECTORIES (FUNCTION (LAMBDA (DIR FL) (COND ((SETQ FL (INFILEP (PACKFILENAME (QUOTE DIRECTORY) DIR (QUOTE NAME) FILE (QUOTE EXTENSION) COMPILE.EXT))) (LOAD FL (QUOTE SYSLOAD)) T] (PRINT (CONS FILE (QUOTE (not found))) T] (MKI.ADDTO (QUOTE BOOTFILES) (QUOTE (MAKEINIT.EXPRESSIONS] (I.MAKEINITLAST))) (RETURN TOFILE]) (MKI.START [LAMBDA NIL (* lmm "19-MAR-82 11:17") (SETQ RESETPTR) (SETQ RESETPC) (BOUTZEROS MKI.FirstDataByte) (CLRHASH MKI.TVHA) (CLRHASH MKI.PLHA) (CLRHASH MKI.ATOMARRAY) (RESETMEMORY) (SETQ MKI.VALUES (for X in INITVALUES bind Y collect (SET (SETQ Y (PACK* "I." (SUBSTRING (CAR X) 2 -1))) (CADR X)) Y)) (SETQ MKI.PTRS (for X in INITPTRS bind Y collect (SET (SETQ Y (PACK* "I." (SUBSTRING (CAR X) 2 -1))) (CADR X)) Y)) (I.MAKEINITFIRST) (MKI.DSET NIL NIL) (MKI.DSET T T) (MKI.DSET (QUOTE MAKEINITDATES) (LIST MKI.DATE (DATE))) (for X in INITCONSTANTS when (NEQ (CAR X) (QUOTE *)) do (I.FSETVAL (CAR X) (COND [(LISTP (CADR X)) (I.VAG2 (CAADR X) (CADR (CADR X] (T (I.\COPY (CADR X]) ) (DEFINEQ (DUMPVP [LAMBDA (VP) (* lpd: "27-APR-77 20:24") (PRIN1 (QUOTE *) T) (WriteoutPage OUTX VP]) ) (DEFINEQ (BOUTZEROS [LAMBDA (N) (* lmm "16-MAY-81 16:49") (FRPTQ N (\BOUT OUTX 0]) (BIN16 [LAMBDA (J) (* lmm "16-MAY-81 16:49") (IPLUS (LLSH (\BIN J) 8) (\BIN J]) (BOUT16 [LAMBDA (J N) (* lmm "16-MAY-81 16:51") (\BOUT J (LRSH N 8)) (\BOUT J (LOGAND N 255]) ) (RPAQQ BYTECOMPILE.EXT DCOM) (RPAQQ CODEINDICATOR D1) (RPAQQ MKI.FirstDataByte 1024) (RPAQQ MKI.Page0Byte 512) (RPAQ MKI.DATE (DATE)) (RPAQQ MKI.CODESTARTOFFSET 52) (RPAQQ MKI.SEQUENTIAL ((SEQUENTIAL T))) (RPAQQ PRINTEXPRS T) (DEFINEQ (MKI.PASSFILE [LAMBDA (FILESET) (* bvm: " 1-NOV-83 21:22") (COND [(NUMBERP FILESET) (MKI.PASSFILE (EVALV (PACK* FILESET (QUOTE LISPSET] ((LISTP FILESET) (MAPC FILESET (FUNCTION MKI.PASSFILE))) (T (PROG NIL (INPUT (SETQ FILESET (OPENFILE (OR (FINDFILE (PACKFILENAME (QUOTE BODY) FILESET (QUOTE EXTENSION) BYTECOMPILE.EXT) T) FILESET) (QUOTE INPUT) (QUOTE OLD) 8 MKI.SEQUENTIAL))) (SETQ FILESET (NAMEFIELD FILESET)) (PROG ([COMSNAMES (LIST (PACK* FILESET (QUOTE COMS] SKIPVARS MEXPRS X) (PRINT (INPUT) T T) LP [SELECTQ (SETQ X (READ)) ((STOP NIL) (GO DONE)) (COND ((NLISTP X) [COND ((NEQ (RATOM) CODEINDICATOR) (ERROR X (QUOTE "Bad compiled code format"] (I.DCODERD X)) (T (DOFORM X] (GO LP) DONE[COND ((CAR MEXPRS) (MKI.ADDTO (SETQ FILESET (PACK* FILESET (QUOTE .EXPRESSIONS))) (CAR MEXPRS)) (MKI.ADDTO (QUOTE BOOTFILES) (LIST FILESET] (RETURN (CLOSEF (INPUT]) (SCRATCHARRAY [LAMBDA (NBYTES ALIGN) (* lmm "21-AUG-81 23:14") [COND ((OR (NULL MKI.ARRAY) (IGREATERP NBYTES (ARRAYSIZE MKI.ARRAY))) (* make sure the scratch array is big enough) (SETQ MKI.ARRAY (\CODEARRAY NBYTES 0] (for I from 0 to (SUB1 (UNFOLD ALIGN BYTESPERCELL)) do (\BYTESETA MKI.ARRAY I 0)) MKI.ARRAY]) (DOFORM [LAMBDA (X) (* lmm "30-APR-80 22:19") (PROG [(FN (GETPROP (CAR X) (QUOTE MKI] (COND (FN (* ASSERT: (CALLS I.RPAQQ I.RPAQ I.DECLARE: I.DEFLIST I.PUTPROPS I.ADDTOVAR I.SETHASHQ I.PRETTYDEFMACROS I.FILECREATED)) (APPLY* FN X)) (T (COND (PRINTEXPRS (PRINT X T T))) (SETQ MEXPRS (TCONC MEXPRS X]) (CONSTFORMP [LAMBDA (X) (* lmm " 7-MAR-80 08:54") (COND ((LISTP X) (SELECTQ (CAR X) ((QUOTE FUNCTION) X) NIL)) [(LITATOM X) (SELECTQ X (NIL (QUOTE (QUOTE NIL))) (T T) (AND (SETQ X (GETHASH X MKI.TVHA)) (KWOTE (CDR X] (T X]) (NOTICECOMS [LAMBDA (VAL) (* lmm "30-APR-80 22:56") (for X in VAL when (LISTP VAL) do (COND [(AND (EQ (CADR X) (QUOTE *)) (LITATOM (CADDR X))) (COND ((EQ (CAR X) (QUOTE COMS)) (push COMSNAMES (CADDR X))) (T (push SKIPVARS (CADDR X] (T (SELECTQ (CAR X) ((COMS DECLARE:) (NOTICECOMS (CDR X))) NIL]) (I.ADDTOVAR [LAMBDA (FORM) (* lmm " 2-DEC-81 23:58") (MKI.ADDTO (CADR FORM) (CDDR FORM]) (I.DECLARE: [LAMBDA (FORM) (* lmm "18-FEB-80 14:04") (* edited (2-APR-75 . 934)) (PROG ((L FORM) (FLAG T) X FN) LP (COND ((NULL (SETQ L (CDR L))) (RETURN)) ((NLISTP (SETQ X (CAR L))) (SELECTQ X ((EVAL@LOAD DOEVAL@LOAD) (SETQ FLAG T)) (DONTEVAL@LOAD (SETQ FLAG NIL)) NIL)) (T (DOFORM X))) (GO LP]) (I.FILECREATED [LAMBDA (X) (* lmm " 6-MAR-80 17:48") (COND ((LITATOM (CADDR X)) (PROG (NAME) [MKI.ADDTO (QUOTE BOOTLOADEDFILES) (LIST (SETQ NAME (NAMEFIELD (CADDR X] (MKI.PUTPROP NAME (QUOTE FILEDATES) (LIST (CONS (CADR X) (CADDR X]) (I.PUTPROPS [LAMBDA (FORM) (* lpd: "29-APR-77 13:22") (MKI.PUTPROP (CADR FORM) (CADDR FORM) (CADDDR FORM]) (I.RPAQ [LAMBDA (FORM) (* lmm " 7-MAR-80 08:36") (PROG ((VAL (CADDR FORM)) V) (COND ((SETQ V (CONSTFORMP VAL)) (MKI.DSET (CADR FORM) (EVAL V))) (T (DOFORM (LIST (QUOTE SETTOPVAL) (KWOTE (CADR FORM)) VAL]) (I.RPAQQ [LAMBDA (FORM) (* lmm "30-APR-80 22:12") (PROG ((ATM (CADR FORM)) (VAL (CADDR FORM))) (COND ((FMEMB ATM COMSNAMES) (NOTICECOMS VAL)) ((FMEMB ATM SKIPVARS)) (T (MKI.DSET ATM VAL]) (EVALFORMAKEINIT [LAMBDA (FORM) (* bvm: " 2-NOV-83 15:22") (COND ((LISTP FORM) (SELECTQ (CAR FORM) [MKATOM (COND ((STRINGP (CADR FORM)) (MKATOM (CADR FORM))) (T (HELP] (HELP))) ((FIXP FORM) FORM) (T (HELP]) ) (DEFINEQ (I.ATOMNUMBER [LAMBDA (A) (* lmm " 9-NOV-81 23:28") (I.LOLOC (COND ((LITATOM A) (MKI.ATOM A)) (T A]) (I.FIXUPNUM [LAMBDA (CA BN NUM MASK) (* lmm " 2-AUG-80 10:29") (\BYTESETA CA (SUB1 BN) (LOGOR (LOGAND (\BYTELT CA (SUB1 BN)) (LRSH (LOGXOR MASK 65535) 8)) (LOGAND (LRSH (LOGAND NUM MASK) 8) 255))) (\BYTESETA CA BN (LOGAND NUM 255]) (I.FIXUPPTR [LAMBDA (CA BN PTR) (* lmm " 2-AUG-80 10:29") (* Specific for MAXC - actual ptr is same as simulated ptr) (PROG ((LOLOC (I.LOLOC PTR))) (\BYTESETA CA (SUB1 BN) (LRSH LOLOC 8)) (\BYTESETA CA BN (LOGAND LOLOC 255)) (\BYTESETA CA (IDIFFERENCE BN 2) (I.HILOC PTR]) ) (DEFINEQ (MKI.ATOM [LAMBDA (X) (* lmm "29-JUL-81 22:46") (* for MAXC) (AND X (OR (GETHASH X MKI.ATOMARRAY) (PUTHASH X (COND ((EQ X (QUOTE NOBIND)) PTRNOBIND) (T (I.COPYATOM X))) MKI.ATOMARRAY]) (MKI.IEEE [LAMBDA (X BOX) (* bvm: "16-Dec-80 00:44") (* Converts pdp-10 floating-point number X to IEEE standard for Dolphin, storing (with I.PUTBASE) into BOX) (PROG (MAGNITUDE (SIGN 0) (EXP 0) (FRAC 0)) RETRY [SETQ MAGNITUDE (COND [(MINUSP X) (SETQ SIGN 32768) (IMINUS (OPENR (LOC X] (T (OPENR (LOC X] (COND ((ZEROP MAGNITUDE) (GO DONE)) ((IEQP (LOGAND MAGNITUDE 67108864) 0) (* unnormalized number???) (SETQ X (FPLUS X 0.0)) (GO RETRY))) (COND ((ILEQ (SETQ EXP (IDIFFERENCE (LRSH MAGNITUDE 27) 2)) 0) (* Exponent bias is off by 1, plus another 1 because of the implicit high bit. Thus have to watch for underflow) (ERROR "Unrepresentable floating-point number" X) (SETQ EXP (SETQ SIGN 0)) (* If continued, make it zero) (GO DONE))) [SETQ FRAC (IPLUS (LOGAND (LRSH MAGNITUDE 3) 16777215) (COND ((OR (ILESSP (LOGAND MAGNITUDE 7) 4) (EQ (LOGAND MAGNITUDE 15) 4)) (* Round down) 0) (T 1] [COND ((IGREATERP FRAC 16777215) (* Rounding overflowed the high bit) (SETQ FRAC (LRSH FRAC 1)) (* EXP can't overflow, because of bias difference) (SETQ EXP (ADD1 EXP] (* FRAC is now a 24-bit fraction with its high bit on) DONE(I.PUTBASE BOX 0 (LOGOR SIGN (LLSH EXP 7) (LOGAND (LRSH FRAC 16) 127))) (I.PUTBASE BOX 1 (LOGAND FRAC 65535]) ) (DEFINEQ (MKI.DSET [LAMBDA (A VAL) (* lpd: "29-APR-77 13:21") (PROG ((LST (GETHASH A MKI.TVHA))) (COND (LST (COND ((NEQ VAL (CDR LST)) (LISPXPRINT (LIST A (QUOTE (value changed from)) (CDR LST) (QUOTE (to)) VAL) T T))) (RPLACD LST VAL)) (T (PUTHASH A (CONS NIL VAL) MKI.TVHA]) (MKI.ADDTO [LAMBDA (A VAL) (* lpd: "29-APR-77 13:20") (PROG ((LST (GETHASH A MKI.TVHA))) (COND [LST (RPLACD LST (UNION VAL (CDR LST] (T (PUTHASH A (CONS NIL VAL) MKI.TVHA]) (MKI.PUTPROP [LAMBDA (A PROP VAL) (* lpd: "29-APR-77 13:19") (PROG ((LST (GETHASH A MKI.PLHA))) (COND (LST (COND ((LISTGET LST PROP) (LISPXPRINT (LIST A (QUOTE (- prop)) PROP (QUOTE (has been changed))) T T))) (LISTPUT LST PROP VAL)) (T (PUTHASH A (LIST PROP VAL) MKI.PLHA]) ) (RPAQQ MKI.ARRAY NIL) (RPAQ MKI.TVHA (HASHARRAY 400)) (RPAQ MKI.PLHA (HASHARRAY 150)) (RPAQ MKI.ATOMARRAY (HASHARRAY 5000)) (RPAQQ INIT.EXT SYSOUT) (PUTPROPS ADDTOVAR MKI I.ADDTOVAR) (PUTPROPS DECLARE: MKI I.DECLARE:) (PUTPROPS FILECREATED MKI I.FILECREATED) (PUTPROPS PUTPROPS MKI I.PUTPROPS) (PUTPROPS RPAQ MKI I.RPAQ) (PUTPROPS RPAQ? MKI I.RPAQ?) (PUTPROPS RPAQQ MKI I.RPAQQ) (PUTPROPS LISPXPRINT MKI NILL) (PUTPROPS PRETTYCOMPRINT MKI NILL) (PUTPROPS * MKI NILL) (DECLARE: DONTEVAL@LOAD DOCOPY (PUTPROP (NAMEFIELD (INPUT) T) (QUOTE LOADDATE) (GETFILEINFO (INPUT) (QUOTE ICREATIONDATE))) ) (DECLARE: EVAL@COMPILE (PUTPROPS SETXVAR MACRO [X (COND ((EQ (CAAR X) (QUOTE QUOTE)) (LIST (QUOTE SETQ) (CADAR X) (CADR X))) ((LITATOM (CAR X)) (LIST (QUOTE SET) (CAR X) (CADR X))) (T (HELP (CONS X (QUOTE (bad SETXVAR form]) (PUTPROPS IEQ MACRO ((X Y) (IEQP X Y))) DONTCOPY (FILESLOAD (LOADCOMP) MEM) ) (PUTPROPS MAKEINIT COPYRIGHT ("Xerox Corporation" 1982 1983 1984)) (DECLARE: DONTCOPY (FILEMAP (NIL (1462 4252 (I.RPAQ? 1472 . 1771) (LOADMAKEINIT 1773 . 3252) (LOADMKIFILES 3254 . 3591) ( RELOAD 3593 . 4250)) (4253 7294 (MAKEINIT 4263 . 6310) (MKI.START 6312 . 7292)) (7295 7438 (DUMPVP 7305 . 7436)) (7439 7814 (BOUTZEROS 7449 . 7557) (BIN16 7559 . 7680) (BOUT16 7682 . 7812)) (8081 12806 (MKI.PASSFILE 8091 . 9293) (SCRATCHARRAY 9295 . 9703) (DOFORM 9705 . 10108) (CONSTFORMP 10110 . 10414 ) (NOTICECOMS 10416 . 10875) (I.ADDTOVAR 10877 . 11009) (I.DECLARE: 11011 . 11465) (I.FILECREATED 11467 . 11783) (I.PUTPROPS 11785 . 11931) (I.RPAQ 11933 . 12229) (I.RPAQQ 12231 . 12492) ( EVALFORMAKEINIT 12494 . 12804)) (12807 13677 (I.ATOMNUMBER 12817 . 12975) (I.FIXUPNUM 12977 . 13282) ( I.FIXUPPTR 13284 . 13675)) (13678 15794 (MKI.ATOM 13688 . 13974) (MKI.IEEE 13976 . 15792)) (15795 16770 (MKI.DSET 15805 . 16177) (MKI.ADDTO 16179 . 16403) (MKI.PUTPROP 16405 . 16768))))) STOP