(FILECREATED "21-May-86 09:05:13" {ERIS}<TAMARIN>WORK>SIMLOAD.;17 5386   

      changes to:  (FNS RELOADEMULATOR LOADLATEST)
		   (VARS SIMLOADCOMS)

      previous date: "20-May-86 12:19:51" {ERIS}<TAMARIN>WORK>SIMLOAD.;15)


(* Copyright (c) 1986 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT SIMLOADCOMS)

(RPAQQ SIMLOADCOMS ((FNS SIMGETYN SIMLOAD SIMCOPYFILES SIMCOPYFILE \LOADTAMOPCODES 
			   \MAKETAMOPCODEARRAY)))
(DEFINEQ

(SIMGETYN
  [LAMBDA (STR)                                              (* rtk " 4-Mar-86 12:16")
    (LET (CH)
         (PRIN1 (CONCAT STR "  (Y / N )  ? "))
         (CONTROL T)
         (SETQ CH (READC T))
         (CONTROL NIL)
         (if (OR (EQ CH (QUOTE Y))
		   (EQ CH (QUOTE y)))
	     then (PRINT (QUOTE es))
		    T
	   else (PRINT (QUOTE o))
		  NIL])

(SIMLOAD
  [LAMBDA NIL                                                (* rtk " 5-May-86 16:18")
    (LET ((LOADSIM NIL)
	  (LOADALL (SIMGETYN "LOAD ALL")))
         (if (NOT LOADALL)
	     then (SETQ LOADSIM (SIMGETYN "LOAD ALL <SIMULATE>")))
         (if (OR LOADALL LOADSIM (SIMGETYN "LOAD TACCESS"))
	     then (LOAD (QUOTE SIMULATE>TACCESS)))
         (if (OR LOADALL LOADSIM (SIMGETYN "LOAD TSIMULATE"))
	     then (LOAD (QUOTE SIMULATE>TSIMULATE)))
         (if (OR LOADALL LOADSIM (SIMGETYN "LOAD TEFNS"))
	     then (LOAD (QUOTE SIMULATE>TEFNS)))       (* if (OR LOADALL LOADSIM (SIMGETYN "LOAD LLBIGNUM")) 
							     then (LOAD (QUOTE SIMULATE>LLBIGNUM.DCOM)))
         (if (OR LOADALL LOADSIM (SIMGETYN "LOAD TAMUFN"))
	     then (LOAD (QUOTE SIMULATE>TAMUFN)))
         (if (OR LOADALL LOADSIM (SIMGETYN "LOAD TOPEDIT"))
	     then (LOAD (QUOTE SIMULATE>TOPEDIT)))
         (if (OR LOADALL LOADSIM (SIMGETYN "LOAD TAMOPS"))
	     then (\LOADTAMOPCODES)
		    (\MAKETAMOPCODEARRAY))
         (if (OR LOADALL (SIMGETYN "LOAD DT"))
	     then (LOAD (QUOTE DT>DDISASM.DCOM))
		    (LOAD (QUOTE DT>D2T.DCOM))
		    (LOAD (QUOTE DT>TAMGETMACHINE.DCOM))
		    (LOAD (QUOTE DT>ASM.DCOM))
		    (LOAD (QUOTE DT>TASM.DCOM))
		    (LOAD (QUOTE DT>DT.DCOM))
		    (LOAD (QUOTE DT>PC.DCOM])

(SIMCOPYFILES
  [LAMBDA NIL                                                (* rtk " 1-Apr-86 10:57")
    (LET ((LOADALL (SIMGETYN "COPY ALL <SIMULATE>")))
         (if (OR LOADALL (SIMGETYN "COPY TACCESS"))
	     then (SIMCOPYFILE (QUOTE SIMULATE>TACCESS.DCOM)))
         (if (OR LOADALL (SIMGETYN "COPY TSIMULATE"))
	     then (SIMCOPYFILE (QUOTE SIMULATE>TSIMULATE.DCOM)))
         (if (OR LOADALL (SIMGETYN "COPY TEFNS"))
	     then (SIMCOPYFILE (QUOTE SIMULATE>TEFNS.DCOM)))
         (if (OR LOADALL (SIMGETYN "LLBIGNUM.DCOM"))
	     then (SIMCOPYFILE (QUOTE SIMULATE>LLBIGNUM.DCOM)))
         (if (OR LOADALL (SIMGETYN "COPY TAMUFN"))
	     then (SIMCOPYFILE (QUOTE SIMULATE>TAMUFN)
				   T))
         (if (OR LOADALL (SIMGETYN "COPY TAMOPS"))
	     then (SIMCOPYFILE (QUOTE SIMULATE>TAMOPS)))
         (if (OR LOADALL (SIMGETYN "COPY TOPEDIT"))
	     then (SIMCOPYFILE (QUOTE SIMULATE>TOPEDIT.DCOM)))
         (if (OR LOADALL (SIMGETYN "COPY SIMLOAD"))
	     then (SIMCOPYFILE (QUOTE SIMLOAD])

(SIMCOPYFILE
  [LAMBDA (FNAME DCOMTOO)                                    (* rtk "27-Mar-86 18:23")
    (LET (FSTREAM1 FSTREAM2 (FNAME1 (CONCAT "{ERIS}<TAMARIN>WORK>" FNAME))
		   (FNAME2 (CONCAT "{ERIS}<TAMARIN>CURRENT>" FNAME)))
         (SETQ FSTREAM1 (OPENSTREAM FNAME1 (QUOTE INPUT)))
         (SETQ FSTREAM2 (OPENSTREAM FNAME2 (QUOTE OUTPUT)))
         (PRINT (CONCAT "COPY FILE: " FNAME1 "  TO  " FNAME2))
         (COPYBYTES FSTREAM1 FSTREAM2)
         (CLOSEF FSTREAM1)
         (CLOSEF FSTREAM2)
         (IF DCOMTOO
	     THEN (SIMCOPYFILE (CONCAT FNAME ".DCOM"])

(\LOADTAMOPCODES
  [LAMBDA NIL                                                (* rtk "18-Mar-86 07:47")
    (PROG (PROP (THEFILE ""))
          (PRINT "READING TAMARIN OPCODES")
          (SETQ THEFILE (OPENFILE (QUOTE SIMULATE>TAMOPS)
				  (QUOTE INPUT)))
          (SETQ PROP (READ THEFILE))
          (SETQ \TAMOPCODES (HREAD THEFILE))
          (CLOSEF THEFILE)
          (PRINT "SETTING TAMARIN PROPERTIES")
          (for I in \TAMOPCODES do (PUTPROP (fetch (TOPCODE OPCODENAME) of I)
						  PROP I])

(\MAKETAMOPCODEARRAY
  [LAMBDA NIL                                                (* rtk "18-Mar-86 07:48")
    (LET (OPNUM LOCARR)
         (SETQ LOCARR (ARRAY 256 (QUOTE POINTER)
			     NIL 0))
         (PRINT "MAKEING   \TAMOPCODEARRAY")
         (for I in \TAMOPCODES
	    do (PUTPROP (fetch (TOPCODE OPCODENAME) of I)
			  (QUOTE TOPCODE)
			  I)
		 (SETQ OPNUM (fetch (TOPCODE OP#) of I))
		 (if (LISTP OPNUM)
		     then (for J from (CAR OPNUM) to (CADR OPNUM)
			       do (SETA LOCARR J I))
		   else (SETA LOCARR OPNUM I)))
         (SETQ \TAMOPCODEARRAY LOCARR])
)
(PUTPROPS SIMLOAD COPYRIGHT ("Xerox Corporation" 1986))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (448 5308 (SIMGETYN 458 . 842) (SIMLOAD 844 . 2390) (SIMCOPYFILES 2392 . 3532) (
SIMCOPYFILE 3534 . 4128) (\LOADTAMOPCODES 4130 . 4666) (\MAKETAMOPCODEARRAY 4668 . 5306)))))
STOP