home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V6 / usr / source / fort / f1 / f12.s < prev    next >
Encoding:
Text File  |  1975-07-17  |  1.1 KB  |  95 lines

  1. /
  2. /
  3.  
  4. / f12 -- type statements and type getter subroutine
  5. /
  6. /
  7.  
  8. .globl    stype
  9. .globl    getype
  10. .globl    typtab
  11.  
  12. .globl    sfunc1
  13. .globl    lookup
  14. .globl    getsym
  15. .globl    error
  16. .globl    sdime1
  17.  
  18. stype:
  19.     mov    r0,-(sp)
  20.     mov    r1,r2
  21.     jsr    r5,lookup; funtab
  22.         br 1f
  23.     mov    r2,r1
  24.     mov    (sp)+,r0
  25.     jmp    sfunc1
  26. 1:
  27.     jsr    r5,getsym
  28.     tst    r0
  29.     bne    3f        / junk error if not identifier
  30.     mov    symtab(r3),r0
  31.     bic    $![377\<8+7],r0 / size,type
  32.     beq    2f
  33.     cmp    r0,(sp)        / redefined, but same
  34.     beq    2f
  35.     jsr    r5,error; 3.
  36. 2:
  37.     bic    $377\<8+7,symtab(r3)
  38.     bis    (sp),symtab(r3)    / set in type and size
  39.     mov    r3,-(sp)
  40.     jsr    r5,getsym
  41.     cmp    r0,$32.        / ( for dimension
  42.     bne    2f
  43.     mov    (sp),r3
  44.     jsr    r5,sdime1
  45.     jsr    r5,getsym
  46. 2:
  47.     tst    (sp)+
  48.     cmp    r0,$36.        / , for another list element
  49.     beq    1b
  50.     cmp    r0,$40.        / eos
  51.     beq    1f
  52. 3:
  53.     jsr    r5,error; 2.    / junk
  54. 1:
  55.     tst    (sp)+
  56.     rts    r5
  57.  
  58. funtab:
  59.     <function\0>
  60.     <\0>
  61.  
  62. getype:
  63.     mov    r1,r2
  64.     jsr    r5,lookup; typtab
  65.         br 1f
  66.     mov    tvaltab(r0),r0
  67.     tst    (r5)+
  68. 1:
  69.     rts    r5
  70.  
  71. tvaltab:
  72.     log1con
  73.     logcon
  74.     int1con
  75.     int2con
  76.     intcon
  77.     dcplxcon
  78.     dblcon
  79.     cplxcon
  80.     dblcon
  81.     realcon
  82.  
  83. typtab:
  84.     <logical*1\0>
  85.     <logical\0>
  86.     <integer*1\0>
  87.     <integer*2\0>
  88.     <integer\0>
  89.     <doublecomplex\0>
  90.     <doubleprecision\0>
  91.     <complex\0>
  92.     <real*8\0>
  93.     <real\0>
  94.     <\0>
  95.