home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / t3_1 / sources.lha / sources / comp / primops / vconstants.t < prev   
Encoding:
Text File  |  1988-02-05  |  7.6 KB  |  198 lines

  1. (herald vaxconstants)
  2.  
  3. ;;; Copyright (c) 1985 Yale University
  4. ;;;     Authors: N Adams, R Kelsey, D Kranz, J Philbin, J Rees.
  5. ;;; This material was developed by the T Project at the Yale University Computer 
  6. ;;; Science Department.  Permission to copy this software, to redistribute it, 
  7. ;;; and to use it for any purpose is granted, subject to the following restric-
  8. ;;; tions and understandings.
  9. ;;; 1. Any copy made of this software must include this copyright notice in full.
  10. ;;; 2. Users of this software agree to make their best efforts (a) to return
  11. ;;;    to the T Project at Yale any improvements or extensions that they make,
  12. ;;;    so that these may be included in future releases; and (b) to inform
  13. ;;;    the T Project of noteworthy uses of this software.
  14. ;;; 3. All materials developed as a consequence of the use of this software
  15. ;;;    shall duly acknowledge such use, in accordance with the usual standards
  16. ;;;    of acknowledging credit in academic research.
  17. ;;; 4. Yale has made no warrantee or representation that the operation of
  18. ;;;    this software will be error-free, and Yale is under no obligation to
  19. ;;;    provide any services, by way of maintenance, update, or otherwise.
  20. ;;; 5. In conjunction with products arising from the use of this material,
  21. ;;;    there shall be no use of the name of the Yale University nor of any
  22. ;;;    adaptation thereof in any advertising, promotional, or sales literature
  23. ;;;    without prior written consent from Yale in each case.
  24. ;;;
  25.  
  26. (define-constant VAX-JUMP-ABSOLUTE #x9f17)
  27. (define-constant JUMP-ABSOLUTE VAX-JUMP-ABSOLUTE)
  28. (define-constant *pointer-registers* 6)
  29.  
  30. ;++ in t3 this will be #x1FFFFFFF fix later
  31. ;(define-constant %%maximum-fixnum             #x3ffffff)
  32. ;(define-constant *max-fixnum*                 #x3ffffff)
  33. ;(define-constant %%maximum-fixnum-as-string   "2147483648")
  34. ;++ in t3 this will be #x20000000 fix later
  35. ;(define-constant %%minimum-fixnum             #x-3ffffff)
  36. ;(define-constant *min-fixnum*                 #x-3ffffff)
  37. ;(define-constant %%minimum-fixnum-as-string  "-2147483647")
  38.  
  39. (define-constant %%slice-size 2)
  40. (define-constant %%vcell-size 4)
  41. (define-constant %%foreign-size 1)
  42. (define-constant %%operation-size 3)
  43.  
  44. (define-constant CELL 4)
  45.  
  46. (define-constant tag/fixnum    0)
  47. (define-constant tag/immediate 1)
  48. (define-constant tag/extend    2)
  49. (define-constant tag/pair      3)
  50.  
  51.  
  52.                                         
  53. ;;;                                           N
  54. (define-constant header/char           #b0000001)  ;; so we can shift char 
  55. (define-constant header/nonvalue      #b10000001)  
  56. (define-constant header/unit           #b0001001) 
  57. (define-constant header/text           #b0010001)
  58. (define-constant header/general-vector #b0011001)
  59. (define-constant header/slice          #b0100001)
  60. (define-constant header/symbol         #b0101001)
  61. (define-constant header/bytev          #b0110001)
  62. (define-constant header/foreign        #b0111001) 
  63. (define-constant header/template       #b1000001)
  64. (define-constant header/cell           #b1001001)  ;; ???
  65. (define-constant header/task           #b1011001)  ;; ???
  66. (define-constant header/true           #b1100001)  ;; ???
  67. (define-constant header/vcell          #b1101001)  ;; ???
  68. (define-constant header/vframe         #b1110001)  ;; stack allocated obj
  69. (define-constant header/stack          #b1111001)
  70.  
  71. (define-constant header/bignum         #b0000101) 
  72. (define-constant header/short-float    #b0001101) 
  73. (define-constant header/double-float   #b0010101)
  74. (define-constant header/single-float   #b0011101)
  75. (define-constant header/ratio          #b0100101)
  76. (define-constant header/complex        #b0101101)
  77. (define-constant header/fault-frame    #b0110101)
  78.  
  79. (define-constant header/weak-set   #b1000101)   
  80. (define-constant header/weak-alist #b1001101)
  81. (define-constant header/weak-table #b1010101)
  82. (define-constant header/weak-cell  #b1011001)
  83.  
  84. (define-constant %%number-of-immediate-types 32)
  85.  
  86.                                           
  87. (define-local-syntax (define-slink-slots . slots)
  88.   (do ((slots slots (cdr slots))
  89.        (i -3 (if (fixnum? (car slots))
  90.          (+ i (* (car slots) 4))
  91.          (+ i 4)))
  92.        (defines '() (if (fixnum? (car slots))
  93.                     defines
  94.             `((define-constant ,(concatenate-symbol 'slink/
  95.                                 (car slots))
  96.                                ,i)
  97.               ,@defines))))
  98.       ((null? slots) `(block (define-constant %%slink-size ,(+ i 3))
  99.                  ,@defines))))
  100.  
  101. (define-slink-slots
  102.   nil-cdr         
  103.   nil-car         
  104.   nary-setup      
  105.   make-pair       
  106.   make-extend       
  107.   set               
  108.   icall
  109.   kernel            
  110.   dispatch
  111.   current-task      
  112.   critical-count
  113.   undefined-effect  
  114.   root-process      
  115.   interrupt-handler 
  116.   initial-pure-memory-begin   
  117.   initial-pure-memory-end     
  118.   initial-impure-memory-begin 
  119.   initial-impure-memory-end   
  120.   gc-stamp                    
  121.   symbol-generator-count      
  122.   hash-generator-count        
  123.   initial-impure-base         
  124.   boot-args                   
  125.   boot-area-base              
  126.   kernel-begin                
  127.   kernel-end
  128.   cont-wrong-nargs
  129.   dispatch-label
  130.   pair-freelist
  131.   snapper-freelist)
  132.  
  133. (define-constant task/extra-pointer      -4)
  134. (define-constant task/extra-scratch      -8)
  135. (define-constant task/dynamic-state      -12)
  136. (define-constant task/stack              -16)
  137. (define-constant task/area-frontier      -20)     ;++ area-frontier
  138. (define-constant task/area-limit         -24)
  139. (define-constant task/area               -28)
  140. (define-constant task/doing-gc?          -32)
  141. (define-constant task/foreign-call-cont  -36)
  142. (define-constant task/re-enter-on-fault  -40)
  143. (define-constant task/critical-count     -44)
  144. (define-constant task/area-begin         -48)
  145. (define-constant task/k-list             -52)
  146. (define-constant task/gc-weak-set-list   -56)
  147. (define-constant task/gc-weak-alist-list -60)
  148. (define-constant task/gc-weak-table-list -64)
  149.  
  150. (define-constant %%task-header-offset   -88)
  151.  
  152. (define-constant task/t0 0)
  153. (define-constant process/pointer-start         14)
  154. (define-constant *maximum-number-of-arguments* 64)
  155. (define-constant *pointer-temps*               64)
  156. (define-constant *scratch-temps*               5)
  157. (define-constant temp-block-size (fx* (fx+ *pointer-temps* *scratch-temps*) 4))
  158.  
  159. (define-constant %%stack-size      10000)
  160. (define-constant template/nargs    -1)
  161.  
  162.  
  163. (define-constant offset/string-text 2)
  164. (define-constant offset/string-base 6)
  165. (define-constant offset/operation-default 2)
  166. (define-constant offset/operation-handler 10)
  167.  
  168. (define-constant version-number 31)
  169.  
  170. (define-local-syntax (define-opcodes . opcodes)
  171.   (do ((i 1 (fx+ i 1))
  172.        (l opcodes (cdr l))
  173.        (z '() (cons `(define-constant ,(concatenate-symbol 'op/ (car l))
  174.                        ,i)
  175.                     z)))
  176.       ((null? l)
  177.        `(block ,@(reverse! z)
  178.                (define *number-of-opcodes* ,i)))))
  179.  
  180. (define-opcodes
  181.   ;; Structural nonsense
  182.   literal               ;Literal s-expression
  183.   foreign               ;Name of a foreign procedure (a string, e.g. "_getc")
  184.   closure               ;Object is a code vector offset - put a cl-int-cl here
  185.   template1             ;Similarly, but put a cl-int-template here
  186.   template2             ; (cl-int-templates take up 3 cells)
  187.   template3             ; (info is copied from the aux. template)
  188.   ;; Variable references
  189.   vcell-stored-definition     ;Pair (name . cl-offset) for a top-level define
  190.   vcell-defined               ;Name of a var otherwise defined
  191.   vcell-lset                  ;Name of a free variable which is lset
  192.   vcell                ;Name of some other free variable
  193.   variable-value
  194.   ;; Other stuff
  195.   special-literal       ;Descriptor for something peculiar, e.g. a primop
  196.   nonlocal              ;Pair (env-name . var-name) for (*value x 'y)
  197.   )
  198.