DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T c

⟦fa2ee5be3⟧ TextFile

    Length: 6035 (0x1793)
    Types: TextFile
    Names: »const.h«

Derivation

└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
    └─ ⟦this⟧ »EUUGD11/gnu-31mar87/scheme/microcode/const.h« 

TextFile

/* Emacs, -*-C-*-an't you guess? */

/****************************************************************
*                                                               *
*                         Copyright (c) 1986                    *
*               Massachusetts Institute of Technology           *
*                                                               *
* This material was developed by the Scheme project at the      *
* Massachusetts Institute of Technology, Department of          *
* Electrical Engineering and Computer Science.  Permission to   *
* copy this software, to redistribute it, and to use it for any *
* purpose is granted, subject to the following restrictions and *
* understandings.                                               *
*                                                               *
* 1. Any copy made of this software must include this copyright *
* notice in full.                                               *
*                                                               *
* 2. Users of this software agree to make their best efforts (a)*
* to return to the MIT Scheme project any improvements or       *
* extensions that they make, so that these may be included in   *
* future releases; and (b) to inform MIT of noteworthy uses of  *
* this software.                                                *
*                                                               *
* 3.  All materials developed as a consequence of the use of    *
* this software shall duly acknowledge such use, in accordance  *
* with the usual standards of acknowledging credit in academic  *
* research.                                                     *
*                                                               *
* 4. MIT has made no warrantee or representation that the       *
* operation of this software will be error-free, and MIT is     *
* under no obligation to provide any services, by way of        *
* maintenance, update, or otherwise.                            *
*                                                               *
* 5.  In conjunction with products arising from the use of this *
* material, there shall be no use of the name of the            *
* Massachusetts Institute of Technology nor of any adaptation   *
* thereof in any advertising, promotional, or sales literature  *
* without prior written consent from MIT in each case.          *
*                                                               *
****************************************************************/

/* File: CONST.H
 *
 * Named constants used throughout the interpreter
 *
 */
\f


#if (CHAR_SIZE != 8)
#define MAX_CHAR		((1<<CHAR_SIZE)-1)
#else
#define MAX_CHAR		0xFF
#endif

#define PI			3.1415926535
#define STACK_FRAME_HEADER	1

/* Precomputed typed pointers */
#ifndef b32			/* Safe version */

#define NIL			Make_Non_Pointer(TC_NULL, 0)
#define TRUTH			Make_Non_Pointer(TC_TRUE, 0)
#define UNASSIGNED_OBJECT 	Make_Non_Pointer(TC_UNASSIGNED, UNASSIGNED)
#define UNBOUND_OBJECT		Make_Non_Pointer(TC_UNASSIGNED, UNBOUND)
#define UNCOMPILED_VARIABLE	Make_Non_Pointer(UNCOMPILED_REF, 0)
#define FIXNUM_0		Make_Non_Pointer(TC_FIXNUM, 0)
#define BROKEN_HEART_0		Make_Non_Pointer(TC_BROKEN_HEART, 0)
#define STRING_0		Make_Non_Pointer(TC_CHARACTER_STRING, 0)

#else				/* 32 bit word */
#define NIL			0x00000000
#define TRUTH			0x08000000
#define UNASSIGNED_OBJECT 	0x32000000
#define UNBOUND_OBJECT		0x32000001
#define UNCOMPILED_VARIABLE	0x08000000
#define FIXNUM_0		0x1A000000
#define BROKEN_HEART_0		0x22000000
#define STRING_0		0x1E000000
#endif				/* b32 */

/* Some names for flag values */

#define SET_IT			0	/* Lookup */
#define CLEAR_IT		1
#define READ_IT			2
#define TEST_IT			3
#define NOT_THERE 		-1	/* Command line parser */
\f


/* Assorted sizes used in various places */

#define FILE_NAME_LENGTH	75    	/* Max. chars. in a file name */
#define OBARRAY_SIZE		3001	/* Interning hash table */
#define STACK_GUARD_SIZE	500	/* Cells between constant and
					   stack before overflow
					   occurs */
#define FILE_CHANNELS		15
#define MAX_LIST_PRINT		10

#define ILLEGAL_PRIMITIVE	-1

/* Hashing algorithm for interning */

#define MAX_HASH_CHARS		5
#define LENGTH_MULTIPLIER	5
#define SHIFT_AMOUNT		2

/* For looking up variable definitions */

#define UNCOMPILED_REF		TC_TRUE
#define GLOBAL_REF		TC_NULL
#define FORMAL_REF		TC_FIXNUM
#define AUX_REF			TC_ENVIRONMENT

/* For headers in pure / constant area */

#define END_OF_BLOCK		TC_FIXNUM
#define CONSTANT_PART		TC_TRUE
#define PURE_PART		TC_FALSE

/* Primitive flow control codes: directs computation after
 * processing a primitive application.
 */
#define PRIM_DONE			-1
#define PRIM_DO_EXPRESSION		-2
#define PRIM_APPLY			-3
#define PRIM_INTERRUPT			-4
#define PRIM_TRANSLATE			-5
#define PRIM_NO_TRAP_EVAL		-6
#define PRIM_NO_TRAP_APPLY		-7
#define PRIM_POP_RETURN			-8
\f


/* Interrupt bits -- scanned from LSB (1) to MSB (16) */

#define INT_Stack_Overflow	1	/* Local interrupt */
#define INT_Global_GC		2
#define INT_GC			4	/* Local interrupt */
#define INT_Global_1		8
#define INT_Character		16	/* Local interrupt */
#define INT_Global_2		32
#define INT_Timer		64	/* Local interrupt */
#define INT_Global_3		128
#define INT_Global_Mask		\
  (INT_Global_GC | INT_Global_1 | INT_Global_2 | INT_Global_3)
#define Global_GC_Level		1
#define Global_1_Level		3
#define Global_2_Level		5
#define Global_3_Level		7
#define MAX_INTERRUPT_NUMBER	7

#define INT_Mask		((1<<(MAX_INTERRUPT_NUMBER+1))-1)

/* Error case detection for precomputed constants */
/* VMS preprocessor does not like line continuations in conditionals */

#define Are_The_Constants_Incompatible					\
((TC_NULL != 0x00) || (TC_TRUE != 0x08) || (TC_UNASSIGNED != 0x32) ||	\
 (UNASSIGNED != 0) || (UNBOUND != 1) || (UNCOMPILED_REF != 0x08) ||	\
 (TC_FIXNUM != 0x1A) || (TC_BROKEN_HEART != 0x22) || 			\
 (TC_CHARACTER_STRING != 0x1E))

#if Are_The_Constants_Incompatible
#include "Error: types.h and scheme.h disagree -- look at scheme.h & config.h"
#endif