From f1e3eca9d807dec64554c00956723903ab5fc09a Mon Sep 17 00:00:00 2001 From: "Guillermo J. Rozas" Date: Wed, 9 Dec 1987 22:35:43 +0000 Subject: [PATCH] Add the STACK-TOP-ADDRESS primitive to comutl.c for use by the compiled code debugger. --- v7/src/microcode/comutl.c | 34 +++++++++++++++++++++++----------- v7/src/microcode/version.h | 4 ++-- v8/src/microcode/version.h | 4 ++-- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/v7/src/microcode/comutl.c b/v7/src/microcode/comutl.c index c41992bbf..f5c0f4028 100644 --- a/v7/src/microcode/comutl.c +++ b/v7/src/microcode/comutl.c @@ -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))); } -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())); } diff --git a/v7/src/microcode/version.h b/v7/src/microcode/version.h index c5127030c..7254eafc9 100644 --- a/v7/src/microcode/version.h +++ b/v7/src/microcode/version.h @@ -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. */ @@ -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 diff --git a/v8/src/microcode/version.h b/v8/src/microcode/version.h index 556bf448f..8c13f6ccc 100644 --- a/v8/src/microcode/version.h +++ b/v8/src/microcode/version.h @@ -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. */ @@ -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 -- 2.25.1