Add a -utabmd command line option to Scheme.
authorGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Sun, 15 Feb 1987 16:10:52 +0000 (16:10 +0000)
committerGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Sun, 15 Feb 1987 16:10:52 +0000 (16:10 +0000)
v7/src/microcode/boot.c
v7/src/microcode/version.h
v8/src/microcode/version.h

index 22afa2e9af93641ccc0b2a1203fdc1c5c654d9e7..110ce0c77584143cae8d9f5a646248e746d33c9b 100644 (file)
@@ -30,7 +30,7 @@ Technology nor of any adaptation thereof in any advertising,
 promotional, or sales literature without prior written consent from
 MIT in each case. */
 \f
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/boot.c,v 9.25 1987/02/07 15:29:41 jinx Exp $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/boot.c,v 9.26 1987/02/15 16:10:52 jinx Exp $
  *
  * This file contains the code to support startup of
  * the SCHEME interpreter.
@@ -50,6 +50,7 @@ MIT in each case. */
           {-heap heap-size}
          {-stack stack-size}
          {-constant constant-size}
+         {-utabmd utab-filename}
           {other arguments ignored by the core microcode}
 
    with filespec either {-band band-name} or {{-}fasl file-name}
@@ -69,6 +70,7 @@ MIT in each case. */
                  be allocated.
    constant-size..number of cells for constant and pure space in the
                   system.
+   utab-filename..name of an alternate utabmd file to use.
 
 Additional arguments may exist for particular machines; see CONFIG.H
 for details.  They are created by defining a macro Command_Line_Args.
@@ -403,20 +405,47 @@ Built_In_Primitive(Prim_Microcode_Identify, 0, "MICROCODE-IDENTIFY")
 \f
 Built_In_Primitive(Prim_Microcode_Tables_Filename,
                   0, "MICROCODE-TABLES-FILENAME")
-{ char *From, *To,
-       *Prefix=SCHEME_SOURCES_PATH,
-       *Suffix=UCODE_TABLES_FILENAME;
-  long Count=0;
-  Pointer Result = Make_Pointer(TC_CHARACTER_STRING, Free);
-
+{ fast char *From, *To;
+  char *Prefix, *Suffix;
+  fast long Count;
+  long position;
+  Pointer Result;
   Primitive_0_Args();
-  /* Might run out of room to do this, but not likely */
-  for (From = &(Prefix[0]), To = (char *) &(Free[STRING_CHARS]);
-       *From != '\0'; Count++) *To++ = *From++;
-  for (From = &(Suffix[0]); *From != '\0'; Count++) *To++ = *From++;
+
+  if (((position = Parse_Option("-utabmd", Saved_argc, Saved_argv, true))
+       != NOT_THERE) &&
+      (position != (Saved_argc - 1)))
+  { Prefix = "";
+    Suffix = Saved_argv[position + 1];
+  }
+  else
+  { Prefix = SCHEME_SOURCES_PATH;
+    Suffix = UCODE_TABLES_FILENAME;
+  }
+  /* Find the length of the combined string, and allocate. */
+  Count = 0;
+  for (From = Prefix; *From++ != '\0'; )
+  { Count += 1;
+  }
+  for (From = Suffix; *From++ != '\0'; )
+  { Count += 1;
+  }
+  Primitive_GC_If_Needed(STRING_CHARS +
+                        ((Count + sizeof(Pointer)) /
+                         sizeof(Pointer)));
+
+  /* Append both substrings. */
+  Result = Make_Pointer(TC_CHARACTER_STRING, Free);
+  To = (char *) &(Free[STRING_CHARS]);
+  for (From = &(Prefix[0]); *From != '\0'; )
+  { *To++ = *From++;
+  }
+  for (From = &(Suffix[0]); *From != '\0'; )
+  { *To++ = *From++;
+  }
   *To = '\0';
-  Free += STRING_CHARS + (Count+sizeof(Pointer))/sizeof(Pointer);
-  Vector_Set(Result, STRING_LENGTH, FIXNUM_0+Count);
+  Free += STRING_CHARS + ((Count + sizeof(Pointer)) / sizeof(Pointer));
+  Vector_Set(Result, STRING_LENGTH, FIXNUM_0 + Count);
   Vector_Set(Result, STRING_HEADER,
     Make_Non_Pointer(TC_MANIFEST_NM_VECTOR, (Free-Get_Pointer(Result))-1));
   return Result;
index 8660108a2668a74dd015f793ac068ef549b39479..f286c51cd88cd6659bdb85fe2ef5f6eec6356e50 100644 (file)
@@ -30,7 +30,7 @@ Technology nor of any adaptation thereof in any advertising,
 promotional, or sales literature without prior written consent from
 MIT in each case. */
 
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 9.27 1987/02/11 00:10:24 cph Exp $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 9.28 1987/02/15 16:09:24 jinx Exp $
 
 This file contains version information for the microcode. */
 \f
@@ -46,7 +46,7 @@ This file contains version information for the microcode. */
 #define VERSION                9
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     27
+#define SUBVERSION     28
 #endif
 
 #ifndef UCODE_TABLES_FILENAME
index f89c5e1727f7c855c7b5fabc0d87bc42667d7cb3..690e94c6017df272055dc25093e4bf2536cda7ca 100644 (file)
@@ -30,7 +30,7 @@ Technology nor of any adaptation thereof in any advertising,
 promotional, or sales literature without prior written consent from
 MIT in each case. */
 
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 9.27 1987/02/11 00:10:24 cph Exp $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 9.28 1987/02/15 16:09:24 jinx Exp $
 
 This file contains version information for the microcode. */
 \f
@@ -46,7 +46,7 @@ This file contains version information for the microcode. */
 #define VERSION                9
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     27
+#define SUBVERSION     28
 #endif
 
 #ifndef UCODE_TABLES_FILENAME