1 /* Include file lisp_ptr_fmt.incl.pl1;
 2     describes the format of lisp pointers as
 3    a bit string overlay on the double word ITS pair
 4     which allows lisp to access some unused bits in
 5     the standard ITS pointer format. It should be noted that
 6     this is somewhat of a kludge, since
 7     it is quite machine dependent.  However, to store type
 8     fields in the pointer, saves 2 words in each cons,
 9     plus some efficiency problems.
10 
11     D.Reed 4/1/71 */
12 /* modified to move type field to other half of ptr */
13 /* D.Reed 5/31/72 */
14 
15 
16 dcl based_ptr ptr aligned based;        /* for dealing with lisp values as pointers */
17 dcl lisp_ptr_type bit(36) aligned based,          /* for more efficient checking of type bits */
18     1 lisp_ptr      based aligned,      /* structure of double word pointer in lisp */
19       2 segno       bit(18) unaligned,  /* segment number pointed to by pointer */
20       2 ringnum     bit(3) unaligned,   /* ring mumber for validation */
21       2 type        bit(9) unaligned,   /* type field */
22       2 itsmod      bit(6) unaligned,
23       2 offset      fixed bin(17) unaligned,      /* offset in segment of object pointed to */
24       2 chain       bit(18) unaligned,  /* normally 0, but may be set to chain pointers together */
25 
26 /* manifest constant strings for testing above type field */
27 
28    (
29     Cons            init("000000000"b),           /* a pointer to a list has a zero type field */
30     Fixed           init("100000000"b),           /* a fixed point number, stored in second word of the ptr */
31     Float           init("010000000"b),           /* a floating number, also stored in the second word of the ptr */
32     Atsym           init("001000000"b),           /* this bit on means a ptr to an atomic symbol */
33     Atomic          init("111111111"b),           /* any bit on means an atomic data type */
34     Bignum          init("000001000"b),           /* a multiple-precision number */
35     Bigfix          init("000001000"b),           /* a fixed point bignum (only kind for now) */
36     Numeric         init("110000000"b),           /* either type immediate number.  Both bits on
37                                                      means a special internal uncollectable weird object */
38     Uncollectable   init("110000000"b),           /* not looked through by garbage collector */
39     String          init("000100000"b),           /* pointer to lisp character string - length word, chars */
40     Subr            init("000010000"b),           /* pointer to compiled (or builtin) subroutine (linkage) code */
41     System_Subr     init("000000100"b),           /* Subr bit must be on too, indicates ptr into lisp_subr_tv_ */
42     Array           init("000000010"b),           /* Subr bit must be on too, indicates ptr to a lisp array */
43     File            init("000000001"b)            /* pointer to a file object (iochan block) */
44    ) bit(9) static,
45 
46           /* 36 bit manifest constant strings for testing lisp_ptr_type */
47 
48 
49 (
50 Cons36    init("000000000000000000000000000000"b),
51 Fixed36   init("000000000000000000000100000000"b),
52 Float36   init("000000000000000000000010000000"b),
53 Atsym36   init("000000000000000000000001000000"b),
54 Atomic36  init("000000000000000000000111111100"b),
55 Bignum36  init("000000000000000000000000001000"b),
56 System_Subr36
57           init("000000000000000000000000000100"b),
58 Bigfix36  init("000000000000000000000000001000"b),
59 Numeric36 init("000000000000000000000110000000"b),          /* does not check for bignum */
60 NotConsOrAtsym36
61           init("000000000000000000000110111111"b),
62 SubrNumeric36
63           init("000000000000000000000110010000"b),          /* used in garbage collector, for quick check */
64 String36  init("000000000000000000000000100000"b),
65 Subr36    init("000000000000000000000000010000"b),
66 File36    init("000000000000000000000000000001"b),
67 Array36   init("000000000000000000000000000010"b)) bit(36) aligned static,
68 
69     /* undefined pointer value is double word of zeros */
70 
71     Undefined       bit(72) static init(""b);
72 
73 /* end of include file lisp_ptr_fmt.incl.pl1 */