Add the STACK-TOP-ADDRESS primitive to comutl.c for use by the
authorGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Wed, 9 Dec 1987 22:35:43 +0000 (22:35 +0000)
committerGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Wed, 9 Dec 1987 22:35:43 +0000 (22:35 +0000)
compiled code debugger.

v7/src/microcode/comutl.c
v7/src/microcode/version.h
v8/src/microcode/version.h

index c41992bbf49a29c5ca881f230ac88ab644b4182e..f5c0f40288e68dca7a80e79ee6d7d8e8f9b078ed 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/comutl.c,v 1.9 1987/11/17 08:08:27 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/comutl.c,v 1.10 1987/12/09 22:35:43 jinx Rel $
 
 Copyright (c) 1987 Massachusetts Institute of Technology
 
@@ -76,28 +76,40 @@ compiled_entry_to_block_offset(ce)
          ((unsigned long) compiled_entry_to_block_address(address)));
 }
 \f
-Built_In_Primitive (Prim_comp_code_address_block, 1,
-                   "COMPILED-CODE-ADDRESS->BLOCK", 0xB5)
-Define_Primitive (Prim_comp_code_address_block, 1,
-                   "COMPILED-CODE-ADDRESS->BLOCK")
+DEFINE_PRIMITIVE ("COMPILED-CODE-ADDRESS->BLOCK",
+                 Prim_comp_code_address_block, 1)
 {
   Pointer *address;
   Primitive_1_Arg ();
 
   CHECK_ARG (1, COMPILED_CODE_ADDRESS_P);
   address = compiled_entry_to_block_address(Arg1);
-  return (Make_Pointer (TC_COMPILED_CODE_BLOCK, address));
+  PRIMITIVE_RETURN (Make_Pointer (TC_COMPILED_CODE_BLOCK, address));
 }
 
-Built_In_Primitive (Prim_comp_code_address_offset, 1,
-                   "COMPILED-CODE-ADDRESS->OFFSET", 0xAC)
-Define_Primitive (Prim_comp_code_address_offset, 1,
-                   "COMPILED-CODE-ADDRESS->OFFSET")
+DEFINE_PRIMITIVE ("COMPILED-CODE-ADDRESS->OFFSET", Prim_comp_code_address_offset, 1)
 {
   long offset;
   Primitive_1_Arg ();
 
   CHECK_ARG (1, COMPILED_CODE_ADDRESS_P);
   offset = compiled_entry_to_block_offset(Arg1);
-  return (Make_Signed_Fixnum (offset));
+  PRIMITIVE_RETURN (MAKE_SIGNED_FIXNUM (offset));
+}
+
+/*
+  This number is eventually used to subtract from stack environment
+  addresses, so it must correspond to how those are made.
+
+  NOTE: this will have to be updated when the compiler is ported to the
+  stacklet microcode.
+ */
+
+#define STACK_TOP_TO_DATUM() (((long) Stack_Top) & ADDRESS_MASK)
+
+DEFINE_PRIMITIVE("STACK-TOP-ADDRESS", Prim_Stack_Top_Address, 0)
+{
+  Primitive_0_Args();
+
+  PRIMITIVE_RETURN (MAKE_SIGNED_FIXNUM(STACK_TOP_TO_DATUM()));
 }
index c5127030c391503649e7665f0c4e228f348b4c1a..7254eafc972d138077ad1c2787937139f5261c3d 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 10.11 1987/12/04 22:20:47 jinx Exp $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 10.12 1987/12/09 22:34:59 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                10
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     11
+#define SUBVERSION     12
 #endif
 
 #ifndef UCODE_TABLES_FILENAME
index 556bf448fa14f5056071be00a97e26f506b0ae09..8c13f6ccc41c5e35bb95b9b9587efd241af9551c 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 10.11 1987/12/04 22:20:47 jinx Exp $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 10.12 1987/12/09 22:34:59 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                10
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     11
+#define SUBVERSION     12
 #endif
 
 #ifndef UCODE_TABLES_FILENAME