The LMI Lambda has a virtual memory space of 24. bits of 32. bit words (32. bits X 16777216. words). The Lambda uses this space in "boxed" and "unboxed" storage. Boxed storage is used to emulate a tagged architecture where each box (also called a "Q") contains a tag and data field. Unboxed storage is used for those things that don't need to be tagged and just contain bits. Boxed storage format: |cc|type | datum | 2. bit cdr code 5. bit type code 24. bit datum (= 30 octal) All "Lisp objects" must fit in one q so that they may be placed on the stack and in arrays and in lists, etc. It is clear that most Lisp objects will not fit in one q. In these cases, the datum field is a pointer to some more q's in which the object resides. The object is "held together" by simple consecutivity of address space. That is to say, a cons cell is represented by a q of type code "CONS" (dtp-list) which points to a q which is the car of the pair. The cdr of the pair is located in the next q. The garbage collector is very careful to always transport the q's together so that the pair remains intact. CDR codes. The most frequently used storage in lisp is a list. A list is a cons in which the car is an element of the list and the cdr is a list of the rest of the elements or nil if there are no elements. The list (a b c) would be as follows: (dtp-list ) | /------/  (dtp-symbol ---)--- points to symbol A (dtp-list ) | /------/  (dtp-symbol ---)--- points to symbol B (dtp-list ) | /------/  (dtp-symbol ---)--- points to symbol C (dtp-symbol ---)--- points to symbol NIL This takes up 7 Q's of storage. The cdr codes are used to implement a more compact list storage. There are 3 cdr codes CDR-NORMAL the cdr of this q is in the next q (like normal lists) CDR-NEXT the cdr of this q is the next q (to cdr, make (dtp-list q+1)) CDR-NIL the cdr of this q is nil Now the list (a b c) becomes: (dtp-list ) | /------/  (cdr-next dtp-symbol ---)--- points to symbol A (cdr-next dtp-symbol ---)--- points to symbol B (cdr-nil dtp-symbol ---)--- points to symbol C This takes up 4 Q's of storage. Cdr codes are meaningless when non dtp-list points to them. There is a fourth cdr code, CDR ERROR, which should never be in a list. If you do a rplacd on a cdr coded list, this is what happens. (defvar the-list '(a b c)) (rplacd the-list (cons 'e (cdr the-list))) Note that the cdr of the-list is generated on the fly during normal cdring and thus cannot be smashed. We make an "invisible pointer" here and adjust the cdr codes accordingly. (dtp-list ) | /------/  (cdr-ERROR dtp-rplacd-forward ---)-------------------------\ /(cdr-next dtp-symbol ---)--- points to symbol B | | (cdr-nil dtp-symbol ---)--- points to symbol C | | | | /--------------------------------------------------------/ |  | (cdr-normal dtp-symbol ---)--- points to symbol A | (cdr-error dtp-list ) | | | /------------------------/ |  | (cdr-normal dtp-symbol ---)--- points to symbol E | (cdr-error dtp-list ) \-----------------------------/ The car of the list gets moved to new storage and replaced by an invisible dtp-replacd-forward pointer. Now, this would get out of hand fairly soon except that the garbage collector collapses lists like this into compact cdr coded lists when it transports them. From this point on, cdr codes will be pretty much ignored. Data types Datum field These are valid lisp objects: 03 dtp-symbol Pointer (to dtp-symbol-header) 05 dtp-fix 24 bit signed integer 06 dtp-extended-number Pointer (to dtp-header) 15 dtp-locative Pointer (to an arbitrary q) 16 dtp-list Pointer (to car of a cons, cdr is located by examining cdr code of the car.) 17 dtp-u-entry Number of a microcode entry point. 20 dtp-fef-pointer Pointer (to dtp-header) 21 dtp-array-pointer Pointer (to dtp-array-header) 23 dtp-stack-group Pointer 24 dtp-closure Pointer 25 dtp-small-flonum 24 bit floating point number 26 dtp-select-method Pointer 27 dtp-instance Pointer (to instance-header) 31 dtp-entity Pointer 32 dtp-stack-closure Pointer (automatically changed on copying) 34 dtp-character Bit 30 = HYPER Bit 27 = SUPER Bit 26 = META Bit 25 = CONTROL Bits 24 - 20 are unused (?) Bits 19 - 10 is the font number Bits 9 - 0 is the character code Invisible pointers are ones that when seen, cause an immediate read of what they point to. You can move objects this way and not worry about everyone losing pointers to it if you leave an invisible one in the old location. These pointers vary as to whom they are invisible to. 10 dtp-gc-forward Only seen by GC, used to locate objects transported from oldspace. 11 dtp-external-value-cell Transparant to setq, visible to bind, used to implement local lexical variables, fef constants, and closures. 12 dtp-one-q-forward "Normal" invisible pointer. 13 dtp-header-forward When a structure is moved, the header gets replaced with this. 14 dtp-body-forward When a structure is moved, the body gets replaced with this. 33 dtp-self-ref-pointer Points to "self" in FEF's of flavor methods. 35 dtp-rplacd-forward Used for rplacd'ing cdr coded lists. Headers sit at the beginning of structures. 04 dtp-symbol-header Pointer to print name of the symbol. 07 dtp-header Datum field here is pretty random, more later. 22 dtp-array-header Info on the array. 30 dtp-instance-header Pointer to flavor descriptor. Other 00 dtp-trap Illegal to ever see, unused storage is initialized to this in order to control lossage caused by random pointers. The machine halts on these. 01 dtp-null A non object used for unbound variables. Datum is a pointer to the symbol header. 02 dtp-unreconciled Used in MOBY address scheme. Structured data formats: (q (field %%q-cdr-code (byte 02 36) (cdr-next 0) (cdr-error 1) (cdr-normal 2) (cdr-nil 3)) (field %%q-data-type (byte 05 31) (dtp-trap 0) (dtp-null 1) (dtp-unreconciled 2) (dtp-symbol 3) (dtp-symbol-header 4) (dtp-fix 5) (dtp-extended-number 6) (dtp-header 7) (dtp-gc-forward 10) (dtp-external-value-cell 11) (dtp-one-q-forward 12) (dtp-header-forward 13) (dtp-body-forward 14) (dtp-locative 15) (dtp-list 16) (dtp-u-entry 17) (dtp-fef-pointer 20) (dtp-array-pointer 21) (dtp-array-header 22) (dtp-stack-group 23) (dtp-closure 24) (dtp-small-flonum 25) (dtp-select-method 26) (dtp-instance 27) (dtp-instance-header 30) (dtp-entity 31) (dtp-stack-closure 32) (dtp-self-ref-pointer 33) (dtp-character 34) (dtp-rplacd-forward 35)) (field %%q-pointer (byte 00 31))) (subtype header (q (%%q-data-type dtp-header) (subfield %%q-pointer (field %%header-type-field (byte 05 23) ( (dtp-header bits 30 - 23 other-randomness) Symbols: dtp-symbol points to (dtp-symbol-header ) (dtp-array-pointer ) dtp-fef points to (dtp-header ) (dtp-fixnum ) (dtp-symbol ) (dtp-fixnum ) (dtp-fixnum ?? fef-bit-map ??) (dtp-fixnum ?? arg-map ??) boxed-fef-constants (dtp-list ) (dtp-list ) unboxed instructions