/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/comutl.c,v 1.14 1988/11/08 07:31:15 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/comutl.c,v 1.15 1988/12/23 04:32:24 cph Exp $
Copyright (c) 1987, 1988 Massachusetts Institute of Technology
(MAKE_SIGNED_FIXNUM (compiled_entry_to_block_offset (ARG_REF (1))));
}
-/*
- This number is eventually used to subtract from stack environment
- addresses, so it must correspond to how those are made.
+#ifndef USE_STACKLETS
- NOTE: this will have to be updated when the compiler is ported to the
- stacklet microcode.
- */
+DEFINE_PRIMITIVE ("STACK-TOP-ADDRESS", Prim_stack_top_address, 0, 0, 0)
+{
+ PRIMITIVE_HEADER (0);
-#define STACK_TOP_TO_DATUM() (((long) Stack_Top) & ADDRESS_MASK)
+ PRIMITIVE_RETURN (C_Integer_To_Scheme_Integer (OBJECT_DATUM (Stack_Top)));
+}
-DEFINE_PRIMITIVE ("STACK-TOP-ADDRESS", Prim_stack_top_address, 0, 0, 0)
+#define STACK_ADDRESS_P(object) \
+ ((OBJECT_TYPE (object)) == TC_STACK_ENVIRONMENT)
+
+DEFINE_PRIMITIVE ("STACK-ADDRESS-OFFSET", Prim_stack_address_offset, 1, 1, 0)
{
- Primitive_0_Args();
+ PRIMITIVE_HEADER (1);
- PRIMITIVE_RETURN (MAKE_SIGNED_FIXNUM(STACK_TOP_TO_DATUM()));
+ CHECK_ARG (1, STACK_ADDRESS_P);
+ PRIMITIVE_RETURN
+ (C_Integer_To_Scheme_Integer
+ ((STACK_LOCATIVE_DIFFERENCE
+ ((OBJECT_DATUM (ARG_REF (1))), (OBJECT_DATUM (Stack_Top))))
+ / (sizeof (Pointer))));
}
+#endif /* USE_STACKLETS */
+
DEFINE_PRIMITIVE ("COMPILED-ENTRY-KIND", Prim_compiled_entry_type, 1, 1, 0)
{
fast Pointer *temp;
/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 10.64 1988/12/12 21:51:29 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 10.65 1988/12/23 04:32:55 cph Exp $
Copyright (c) 1988 Massachusetts Institute of Technology
#define VERSION 10
#endif
#ifndef SUBVERSION
-#define SUBVERSION 64
+#define SUBVERSION 65
#endif
#ifndef UCODE_TABLES_FILENAME